summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix42
1 files changed, 32 insertions, 10 deletions
diff --git a/flake.nix b/flake.nix
index 2b30e11..bfeb7ea 100644
--- a/flake.nix
+++ b/flake.nix
@@ -6,10 +6,19 @@
 
   inputs = {
     nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
+
+    agenix = {
+      url = "github:ryantm/agenix";
+      inputs.nixpkgs.follows = "nixpkgs";
+    };
   };
 
   outputs =
-    inputs@{ self, nixpkgs }:
+    inputs@{
+      self,
+      nixpkgs,
+      agenix,
+    }:
     let
       inherit (nixpkgs) lib;
 
@@ -19,7 +28,12 @@
         "aarch64-linux"
       ];
 
-      pkgsForSystem = system: import nixpkgs { inherit system; };
+      pkgsForSystem =
+        system:
+        import nixpkgs {
+          inherit system;
+          overlays = [ agenix.overlays.default ];
+        };
 
       forAllSystems =
         f:
@@ -56,13 +70,21 @@
 
       nixosModules.default = import ./application/module.nix;
 
-      nixosConfigurations.${name} = lib.nixosSystem {
-        system = "aarch64-linux";
-        specialArgs = inputs;
-        modules = [
-          ./configuration/configuration.nix
-          self.nixosModules.default
-        ];
-      };
+      nixosConfigurations.${name} =
+        let
+          defaultSystem = "aarch64-linux";
+          pkgs = pkgsForSystem defaultSystem;
+        in
+        lib.nixosSystem {
+          system = defaultSystem;
+          specialArgs = {
+            inherit pkgs;
+          } // inputs;
+          modules = [
+            ./configuration/configuration.nix
+            self.nixosModules.default
+            agenix.nixosModules.default
+          ];
+        };
     };
 }