Configure nix settings (#257)
Only manage /etc/nix/nix.conf options based on nixpkgs options. We cannot control nix-gc / nix-daemon services yet as they rely on users.
This commit is contained in:
parent
ba09b781b1
commit
3219a927e1
3 changed files with 42 additions and 1 deletions
|
|
@ -134,6 +134,16 @@ let
|
|||
'';
|
||||
};
|
||||
};
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
trusted-users = [ "zimbatm" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
|
|
@ -149,7 +159,7 @@ forEachUbuntuImage "example" {
|
|||
];
|
||||
extraPathsToRegister = [ newConfig ];
|
||||
testScriptFunction =
|
||||
{ toplevel, ... }:
|
||||
{ toplevel, hostPkgs, ... }:
|
||||
#python
|
||||
''
|
||||
# Start all machines in parallel
|
||||
|
|
@ -223,6 +233,9 @@ forEachUbuntuImage "example" {
|
|||
vm.fail("test -f /etc/baz/bar/foo2")
|
||||
vm.succeed("test -f /etc/foo_new")
|
||||
|
||||
nix_trusted_users = vm.succeed("${hostPkgs.nix}/bin/nix config show trusted-users").strip()
|
||||
assert "zimbatm" in nix_trusted_users, f"Expected 'zimbatm' to be in trusted-users, got {nix_trusted_users}"
|
||||
|
||||
${system-manager.lib.deactivateProfileSnippet {
|
||||
node = "vm";
|
||||
profile = newConfig;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue