default: set name for selfInStore

This commit is contained in:
Wroclaw 2025-02-27 23:38:38 +01:00
parent a8da791356
commit 278987461a

View file

@ -13,7 +13,10 @@ let
storePathLength = builtins.stringLength (builtins.toString builtins.storeDir); storePathLength = builtins.stringLength (builtins.toString builtins.storeDir);
evaluatingInStore = (builtins.substring 0 storePathLength currentFilePath) == builtins.storeDir; evaluatingInStore = (builtins.substring 0 storePathLength currentFilePath) == builtins.storeDir;
selfInStore = builtins.filterSource (path: type: selfInStore = builtins.path {
path = ./.;
name = "source";
filter = path: type:
let let
selfPath = builtins.dirOf currentFilePath; selfPath = builtins.dirOf currentFilePath;
gitIgnoreFilters = lib.parseGitignore selfPath path; gitIgnoreFilters = lib.parseGitignore selfPath path;
@ -21,8 +24,8 @@ let
&& type != "symlink" && type != "symlink"
&& builtins.baseNameOf path != ".git" && builtins.baseNameOf path != ".git"
&& lib.runGitignoreFilter gitIgnoreFilters path type; && lib.runGitignoreFilter gitIgnoreFilters path type;
in result in result;
) ./.; };
in in
if !(evaluatingInStore) then { ... }@args: import selfInStore ({ selfPath = selfInStore; } // args ) if !(evaluatingInStore) then { ... }@args: import selfInStore ({ selfPath = selfInStore; } // args )
else { ... }@args: import ./outputs.nix ({ selfPath = selfInStore; } // args) else { ... }@args: import ./outputs.nix ({ selfPath = selfInStore; } // args)