From f4364c6398d5815c99ecd4942e5716b4c69396e7 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Thu, 21 Nov 2024 10:14:58 +0100 Subject: [PATCH] Enable `webdav` in LAN for Kodi on the TV --- hosts/sisko/default.nix | 2 +- modules/sisko-nfs/default.nix | 20 ----------------- modules/sisko-share/default.nix | 39 +++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 21 deletions(-) delete mode 100644 modules/sisko-nfs/default.nix create mode 100644 modules/sisko-share/default.nix diff --git a/hosts/sisko/default.nix b/hosts/sisko/default.nix index 969f4e4..65c5e0b 100644 --- a/hosts/sisko/default.nix +++ b/hosts/sisko/default.nix @@ -18,7 +18,7 @@ "sisko-proxy" "invidious" "searx" - "sisko-nfs" + "sisko-share" "forgejo" "prometheus" "grafana" diff --git a/modules/sisko-nfs/default.nix b/modules/sisko-nfs/default.nix deleted file mode 100644 index 7e9b82b..0000000 --- a/modules/sisko-nfs/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - systemd.tmpfiles.rules = [ - "d /export 770 nobody nogroup" - ]; - - fileSystems."/export/hd" = { - device = "/mnt/hd"; - options = [ "bind" ]; - }; - - services.nfs.server = { - enable = true; - exports = '' - /export 10.100.0.1/24(rw,fsid=0,no_subtree_check) - /export/hd 10.100.0.1/24(rw,nohide,insecure,no_subtree_check,no_root_squash) - ''; - }; - - networking.firewall.allowedTCPPorts = [ 2049 ]; -} diff --git a/modules/sisko-share/default.nix b/modules/sisko-share/default.nix new file mode 100644 index 0000000..41ea29b --- /dev/null +++ b/modules/sisko-share/default.nix @@ -0,0 +1,39 @@ +{ + systemd.tmpfiles.rules = [ + "d /export 770 nobody nogroup" + ]; + + fileSystems."/export/hd" = { + device = "/mnt/hd"; + options = [ "bind" ]; + }; + + services.nfs.server = { + enable = true; + exports = '' + /export 10.100.0.1/24(rw,fsid=0,no_subtree_check) + /export/hd 10.100.0.1/24(rw,nohide,insecure,no_subtree_check,no_root_squash) + ''; + }; + + services.webdav = { + enable = true; + + settings = { + address = "10.1.1.2"; # accessible only in LAN, used by Kodi installed on the TV + port = 9999; + scope = "/mnt/hd/torrent"; + modify = false; + auth = false; # TODO should we enable authentication? It's only reachable in LAN + debug = true; + users = [ ]; + }; + }; + + users.users.webdav.extraGroups = [ "transmission" ]; + + networking.firewall.allowedTCPPorts = [ + 2049 + 9999 + ]; +}