refactor: pull out template filter into variable
This commit is contained in:
parent
f5427d28a9
commit
9201edf945
1 changed files with 4 additions and 1 deletions
|
|
@ -16,6 +16,9 @@
|
||||||
rust = "rust_cargo-nightly_crane+fenix";
|
rust = "rust_cargo-nightly_crane+fenix";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Files to filter out of the template
|
||||||
|
template-ignore = [ "flake.lock" "Cargo.lock" ];
|
||||||
|
|
||||||
# Get all subdirectories of the given path
|
# Get all subdirectories of the given path
|
||||||
# Returns [str]
|
# Returns [str]
|
||||||
subdirs = dir:
|
subdirs = dir:
|
||||||
|
|
@ -37,7 +40,7 @@
|
||||||
${concatStringsSep "_" subds} = {
|
${concatStringsSep "_" subds} = {
|
||||||
description = generateDesc subds;
|
description = generateDesc subds;
|
||||||
path = filterSource
|
path = filterSource
|
||||||
(p: _: !(elem (baseNameOf p) [ "flake.lock" "Cargo.lock" ]))
|
(p: _: !(elem (baseNameOf p) template-ignore))
|
||||||
(foldl' (dir: subd: /${dir}/${subd}) ./. subds);
|
(foldl' (dir: subd: /${dir}/${subd}) ./. subds);
|
||||||
};
|
};
|
||||||
}) (flakeSubdirs ./.) // mapAttrs (from: to:
|
}) (flakeSubdirs ./.) // mapAttrs (from: to:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue