2019-07-29 01:41:02 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.xsession.numlock;
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
in {
|
|
|
|
options = { xsession.numlock.enable = mkEnableOption "Num Lock"; };
|
2019-07-29 01:41:02 +00:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.user.services.numlockx = {
|
|
|
|
Unit = {
|
|
|
|
Description = "NumLockX";
|
|
|
|
After = [ "graphical-session-pre.target" ];
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
|
|
|
Type = "oneshot";
|
2019-08-14 18:41:19 +00:00
|
|
|
RemainAfterExit = true;
|
2019-07-29 01:41:02 +00:00
|
|
|
ExecStart = "${pkgs.numlockx}/bin/numlockx";
|
|
|
|
};
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
2019-07-29 01:41:02 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|