pass-secret-service: add module (#1898)

pass-secret-service is a proxy between
secret service (libsecret) and pass.
This commit is contained in:
Vladimir Serov 2021-04-27 22:36:29 +03:00 committed by GitHub
parent 827636c619
commit b4e3f069f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 0 deletions

2
.github/CODEOWNERS vendored
View File

@ -211,6 +211,8 @@
/modules/services/parcellite.nix @gleber
/modules/services/pass-secret-service.nix @cab404
/modules/services/password-store-sync.nix @pacien
/modules/services/pasystray.nix @pltanton

View File

@ -1897,6 +1897,15 @@ in
A new module is available: 'programs.exa'.
'';
}
{
time = "2021-04-23T10:00:00+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.pass-secret-service'.
'';
}
];
};
}

View File

@ -173,6 +173,7 @@ let
(loadModule ./services/nextcloud-client.nix { })
(loadModule ./services/owncloud-client.nix { })
(loadModule ./services/parcellite.nix { })
(loadModule ./services/pass-secret-service.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/password-store-sync.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/pasystray.nix { })
(loadModule ./services/pbgopy.nix { condition = hostPlatform.isLinux; })

View File

@ -0,0 +1,28 @@
{ pkgs, config, lib, ... }:
with lib;
let serviceCfg = config.services.pass-secret-service;
in {
meta.maintainers = [ maintainers.cab404 ];
options.services.pass-secret-service = {
enable = mkEnableOption "Pass libsecret service";
};
config = mkIf serviceCfg.enable {
assertions = [{
assertion = config.programs.password-store.enable;
message = "The 'services.pass-secret-service' module requires"
+ " 'programs.password-store.enable = true'.";
}];
systemd.user.services.pass-secret-service = {
Unit = { Description = "Pass libsecret service"; };
Service = {
Install = { WantedBy = [ "default.target" ]; };
# pass-secret-service doesn't use environment variables for some reason.
ExecStart =
"${pkgs.pass-secret-service}/bin/pass_secret_service --path ${config.programs.password-store.settings.PASSWORD_STORE_DIR}";
};
};
};
}