mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-22 22:33:46 +03:00
makeShell: minor improvements
- import pkgs without the global config to avoid pulling in external state - rename `path` -> `setPath` - export `nixpkgsUnstable` This avoids garbage collection of nixpkgs-unstable for gcrooted shell environments (like those created by lorri)
This commit is contained in:
parent
a5730eb736
commit
7f77147b60
@ -1,11 +1,12 @@
|
|||||||
{ configDir, shellVersion ? null, extraShellInitCmds ? (pkgs: "") }:
|
{ configDir, shellVersion ? null, extraShellInitCmds ? (pkgs: "") }:
|
||||||
let
|
let
|
||||||
|
pinned = import ../pkgs/nixpkgs-pinned.nix;
|
||||||
|
pkgs = import nixpkgs { config = {}; overlays = []; };
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
nixpkgs = (import ../pkgs/nixpkgs-pinned.nix).nixpkgs;
|
inherit (pinned) nixpkgs;
|
||||||
pkgs = import nixpkgs {};
|
|
||||||
nbPkgs = import ../pkgs { inherit pkgs; };
|
nbPkgs = import ../pkgs { inherit pkgs; };
|
||||||
cfgDir = toString configDir;
|
cfgDir = toString configDir;
|
||||||
path = lib.optionalString pkgs.stdenv.isLinux ''
|
setPath = lib.optionalString pkgs.stdenv.isLinux ''
|
||||||
export PATH="${lib.makeBinPath [ nbPkgs.pinned.extra-container ]}''${PATH:+:}$PATH"
|
export PATH="${lib.makeBinPath [ nbPkgs.pinned.extra-container ]}''${PATH:+:}$PATH"
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
@ -39,8 +40,9 @@ pkgs.stdenv.mkDerivation {
|
|||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export NIX_PATH="nixpkgs=${nixpkgs}:nix-bitcoin=${toString ../.}:."
|
export NIX_PATH="nixpkgs=${nixpkgs}:nix-bitcoin=${toString ../.}:."
|
||||||
${path}
|
${setPath}
|
||||||
export NIX_BITCOIN_EXAMPLES_DIR="${cfgDir}"
|
export NIX_BITCOIN_EXAMPLES_DIR="${cfgDir}"
|
||||||
|
export nixpkgsUnstable="${pinned.nixpkgs-unstable}"
|
||||||
|
|
||||||
# Set isInteractive=1 if
|
# Set isInteractive=1 if
|
||||||
# 1. stdout is a TTY, i.e. we're not piping the output
|
# 1. stdout is a TTY, i.e. we're not piping the output
|
||||||
|
Loading…
Reference in New Issue
Block a user