diff options
| -rw-r--r-- | hosts/poweredge/configuration.nix | 9 | ||||
| -rw-r--r-- | hosts/poweredge/filebrowser.nix | 48 | ||||
| -rw-r--r-- | hosts/poweredge/router-hosts.nix | 4 |
3 files changed, 57 insertions, 4 deletions
diff --git a/hosts/poweredge/configuration.nix b/hosts/poweredge/configuration.nix index 0119620..e9e2d3e 100644 --- a/hosts/poweredge/configuration.nix +++ b/hosts/poweredge/configuration.nix @@ -1,13 +1,14 @@ { config, lib, pkgs, ... }: { imports = [ + ./bitcoind.nix ./ddns-updater.nix + ./filebrowser.nix ./fileshares.nix - ./networking.nix - #./notification-mailer.nix # TODO move some of this stuff to archetype ./gitea.nix - ./jellyfin.nix ./immich.nix - ./bitcoind.nix + ./jellyfin.nix + ./networking.nix + #./notification-mailer.nix # TODO move some of this stuff to archetype ]; # Setup bootloader diff --git a/hosts/poweredge/filebrowser.nix b/hosts/poweredge/filebrowser.nix new file mode 100644 index 0000000..818b3df --- /dev/null +++ b/hosts/poweredge/filebrowser.nix @@ -0,0 +1,48 @@ +{ + containers.filebrowser = { + autoStart = true; + privateNetwork = true; + hostBridge = "br-lan0"; + localMacAddress = "02:00:00:00:00:05"; + + # Host path + bindMounts = { + "/var/lib/filebrowser/data" = { + hostPath = "/media"; + isReadOnly = true; + }; + }; + + config = { lib, pkg, config, ... }: let + publicPort = 9000; + in { + # Network + networking.interfaces.eth0.useDHCP = true; + networking.firewall.allowedTCPPorts = [ 80 publicPort ]; # Caddy (private + public) + + # Filebrowser + services.filebrowser.enable = true; + + # Reverse proxy + services.caddy = { + enable = true; + # Private + virtualHosts.":80".extraConfig = '' + reverse_proxy localhost:8080 + ''; + # Public (not sure why toString is needed but ok) + virtualHosts.":${toString publicPort}".extraConfig = '' + @shared { + path /share/* + path /static/* + path /api/public/* + } + + reverse_proxy @shared localhost:8080 + ''; + }; + + system.stateVersion = "26.05"; + }; + }; +} diff --git a/hosts/poweredge/router-hosts.nix b/hosts/poweredge/router-hosts.nix index aedf18a..391d0e4 100644 --- a/hosts/poweredge/router-hosts.nix +++ b/hosts/poweredge/router-hosts.nix @@ -59,6 +59,10 @@ let macAddress = "02:00:00:00:00:04"; staticIp = "192.168.1.44"; }; + filebrowser = { + macAddress = "02:00:00:00:00:05"; + staticIp = "192.168.1.45"; + }; }; dns.hostOverrides = { "router.${localDomain}" = "192.168.1.1"; |
