Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass-secret-service: add module #1898

Merged
merged 1 commit into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions modules/misc/news.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
'';
}

];
};
}
1 change: 1 addition & 0 deletions modules/modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; })
Expand Down
28 changes: 28 additions & 0 deletions modules/services/pass-secret-service.nix
Original file line number Diff line number Diff line change
@@ -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}";
};
};
};
}