aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/nixos/modules/services/video/epgstation/generate
blob: 2940768b6d2c843a0ba6a5d6805b91469d328299 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env -S nix-build --no-out-link

# Script to generate default streaming configurations for EPGStation. There's
# no need to run this script directly since generate.sh in the EPGStation
# package directory would run this script for you.
#
# Usage: ./generate | xargs cat > streaming.json

{ pkgs ? (import ../../../../.. {}) }:

let
  sampleConfigPath = "${pkgs.epgstation.src}/config/config.sample.json";
  sampleConfig = builtins.fromJSON (builtins.readFile sampleConfigPath);
  streamingConfig = {
    inherit (sampleConfig)
      mpegTsStreaming
      mpegTsViewer
      liveHLS
      liveMP4
      liveWebM
      recordedDownloader
      recordedStreaming
      recordedViewer
      recordedHLS;
  };
in
pkgs.runCommand "streaming.json" { nativeBuildInputs = [ pkgs.jq ]; } ''
  jq . <<<'${builtins.toJSON streamingConfig}' > $out
''

# vim:set ft=nix: