mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 21:49:48 +01:00
29 lines
600 B
Nix
29 lines
600 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";
|
|
RemainAfterExit = true;
|
|
ExecStart = "${pkgs.numlockx}/bin/numlockx";
|
|
};
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
};
|
|
};
|
|
}
|