From 1dd36e9f6b2079a5f245bef2c912ec08709ccea6 Mon Sep 17 00:00:00 2001 From: oddlama Date: Tue, 31 Jan 2023 01:18:04 +0100 Subject: [PATCH] feat: inherit agenix-rekey apps --- flake.lock | 44 ++++++++++++++++++++++++-------------------- flake.nix | 29 +++++++++++------------------ nix/nixos.nix | 2 +- 3 files changed, 36 insertions(+), 39 deletions(-) diff --git a/flake.lock b/flake.lock index d43e5a1..4c44361 100644 --- a/flake.lock +++ b/flake.lock @@ -3,15 +3,16 @@ "agenix": { "inputs": { "nixpkgs": [ + "ragenix", "nixpkgs" ] }, "locked": { - "lastModified": 1675030834, - "narHash": "sha256-e1/7Z7rVRqy2NuEOxrRm560wc/Kn8NU7gz8CDfmu9F0=", + "lastModified": 1673301561, + "narHash": "sha256-gRUWHbBAtMuPDJQXotoI8u6+3DGBIUZHkyQWpIv7WpM=", "owner": "ryantm", "repo": "agenix", - "rev": "49798e535ebc07fec82256b283d35be36d8c6c9a", + "rev": "42d371d861a227149dc9a7e03350c9ab8b8ddd68", "type": "github" }, "original": { @@ -22,22 +23,14 @@ }, "agenix-rekey": { "inputs": { - "agenix": [ - "agenix" - ], - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] + "flake-utils": "flake-utils" }, "locked": { - "lastModified": 1675114231, - "narHash": "sha256-lIPXmd2JRNv1D0CUmv8/djiIUZnm04MIHxLR7sm1PPo=", + "lastModified": 1675123691, + "narHash": "sha256-MyB+eQtV6/YRy1briQhVGOGW2FgvaEzco2epXCNEy+k=", "owner": "oddlama", "repo": "agenix-rekey", - "rev": "60829dfc172260dcff7bce9e03b24dd686a0a512", + "rev": "378105cc33e1b8245d002fa895f506414e21d258", "type": "github" }, "original": { @@ -89,6 +82,20 @@ } }, "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "flake-utils_2": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -239,9 +246,7 @@ }, "ragenix": { "inputs": { - "agenix": [ - "agenix" - ], + "agenix": "agenix", "flake-utils": [ "flake-utils" ], @@ -266,11 +271,10 @@ }, "root": { "inputs": { - "agenix": "agenix", "agenix-rekey": "agenix-rekey", "deploy-rs": "deploy-rs", "flake-compat": "flake-compat", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "home-manager": "home-manager", "impermanence": "impermanence", "nixos-hardware": "nixos-hardware", diff --git a/flake.nix b/flake.nix index e7099ec..eaa9762 100644 --- a/flake.nix +++ b/flake.nix @@ -33,19 +33,9 @@ inputs.flake-compat.follows = "flake-compat"; }; - agenix = { - url = "github:ryantm/agenix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + agenix-rekey.url = "github:oddlama/agenix-rekey"; ragenix = { url = "github:yaxitech/ragenix"; - inputs.agenix.follows = "agenix"; - inputs.flake-utils.follows = "flake-utils"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - agenix-rekey = { - url = "github:oddlama/agenix-rekey"; - inputs.agenix.follows = "agenix"; inputs.flake-utils.follows = "flake-utils"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -58,6 +48,7 @@ self, nixpkgs, flake-utils, + agenix-rekey, ... } @ inputs: { @@ -67,25 +58,27 @@ homeConfigurations = import ./nix/home-manager.nix inputs; nixosConfigurations = import ./nix/nixos.nix inputs; } - // flake-utils.lib.eachDefaultSystem (localSystem: rec { - checks = import ./nix/checks.nix inputs localSystem; - devShells.default = import ./nix/dev-shell.nix inputs localSystem; + // flake-utils.lib.eachDefaultSystem (system: rec { + checks = import ./nix/checks.nix inputs system; + devShells.default = import ./nix/dev-shell.nix inputs system; packages = let - hostDrvs = import ./nix/host-drvs.nix inputs localSystem; + hostDrvs = import ./nix/host-drvs.nix inputs system; default = - if builtins.hasAttr "${localSystem}" hostDrvs - then {default = self.packages.${localSystem}.${localSystem};} + if builtins.hasAttr "${system}" hostDrvs + then {default = self.packages.${system}.${system};} else {}; in hostDrvs // default; pkgs = import nixpkgs { - inherit localSystem; + inherit system; overlays = [ self.overlays.default ]; config.allowUnfree = true; }; + + apps = agenix-rekey.defineApps inputs system; }); } diff --git a/nix/nixos.nix b/nix/nixos.nix index 5a633af..4079851 100644 --- a/nix/nixos.nix +++ b/nix/nixos.nix @@ -35,7 +35,7 @@ nixRegistry home-manager.nixosModules.default #impermanence.nixosModules.default - ragenix.nixosModules.default + ragenix.nixosModules.age agenix-rekey.nixosModules.default ]; specialArgs = {