diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-04-24 21:02:15 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2021-10-06 16:43:48 -0400 |
commit | cc3f2432d0d05ed12ef8b9858c54048edadbccbb (patch) | |
tree | 64994a24976a778a8ebd57b0a1a17c7fb20ff129 /nixos/tests/without-nix.nix | |
parent | 1d88d6faedf9255f2fcb30b1e9b1065f4524ddf4 (diff) | |
download | nixpkgs-cc3f2432d0d05ed12ef8b9858c54048edadbccbb.tar nixpkgs-cc3f2432d0d05ed12ef8b9858c54048edadbccbb.tar.gz nixpkgs-cc3f2432d0d05ed12ef8b9858c54048edadbccbb.tar.bz2 nixpkgs-cc3f2432d0d05ed12ef8b9858c54048edadbccbb.tar.lz nixpkgs-cc3f2432d0d05ed12ef8b9858c54048edadbccbb.tar.xz nixpkgs-cc3f2432d0d05ed12ef8b9858c54048edadbccbb.tar.zst nixpkgs-cc3f2432d0d05ed12ef8b9858c54048edadbccbb.zip |
nixos/nix-daemon: Add enable option
Don't worry, it's is true by default. But I think this is important to have because NixOS indeed shouldn't need Nix at run time when the installation is not being modified, and now we can verify that. NixOS images that cannot "self-modify" are a legitamate use-case that this supports more minimally. One should be able to e.g. do a sshfs mount and use `nixos-install` to modify them remotely, or just discard them and build fresh ones if they are run VMs or something. The next step would be to make generations optional, allowing just baking `/etc` and friends rather than using activation scripts. But that's more involved so I'm leaving it out.
Diffstat (limited to 'nixos/tests/without-nix.nix')
-rw-r--r-- | nixos/tests/without-nix.nix | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/nixos/tests/without-nix.nix b/nixos/tests/without-nix.nix new file mode 100644 index 00000000000..2fc00b04144 --- /dev/null +++ b/nixos/tests/without-nix.nix @@ -0,0 +1,23 @@ +import ./make-test-python.nix ({ lib, ... }: { + name = "without-nix"; + meta = with lib.maintainers; { + maintainers = [ ericson2314 ]; + }; + + nixpkgs.overlays = [ + (self: super: { + nix = throw "don't want to use this"; + }) + ]; + + nodes.machine = { ... }: { + nix.enable = false; + }; + + testScript = '' + start_all() + + machine.succeed("which which") + machine.fail("which nix") + ''; +}) |