-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from tsandrini/rfc_formatter
refactor(formatting): switch to nixfmt-rfc-style
- Loading branch information
Showing
71 changed files
with
1,019 additions
and
918 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
# --- lib/_bootstrap-lib.nix | ||
{lib, ...}: | ||
{ lib, ... }: | ||
with lib; | ||
with builtins; rec { | ||
with builtins; | ||
rec { | ||
# This file should provide the bare minimum to bootstrap the lib, namely the | ||
# mapModules' function to enable properly loading the library files and its | ||
# functions | ||
|
||
mapFilterAttrs' = pred: f: attrs: filterAttrs pred (mapAttrs' f attrs); | ||
mapFilterAttrs' = | ||
pred: f: attrs: | ||
filterAttrs pred (mapAttrs' f attrs); | ||
|
||
mapModules' = dir: fn: | ||
mapFilterAttrs' | ||
(n: v: v != null && !(hasPrefix "_" n) && !(hasPrefix ".git" n)) (n: v: let | ||
path = "${toString dir}/${n}"; | ||
in | ||
if v == "directory" && pathExists "${path}/default.nix" | ||
then nameValuePair n (fn path) | ||
else if v == "directory" | ||
then nameValuePair n (mapModules' path fn) | ||
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n | ||
then nameValuePair (removeSuffix ".nix" n) (fn path) | ||
else nameValuePair "" null) (readDir dir); | ||
mapModules' = | ||
dir: fn: | ||
mapFilterAttrs' (n: v: v != null && !(hasPrefix "_" n) && !(hasPrefix ".git" n)) ( | ||
n: v: | ||
let | ||
path = "${toString dir}/${n}"; | ||
in | ||
if v == "directory" && pathExists "${path}/default.nix" then | ||
nameValuePair n (fn path) | ||
else if v == "directory" then | ||
nameValuePair n (mapModules' path fn) | ||
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n then | ||
nameValuePair (removeSuffix ".nix" n) (fn path) | ||
else | ||
nameValuePair "" null | ||
) (readDir dir); | ||
} |
Oops, something went wrong.