2023-10-17 19:39:51 +00:00
|
|
|
{ lib, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name = "activation-nix-channel";
|
|
|
|
|
|
|
|
meta.maintainers = with lib.maintainers; [ nikstur ];
|
|
|
|
|
|
|
|
nodes.machine = {
|
|
|
|
nix.channel.enable = true;
|
|
|
|
};
|
|
|
|
|
2023-10-31 15:50:30 +00:00
|
|
|
testScript = { nodes, ... }: ''
|
2023-11-01 15:01:49 +00:00
|
|
|
machine.start(allow_reboot=True)
|
|
|
|
|
2023-10-31 15:50:30 +00:00
|
|
|
assert machine.succeed("cat /root/.nix-channels") == "${nodes.machine.system.defaultChannel} nixos\n"
|
2023-11-01 15:01:49 +00:00
|
|
|
|
|
|
|
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"
|
2023-10-17 19:39:51 +00:00
|
|
|
'';
|
2023-10-31 15:50:30 +00:00
|
|
|
|
2023-10-17 19:39:51 +00:00
|
|
|
}
|