From 74068173aabf8439fea3a4d156a30d8d6ad6f882 Mon Sep 17 00:00:00 2001 From: winston Date: Tue, 21 May 2024 17:54:05 +0200 Subject: [PATCH] feat(secrets): simplify agenix-hm on darwin --- home/secrets/default.nix | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/home/secrets/default.nix b/home/secrets/default.nix index 288fa04..abd20ce 100644 --- a/home/secrets/default.nix +++ b/home/secrets/default.nix @@ -1,28 +1,11 @@ +{ lib, ... }: { - config, - lib, - pkgs, - ... -}: -let - inherit (pkgs.stdenv) isDarwin; -in -{ - age = { - identityPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; - - secrets = - with builtins; - listToAttrs ( - map (k: { - name = lib.removePrefix "home/secrets/" (lib.removeSuffix ".age" k); - value = { - file = ./../.. + "/${k}"; - }; - }) (attrNames (import ./secrets.nix)) - ); - - secretsDir = lib.mkIf isDarwin "/private/tmp/agenix"; - secretsMountPoint = lib.mkIf isDarwin "/private/tmp/agenix.d"; - }; + age.secrets = builtins.listToAttrs ( + builtins.map (k: { + name = lib.removePrefix "home/secrets/" (lib.removeSuffix ".age" k); + value = { + file = ./../.. + "/${k}"; + }; + }) (builtins.attrNames (import ./secrets.nix)) + ); }