Terrible backward compatibility hack
This commit is contained in:
parent
d374bff41e
commit
a2600b7bc3
|
@ -1,6 +1,6 @@
|
||||||
{ system, minimal ? false }:
|
{ system, minimal ? false }:
|
||||||
|
|
||||||
let pkgs = import ../.. { config = {}; inherit system; }; in
|
let pkgs = import ./nixpkgs.nix { config = {}; inherit system; }; in
|
||||||
|
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
with import ../lib/qemu-flags.nix;
|
with import ../lib/qemu-flags.nix;
|
||||||
|
|
|
@ -30,7 +30,7 @@ rec {
|
||||||
extraArgs = extraArgs_ // {
|
extraArgs = extraArgs_ // {
|
||||||
inherit pkgs modules baseModules;
|
inherit pkgs modules baseModules;
|
||||||
modulesPath = ../modules;
|
modulesPath = ../modules;
|
||||||
pkgs_i686 = import ../.. { system = "i686-linux"; };
|
pkgs_i686 = import ./nixpkgs.nix { system = "i686-linux"; };
|
||||||
utils = import ./utils.nix pkgs;
|
utils = import ./utils.nix pkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ rec {
|
||||||
pkgs =
|
pkgs =
|
||||||
if pkgs_ != null
|
if pkgs_ != null
|
||||||
then pkgs_
|
then pkgs_
|
||||||
else import ../.. (
|
else import ./nixpkgs.nix (
|
||||||
let
|
let
|
||||||
system = if nixpkgsOptions.system != "" then nixpkgsOptions.system else system_;
|
system = if nixpkgsOptions.system != "" then nixpkgsOptions.system else system_;
|
||||||
nixpkgsOptions = (import ./eval-config.nix {
|
nixpkgsOptions = (import ./eval-config.nix {
|
||||||
|
@ -55,7 +55,7 @@ rec {
|
||||||
# For efficiency, leave out most NixOS modules; they don't
|
# For efficiency, leave out most NixOS modules; they don't
|
||||||
# define nixpkgs.config, so it's pointless to evaluate them.
|
# define nixpkgs.config, so it's pointless to evaluate them.
|
||||||
baseModules = [ ../modules/misc/nixpkgs.nix ];
|
baseModules = [ ../modules/misc/nixpkgs.nix ];
|
||||||
pkgs = import ../.. { system = system_; config = {}; };
|
pkgs = import ./nixpkgs.nix { system = system_; config = {}; };
|
||||||
}).optionDefinitions.nixpkgs;
|
}).optionDefinitions.nixpkgs;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
/* 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