applied nixfmt (new version)
This commit is contained in:
@@ -1,47 +1,59 @@
|
||||
{ pkgs, lib, config, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ ./base.nix ];
|
||||
options.my.units.stream-dl.enable = lib.mkEnableOption "enable";
|
||||
config = let
|
||||
stream-dl = pkgs.writeScriptBin "stream-dl"
|
||||
(builtins.readFile ../../scripts/stream-dl.sh);
|
||||
in {
|
||||
systemd.user = lib.mkIf config.my.units.stream-dl.enable {
|
||||
services."stream@" = {
|
||||
description = "monitors a stream channel for online streams.";
|
||||
restartIfChanged = true;
|
||||
wantedBy = [ "default.target" ];
|
||||
path = [ pkgs.nix stream-dl ];
|
||||
serviceConfig = {
|
||||
Restart = "on-failure";
|
||||
RestartSec = 30;
|
||||
ExecStart = "${stream-dl}/bin/stream-dl %I";
|
||||
};
|
||||
};
|
||||
timers = let
|
||||
streamTimer = {
|
||||
enable = true;
|
||||
config =
|
||||
let
|
||||
stream-dl = pkgs.writeScriptBin "stream-dl" (builtins.readFile ../../scripts/stream-dl.sh);
|
||||
in
|
||||
{
|
||||
systemd.user = lib.mkIf config.my.units.stream-dl.enable {
|
||||
services."stream@" = {
|
||||
description = "monitors a stream channel for online streams.";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "5min";
|
||||
OnUnitActiveSec = "65min";
|
||||
RandomizedDelaySec = 30;
|
||||
restartIfChanged = true;
|
||||
wantedBy = [ "default.target" ];
|
||||
path = [
|
||||
pkgs.nix
|
||||
stream-dl
|
||||
];
|
||||
serviceConfig = {
|
||||
Restart = "on-failure";
|
||||
RestartSec = 30;
|
||||
ExecStart = "${stream-dl}/bin/stream-dl %I";
|
||||
};
|
||||
};
|
||||
in {
|
||||
"stream@johnneal911" = streamTimer // { };
|
||||
"stream@uk2011boy" = streamTimer // { };
|
||||
"stream@tommy9x6" = streamTimer // { };
|
||||
"stream@brocollirob" = streamTimer // { };
|
||||
"stream@tomayto\\x20picarto" = streamTimer // { };
|
||||
timers =
|
||||
let
|
||||
streamTimer = {
|
||||
enable = true;
|
||||
description = "monitors a stream channel for online streams.";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "5min";
|
||||
OnUnitActiveSec = "65min";
|
||||
RandomizedDelaySec = 30;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
"stream@johnneal911" = streamTimer // { };
|
||||
"stream@uk2011boy" = streamTimer // { };
|
||||
"stream@tommy9x6" = streamTimer // { };
|
||||
"stream@brocollirob" = streamTimer // { };
|
||||
"stream@tomayto\\x20picarto" = streamTimer // { };
|
||||
};
|
||||
};
|
||||
my.scripts.stream-dl = {
|
||||
enable = lib.mkDefault false;
|
||||
install = true;
|
||||
service = false;
|
||||
name = "stream-dl";
|
||||
package = stream-dl;
|
||||
};
|
||||
};
|
||||
my.scripts.stream-dl = {
|
||||
enable = lib.mkDefault false;
|
||||
install = true;
|
||||
service = false;
|
||||
name = "stream-dl";
|
||||
package = stream-dl;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user