summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--default.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/default.nix b/default.nix
index ca1aa5f..d97ecb4 100644
--- a/default.nix
+++ b/default.nix
@@ -8,7 +8,20 @@
}: let
- config = (import ./config/default.nix) // hostConfig ;
+ recursiveMerge = with pkgs.lib; attrList:
+ let f = attrPath:
+ zipAttrsWith (n: values:
+ if tail values == []
+ then head values
+ else if all isList values
+ then unique (concatLists values)
+ else if all isAttrs values
+ then f (attrPath ++ [n]) values
+ else last values
+ );
+ in f [] attrList;
+
+ config = recursiveMerge [ (import ./config/default.nix) hostConfig ];
in rec {