nixos/nix-channnel: fix setting up the default channel again
This commit is contained in:
parent
d64dbf7253
commit
7d0b5b3a94
2 changed files with 10 additions and 2 deletions
|
@ -98,8 +98,7 @@ in
|
||||||
nix.settings.nix-path = mkIf (! cfg.channel.enable) (mkDefault "");
|
nix.settings.nix-path = mkIf (! cfg.channel.enable) (mkDefault "");
|
||||||
|
|
||||||
systemd.tmpfiles.rules = lib.mkIf cfg.channel.enable [
|
systemd.tmpfiles.rules = lib.mkIf cfg.channel.enable [
|
||||||
"f /root/.nix-channels -"
|
''f /root/.nix-channels - - - - ${config.system.defaultChannel} nixos\n''
|
||||||
''w+ "/root/.nix-channels" - - - - ${config.system.defaultChannel} nixos\n''
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,16 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = { nodes, ... }: ''
|
testScript = { nodes, ... }: ''
|
||||||
|
machine.start(allow_reboot=True)
|
||||||
|
|
||||||
assert machine.succeed("cat /root/.nix-channels") == "${nodes.machine.system.defaultChannel} nixos\n"
|
assert machine.succeed("cat /root/.nix-channels") == "${nodes.machine.system.defaultChannel} nixos\n"
|
||||||
|
|
||||||
|
nixpkgs_unstable_channel = "https://nixos.org/channels/nixpkgs-unstable nixpkgs"
|
||||||
|
machine.succeed(f"echo '{nixpkgs_unstable_channel}' > /root/.nix-channels")
|
||||||
|
|
||||||
|
machine.reboot()
|
||||||
|
|
||||||
|
assert machine.succeed("cat /root/.nix-channels") == f"{nixpkgs_unstable_channel}\n"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue