From e6ed60548397627bf10f561f9438201dbba0a36e Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sun, 21 Apr 2024 02:15:42 +0300 Subject: 2024-04-21 --- modules/common/secrets.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 modules/common/secrets.nix (limited to 'modules/common/secrets.nix') diff --git a/modules/common/secrets.nix b/modules/common/secrets.nix new file mode 100644 index 0000000..03a2eeb --- /dev/null +++ b/modules/common/secrets.nix @@ -0,0 +1,30 @@ +{ + config, + inputs, + lib, + pkgs, + this, + ... +}: +with lib; +{ + imports = [ + inputs.agenix.nixosModules.default + (mkAliasOptionModule [ "secrets" ] [ + "age" + "secrets" + ]) + ]; + + config = { + age.identityPaths = + if this.isHeadful then + [ "${config.my.home}/.ssh/id_${my.ssh.type}" ] + else + map (attr: attr.path) (filter (attr: attr.type == my.ssh.type) config.services.openssh.hostKeys); + + environment.systemPackages = with pkgs; [ agenix ]; + + nixpkgs.overlays = [ inputs.agenix.overlays.default ]; + }; +} -- cgit 1.4.1