diff --git a/nixos/modules/services/hardware/lirc.nix b/nixos/modules/services/hardware/lirc.nix index 8103dbeb2d48..9942b9a97513 100644 --- a/nixos/modules/services/hardware/lirc.nix +++ b/nixos/modules/services/hardware/lirc.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.lirc; in { @@ -11,10 +8,10 @@ in { options = { services.lirc = { - enable = mkEnableOption "the LIRC daemon, to receive and send infrared signals"; + enable = lib.mkEnableOption "the LIRC daemon, to receive and send infrared signals"; - options = mkOption { - type = types.lines; + options = lib.mkOption { + type = lib.types.lines; example = '' [lircd] nodaemon = False @@ -22,13 +19,13 @@ in { description = "LIRC default options described in man:lircd(8) ({file}`lirc_options.conf`)"; }; - configs = mkOption { - type = types.listOf types.lines; + configs = lib.mkOption { + type = lib.types.listOf lib.types.lines; description = "Configurations for lircd to load, see man:lircd.conf(5) for details ({file}`lircd.conf`)"; }; - extraArguments = mkOption { - type = types.listOf types.str; + extraArguments = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; description = "Extra arguments to lircd."; }; @@ -37,7 +34,7 @@ in { ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { # Note: LIRC executables raises a warning, if lirc_options.conf do not exists environment.etc."lirc/lirc_options.conf".text = cfg.options; @@ -82,7 +79,7 @@ in { ExecStart = '' ${pkgs.lirc}/bin/lircd --nodaemon \ - ${escapeShellArgs cfg.extraArguments} \ + ${lib.escapeShellArgs cfg.extraArguments} \ ${configFile} ''; User = "lirc";