diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 50e396c7..8f6b504a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -13,6 +13,9 @@ /modules/misc/news.nix @rycee +/modules/misc/numlock.nix @evanjs +/tests/modules/misc/numlock @evanjs + /modules/misc/pam.nix @rycee /tests/modules/misc/pam @rycee diff --git a/modules/misc/numlock.nix b/modules/misc/numlock.nix index 199dd317..c823f6db 100644 --- a/modules/misc/numlock.nix +++ b/modules/misc/numlock.nix @@ -7,6 +7,8 @@ let cfg = config.xsession.numlock; in { + meta.maintainers = [ maintainers.evanjs ]; + options = { xsession.numlock.enable = mkEnableOption "Num Lock"; }; config = mkIf cfg.enable { diff --git a/tests/default.nix b/tests/default.nix index fc294206..a4a4da0c 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -75,6 +75,7 @@ import nmt { ] ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [ ./meta # Suffices to run on one platform. ./modules/misc/debug + ./modules/misc/numlock ./modules/misc/pam ./modules/misc/xdg ./modules/misc/xsession diff --git a/tests/modules/misc/numlock/default.nix b/tests/modules/misc/numlock/default.nix new file mode 100644 index 00000000..47ca563f --- /dev/null +++ b/tests/modules/misc/numlock/default.nix @@ -0,0 +1 @@ +{ numlock = ./numlock.nix; } diff --git a/tests/modules/misc/numlock/numlock.nix b/tests/modules/misc/numlock/numlock.nix new file mode 100644 index 00000000..aa468c21 --- /dev/null +++ b/tests/modules/misc/numlock/numlock.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + config = { + xsession.numlock.enable = true; + + nixpkgs.overlays = [ + (self: super: { numlockx = pkgs.writeScriptBin "dummy-numlockx" ""; }) + ]; + + nmt.script = '' + serviceFile=home-files/.config/systemd/user/numlockx.service + assertFileExists $serviceFile + ''; + }; +}