added more stuff
This commit is contained in:
parent
369cfc5d52
commit
6eacd76d61
13 changed files with 237 additions and 60 deletions
52
moduler/services/filebrowser/default.nix
Normal file
52
moduler/services/filebrowser/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue