diff options
author | Robert Hensing <roberth@users.noreply.github.com> | 2020-03-24 10:05:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-24 10:05:32 +0100 |
commit | 1484e1acfeee4c5ec039df93282e78ffc0be2236 (patch) | |
tree | 09a088f9e5f7ed64e81d77978fa4dd56e7afa1d1 /lib | |
parent | e93767d5a0806b10710e0b9c17f3c169c523b5e1 (diff) | |
parent | 07f363fae3b106412746e75c631d35da3e5119d8 (diff) |
Merge pull request #83201 from michaelpj/imp/sources-unnamed
cleanSourceWith: don't use baseNameOf
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sources.nix | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/sources.nix b/lib/sources.nix index 05519c3e392e..ed9bce485300 100644 --- a/lib/sources.nix +++ b/lib/sources.nix @@ -63,17 +63,14 @@ rec { # https://nixos.org/nix/manual/#builtin-filterSource # # name: Optional name to use as part of the store path. - # This defaults `src.name` or otherwise `baseNameOf src`. - # We recommend setting `name` whenever `src` is syntactically `./.`. - # Otherwise, you depend on `./.`'s name in the parent directory, - # which can cause inconsistent names, defeating caching. + # This defaults to `src.name` or otherwise `"source"`. # cleanSourceWith = { filter ? _path: _type: true, src, name ? null }: let isFiltered = src ? _isLibCleanSourceWith; origSrc = if isFiltered then src.origSrc else src; filter' = if isFiltered then name: type: filter name type && src.filter name type else filter; - name' = if name != null then name else if isFiltered then src.name else baseNameOf src; + name' = if name != null then name else if isFiltered then src.name else "source"; in { inherit origSrc; filter = filter'; |