lib: add mapNixDir{,1}
This commit is contained in:
parent
53359a60f5
commit
5f0b1b8035
@ -15,10 +15,4 @@ let
|
|||||||
else override;
|
else override;
|
||||||
in
|
in
|
||||||
|
|
||||||
listToAttrs
|
mapNixDir (path: callPackage path {}) ./.
|
||||||
(map
|
|
||||||
(name: nameValuePair (removeSuffix ".nix" name)
|
|
||||||
(callPackage (./. + "/${name}") {}))
|
|
||||||
(filter
|
|
||||||
(name: name != "default.nix" && !hasPrefix "." name)
|
|
||||||
(attrNames (readDir ./.))))
|
|
||||||
|
@ -1,13 +1,6 @@
|
|||||||
with import <stockholm/lib>;
|
with import <stockholm/lib>;
|
||||||
let
|
let
|
||||||
overrides = self: super:
|
overrides = self: super: mapNixDir (path: self.callPackage path {}) ./.;
|
||||||
listToAttrs
|
|
||||||
(map
|
|
||||||
(name: nameValuePair (removeSuffix ".nix" name)
|
|
||||||
(self.callPackage (./. + "/${name}") {}))
|
|
||||||
(filter
|
|
||||||
(name: name != "default.nix" && !hasPrefix "." name)
|
|
||||||
(attrNames (readDir ./.))));
|
|
||||||
in
|
in
|
||||||
self: super:
|
self: super:
|
||||||
{
|
{
|
||||||
|
@ -15,10 +15,4 @@ let
|
|||||||
else override;
|
else override;
|
||||||
in
|
in
|
||||||
|
|
||||||
listToAttrs
|
mapNixDir (path: callPackage path {}) ./.
|
||||||
(map
|
|
||||||
(name: nameValuePair (removeSuffix ".nix" name)
|
|
||||||
(callPackage (./. + "/${name}") {}))
|
|
||||||
(filter
|
|
||||||
(name: name != "default.nix" && !hasPrefix "." name)
|
|
||||||
(attrNames (readDir ./.))))
|
|
||||||
|
@ -44,6 +44,23 @@ let
|
|||||||
|
|
||||||
indent = replaceChars ["\n"] ["\n "];
|
indent = replaceChars ["\n"] ["\n "];
|
||||||
|
|
||||||
|
mapNixDir = f: x: {
|
||||||
|
list = foldl' mergeAttrs {} (map (mapNixDir1 f) x);
|
||||||
|
path = mapNixDir1 f x;
|
||||||
|
}.${typeOf x};
|
||||||
|
|
||||||
|
mapNixDir1 = f: dirPath:
|
||||||
|
listToAttrs
|
||||||
|
(map
|
||||||
|
(relPath: let
|
||||||
|
name = removeSuffix ".nix" relPath;
|
||||||
|
path = dirPath + "/${relPath}";
|
||||||
|
in
|
||||||
|
nameValuePair name (f path))
|
||||||
|
(filter
|
||||||
|
(name: name != "default.nix" && !hasPrefix "." name)
|
||||||
|
(attrNames (readDir dirPath))));
|
||||||
|
|
||||||
# https://tools.ietf.org/html/rfc5952
|
# https://tools.ietf.org/html/rfc5952
|
||||||
normalize-ip6-addr =
|
normalize-ip6-addr =
|
||||||
let
|
let
|
||||||
|
@ -15,10 +15,4 @@ let
|
|||||||
else override;
|
else override;
|
||||||
in
|
in
|
||||||
|
|
||||||
listToAttrs
|
mapNixDir (path: callPackage path {}) ./.
|
||||||
(map
|
|
||||||
(name: nameValuePair (removeSuffix ".nix" name)
|
|
||||||
(callPackage (./. + "/${name}") {}))
|
|
||||||
(filter
|
|
||||||
(name: name != "default.nix" && !hasPrefix "." name)
|
|
||||||
(attrNames (readDir ./.))))
|
|
||||||
|
Loading…
Reference in New Issue
Block a user