nix-tools: set $NIX_PATH
This will be important once most users are running `sudo darwin-rebuild` and therefore not getting their environment’s `$NIX_PATH` passed through.
This commit is contained in:
parent
4d0ae6980d
commit
b5b7888793
4 changed files with 12 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ let
|
|||
nix-tools = pkgs.callPackage ../../pkgs/nix-tools {
|
||||
inherit (config.system) profile;
|
||||
inherit (config.environment) systemPath;
|
||||
nixPath = lib.concatStringsSep ":" config.nix.nixPath;
|
||||
};
|
||||
|
||||
darwin-uninstaller = pkgs.callPackage ../../pkgs/darwin-uninstaller { };
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
#! @shell@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
export PATH=@path@
|
||||
export NIX_PATH=${NIX_PATH:-@nixPath@}
|
||||
|
||||
evalNix() {
|
||||
nix-instantiate --eval --strict "${extraEvalFlags[@]}" -E "with import <darwin> {}; $*" 2>/dev/null
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
#! @shell@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
export PATH=@path@
|
||||
export NIX_PATH=${NIX_PATH:-@nixPath@}
|
||||
|
||||
showSyntax() {
|
||||
echo "darwin-rebuild [--help] {edit | switch | activate | build | check | changelog}" >&2
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@
|
|||
"/usr/sbin"
|
||||
"/sbin"
|
||||
]
|
||||
, # This should be kept in sync with the default `nix.nixPath`.
|
||||
nixPath ? lib.concatStringsSep ":" [
|
||||
"darwin-config=/etc/nix-darwin/configuration.nix"
|
||||
"/nix/var/nix/profiles/per-user/root/channels"
|
||||
]
|
||||
}:
|
||||
|
||||
let
|
||||
|
|
@ -39,14 +44,14 @@ in
|
|||
{
|
||||
darwin-option = writeProgram "darwin-option"
|
||||
{
|
||||
inherit path;
|
||||
inherit path nixPath;
|
||||
inherit (stdenv) shell;
|
||||
}
|
||||
./darwin-option.sh;
|
||||
|
||||
darwin-rebuild = writeProgram "darwin-rebuild"
|
||||
{
|
||||
inherit path profile;
|
||||
inherit path nixPath profile;
|
||||
inherit (stdenv) shell;
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/zsh/site-functions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue