mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 17:14:33 +00:00
27 lines
633 B
Nix
27 lines
633 B
Nix
{ lib, ... }:
|
|
|
|
{
|
|
|
|
name = "activation-nix-channel";
|
|
|
|
meta.maintainers = with lib.maintainers; [ nikstur ];
|
|
|
|
nodes.machine = {
|
|
nix.channel.enable = true;
|
|
};
|
|
|
|
testScript = { nodes, ... }: ''
|
|
machine.start(allow_reboot=True)
|
|
|
|
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"
|
|
'';
|
|
|
|
}
|