{ containers.filebrowser = { autoStart = true; privateNetwork = true; hostBridge = "br-lan0"; localMacAddress = "02:00:00:00:01:45"; ephemeral = true; # Host path bindMounts = { "/var/lib/filebrowser" = { hostPath = "/nix/persist/filebrowser"; isReadOnly = false; }; "/media" = { hostPath = "/media"; isReadOnly = true; }; }; config = { lib, pkgs, config, ... }: let FILEBROWSER_CONFIG = "${(pkgs.formats.yaml { }).generate "config.yaml" { server = { port = 8080; database = "/var/lib/filebrowser/database.db"; sources = [ { path = "/media"; } ]; }; }}"; in { # Network networking.interfaces.eth0.useDHCP = true; networking.firewall.allowedTCPPorts = [ 80 8080 ]; # Caddy + filebrowser # Filebrowser-quantum services.filebrowser = { enable = true; 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; virtualHosts.":80".extraConfig = '' reverse_proxy localhost:8080 ''; }; system.stateVersion = "26.05"; }; }; }