Free and Open-source video streaming suite. https://miracle-tv.live
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

51 lines
1.2 KiB

{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.services.miracle-tv;
miracleSrc = ./.;
miracle-tv = (import "${miracleSrc}/default.nix");
in {
options.services.miracle-tv = {
enable = mkEnableOption "Miracle TV server";
settings = {
name = mkOption {
type = types.str;
default = "MiracleTV";
};
server = {
hostname = mkOption {
type = types.str;
default = "0.0.0.0";
};
port = mkOption {
type = types.int;
default = 4000;
};
};
database = {
host = mkOption {
type = types.str;
default = "localhost";
};
port = mkOption {
type = types.int;
default = 28015;
};
db = mkOption {
type = types.str;
default = "miracle-tv";
};
};
};
};
config = let
configFile = pkgs.writeText "config.json" (builtins.toJSON cfg.settings);
in lib.mkIf cfg.enable {
systemd.services.miracle-tv = {
wantedBy = [ "multi-user.target" ];
serviceConfig.ExecStart = "${miracle-tv}/bin/miracle-tv ${configFile}";
};
};
}