0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/services.input-remapper: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-24 22:05:45 +02:00
parent 7065336804
commit bd471d7eb1

View file

@ -1,25 +1,22 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
with lib;
let cfg = config.services.input-remapper; in let cfg = config.services.input-remapper; in
{ {
options = { options = {
services.input-remapper = { services.input-remapper = {
enable = mkEnableOption "input-remapper, an easy to use tool to change the mapping of your input device buttons"; enable = lib.mkEnableOption "input-remapper, an easy to use tool to change the mapping of your input device buttons";
package = mkPackageOption pkgs "input-remapper" { }; package = lib.mkPackageOption pkgs "input-remapper" { };
enableUdevRules = mkEnableOption "udev rules added by input-remapper to handle hotplugged devices. Currently disabled by default due to https://github.com/sezanzeb/input-remapper/issues/140"; enableUdevRules = lib.mkEnableOption "udev rules added by input-remapper to handle hotplugged devices. Currently disabled by default due to https://github.com/sezanzeb/input-remapper/issues/140";
serviceWantedBy = mkOption { serviceWantedBy = lib.mkOption {
default = [ "graphical.target" ]; default = [ "graphical.target" ];
example = [ "multi-user.target" ]; example = [ "multi-user.target" ];
type = types.listOf types.str; type = lib.types.listOf lib.types.str;
description = "Specifies the WantedBy setting for the input-remapper service."; description = "Specifies the WantedBy setting for the input-remapper service.";
}; };
}; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.udev.packages = mkIf cfg.enableUdevRules [ cfg.package ]; services.udev.packages = lib.mkIf cfg.enableUdevRules [ cfg.package ];
services.dbus.packages = [ cfg.package ]; services.dbus.packages = [ cfg.package ];
systemd.packages = [ cfg.package ]; systemd.packages = [ cfg.package ];
environment.systemPackages = [ cfg.package ]; environment.systemPackages = [ cfg.package ];