Nixfmt Tree
This commit is contained in:
parent
d6bcf1a468
commit
f173b9d236
23 changed files with 381 additions and 224 deletions
|
|
@ -1,28 +1,25 @@
|
|||
pkgs: let
|
||||
getPackages = dir: let
|
||||
entries = builtins.readDir dir;
|
||||
pkgs:
|
||||
let
|
||||
getPackages =
|
||||
dir:
|
||||
let
|
||||
entries = builtins.readDir dir;
|
||||
|
||||
procEntry = name: type: let
|
||||
path = dir + "/${name}";
|
||||
procEntry =
|
||||
name: type:
|
||||
let
|
||||
path = dir + "/${name}";
|
||||
in
|
||||
if type == "directory" then
|
||||
(if builtins.pathExists (path + "/default.nix") then [ path ] else [ ])
|
||||
else
|
||||
[ ];
|
||||
in
|
||||
if type == "directory"
|
||||
then
|
||||
(
|
||||
if builtins.pathExists (path + "/default.nix")
|
||||
then [path]
|
||||
else []
|
||||
)
|
||||
else [];
|
||||
in
|
||||
builtins.concatLists (
|
||||
builtins.attrValues (
|
||||
builtins.mapAttrs procEntry entries
|
||||
)
|
||||
);
|
||||
builtins.concatLists (builtins.attrValues (builtins.mapAttrs procEntry entries));
|
||||
|
||||
buildPackage = path: {
|
||||
name = builtins.baseNameOf (toString path);
|
||||
value = pkgs.callPackage (path + "/default.nix") {};
|
||||
value = pkgs.callPackage (path + "/default.nix") { };
|
||||
};
|
||||
in
|
||||
builtins.listToAttrs (builtins.map buildPackage (getPackages ../packages))
|
||||
builtins.listToAttrs (builtins.map buildPackage (getPackages ../packages))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue