diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-09-02 17:57:50 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-09-02 17:57:50 +0530 |
| commit | 1d7e16552cb230b0d35dcad01fb023990186c636 (patch) | |
| tree | 9c152a11858de648d4d0df0c75e889793e49c782 | |
| parent | f4752f0cf338b89084cbf917b2de88113aeac9f7 (diff) | |
| download | home-manager-config-1d7e16552cb230b0d35dcad01fb023990186c636.tar.gz home-manager-config-1d7e16552cb230b0d35dcad01fb023990186c636.zip | |
feat(office/calcurse): option to use custom username and password for git remote
| -rw-r--r-- | modules/office/calcurse/default.nix | 17 | ||||
| -rw-r--r-- | modules/private/calcurse.example.nix | 8 |
2 files changed, 23 insertions, 2 deletions
diff --git a/modules/office/calcurse/default.nix b/modules/office/calcurse/default.nix index c72896e..3296f95 100644 --- a/modules/office/calcurse/default.nix +++ b/modules/office/calcurse/default.nix @@ -54,7 +54,19 @@ in remote = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; - description = "Git remote URL for the calcurse data directory. When set, calcurse-sync uses it automatically on first init instead of prompting."; + description = "Git remote URL for the calcurse data directory. Use an https:// URL if 'credential' is configured. When set, calcurse-sync uses it automatically on first init instead of prompting."; + }; + credential = { + username = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + description = "Username for HTTPS git authentication against the calcurse remote."; + }; + passwordGopassPath = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + description = "gopass entry path holding the password or token used for HTTPS git authentication against the calcurse remote. E.g. 'git/calcurse-sync'."; + }; }; }; }; @@ -94,6 +106,9 @@ in }; commit.gpgSign = false; tag.gpgSign = false; + } + // lib.optionalAttrs (config.office.calcurse.sync.credential.passwordGopassPath != null) { + credential.helper = "!f() { echo username=${lib.escapeShellArg config.office.calcurse.sync.credential.username}; echo password=\"$(${config.security.gopass.package}/bin/gopass show -o ${lib.escapeShellArg config.office.calcurse.sync.credential.passwordGopassPath})\"; }; f"; }; } ]; diff --git a/modules/private/calcurse.example.nix b/modules/private/calcurse.example.nix index 16ee9e8..681d343 100644 --- a/modules/private/calcurse.example.nix +++ b/modules/private/calcurse.example.nix @@ -2,6 +2,12 @@ { ... }: { config = { - office.calcurse.sync.remote = "YOUR_REPOSITORY_URL"; + office.calcurse.sync = { + remote = "YOUR_REPOSITORY_URL"; + credential = { + username = "example"; + passwordGopassPath = "websites/github.com/example/tokens/calendar"; + }; + }; }; } |
