summaryrefslogtreecommitdiff
path: root/modules/home-manager/git-credential-lastpass/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/home-manager/git-credential-lastpass/default.nix')
-rw-r--r--modules/home-manager/git-credential-lastpass/default.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/home-manager/git-credential-lastpass/default.nix b/modules/home-manager/git-credential-lastpass/default.nix
new file mode 100644
index 0000000..bbc8d34
--- /dev/null
+++ b/modules/home-manager/git-credential-lastpass/default.nix
@@ -0,0 +1,14 @@
+{pkgs, config, lib, ...}: let inherit (lib.options) mkEnableOption mkPackageOption;
+ inherit (lib.modules) mkIf;
+ cfg = config.programs.git-credential-lastpass;
+in {
+ options.programs.git-credential-lastpass = {
+ enable = mkEnableOption "Lastpass credential helper";
+
+ package = mkPackageOption pkgs "lastpass-cli" {};
+ };
+
+ config = mkIf cfg.enable {
+ programs.git.extraConfig.credential.helper = [ "${cfg.package}/bin/git-credential-lastpass" ];
+ };
+}