feat(secrets): Add darwin sops config and gemini key access

This commit is contained in:
Mohammad Rafiq 2025-07-14 19:16:37 +08:00
parent f502810dae
commit 79b83cfc70
No known key found for this signature in database

View file

@ -30,6 +30,21 @@ in
''; '';
}; };
}; };
flake.modules.darwin.default =
{ config, ... }:
{
imports = [ inputs.sops-nix.darwinModules.sops ];
config = {
sops = {
age.sshKeyPaths = [ "${config.users.users.${username}.home}/.ssh/id_ed25519" ];
secrets."keys/gemini".sopsFile = secrets + "/keys.yaml";
};
environment.shellInit = # sh
''
export GEMINI_API_KEY=$(sudo cat ${config.sops.secrets."keys/gemini".path})
'';
};
};
flake.modules.homeManager.default.persistDirs = [ ".config/sops/age" ]; flake.modules.homeManager.default.persistDirs = [ ".config/sops/age" ];
perSystem = perSystem =
{ pkgs, ... }: { pkgs, ... }: