From 46af7dad1e5e072cecb0b434d03ced9052670547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Fri, 30 Jun 2023 05:31:38 +0200 Subject: [PATCH] Add an automatic default.nix --- default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..21693b5 --- /dev/null +++ b/default.nix @@ -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