home-manager/modules/misc/numlock.nix

32 lines
646 B
Nix
Raw Normal View History

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