xsettingsd: add service module

This commit is contained in:
Ivan Malison 2021-07-12 23:59:37 -06:00 committed by Robert Helgesson
parent f56a087cbc
commit c476cc61b2
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 53 additions and 0 deletions

View file

@ -2125,6 +2125,14 @@ in
A new module is available: 'programs.sm64ex'.
'';
}
{
time = "2021-07-15T13:38:32+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'services.xsettingsd'.
'';
}
];
};
}

View file

@ -229,6 +229,7 @@ let
(loadModule ./services/xembed-sni-proxy.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/xidlehook.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/xscreensaver.nix { })
(loadModule ./services/xsettingsd.nix { condition = hostPlatform.isLinux; })
(loadModule ./services/xsuspender.nix { condition = hostPlatform.isLinux; })
(loadModule ./systemd.nix { })
(loadModule ./targets/darwin { condition = hostPlatform.isDarwin; })

View file

@ -0,0 +1,44 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.xsettingsd;
in {
meta.maintainers = [ maintainers.imalison ];
options = {
services.xsettingsd = {
enable = mkEnableOption "xsettingsd";
package = mkOption {
type = types.package;
default = pkgs.xsettingsd;
defaultText = literalExample "pkgs.xsettingsd";
description = ''
Package containing the <command>xsettingsd</command> program.
'';
};
};
};
config = mkIf cfg.enable {
systemd.user.services.xsettingsd = {
Unit = {
Description = "xsettingsd";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install.WantedBy = [ "graphical-session.target" ];
Service = {
Environment = "PATH=${config.home.profileDirectory}/bin";
ExecStart = "${cfg.package}/bin/xsettingsd";
Restart = "on-abort";
};
};
};
}