Skip to content

Commit

Permalink
refactor: use findTargets for data.configs
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Sep 15, 2023
1 parent 2494dda commit 2033271
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/data/configs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
inputs,
cell,
}: let
inherit (inputs) nixpkgs;
inherit (inputs.mdbook-paisano-preprocessor.app.package) mdbook-paisano-preprocessor;
inherit (inputs.cells.lib) cfg;
inherit (inputs) cells;
inherit (inputs.std) findTargets;

inherit (inputs.nixpkgs.lib) recursiveUpdate;
in {
adrgen = recursiveUpdate cfg.adrgen (import ./adrgen.nix);
editorconfig = recursiveUpdate cfg.editorconfig (import ./editorconfig.nix);
conform = recursiveUpdate cfg.conform (import ./conform.nix);
lefthook = recursiveUpdate cfg.lefthook (import ./lefthook.nix);
mdbook = recursiveUpdate cfg.mdbook (scopedImport {inherit inputs;} ./mdbook.nix);
treefmt = recursiveUpdate cfg.treefmt (scopedImport {inherit inputs;} ./treefmt.nix);
githubsettings = recursiveUpdate cfg.githubsettings (import ./githubsettings.nix);
cog = recursiveUpdate cfg.cog (import ./cog.nix);
}
inherit (inputs.nixpkgs.lib) recursiveUpdate mapAttrs;

data = findTargets {
inherit inputs cell;
block = ./.;
};
in
mapAttrs (name: config: recursiveUpdate config (data.${name} or {})) cells.lib.cfg

0 comments on commit 2033271

Please sign in to comment.