This commit is contained in:
glenn 2024-10-06 21:25:59 +02:00
parent b33b2a6b5f
commit 447fe8862a
2 changed files with 49 additions and 2 deletions

46
dufs.nix Normal file
View file

@ -0,0 +1,46 @@
{
# self,
# config,
# lib,
pkgs,
...
}: let
adminArg = "-a admin:$(cat /etc/nixos/.secrets/dufs/adminpw)@/:rw";
cerinventArg = "-a cerinvent:$(cat /etc/nixos/.secrets/dufs/cerinventpw)@/cerinvent";
domain = "builds.sondell.org";
port = "5555";
in {
users = {
users.dufs = {
isNormalUser = false;
isSystemUser = true;
group = "dufs";
};
groups.dufs = {};
};
systemd.services."dufs-files" = {
enable = true;
description = "website for file browsing";
wantedBy = ["multi-user.target"];
unitConfig = {
After = "network-online.target";
};
script = with pkgs; ''
${dufs}/bin/dufs /pool/var/dufs/ -A -p ${port} ${cerinventArg} ${adminArg}
'';
serviceConfig = {
Type = "simple";
User = "dufs";
};
};
services.nginx.virtualHosts.${domain} = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${port}/";
proxyWebsockets = true;
};
};
}

View file

@ -55,9 +55,10 @@
./filebrowser.nix
./tail.nix
./ai.nix
./matrix.nix
./coturn.nix
# ./matrix.nix TODO does not work atm, fixit
# ./coturn.nix
./vaultwarden.nix
./dufs.nix
(import ./mail.nix {inherit mailserver;})
(import ./homepage.nix {inherit homepage;})
]