mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
9 lines
552 B
Nix
9 lines
552 B
Nix
/* 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’."
|