mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
pkgs/libreelec-dvb-firmware: init + hosts/ostara: tvheadend
Samhain has a virtualhost for it to make it accessible on Yggdrasil.
This commit is contained in:
parent
a1aafd06f7
commit
e9d795cc37
4 changed files with 70 additions and 1 deletions
|
|
@ -1,4 +1,6 @@
|
|||
{ config, users, pkgs, profiles, ... }:
|
||||
{ lib, config, users, pkgs, profiles, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [ ./hw.nix profiles.laptop ];
|
||||
|
|
@ -16,5 +18,43 @@
|
|||
networking.interfaces.enp1s0.useDHCP = true;
|
||||
networking.interfaces.wlp2s0.useDHCP = true;
|
||||
|
||||
katnet.public.interfaces = singleton "wlp2s0";
|
||||
|
||||
katnet.public.tcp.ports = [ 9981 9982 ];
|
||||
|
||||
hardware.firmware = [ pkgs.libreelec-dvb-firmware ];
|
||||
|
||||
services.tvheadend.enable = true;
|
||||
|
||||
systemd.services.tvheadend.enable = lib.mkForce false;
|
||||
|
||||
systemd.services.tvheadend-kat = {
|
||||
description = "Tvheadend TV streaming server";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
script = ''
|
||||
${pkgs.tvheadend}/bin/tvheadend \
|
||||
--http_root /tvheadend \
|
||||
--http_port 9981 \
|
||||
--htsp_port 9982 \
|
||||
-f \
|
||||
-C \
|
||||
-p ${config.users.users.tvheadend.home}/tvheadend.pid \
|
||||
-u tvheadend \
|
||||
-g video
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
PIDFile = "${config.users.users.tvheadend.home}/tvheadend.pid";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
User = "tvheadend";
|
||||
Group = "video";
|
||||
|
||||
ExecStop = "${pkgs.coreutils}/bin/rm ${config.users.users.tvheadend.home}/tvheadend.pid";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
system.stateVersion = "20.09";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ with lib;
|
|||
proxy_set_header Connection "upgrade";
|
||||
'';
|
||||
};
|
||||
"/tvheadend/".proxyPass = "http://192.168.1.245:9981";
|
||||
"/" = {
|
||||
root = "/mnt/zraw/media/";
|
||||
extraConfig = "autoindex on;";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue