From a0a733ede0bca29573f68602462cb6a19b60a2c2 Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 29 Dec 2024 22:07:37 +0100 Subject: Add agenix module and package Signed-off-by: Mel --- flake.nix | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'flake.nix') 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 + ]; + }; }; } -- cgit 1.4.1