-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
24 lines (24 loc) · 767 Bytes
/
flake.nix
File metadata and controls
24 lines (24 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
outputs = { ... }: {
value = "";
extract = prefix: inputs:
let
keys = builtins.filter (attr:
(builtins.substring 0 (builtins.stringLength prefix) attr) == prefix)
(builtins.attrNames inputs);
getUntilPivot = lst:
if lst == [ ] then
lst
else
let
head = builtins.head lst;
attr = builtins.getAttr head inputs;
in if (attr == null || attr == ""
|| !(builtins.hasAttr "value" attr) || attr.value == null
|| attr.value == "") then
[ ]
else
[ attr.value ] ++ (getUntilPivot (builtins.tail lst));
in builtins.foldl' (x: y: x + y) "" (getUntilPivot keys);
};
}