summaryrefslogtreecommitdiffstats
path: root/hosts/poweredge-pro/filebrowser.nix
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2026-11-24 12:58:49 -0600
committerTim Keller <tjk@tjkeller.xyz>2026-11-24 12:58:49 -0600
commit14ae2fa12ccfe0e72f405a295f2343bfb1bbe328 (patch)
tree836827b1e1bb70efca4295905148fd4bf57ebf42 /hosts/poweredge-pro/filebrowser.nix
parent9be662f071467094379887a653e49a0ae42bb599 (diff)
downloadnixos-14ae2fa12ccfe0e72f405a295f2343bfb1bbe328.tar.xz
nixos-14ae2fa12ccfe0e72f405a295f2343bfb1bbe328.zip
use filebrowser-quantum for pe-pro
Diffstat (limited to 'hosts/poweredge-pro/filebrowser.nix')
-rw-r--r--hosts/poweredge-pro/filebrowser.nix51
1 files changed, 30 insertions, 21 deletions
diff --git a/hosts/poweredge-pro/filebrowser.nix b/hosts/poweredge-pro/filebrowser.nix
index 4c63af3..d7ca026 100644
--- a/hosts/poweredge-pro/filebrowser.nix
+++ b/hosts/poweredge-pro/filebrowser.nix
@@ -4,49 +4,58 @@
privateNetwork = true;
hostBridge = "br-lan1";
localMacAddress = "02:00:00:00:77:12";
+ ephemeral = true;
# Host path
bindMounts = {
- "/var/lib/filebrowser/data/chexx" = {
+ "/var/lib/filebrowser" = {
+ hostPath = "/nix/persist/filebrowser";
+ isReadOnly = false;
+ };
+ "/VMDisk/shares/chexx" = {
hostPath = "/VMDisk/shares/chexx";
- isReadOnly = true;
+ isReadOnly = false;
};
- "/var/lib/filebrowser/data/Scans" = {
- hostPath = "/VMDisk/shares/scans/";
- isReadOnly = true;
+ "/VMDisk/shares/scans" = {
+ hostPath = "/VMDisk/shares/scans";
+ isReadOnly = false;
};
};
- config = { lib, pkg, config, ... }: let
- publicPort = 9000;
+ config = { lib, pkgs, config, ... }: let
+ FILEBROWSER_CONFIG = "${(pkgs.formats.yaml { }).generate "config.yaml" {
+ server = {
+ port = 8080;
+ database = "/var/lib/filebrowser/database.db";
+ sources = [ { path = "/VMDisk/shares"; } ];
+ };
+ }}";
in {
# Network
networking.interfaces.eth0.useDHCP = true;
- networking.firewall.allowedTCPPorts = [ 80 publicPort ]; # Caddy (private + public)
+ networking.firewall.allowedTCPPorts = [ 80 8080 ]; # Caddy + filebrowser
- # Filebrowser
+ # Filebrowser-quantum
services.filebrowser = {
enable = true;
- #package = pkgs.filebrowser-quantum; # Not supported yet
+ package = pkgs.filebrowser-quantum;
+ };
+
+ # Edit systemd service for filebrowser to make it compatible w/ filebrowser-quantum
+ systemd.services.filebrowser = {
+ #environment.FILEBROWSER_DATABASE =
+ environment = { inherit FILEBROWSER_CONFIG; };
+ serviceConfig = {
+ ExecStart = lib.mkForce (lib.getExe pkgs.filebrowser-quantum);
+ };
};
# 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";