diff --git a/hosts/redshift/default.nix b/hosts/redshift/default.nix index 776ec04..804b343 100644 --- a/hosts/redshift/default.nix +++ b/hosts/redshift/default.nix @@ -19,7 +19,7 @@ ataraxia.filesystems.btrfs.enable = true; ataraxia.filesystems.btrfs.eraseOnBoot.enable = true; ataraxia.filesystems.btrfs.eraseOnBoot.device = "/dev/sda4"; - ataraxia.filesystems.btrfs.eraseOnBoot.systemdDevice = + ataraxia.filesystems.btrfs.eraseOnBoot.waitForDevice = "sys-devices-pci0000:00-0000:00:05.0-0000:01:01.0-virtio3-host0-target0:0:0-0:0:0:0-block-sda.device"; ataraxia.filesystems.btrfs.eraseOnBoot.eraseVolumes = [ { diff --git a/modules/nixos/filesystems/btrfs.nix b/modules/nixos/filesystems/btrfs.nix index 91d44ac..8ff5926 100644 --- a/modules/nixos/filesystems/btrfs.nix +++ b/modules/nixos/filesystems/btrfs.nix @@ -48,15 +48,6 @@ in default = config.persist.enable; description = "Clean btrfs subvolumes on boot"; }; - device = mkOption { - type = str; - description = "Device on which is btrfs partititon"; - }; - systemdDevice = mkOption { - type = str; - description = "Escaped string with name of .device service"; - example = "dev-disk-by\\x2did-ata\\x2dPhison_SATA_SSD_2165.device"; - }; eraseVolumes = mkOption { type = listOf (submodule eraseVolumesOpts); default = [ ]; @@ -70,6 +61,15 @@ in A list of subvolumes to erase on boot. ''; }; + device = mkOption { + type = str; + description = "Device on which is btrfs partititon"; + }; + waitForDevice = mkOption { + type = str; + description = "Escaped string with name of .device service"; + example = "dev-disk-by\\x2did-ata\\x2dPhison_SATA_SSD_2165.device"; + }; }; }; @@ -105,8 +105,8 @@ in systemd.services.rollback = mkIf config.boot.initrd.systemd.enable { description = "Rollback btrfs root subvolume to a pristine state on boot"; wantedBy = [ "initrd.target" ]; - requires = [ cfg.eraseOnBoot.systemdDevice ]; - after = [ cfg.eraseOnBoot.systemdDevice ]; + requires = [ cfg.eraseOnBoot.waitForDevice ]; + after = [ cfg.eraseOnBoot.waitForDevice ]; before = [ "sysroot.mount" ]; path = [ pkgs.btrfs-progs