summaryrefslogtreecommitdiffstats
path: root/hosts/poweredge/filebrowser.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/poweredge/filebrowser.nix')
-rw-r--r--hosts/poweredge/filebrowser.nix36
1 files changed, 30 insertions, 6 deletions
diff --git a/hosts/poweredge/filebrowser.nix b/hosts/poweredge/filebrowser.nix
index 681a6a6..6574c6c 100644
--- a/hosts/poweredge/filebrowser.nix
+++ b/hosts/poweredge/filebrowser.nix
@@ -3,24 +3,48 @@
autoStart = true;
privateNetwork = true;
hostBridge = "br-lan0";
- localMacAddress = "02:00:00:00:00:05";
+ localMacAddress = "02:00:00:00:01:45";
+ ephemeral = true;
# Host path
bindMounts = {
- "/var/lib/filebrowser/data" = {
+ "/var/lib/filebrowser" = {
+ hostPath = "/nix/persist/filebrowser";
+ isReadOnly = false;
+ };
+ "/media" = {
hostPath = "/media";
isReadOnly = true;
};
};
- config = { lib, pkg, config, ... }: {
+ 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
- services.filebrowser.enable = true;
- services.filebrowser.settings.address = "0.0.0.0";
+ # 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 = {