dufs :)
This commit is contained in:
parent
b33b2a6b5f
commit
447fe8862a
46
dufs.nix
Normal file
46
dufs.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue