about summary refs log tree commit diff
path: root/nixos/tests/activation/etc-overlay-immutable.nix
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2024-01-22 12:01:10 +0000
committerGitHub <noreply@github.com>2024-01-22 12:01:10 +0000
commit3a8094730e6ff9783b31c423af848b63abbeaebb (patch)
tree69bfe4e1abfdf5b0334ae81eb1fa7141b757dd98 /nixos/tests/activation/etc-overlay-immutable.nix
parent78b0905b1bfbbfc6879ecb23813966ad1b9639b5 (diff)
parent4e2e46fe89b071e008ee30908770e19c0f89ad2a (diff)
downloadnixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar
nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar.gz
nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar.bz2
nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar.lz
nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar.xz
nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar.zst
nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.zip
Merge master into staging-next
Diffstat (limited to 'nixos/tests/activation/etc-overlay-immutable.nix')
-rw-r--r--nixos/tests/activation/etc-overlay-immutable.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/nixos/tests/activation/etc-overlay-immutable.nix b/nixos/tests/activation/etc-overlay-immutable.nix
new file mode 100644
index 000000000000..70c3623b929c
--- /dev/null
+++ b/nixos/tests/activation/etc-overlay-immutable.nix
@@ -0,0 +1,30 @@
+{ lib, ... }: {
+
+  name = "activation-etc-overlay-immutable";
+
+  meta.maintainers = with lib.maintainers; [ nikstur ];
+
+  nodes.machine = { pkgs, ... }: {
+    system.etc.overlay.enable = true;
+    system.etc.overlay.mutable = false;
+
+    # Prerequisites
+    systemd.sysusers.enable = true;
+    users.mutableUsers = false;
+    boot.initrd.systemd.enable = true;
+    boot.kernelPackages = pkgs.linuxPackages_latest;
+
+    specialisation.new-generation.configuration = {
+      environment.etc."newgen".text = "newgen";
+    };
+  };
+
+  testScript = ''
+    machine.succeed("findmnt --kernel --type overlay /etc")
+    machine.fail("stat /etc/newgen")
+
+    machine.succeed("/run/current-system/specialisation/new-generation/bin/switch-to-configuration switch")
+
+    assert machine.succeed("cat /etc/newgen") == "newgen"
+  '';
+}