mirror of
https://github.com/nix-community/home-manager
synced 2024-11-18 00:59:44 +01:00
e59b8b0c37
This adds an option `xsession.numlock` that enable the Num Lock key when starting a graphical session. Fixes #651
34 lines
589 B
Nix
34 lines
589 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.xsession.numlock;
|
|
|
|
in
|
|
|
|
{
|
|
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";
|
|
ExecStart = "${pkgs.numlockx}/bin/numlockx";
|
|
};
|
|
|
|
Install = {
|
|
WantedBy = [ "graphical-session.target" ];
|
|
};
|
|
};
|
|
};
|
|
}
|