diff options
author | Linnnus <[email protected]> | 2023-10-07 23:18:57 +0200 |
---|---|---|
committer | Linnnus <[email protected]> | 2023-10-08 13:14:15 +0200 |
commit | 4c823f476744aff1c9ec6661d8254f1a63865b40 (patch) | |
tree | 32fbb4f7219351544d318eb6dadbd969ef24b9ba /modules | |
parent | 0d3dfdeb6d2166ed394a15c3899ad9a1cccbfc59 (diff) |
Use git-credential-lastpass
Diffstat (limited to 'modules')
-rw-r--r-- | modules/home-manager/default.nix | 1 | ||||
-rw-r--r-- | modules/home-manager/git-credential-lastpass/default.nix | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 3eb61a1..fc8366d 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -3,4 +3,5 @@ # goes in home/ instead. { iterm2 = import ./iterm2; + git-credential-lastpass = import ./git-credential-lastpass; } 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" ]; + }; +} |