Put the NixOS channel in an option
This commit is contained in:
parent
8c65a2a181
commit
373c14614b
@ -24,6 +24,13 @@ with pkgs.lib;
|
|||||||
description = "NixOS release code name.";
|
description = "NixOS release code name.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.defaultChannel = mkOption {
|
||||||
|
internal = true;
|
||||||
|
type = types.uniq types.string;
|
||||||
|
default = https://nixos.org/channels/nixos-unstable;
|
||||||
|
description = "Default NixOS channel to which the root user is subscribed.";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
@ -39,7 +39,7 @@ in
|
|||||||
|
|
||||||
# Subscribe the root user to the NixOS channel by default.
|
# Subscribe the root user to the NixOS channel by default.
|
||||||
if [ "$USER" = root -a ! -e $HOME/.nix-channels ]; then
|
if [ "$USER" = root -a ! -e $HOME/.nix-channels ]; then
|
||||||
echo "http://nixos.org/channels/nixos-unstable nixos" > $HOME/.nix-channels
|
echo "${config.system.defaultChannel} nixos" > $HOME/.nix-channels
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the per-user garbage collector roots directory.
|
# Create the per-user garbage collector roots directory.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user