diff --git a/modules/nixos/network.nix b/modules/nixos/network.nix index 122a4abf..8fc59a52 100644 --- a/modules/nixos/network.nix +++ b/modules/nixos/network.nix @@ -121,8 +121,6 @@ in networksWithDomains = filterAttrs (_: v: v.enable) networks; in mkIf cfg.enable { - lib.kw.virtualHostGen = args: virtualHostGen ({ inherit config; } // args); - network = { dns = { domain = builtins.substring 0 ((builtins.stringLength cfg.dns.zone) - 1) cfg.dns.zone; diff --git a/nixos/systems/yukari.nix b/nixos/systems/yukari.nix index 9d0950b3..c3f6e097 100644 --- a/nixos/systems/yukari.nix +++ b/nixos/systems/yukari.nix @@ -10,7 +10,6 @@ services.postgres services.nfs services.nginx - services.transmission services.tvheadend services.zfs services.plex diff --git a/services/jellyfin.nix b/services/jellyfin.nix deleted file mode 100644 index 5f0826ea..00000000 --- a/services/jellyfin.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ config, lib, pkgs, kw, ... }: - -{ - services.nginx.virtualHosts = kw.virtualHostGen { - networkFilter = [ "private" "yggdrasil" ]; - block.locations = { - "/jellyfin/".proxyPass = "http://127.0.0.1:8096/jellyfin/"; - "/jellyfin/socket" = { - proxyPass = "http://127.0.0.1:8096/jellyfin/"; - extraConfig = '' - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - ''; - }; - }; - }; - - systemd.services = { - jellyfin-socat = - let - service = lib.singleton "jellyfin.service"; - in - { - after = service; - bindsTo = service; - serviceConfig = { - DynamicUser = true; - }; - script = - let - port = toString 8096; - addr = config.network.addresses.yggdrasil.nixos.ipv6.address; - in "${pkgs.socat}/bin/socat TCP6-LISTEN:${port},bind=${addr},fork TCP4:localhost:${port}"; - }; - }; - - network.firewall = { - public.tcp.ranges = [{ - from = 32768; - to = 60999; - }]; - public.tcp.ports = [ 8096 ]; - private.tcp = { - ports = [ - 8096 - ]; - ranges = [{ - from = 32768; - to = 60999; - }]; - }; - }; - - services.jellyfin.enable = true; -} diff --git a/services/nfs.nix b/services/nfs.nix index 5ea9407f..e11f2684 100644 --- a/services/nfs.nix +++ b/services/nfs.nix @@ -10,12 +10,5 @@ with lib; services.nfs.server.enable = true; services.nfs.server.exports = "/mnt/zraw/media 192.168.1.0/24(rw) fe80::/10(rw) 200::/7(rw) 2a00:23c7:c597:7400::/56(rw)"; - - services.nginx.virtualHosts = kw.virtualHostGen { - networkFilter = [ "private" "yggdrasil" ]; - block.locations."/" = { - alias = "/mnt/zraw/media/"; - extraConfig = "autoindex on;"; - }; - }; } + diff --git a/services/transmission.nix b/services/transmission.nix deleted file mode 100644 index 9c39c15e..00000000 --- a/services/transmission.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ config, pkgs, lib, kw, ... }: - -{ - services.nginx.virtualHosts = kw.virtualHostGen { - networkFilter = [ "private" "yggdrasil" ]; - block = { - locations."/transmission" = { - proxyPass = "http://[::1]:9091"; - extraConfig = "proxy_pass_header X-Transmission-Session-Id;"; - }; - }; - }; - - services.transmission = - let - transmission-done-script = pkgs.writeScriptBin "script" '' - #!${pkgs.bash}/bin/bash - set -e - if [ "$TR_TORRENT_DIR"/"$TR_TORRENT_NAME" != "/" ]; then - cd "$TR_TORRENT_DIR"/"$TR_TORRENT_NAME" - if [ ! -z "*.rar" ]; then - ${pkgs.unrar}/bin/unrar x "*.rar" - fi - chmod ugo=rwX . - fi''; - in - { - enable = true; - home = "/mnt/zraw/transmission"; - downloadDirPermissions = "777"; - settings = { - download-dir = "/mnt/zraw/media/unsorted"; - incomplete-dir = "/mnt/zraw/media/.incomplete"; - incomplete-dir-enabled = true; - rpc-bind-address = "::"; - rpc-whitelist-enabled = false; - rpc-host-whitelist-enabled = false; - script-torrent-done-enabled = true; - dht-enabled = true; - pex-enabled = true; - script-torrent-done-filename = "${transmission-done-script}/bin/script"; - umask = 0; - }; - }; -}