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.wip/yesman
parent
91e71725d4
commit
2cd7c1f198
@ -1,6 +0,0 @@ |
||||
{ system ? builtins.currentSystem }: |
||||
|
||||
{ pkgs = |
||||
(import nixpkgs/default.nix { inherit system; }) |
||||
// { recurseForDerivations = true; }; |
||||
} |
@ -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’." |
Loading…
Reference in new issue