summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix33
1 files changed, 24 insertions, 9 deletions
diff --git a/flake.nix b/flake.nix
index f99f130..f51b05e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -9,15 +9,23 @@
       inputs.nixpkgs.follows = "nixpkgs";
     };
 
+    agenix = {
+      url = "github:ryantm/agenix";
+      inputs = {
+        nixpkgs.follows = "nixpkgs";
+        home-manager.follows = "home-manager";
+      };
+    };
+
     flake-compat.url = "github:edolstra/flake-compat";
-  
+
     oisd = {
       url = "github:sjhgvr/oisd";
       flake = false;
     };
   };
 
-  outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager, ... }:
+  outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager, agenix, ... }:
   let
     tailnetName = "serval-moth";
 
@@ -45,13 +53,18 @@
       { name = "lapin"; system = arm; tailscale.ip = "100.83.254.27"; }
       { name = "renard"; system = x86; tailscale.ip = "100.75.17.75"; }
     ];
-    
+
+    overlays = [ agenix.overlays.default ];
+
     packageSetsForSystem = system: let
-      pkgsInputs = { inherit system; config = import ./config.nix; };
+      pkgsInputs =
+        i: { inherit system; config = import ./config.nix; } // i;
     in rec {
-      pkgs = import nixpkgs pkgsInputs;
-      unstablePkgs = import nixpkgs-unstable pkgsInputs;
-      auxiliaryPkgs = import ./pkgs { inherit system pkgs unstablePkgs; };
+      pkgs = import nixpkgs (pkgsInputs { inherit overlays; });
+
+      unstablePkgs = import nixpkgs-unstable (pkgsInputs { });
+
+      auxiliaryPkgs = import ./pkgs (pkgsInputs { inherit pkgs unstablePkgs; });
     };
 
     inherit (nixpkgs) lib;
@@ -68,18 +81,20 @@
 
         modules = [
           ./machines/${machine.name}
-        
+
           home-manager.nixosModules.home-manager {
             home-manager.useGlobalPkgs = true;
             home-manager.useUserPackages = true;
             home-manager.users.mel = import ./machines/${machine.name}/home.nix;
           }
+
+          agenix.nixosModules.default
         ];
       };
     }) machines);
 
     # compatibility wrapper for nixos-option
-    legacyPackages = lib.genAttrs (lib.attrValues systems) 
+    legacyPackages = lib.genAttrs (lib.attrValues systems)
       (system: with packageSetsForSystem system; pkgs.recurseIntoAttrs pkgs);
   };
 }