started soteria-specific secrets

This commit is contained in:
John Lancaster
2026-03-23 17:58:26 -05:00
parent 52a351ee8c
commit a45f5a4cca
4 changed files with 53 additions and 49 deletions
+4 -32
View File
@@ -11,15 +11,8 @@ in
};
flake.modules.nixos.sops = {
imports = with inputs.sops-nix.nixosModules; [
sops
];
sops.defaultSopsFile = ../../keys/secrets.yaml;
sops.secrets."test-nix/ssh_host_key" = {
owner = "john";
path = "/home/john/.ssh/host_key";
};
imports = [ inputs.sops-nix.nixosModules.sops ];
# sops.defaultSopsFile = ../../keys/secrets.yaml;
};
# Define the homeModules that are used by flake-parts
@@ -39,6 +32,7 @@ in
sops # This is necessary to make the sops binary available
ssh-to-age
(writeShellScriptBin "gen-age-key" ''
mkdir -p "${config.xdg.configHome}/sops/age"
${lib.getExe pkgs.ssh-to-age} -i ${config.ssh.IdentityFile} -private-key > ${ageKeyFile}
echo -n "Created ${ageKeyFile}: "
echo $(show-age-key)
@@ -55,34 +49,12 @@ in
inputs'.sops-nix.homeManagerModules.sops
];
home.sessionVariables = {
GMAIL_CREDS_PATH = "${config.xdg.configHome}/sops-nix/gmail_api_credentials.json";
};
# Option definitions for the sops home-manager module:
# https://github.com/Mic92/sops-nix/blob/master/modules/home-manager/sops.nix
sops = {
defaultSopsFile = sopsSecretsPath;
# defaultSopsFile = sopsSecretsPath;
defaultSopsFormat = "yaml";
age.sshKeyPaths = [ "${config.ssh.IdentityFile}" ];
secrets."api/gmail_client_secret" = { };
templates."gmail_creds" = {
path = "${config.xdg.configHome}/sops-nix/gmail_api_credentials.json";
content = ''
{
"installed": {
"client_id": "499012320469-vtml6emu6bmujpsj9lud2b44jqu7h26j.apps.googleusercontent.com",
"project_id": "python-apis-423500",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "${config.sops.placeholder."api/gmail_client_secret"}",
"redirect_uris": [ "http://localhost" ]
}
}
'';
};
};
};
}