2017-01-07 19:16:26 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.gnome-keyring;
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
in {
|
2017-09-26 23:40:31 +02:00
|
|
|
meta.maintainers = [ maintainers.rycee ];
|
|
|
|
|
2017-01-07 19:16:26 +01:00
|
|
|
options = {
|
|
|
|
services.gnome-keyring = {
|
2023-07-02 01:45:18 +02:00
|
|
|
enable = mkEnableOption "GNOME Keyring";
|
2017-01-07 19:16:26 +01:00
|
|
|
|
|
|
|
components = mkOption {
|
2020-02-02 00:39:17 +01:00
|
|
|
type = types.listOf (types.enum [ "pkcs11" "secrets" "ssh" ]);
|
|
|
|
default = [ ];
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2017-01-07 19:16:26 +01:00
|
|
|
The GNOME keyring components to start. If empty then the
|
|
|
|
default set of components will be started.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2021-07-07 23:24:27 +02:00
|
|
|
assertions = [
|
|
|
|
(lib.hm.assertions.assertPlatform "services.gnome-keyring" pkgs
|
|
|
|
lib.platforms.linux)
|
2023-05-07 23:44:48 +02:00
|
|
|
{
|
2023-05-08 13:04:12 +02:00
|
|
|
assertion = !config.services.pass-secret-service.enable;
|
2023-05-07 23:44:48 +02:00
|
|
|
message = ''
|
|
|
|
Only one secrets service per user can be enabled at a time.
|
|
|
|
Other services enabled:
|
2023-05-08 13:04:12 +02:00
|
|
|
- pass-secret-service
|
2023-05-07 23:44:48 +02:00
|
|
|
'';
|
|
|
|
}
|
2021-07-07 23:24:27 +02:00
|
|
|
];
|
|
|
|
|
2017-01-07 19:16:26 +01:00
|
|
|
systemd.user.services.gnome-keyring = {
|
|
|
|
Unit = {
|
|
|
|
Description = "GNOME Keyring";
|
2017-06-26 18:34:09 +02:00
|
|
|
PartOf = [ "graphical-session-pre.target" ];
|
2017-01-07 19:16:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
2020-02-02 00:39:17 +01:00
|
|
|
ExecStart = let
|
|
|
|
args = concatStringsSep " " ([ "--start" "--foreground" ]
|
|
|
|
++ optional (cfg.components != [ ])
|
|
|
|
("--components=" + concatStringsSep "," cfg.components));
|
2021-05-30 22:47:03 +02:00
|
|
|
in "${pkgs.gnome.gnome-keyring}/bin/gnome-keyring-daemon ${args}";
|
2017-01-07 19:16:26 +01:00
|
|
|
Restart = "on-abort";
|
|
|
|
};
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
Install = { WantedBy = [ "graphical-session-pre.target" ]; };
|
2017-01-07 19:16:26 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|