use local overlays automatically
Alan Pearce alan@alanpearce.eu
Fri, 10 May 2024 11:05:51 +0200
1 files changed, 12 insertions(+), 5 deletions(-)
jump to
M flake.nix → flake.nix
@@ -35,12 +35,21 @@ , deploy-rs , ... }: 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 @@ ./user/mba.nix 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 @@ ./user/prefect.nix nix-index-database.hmModules.nix-index (secrets + "/default.nix") (secrets + "/ssh.nix") - ({ nixpkgs.overlays = [ emacs-overlay.overlay ]; }) ]; }; homeConfigurations."alan@nanopi" = mkHomeConfiguration {