mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-08-08 06:30:18 +02:00
started refactoring
This commit is contained in:
parent
729050b005
commit
f61d2eedef
36 changed files with 12 additions and 10 deletions
87
hosts/sisyphe/features/multimedia/arr-suite.nix
Normal file
87
hosts/sisyphe/features/multimedia/arr-suite.nix
Normal file
|
@ -0,0 +1,87 @@
|
|||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.arrSuite;
|
||||
in
|
||||
{
|
||||
services.sonarr = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
services.radarr = {
|
||||
enable = true;
|
||||
group = "multimedia";
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
services.prowlarr = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
services.jellyseerr = {
|
||||
openFirewall = true;
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.bazarr = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
/*
|
||||
#TODO: create duplicated instances of Sonarr.
|
||||
systemd.services."sonarrAnime" = {
|
||||
enable = true;
|
||||
description = "Duplicated Sonarr instance, for animes";
|
||||
after = [
|
||||
"syslog.target"
|
||||
"network.target"
|
||||
];
|
||||
|
||||
path = [ pkgs.sonarr ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = "sonarr";
|
||||
ExecStart = "${pkgs.sonarr}/bin/Sonarr -nobrowser -data=/var/lib/sonarrAnime";
|
||||
TimeoutStopSec = "20";
|
||||
KillMode = "process";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
*/
|
||||
|
||||
services.caddy.virtualHosts = {
|
||||
"http://radarr.sisyphe.normandy.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :7878
|
||||
'';
|
||||
|
||||
"http://sonarr.sisyphe.normandy.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :8989
|
||||
'';
|
||||
|
||||
"http://sonarr-anime.sisyphe.normandy.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :8999
|
||||
'';
|
||||
|
||||
"http://prowlarr.sisyphe.normandy.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :9696
|
||||
'';
|
||||
|
||||
"http://katflix.sisyphe.normandy.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :5055
|
||||
'';
|
||||
|
||||
"http://bazarr.sisyphe.normandy.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :6767
|
||||
'';
|
||||
|
||||
"http://bazarr-anime.sisyphe.normandy.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :6777
|
||||
'';
|
||||
};
|
||||
}
|
17
hosts/sisyphe/features/multimedia/calibre-web.nix
Normal file
17
hosts/sisyphe/features/multimedia/calibre-web.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.calibre-web = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
listen.ip = "0.0.0.0";
|
||||
options = {
|
||||
enableBookUploading = true;
|
||||
enableKepubify = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts."http://books.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :8083
|
||||
'';
|
||||
}
|
9
hosts/sisyphe/features/multimedia/default.nix
Normal file
9
hosts/sisyphe/features/multimedia/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
imports = [
|
||||
./arr-suite.nix
|
||||
./calibre-web.nix
|
||||
./slskd.nix
|
||||
./transmission.nix
|
||||
./jellyfin.nix
|
||||
];
|
||||
}
|
34
hosts/sisyphe/features/multimedia/jellyfin.nix
Normal file
34
hosts/sisyphe/features/multimedia/jellyfin.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
# 1. enable vaapi on OS-level
|
||||
nixpkgs.config.packageOverrides = pkgs: {
|
||||
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
|
||||
};
|
||||
|
||||
hardware.opengl = {
|
||||
# hardware.opengl in 24.05
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
intel-media-driver
|
||||
intel-vaapi-driver # previously vaapiIntel
|
||||
vaapiVdpau
|
||||
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
|
||||
intel-media-sdk # QSV up to 11th gen
|
||||
];
|
||||
};
|
||||
|
||||
services.jellyfin = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts = {
|
||||
"http://jellyfin.sisyphe.normandy.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :8096
|
||||
'';
|
||||
|
||||
"http://media.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :8096
|
||||
'';
|
||||
};
|
||||
}
|
43
hosts/sisyphe/features/multimedia/slskd.nix
Normal file
43
hosts/sisyphe/features/multimedia/slskd.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
secrets,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.downloads.music;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
downloads.music.directory = mkOption {
|
||||
type = types.str;
|
||||
default = "/srv/media/Music";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
|
||||
sops.secrets.slskd = {
|
||||
sopsFile = "${secrets}/secrets/slskd.env";
|
||||
format = "dotenv";
|
||||
};
|
||||
|
||||
services.slskd = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
environmentFile = config.sops.secrets.slskd.path;
|
||||
domain = null;
|
||||
settings = {
|
||||
shares.directories = [ "${cfg.directory}/clean" ];
|
||||
soulseek.description = "i luv katz n mewsik";
|
||||
directories.downloads = "${cfg.directory}/downloads";
|
||||
directories.incomplete = "${cfg.directory}/incomplete";
|
||||
};
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts."http://slskd.sisyphe.normandy.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :5030
|
||||
'';
|
||||
};
|
||||
}
|
47
hosts/sisyphe/features/multimedia/transmission.nix
Normal file
47
hosts/sisyphe/features/multimedia/transmission.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
config,
|
||||
secrets,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.downloads.transmission;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
downloads.transmission = {
|
||||
directory = mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/srv/Multimedia";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
sops.secrets.transmission = {
|
||||
sopsFile = "${secrets}/secrets/transmission.json";
|
||||
path = "/var/lib/secrets/transmission/settings.json";
|
||||
};
|
||||
|
||||
# torrenting apps
|
||||
services.transmission = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
openRPCPort = true;
|
||||
credentialsFile = config.sops.secrets.transmission.path;
|
||||
settings = {
|
||||
rpc-bind-address = "0.0.0.0";
|
||||
rpc-whitelist-enabled = false;
|
||||
rpc-authentication-required = true;
|
||||
download-dir = "${cfg.directory}/Torrents";
|
||||
ratio-limit-enabled = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts."http://transmission.sisyphe.normandy.hypervirtual.world".extraConfig = ''
|
||||
reverse_proxy :9091
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue