diff --git a/nixos/tests/swap-file-btrfs.nix b/nixos/tests/swap-file-btrfs.nix index d074a781ce0a..620639ae893f 100644 --- a/nixos/tests/swap-file-btrfs.nix +++ b/nixos/tests/swap-file-btrfs.nix @@ -5,20 +5,18 @@ meta.maintainers = with lib.maintainers; [ oxalica ]; nodes.machine = - { pkgs, ... }: + { config, pkgs, ... }: { virtualisation.useDefaultFilesystems = false; virtualisation.rootDevice = "/dev/vda"; - boot.initrd.postDeviceCommands = '' - ${pkgs.btrfs-progs}/bin/mkfs.btrfs --label root /dev/vda - ''; - + boot.initrd.systemd.enable = true; virtualisation.fileSystems = { "/" = { - device = "/dev/disk/by-label/root"; + device = config.virtualisation.rootDevice; fsType = "btrfs"; + autoFormat = true; }; };