From 782e0000196146183ee4a7e91e60424c24652d2f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 4 May 2024 09:27:40 +0200 Subject: nix: set nix.nixPath --- shell.nix | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'shell.nix') 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 { -- cgit 1.4.1