diff options
| -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"; + }; + }; }; } |
