From 2cd7c1f19888ae73bf7ef0f41a45680cfb86334a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 5 Aug 2015 17:29:08 +0200 Subject: Unify NixOS and Nixpkgs channel structure This is primarily to ensure that -I nixpkgs=https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz and -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz and -I nixpkgs=https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz behave consistently. It also allows installing packages via "nix-env -iA nixos." rather than "nixos.pkgs.". It would be even better to allow "nixpkgs.", but that requires a change to nix-channel. Fixes #7659. --- nixos/modules/installer/cd-dvd/channel.nix | 17 ++++++++--------- nixos/modules/installer/tools/nixos-checkout.nix | 2 +- nixos/modules/misc/extra-arguments.nix | 2 +- nixos/modules/misc/nixpkgs.nix | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/installer/cd-dvd/channel.nix b/nixos/modules/installer/cd-dvd/channel.nix index ca0e233f9e3f..eccb19da5cb3 100644 --- a/nixos/modules/installer/cd-dvd/channel.nix +++ b/nixos/modules/installer/cd-dvd/channel.nix @@ -9,18 +9,17 @@ let # We need a copy of the Nix expressions for Nixpkgs and NixOS on the # CD. These are installed into the "nixos" channel of the root - # user, as expected by nixos-rebuild/nixos-install. + # user, as expected by nixos-rebuild/nixos-install. FIXME: merge + # with make-channel.nix. channelSources = pkgs.runCommand "nixos-${config.system.nixosVersion}" - { expr = readFile ../../../lib/channel-expr.nix; } + { } '' - mkdir -p $out/nixos - cp -prd ${pkgs.path} $out/nixos/nixpkgs - ln -s nixpkgs/nixos $out/nixos/nixos + mkdir -p $out + cp -prd ${pkgs.path} $out/nixos chmod -R u+w $out/nixos - rm -rf $out/nixos/nixpkgs/.git - echo -n ${config.system.nixosVersion} > $out/nixos/nixpkgs/.version - echo -n "" > $out/nixos/nixpkgs/.version-suffix - echo "$expr" > $out/nixos/default.nix + ln -s . $out/nixos/nixpkgs + rm -rf $out/nixos/.git + echo -n ${config.system.nixosVersionSuffix} > $out/nixos/.version-suffix ''; in diff --git a/nixos/modules/installer/tools/nixos-checkout.nix b/nixos/modules/installer/tools/nixos-checkout.nix index 9cdd8a74a188..07274e139f7d 100644 --- a/nixos/modules/installer/tools/nixos-checkout.nix +++ b/nixos/modules/installer/tools/nixos-checkout.nix @@ -27,7 +27,7 @@ let if [ -z "$(type -P git)" ]; then echo "installing Git..." - nix-env -iA nixos.pkgs.git || nix-env -i git + nix-env -iA nixos.git fi # Move any old nixpkgs directories out of the way. diff --git a/nixos/modules/misc/extra-arguments.nix b/nixos/modules/misc/extra-arguments.nix index ff2ff7cd4322..02ac6e7a59dc 100644 --- a/nixos/modules/misc/extra-arguments.nix +++ b/nixos/modules/misc/extra-arguments.nix @@ -2,7 +2,7 @@ { _module.args = { - pkgs_i686 = import ../../lib/nixpkgs.nix { + pkgs_i686 = import ../../.. { system = "i686-linux"; config.allowUnfree = true; }; diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index fb5516c953c2..5eb38c510b48 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -72,7 +72,7 @@ in }; config = { - _module.args.pkgs = import ../../lib/nixpkgs.nix { + _module.args.pkgs = import ../../.. { system = config.nixpkgs.system; inherit (config.nixpkgs) config; -- cgit 1.4.1