about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-12-29 22:07:37 +0100
committerMel <einebeere@gmail.com>2024-12-29 22:07:37 +0100
commita0a733ede0bca29573f68602462cb6a19b60a2c2 (patch)
treeb5891211dcd4b0d895c7516635cd9aaf17d30f35 /flake.nix
parentf7f53feb09d54ce81a6bedc3dd460a06732f3c50 (diff)
downloadspecimen-a0a733ede0bca29573f68602462cb6a19b60a2c2.tar.zst
specimen-a0a733ede0bca29573f68602462cb6a19b60a2c2.zip
Add agenix module and package
Signed-off-by: Mel <einebeere@gmail.com>
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
+          ];
+        };
     };
 }