mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 06:00:45 -06:00
pipeList -> listify
This commit is contained in:
parent
79c7654486
commit
2635aa5b57
4 changed files with 36 additions and 15 deletions
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
enabled,
|
||||
enableAttrs,
|
||||
pipeList,
|
||||
listify,
|
||||
...
|
||||
}:
|
||||
{
|
||||
oizys = {
|
||||
rune.motd = enabled;
|
||||
languages = "nim|node|python|nushell" |> pipeList;
|
||||
} // ("docker|backups|nix-ld" |> pipeList |> enableAttrs);
|
||||
languages = "nim|node|python|nushell" |> listify;
|
||||
} // ("docker|backups|nix-ld" |> listify |> enableAttrs);
|
||||
|
||||
services.restic.backups.gdrive = {
|
||||
# directories created by gitea and soft-serve aren't world readable
|
||||
|
|
|
@ -3,15 +3,24 @@
|
|||
config,
|
||||
enabled,
|
||||
enableAttrs,
|
||||
pipeList,
|
||||
listify,
|
||||
...
|
||||
}:
|
||||
{
|
||||
oizys = {
|
||||
oizys =
|
||||
{
|
||||
nix-ld = enabled // {
|
||||
overkill = enabled;
|
||||
};
|
||||
languages = "misc|nim|node|nushell|python|roc|tex|zig" |> pipeList;
|
||||
} // ("vpn|desktop|hyprland|chrome|docker|vbox|backups|hp-scanner|llm" |> pipeList |> enableAttrs);
|
||||
languages = "misc|nim|node|nushell|python|roc|tex|zig" |> listify;
|
||||
}
|
||||
// (
|
||||
''
|
||||
vpn|desktop|hyprland|chrome
|
||||
docker|vbox|backups|hp-scanner|llm
|
||||
''
|
||||
|> listify
|
||||
|> enableAttrs
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ let
|
|||
mkOption
|
||||
types
|
||||
splitString
|
||||
trim
|
||||
;
|
||||
inherit (final.filesystem) listFilesRecursive;
|
||||
in
|
||||
|
@ -26,8 +27,19 @@ let
|
|||
enable = false;
|
||||
};
|
||||
|
||||
# "opt1|opt2" |> pipeList -> ["opt1" "opt2"]
|
||||
pipeList = s: s |> replaceStrings [ "\n" ] [ "|" ] |> splitString "|" |> filter (s': s' != "");
|
||||
# split a string on newlines and pipes to generate list
|
||||
# "opt1|opt2" |> listify -> ["opt1" "opt2"]
|
||||
# ''
|
||||
# opt1
|
||||
# opt2|opt3
|
||||
# '' |> listify ["opt1" "opt2" "opt3"]
|
||||
listify =
|
||||
s:
|
||||
s
|
||||
|> replaceStrings [ "\n" ] [ "|" ]
|
||||
|> splitString "|"
|
||||
|> filter (s': s' != "")
|
||||
|> map (s': trim s');
|
||||
|
||||
# ["a" "b"] -> {a.enable = true; b.enable = true;}
|
||||
enableAttrs =
|
||||
|
@ -112,6 +124,6 @@ in
|
|||
pkgFromSystem
|
||||
overlayFrom
|
||||
flakeFromSystem
|
||||
pipeList
|
||||
listify
|
||||
;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ let
|
|||
enableAttrs
|
||||
isNixFile
|
||||
flakeFromSystem
|
||||
pipeList
|
||||
listify
|
||||
;
|
||||
inherit (lib.filesystem) listFilesRecursive;
|
||||
|
||||
|
@ -59,7 +59,7 @@ let
|
|||
inherit
|
||||
mkDefaultOizysModule
|
||||
mkOizysModule
|
||||
pipeList
|
||||
listify
|
||||
enableAttrs
|
||||
hostName
|
||||
flake
|
||||
|
|
Loading…
Reference in a new issue