nixos/nix-channel: fix subscribing to default channel

Fixes https://github.com/NixOS/nixpkgs/issues/264602
This commit is contained in:
nikstur 2023-10-31 16:50:30 +01:00
parent ed9263dc61
commit 8c1739cafe
2 changed files with 4 additions and 3 deletions

View file

@ -99,7 +99,7 @@ in
systemd.tmpfiles.rules = lib.mkIf cfg.channel.enable [
"f /root/.nix-channels -"
''w "/root/.nix-channels" - - - - "${config.system.defaultChannel} nixos\n"''
''w+ "/root/.nix-channels" - - - - ${config.system.defaultChannel} nixos\n''
];
};
}

View file

@ -10,7 +10,8 @@
nix.channel.enable = true;
};
testScript = ''
print(machine.succeed("cat /root/.nix-channels"))
testScript = { nodes, ... }: ''
assert machine.succeed("cat /root/.nix-channels") == "${nodes.machine.system.defaultChannel} nixos\n"
'';
}