added more stuff

This commit is contained in:
fwastring 2026-02-18 17:35:47 +01:00
parent 369cfc5d52
commit 6eacd76d61
13 changed files with 237 additions and 60 deletions

View file

@ -0,0 +1,52 @@
{
lib,
pkgs,
config,
...
}:
with lib;
{
options = {
filebrowser = {
enable = mkEnableOption "enables filebrowser";
port = lib.mkOption {
type = lib.types.int;
default = 8887;
description = "The port filebrowser listens on.";
};
host = mkOption {
type = types.str;
defaultText = literalExpression "127.0.0.1";
description = "The hostname that filebrowser binds to";
};
domain = mkOption {
type = types.str;
defaultText = literalExpression "files.wastring.com";
description = "The hostname that filebrowser binds to";
};
};
};
config = mkMerge [
(mkIf config.filebrowser.enable {
services.filebrowser = {
enable = true;
settings = {
address = config.filebrowser.host;
port = config.filebrowser.port;
};
};
services.nginx.virtualHosts.${config.filebrowser.domain} = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://${toString config.filebrowser.host}:${toString config.filebrowser.port}";
proxyWebsockets = true;
};
};
})
];
}