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 = {
|
|
|
|
enable = mkEnableOption "GNOME Keyring";
|
|
|
|
|
|
|
|
components = mkOption {
|
2020-02-02 00:39:17 +01:00
|
|
|
type = types.listOf (types.enum [ "pkcs11" "secrets" "ssh" ]);
|
|
|
|
default = [ ];
|
2017-01-07 19:16:26 +01: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 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
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|