pass-secret-service: various improvements

Allow setting the application package and storePath used by the
config. Since the `programs.password-store` Home Manager module sets
config values via global environment variables, the default behavior
of the module should continue to behave as before for the user.

Additionally,

- Adds a few tests.

- Use "escapeShellArg" function call to the path parameter call to
  ensure paths with spaces work.

- Allow not setting storePath, which will cause `pass_secret_service`
  to default to using `~/.password-store`.

- If `pass-secret-service` is enabled, set its store path to default
  to the one defined in our password-store environment settings.

- Add myself (houstdav000) as maintainer.
This commit is contained in:
David Houston 2022-05-07 14:05:10 -04:00 committed by Robert Helgesson
parent 1c6f3054ca
commit 1d94de5604
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
6 changed files with 69 additions and 14 deletions

View file

@ -0,0 +1,17 @@
{ config, pkgs, ... }:
{
services.pass-secret-service = {
enable = true;
package = config.lib.test.mkStubPackage { };
storePath = "/mnt/password-store";
};
nmt.script = ''
serviceFile=home-files/.config/systemd/user/pass-secret-service.service
assertFileExists $serviceFile
assertFileRegex $serviceFile 'ExecStart=.*/bin/pass_secret_service'
assertFileRegex $serviceFile '/mnt/password-store'
'';
}

View file

@ -0,0 +1,15 @@
{ config, pkgs, ... }:
{
services.pass-secret-service = {
enable = true;
package = config.lib.test.mkStubPackage { };
};
nmt.script = ''
serviceFile=home-files/.config/systemd/user/pass-secret-service.service
assertFileExists $serviceFile
assertFileRegex $serviceFile 'ExecStart=.*/bin/pass_secret_service'
'';
}

View file

@ -0,0 +1,4 @@
{
pass-secret-service-default-configuration = ./default-configuration.nix;
pass-secret-service-basic-configuration = ./basic-configuration.nix;
}