Add an automatic default.nix
This commit is contained in:
parent
b825086d3d
commit
46af7dad1e
8
default.nix
Normal file
8
default.nix
Normal file
@ -0,0 +1,8 @@
|
||||
# Automatically produce an attribute set, so that nix-build works directly.
|
||||
with builtins; let
|
||||
entries = attrNames (builtins.readDir ./.);
|
||||
good = filter (name: name != "default.nix") entries;
|
||||
nullToList = value: if value != null then value else [];
|
||||
nixes = concatMap (name: nullToList (match "(.*)\\.nix" name)) good;
|
||||
in
|
||||
foldl' (acc: name: acc // { ${name} = import ./${name}.nix; }) {} nixes
|
Loading…
Reference in New Issue
Block a user