mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-19 06:43:01 +00:00
* nixos: remove with lib * nix-darwin: remove with lib * home-manager: remove with lib * modules/accounts: remove with lib * modules/config: remove with lib * modules/i18n: remove with lib * modules/misc: remove with lib * modules: remove with lib * modules/targets: remove with lib * tests/modules/firefox: remove with lib * tests/modules/services: remove with lib
34 lines
767 B
Nix
34 lines
767 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.xsession.numlock;
|
|
|
|
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";
|
|
};
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
};
|
|
};
|
|
}
|