diff options
author | Alan Pearce | 2024-05-04 09:27:40 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-18 12:17:12 +0200 |
commit | 782e0000196146183ee4a7e91e60424c24652d2f (patch) | |
tree | b21a2690ed3ecbd7085f653d1ba53a1236708a58 /shell.nix | |
parent | 72e7e31cefd86fba84924c9b579020a4b733426c (diff) | |
download | nixfiles-782e0000196146183ee4a7e91e60424c24652d2f.tar.lz nixfiles-782e0000196146183ee4a7e91e60424c24652d2f.tar.zst nixfiles-782e0000196146183ee4a7e91e60424c24652d2f.zip |
nix: set nix.nixPath
Diffstat (limited to 'shell.nix')
-rw-r--r-- | shell.nix | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/shell.nix b/shell.nix index 9167cb7e..81938c3f 100644 --- a/shell.nix +++ b/shell.nix @@ -2,26 +2,12 @@ with builtins; let sources = import ./nix/sources.nix; - sourcesJSON = fromJSON (readFile ./nix/sources.json); nixpkgs = sources.nixpkgs; pkgs = import nixpkgs { }; - inherit (pkgs.lib) path attrsets; + lib = import ./lib { inherit pkgs; }; - mkPathable = v: toString ( - if - path.subpath.isValid v - then - path.append ./. v - else - v - ); - - nixPath = concatStringsSep ":" ( - attrsets.mapAttrsToList - (k: v: "${k}=${mkPathable (getAttr "outPath" v)}") - (intersectAttrs sourcesJSON sources) - ); + nixPath = concatStringsSep ":" (lib.mkNixPath sources); in pkgs.mkShell { |