Create 6 new NixOS modules to reduce duplication across system configs: - hardware/wooting: Wooting keyboard udev rules and Bluetooth compat - services/nginx-base: Common nginx server settings - services/acme-base: ACME certificate defaults - services/xremap: Key remapping with sensible defaults - system/no-sleep: Disable sleep/suspend/hibernate targets - system/kernel-tweaks: PM freeze timeout and zram configuration Update system configuration files to use these new modules. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
with lib;
|
|
with lib.metacfg;
|
|
let
|
|
cfg = config.metacfg.services.xremap;
|
|
in
|
|
{
|
|
options.metacfg.services.xremap = with types; {
|
|
enable = mkBoolOpt false "Whether or not to enable xremap key remapping.";
|
|
userName = mkOption {
|
|
type = types.str;
|
|
default = "harald";
|
|
description = "User to run xremap as.";
|
|
};
|
|
withGnome = mkBoolOpt true "Enable GNOME support.";
|
|
deviceNames = mkOption {
|
|
type = types.listOf types.str;
|
|
default = [ ];
|
|
description = "List of device names to remap.";
|
|
};
|
|
config = mkOption {
|
|
type = types.attrs;
|
|
default = { };
|
|
description = "Xremap configuration.";
|
|
};
|
|
};
|
|
|
|
config = {
|
|
services.xremap = {
|
|
enable = cfg.enable;
|
|
userName = mkIf cfg.enable cfg.userName;
|
|
serviceMode = mkIf cfg.enable "user";
|
|
withGnome = mkIf cfg.enable cfg.withGnome;
|
|
deviceNames = mkIf cfg.enable cfg.deviceNames;
|
|
config = mkIf cfg.enable cfg.config;
|
|
};
|
|
|
|
users.users.${cfg.userName}.extraGroups = mkIf cfg.enable [ "input" ];
|
|
};
|
|
}
|