summary refs log tree commit diff stats
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix32
1 files changed, 19 insertions, 13 deletions
diff --git a/flake.nix b/flake.nix
index 341e3514..459d2202 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,6 +1,7 @@
 {
   inputs = {
     nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+    nixpkgs-small.url = "github:NixOS/nixpkgs/nixos-unstable-small";
     nixos-hardware.url = "github:NixOS/nixos-hardware";
     nix-index-database.url = "github:Mic92/nix-index-database";
     nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
@@ -17,6 +18,7 @@
     agenix.url = "github:ryantm/agenix";
     agenix.inputs.nixpkgs.follows = "nixpkgs";
     deploy-rs.url = "github:serokell/deploy-rs";
+    searchix.url = "git+https://git.alanpearce.eu/searchix";
   };
 
   outputs =
@@ -24,6 +26,7 @@
     { self
     , utils
     , nixpkgs
+    , nixpkgs-small
     , nixos-hardware
     , home-manager
     , darwin
@@ -32,15 +35,25 @@
     , emacs-overlay
     , agenix
     , deploy-rs
+    , searchix
     , ...
     }:
     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;
@@ -50,12 +63,6 @@
       };
     in
     {
-      overlays.default = final: prev: {
-        self = {
-          htmlformat = final.callPackage ./packages/htmlformat { };
-        };
-      };
-
       nixosConfigurations.prefect = nixpkgs.lib.nixosSystem {
         system = utils.lib.system.x86_64-linux;
         specialArgs = { inherit inputs; };
@@ -69,7 +76,7 @@
           common-gpu-nvidia-nonprime
         ]);
       };
-      nixosConfigurations.nanopi = nixpkgs.lib.nixosSystem {
+      nixosConfigurations.nanopi = nixpkgs-small.lib.nixosSystem {
         system = utils.lib.system.aarch64-linux;
         specialArgs = { inherit inputs; };
         modules = [
@@ -77,11 +84,12 @@
           ./system/nanopi.nix
         ];
       };
-      nixosConfigurations.linde = nixpkgs.lib.nixosSystem {
+      nixosConfigurations.linde = nixpkgs-small.lib.nixosSystem {
         system = utils.lib.system.aarch64-linux;
         specialArgs = { inherit inputs; };
         modules = [
           agenix.nixosModules.default
+          searchix.nixosModules.default
           ./system/linde.nix
         ];
       };
@@ -97,7 +105,6 @@
           nix-index-database.hmModules.nix-index
           (secrets + "/default.nix")
           (secrets + "/ssh.nix")
-          ({ nixpkgs.overlays = [ emacs-overlay.overlay ]; })
         ];
       };
       homeConfigurations."alan@prefect" = mkHomeConfiguration {
@@ -107,7 +114,6 @@
           nix-index-database.hmModules.nix-index
           (secrets + "/default.nix")
           (secrets + "/ssh.nix")
-          ({ nixpkgs.overlays = [ emacs-overlay.overlay ]; })
         ];
       };
       homeConfigurations."alan@nanopi" = mkHomeConfiguration {