summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-08-05 17:29:08 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-08-05 17:37:11 +0200
commit2cd7c1f19888ae73bf7ef0f41a45680cfb86334a (patch)
tree1d153e8744e4fb693b78f5a7c1ac445201b610a2 /nixos/lib
parent91e71725d49c185401f459f58062b02bcbf1651e (diff)
downloadnixlib-2cd7c1f19888ae73bf7ef0f41a45680cfb86334a.tar
nixlib-2cd7c1f19888ae73bf7ef0f41a45680cfb86334a.tar.gz
nixlib-2cd7c1f19888ae73bf7ef0f41a45680cfb86334a.tar.bz2
nixlib-2cd7c1f19888ae73bf7ef0f41a45680cfb86334a.tar.lz
nixlib-2cd7c1f19888ae73bf7ef0f41a45680cfb86334a.tar.xz
nixlib-2cd7c1f19888ae73bf7ef0f41a45680cfb86334a.tar.zst
nixlib-2cd7c1f19888ae73bf7ef0f41a45680cfb86334a.zip
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.<pkg>"
rather than "nixos.pkgs.<pkg>". It would be even better to allow
"nixpkgs.<pkg>", but that requires a change to nix-channel.

Fixes #7659.
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/build-vms.nix2
-rw-r--r--nixos/lib/channel-expr.nix6
-rw-r--r--nixos/lib/make-channel.nix8
-rw-r--r--nixos/lib/nixpkgs.nix8
4 files changed, 3 insertions, 21 deletions
diff --git a/nixos/lib/build-vms.nix b/nixos/lib/build-vms.nix
index 01d6b21bba90..a97bae57d9bb 100644
--- a/nixos/lib/build-vms.nix
+++ b/nixos/lib/build-vms.nix
@@ -1,6 +1,6 @@
 { system, minimal ? false }:
 
-let pkgs = import ./nixpkgs.nix { config = {}; inherit system; }; in
+let pkgs = import ../.. { config = {}; inherit system; }; in
 
 with pkgs.lib;
 with import ../lib/qemu-flags.nix;
diff --git a/nixos/lib/channel-expr.nix b/nixos/lib/channel-expr.nix
deleted file mode 100644
index 453bdd506b88..000000000000
--- a/nixos/lib/channel-expr.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ system ? builtins.currentSystem }:
-
-{ pkgs =
-    (import nixpkgs/default.nix { inherit system; })
-    // { recurseForDerivations = true; };
-}
diff --git a/nixos/lib/make-channel.nix b/nixos/lib/make-channel.nix
index 1c6bf0897f49..fd805f7f943f 100644
--- a/nixos/lib/make-channel.nix
+++ b/nixos/lib/make-channel.nix
@@ -10,19 +10,15 @@ pkgs.releaseTools.makeSourceTarball {
 
   buildInputs = [ pkgs.nix ];
 
-  expr = builtins.readFile ./channel-expr.nix;
-
   distPhase = ''
     rm -rf .git
     echo -n $VERSION_SUFFIX > .version-suffix
     echo -n ${nixpkgs.rev or nixpkgs.shortRev} > .git-revision
     releaseName=nixos-$VERSION$VERSION_SUFFIX
     mkdir -p $out/tarballs
-    mkdir ../$releaseName
-    cp -prd . ../$releaseName/nixpkgs
+    cp -prd . ../$releaseName
     chmod -R u+w ../$releaseName
-    ln -s nixpkgs/nixos ../$releaseName/nixos
-    echo "$expr" > ../$releaseName/default.nix
+    ln -s . ../$releaseName/nixpkgs # hack to make ‘<nixpkgs>’ work
     NIX_STATE_DIR=$TMPDIR nix-env -f ../$releaseName/default.nix -qaP --meta --xml \* > /dev/null
     cd ..
     chmod -R u+w $releaseName
diff --git a/nixos/lib/nixpkgs.nix b/nixos/lib/nixpkgs.nix
deleted file mode 100644
index 10096f58c79a..000000000000
--- a/nixos/lib/nixpkgs.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Terrible backward compatibility hack to get the path to Nixpkgs
-   from here.  Usually, that's the relative path ‘../..’.  However,
-   when using the NixOS channel, <nixos> resolves to a symlink to
-   nixpkgs/nixos, so ‘../..’ doesn't resolve to the top-level Nixpkgs
-   directory but one above it.  So check for that situation. */
-if builtins.pathExists ../../.version then import ../..
-else if builtins.pathExists ../../nixpkgs then import ../../nixpkgs
-else abort "Can't find Nixpkgs, please set ‘NIX_PATH=nixpkgs=/path/to/nixpkgs’."