1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-18 22:33:00 +00:00
home-manager/modules/misc/numlock.nix

35 lines
767 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
let
cfg = config.xsession.numlock;
2020-02-02 00:39:17 +01:00
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-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.numlockx}/bin/numlockx";
};
2020-02-02 00:39:17 +01:00
Install = { WantedBy = [ "graphical-session.target" ]; };
};
};
}