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:
kat witch 2021-05-12 01:52:15 +01:00
parent a1aafd06f7
commit e9d795cc37
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
4 changed files with 70 additions and 1 deletions

View file

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

View file

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

View file

@ -51,6 +51,8 @@ let
obs-studio = super.obs-studio.override { pipewireSupport = true; };
libreelec-dvb-firmware = self.callPackage ./libreelec-dvb-firmware { };
hextorgba =
(import ../lib/colorhelpers.nix { inherit (super) lib; }).hextorgba;

View file

@ -0,0 +1,26 @@
{ stdenv, fetchFromGitHub, lib}:
stdenv.mkDerivation rec {
name = "libreelec-fw-dvb";
version = "1.4.2";
src = fetchFromGitHub {
repo = "dvb-firmware";
owner = "LibreElec";
rev = version;
sha256 = "1xnfl4gp6d81gpdp86v5xgcqiqz2nf1i43sb3a4i5jqs8kxcap2k";
};
buildPhase = "";
installPhase = ''
mkdir -p $out/lib
cp -rv firmware $out/lib/
'';
meta = with lib; {
license = lib.licenses.unfreeRedistributableFirmware;
maintainers = with maintainers; [ kittywitch ];
platforms = with platforms; linux;
};
}