Add an automatic default.nix

This commit is contained in:
Přemysl Eric Janouch 2023-06-30 05:31:38 +02:00
parent b825086d3d
commit 46af7dad1e
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 8 additions and 0 deletions

8
default.nix Normal file
View 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