summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2026-06-14 16:06:20 -0500
committerTim Keller <tjk@tjkeller.xyz>2026-06-14 16:06:20 -0500
commit83dd514fba4071abbecfbc5f04cd7ea33d14c473 (patch)
tree03ba9004abc6fb6d9d9fcec82eeea52655b5e2d6
parent33771d6733ba9064fa29478a5f356dbbb1d975c2 (diff)
downloadnixos-83dd514fba4071abbecfbc5f04cd7ea33d14c473.tar.xz
nixos-83dd514fba4071abbecfbc5f04cd7ea33d14c473.zip
filebrowser container on poweredge with public and private portsHEADmaster
-rw-r--r--hosts/poweredge/configuration.nix9
-rw-r--r--hosts/poweredge/filebrowser.nix48
-rw-r--r--hosts/poweredge/router-hosts.nix4
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";