aboutsummaryrefslogtreecommitdiff
path: root/home-manager/modules/misc/numlock.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/modules/misc/numlock.nix')
-rw-r--r--home-manager/modules/misc/numlock.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/home-manager/modules/misc/numlock.nix b/home-manager/modules/misc/numlock.nix
new file mode 100644
index 00000000000..77149d123ec
--- /dev/null
+++ b/home-manager/modules/misc/numlock.nix
@@ -0,0 +1,35 @@
+{ 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" ];
+ };
+ };
+ };
+}