diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2019-01-05 17:51:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-05 17:51:41 +0100 |
commit | 09fb07e4aff0a3554a170f4ce9378c322048e7d4 (patch) | |
tree | bf757b69b5968f61d6c12fb40fb6b33039ea40ed /nixos | |
parent | 8a7d9e6dd09d6db119ccfb34b8cb52157e61e7bc (diff) | |
parent | 9b2f0fbcdd4cbb4acac3f894cb93d0efdd5fcd26 (diff) | |
download | nixlib-09fb07e4aff0a3554a170f4ce9378c322048e7d4.tar nixlib-09fb07e4aff0a3554a170f4ce9378c322048e7d4.tar.gz nixlib-09fb07e4aff0a3554a170f4ce9378c322048e7d4.tar.bz2 nixlib-09fb07e4aff0a3554a170f4ce9378c322048e7d4.tar.lz nixlib-09fb07e4aff0a3554a170f4ce9378c322048e7d4.tar.xz nixlib-09fb07e4aff0a3554a170f4ce9378c322048e7d4.tar.zst nixlib-09fb07e4aff0a3554a170f4ce9378c322048e7d4.zip |
Merge pull request #52943 from ck3d/vdr-enableLirc
nixos vdr: introduce option enableLirc
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/hardware/lirc.nix | 6 | ||||
-rw-r--r-- | nixos/modules/services/hardware/vdr.nix | 14 |
2 files changed, 15 insertions, 5 deletions
diff --git a/nixos/modules/services/hardware/lirc.nix b/nixos/modules/services/hardware/lirc.nix index 0072406a438c..826e512c75d1 100644 --- a/nixos/modules/services/hardware/lirc.nix +++ b/nixos/modules/services/hardware/lirc.nix @@ -32,7 +32,6 @@ in { default = []; description = "Extra arguments to lircd."; }; - }; }; @@ -43,14 +42,15 @@ in { # Note: LIRC executables raises a warning, if lirc_options.conf do not exists environment.etc."lirc/lirc_options.conf".text = cfg.options; + passthru.lirc.socket = "/run/lirc/lircd"; + environment.systemPackages = [ pkgs.lirc ]; systemd.sockets.lircd = { description = "LIRC daemon socket"; wantedBy = [ "sockets.target" ]; socketConfig = { - # default search path - ListenStream = "/run/lirc/lircd"; + ListenStream = config.passthru.lirc.socket; SocketUser = "lirc"; SocketMode = "0660"; }; diff --git a/nixos/modules/services/hardware/vdr.nix b/nixos/modules/services/hardware/vdr.nix index 75136a2f7964..4822506a899b 100644 --- a/nixos/modules/services/hardware/vdr.nix +++ b/nixos/modules/services/hardware/vdr.nix @@ -33,12 +33,14 @@ in { default = []; description = "Additional command line arguments to pass to VDR."; }; + + enableLirc = mkEnableOption "enable LIRC"; }; }; ###### implementation - config = mkIf cfg.enable { + config = mkIf cfg.enable (mkMerge [{ systemd.tmpfiles.rules = [ "d ${cfg.videoDir} 0755 vdr vdr -" "Z ${cfg.videoDir} - vdr vdr -" @@ -67,5 +69,13 @@ in { }; users.groups.vdr = {}; - }; + } + + (mkIf cfg.enableLirc { + services.lirc.enable = true; + users.users.vdr.extraGroups = [ "lirc" ]; + services.vdr.extraArguments = [ + "--lirc=${config.passthru.lirc.socket}" + ]; + })]); } |