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

nixos/services.lirc: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-27 20:43:20 +02:00
parent 827d9dfac9
commit 78b24bea0f

View file

@ -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";