diff options
| author | Mel <einebeere@gmail.com> | 2024-12-29 22:07:37 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-12-29 22:07:37 +0100 |
| commit | a0a733ede0bca29573f68602462cb6a19b60a2c2 (patch) | |
| tree | b5891211dcd4b0d895c7516635cd9aaf17d30f35 | |
| parent | f7f53feb09d54ce81a6bedc3dd460a06732f3c50 (diff) | |
| download | specimen-a0a733ede0bca29573f68602462cb6a19b60a2c2.tar.zst specimen-a0a733ede0bca29573f68602462cb6a19b60a2c2.zip | |
Add agenix module and package
Signed-off-by: Mel <einebeere@gmail.com>
| -rw-r--r-- | configuration/configuration.nix | 1 | ||||
| -rw-r--r-- | flake.lock | 82 | ||||
| -rw-r--r-- | flake.nix | 42 |
3 files changed, 115 insertions, 10 deletions
diff --git a/configuration/configuration.nix b/configuration/configuration.nix index 4a0d0eb..3ddcca1 100644 --- a/configuration/configuration.nix +++ b/configuration/configuration.nix @@ -40,6 +40,7 @@ vim git wget + agenix ]; services.openssh = { diff --git a/flake.lock b/flake.lock index 369a3b3..adcc163 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,71 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1723293904, + "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", + "owner": "ryantm", + "repo": "agenix", + "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1700795494, + "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703113217, + "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1735291276, @@ -18,8 +84,24 @@ }, "root": { "inputs": { + "agenix": "agenix", "nixpkgs": "nixpkgs" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", 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 + ]; + }; }; } |
