From 9403b72a75d8670b3d71b9a3bda8ee487c1f594b Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Mon, 23 Mar 2026 18:04:47 -0500 Subject: [PATCH] gmail creds --- modules/programs/gmail.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 modules/programs/gmail.nix diff --git a/modules/programs/gmail.nix b/modules/programs/gmail.nix new file mode 100644 index 0000000..a2b3055 --- /dev/null +++ b/modules/programs/gmail.nix @@ -0,0 +1,26 @@ +{ inputs, ... }: { + flake.modules.homeManager = { + home.sessionVariables = { + GMAIL_CREDS_PATH = "${config.xdg.configHome}/sops-nix/gmail_api_credentials.json"; + }; + sops = { + 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" ] + } + } + ''; + }; + }; + }; +} \ No newline at end of file