summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--flake.nix17
1 files changed, 12 insertions, 5 deletions
diff --git a/flake.nix b/flake.nix
index ed8ccc47..fd497e57 100644
--- a/flake.nix
+++ b/flake.nix
@@ -35,12 +35,21 @@
     , ...
     }:
     let
+      readOverlays = path:
+        let content = builtins.readDir path; in
+        map (n: import (path + ("/" + n)))
+          (builtins.filter
+            (n:
+              (builtins.match ".*\\.nix" n != null &&
+              # ignore Emacs lock files (.#foo.nix)
+              builtins.match "\\.#.*" n == null) ||
+              builtins.pathExists (path + ("/" + n + "/default.nix")))
+            (builtins.attrNames content));
+
       mkHomeConfiguration = { modules, system }: home-manager.lib.homeManagerConfiguration {
         pkgs = import nixpkgs {
           inherit system;
-          overlays = [
-            self.overlays.default
-          ];
+          overlays = readOverlays (toString ./overlays) ++ [ emacs-overlay.overlay ];
         };
 
         inherit modules;
@@ -93,7 +102,6 @@
           nix-index-database.hmModules.nix-index
           (secrets + "/default.nix")
           (secrets + "/ssh.nix")
-          ({ nixpkgs.overlays = [ emacs-overlay.overlay ]; })
         ];
       };
       homeConfigurations."alan@prefect" = mkHomeConfiguration {
@@ -103,7 +111,6 @@
           nix-index-database.hmModules.nix-index
           (secrets + "/default.nix")
           (secrets + "/ssh.nix")
-          ({ nixpkgs.overlays = [ emacs-overlay.overlay ]; })
         ];
       };
       homeConfigurations."alan@nanopi" = mkHomeConfiguration {