1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/modules/misc/numlock.nix
Austin Horstman cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00

43 lines
783 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.xsession.numlock;
in
{
meta.maintainers = [ lib.maintainers.evanjs ];
options = {
xsession.numlock.enable = lib.mkEnableOption "Num Lock";
};
config = lib.mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "xsession.numlock" pkgs lib.platforms.linux)
];
systemd.user.services.numlockx = {
Unit = {
Description = "NumLockX";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.numlockx}/bin/numlockx";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
};
}