nixos-selfhost/filebrowser.nix

44 lines
1 KiB
Nix
Raw Permalink Normal View History

2024-03-06 20:48:43 +01:00
{
2024-10-15 12:34:28 +02:00
config,
pkgs,
...
}: let
domain = "files.sondell.org";
in {
2024-03-06 22:14:44 +01:00
systemd.services.filebrowser = with pkgs; {
2024-03-06 20:48:43 +01:00
enable = true;
description = "web app file explorer";
2024-10-15 12:34:28 +02:00
wantedBy = ["multi-user.target"];
2024-03-06 22:14:44 +01:00
unitConfig = {
2024-10-15 12:34:28 +02:00
After = "network-online.target";
2024-03-06 22:14:44 +01:00
};
serviceConfig = {
2024-04-29 21:20:27 +02:00
ExecStart = "${filebrowser}/bin/filebrowser -r /pool/media/ -d /var/lib/filebrowser/filebrowser.db";
2024-10-15 12:34:28 +02:00
User = "jellyfin";
Group = "backup";
Type = "simple";
2024-03-06 22:14:44 +01:00
};
2024-03-06 20:48:43 +01:00
};
2024-03-25 00:18:55 +01:00
systemd.services.tailBrowser = with pkgs; {
2024-04-02 19:24:26 +02:00
enable = false;
2024-03-25 00:18:55 +01:00
description = "serve via tailscale filebrowser";
2024-10-15 12:34:28 +02:00
wantedBy = ["multi-user.target"];
2024-03-25 00:18:55 +01:00
unitConfig = {
2024-10-15 12:34:28 +02:00
After = "filebrowser.target";
2024-03-25 00:18:55 +01:00
};
serviceConfig = {
ExecStart = "${tailscale}/bin/tailscale serve --http 80 localhost:8080";
# User= "jellyfin";
2024-10-15 12:34:28 +02:00
Type = "simple";
2024-03-25 00:18:55 +01:00
};
};
2024-03-06 20:48:43 +01:00
services.nginx.virtualHosts.${domain} = {
locations."/" = {
proxyPass = "http://localhost:8080/";
proxyWebsockets = true;
};
};
}