home-manager/modules/services/xsettingsd.nix

45 lines
981 B
Nix
Raw Normal View History

2021-07-13 07:59:37 +02:00
{ 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";
};
};
};
}