From 373c14614b5e97f64b1c86523f85762aedc72698 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 24 Oct 2013 15:09:00 +0200 Subject: [PATCH] Put the NixOS channel in an option --- nixos/modules/misc/version.nix | 7 +++++++ nixos/modules/programs/shell.nix | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix index 489fcaeb989..2a0b95ebeb6 100644 --- a/nixos/modules/misc/version.nix +++ b/nixos/modules/misc/version.nix @@ -24,6 +24,13 @@ with pkgs.lib; 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 = { diff --git a/nixos/modules/programs/shell.nix b/nixos/modules/programs/shell.nix index 679c4979dfa..8052502c21e 100644 --- a/nixos/modules/programs/shell.nix +++ b/nixos/modules/programs/shell.nix @@ -39,7 +39,7 @@ in # Subscribe the root user to the NixOS channel by default. 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 # Create the per-user garbage collector roots directory.