From 1e7e46c99bbd75dafb7f7d1d0ece222a86959d75 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 10 May 2024 11:05:51 +0200 Subject: use local overlays automatically --- flake.nix | 17 ++++++++++++----- 1 file 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 { -- cgit 1.4.1