diff --git a/modules/programs/git-credential-keepassxc.nix b/modules/programs/git-credential-keepassxc.nix index ac2038864..874a410d1 100644 --- a/modules/programs/git-credential-keepassxc.nix +++ b/modules/programs/git-credential-keepassxc.nix @@ -52,7 +52,7 @@ in if cfg.hosts == [ ] then helperConfig else - lib.listToAttrs (map (host: lib.nameValuePair host helperConfig)) cfg.hosts; + lib.listToAttrs (map (host: lib.nameValuePair host helperConfig) cfg.hosts); }; } diff --git a/tests/modules/programs/git-credential-keepassxc/custom-hosts.nix b/tests/modules/programs/git-credential-keepassxc/custom-hosts.nix new file mode 100644 index 000000000..6943cce45 --- /dev/null +++ b/tests/modules/programs/git-credential-keepassxc/custom-hosts.nix @@ -0,0 +1,13 @@ +{ + programs.git.enable = true; + programs.git-credential-keepassxc = { + enable = true; + hosts = [ "https://codeberg.org" ]; + }; + + nmt.script = '' + assertFileExists home-files/.config/git/config + assertFileContains home-files/.config/git/config '[credential "https://codeberg.org"]' + assertFileRegex home-files/.config/git/config 'helper = "\S*/bin/git-credential-keepassxc --git-groups"' + ''; +} diff --git a/tests/modules/programs/git-credential-keepassxc/default.nix b/tests/modules/programs/git-credential-keepassxc/default.nix index 5c0f455e5..d50f460e4 100644 --- a/tests/modules/programs/git-credential-keepassxc/default.nix +++ b/tests/modules/programs/git-credential-keepassxc/default.nix @@ -1,4 +1,5 @@ { git-credential-keepassxc-default-config = ./default-config.nix; git-credential-keepassxc-custom-groups = ./custom-groups.nix; + git-credential-keepassxc-custom-hosts = ./custom-hosts.nix; }