nixos/stage-1: support bind mounts of files

On my system, / is tmpfs, and /etc/machine-id is bind mounted from
/persist.
This commit is contained in:
Alyssa Ross
2023-05-26 13:26:48 +00:00
parent f91ee3065d
commit a92bc576b1
2 changed files with 48 additions and 1 deletions

View File

@@ -6,6 +6,31 @@
with import ../lib/testing-python.nix { inherit system pkgs; };
with pkgs.lib;
{
bind = makeTest {
name = "non-default-filesystem-bind";
nodes.machine = { ... }: {
virtualisation.writableStore = false;
virtualisation.fileSystems."/test-bind-dir/bind" = {
device = "/";
neededForBoot = true;
options = [ "bind" ];
};
virtualisation.fileSystems."/test-bind-file/bind" = {
depends = [ "/nix/store" ];
device = builtins.toFile "empty" "";
neededForBoot = true;
options = [ "bind" ];
};
};
testScript = ''
machine.wait_for_unit("multi-user.target")
'';
};
btrfs = makeTest
{
name = "non-default-filesystems-btrfs";