2017-01-07 18:16:26 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.gnome-keyring;
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
in {
|
2017-09-26 21:40:31 +00:00
|
|
|
meta.maintainers = [ maintainers.rycee ];
|
|
|
|
|
2017-01-07 18:16:26 +00:00
|
|
|
options = {
|
|
|
|
services.gnome-keyring = {
|
|
|
|
enable = mkEnableOption "GNOME Keyring";
|
|
|
|
|
|
|
|
components = mkOption {
|
2020-02-01 23:39:17 +00:00
|
|
|
type = types.listOf (types.enum [ "pkcs11" "secrets" "ssh" ]);
|
|
|
|
default = [ ];
|
2017-01-07 18:16:26 +00:00
|
|
|
description = ''
|
|
|
|
The GNOME keyring components to start. If empty then the
|
|
|
|
default set of components will be started.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.user.services.gnome-keyring = {
|
|
|
|
Unit = {
|
|
|
|
Description = "GNOME Keyring";
|
2017-06-26 16:34:09 +00:00
|
|
|
PartOf = [ "graphical-session-pre.target" ];
|
2017-01-07 18:16:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
2020-02-01 23:39:17 +00:00
|
|
|
ExecStart = let
|
|
|
|
args = concatStringsSep " " ([ "--start" "--foreground" ]
|
|
|
|
++ optional (cfg.components != [ ])
|
|
|
|
("--components=" + concatStringsSep "," cfg.components));
|
2020-06-06 12:17:10 +00:00
|
|
|
in "${pkgs.gnome3.gnome-keyring}/bin/gnome-keyring-daemon ${args}";
|
2017-01-07 18:16:26 +00:00
|
|
|
Restart = "on-abort";
|
|
|
|
};
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
Install = { WantedBy = [ "graphical-session-pre.target" ]; };
|
2017-01-07 18:16:26 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|