1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 19:51:17 +00:00
nixpkgs/nixos/tests/activation/nix-channel.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"
'';
}