45 lines
1.0 KiB
Nix
45 lines
1.0 KiB
Nix
name:
|
|
|
|
(import ../outer-defaults.nix name) // {
|
|
|
|
bindMounts."/srv/files" = {
|
|
hostPath = "/srv/ceph/c3d2/files";
|
|
isReadOnly = true;
|
|
};
|
|
|
|
config = { config, pkgs, lib, ... }: {
|
|
imports = [ ../inner-defaults.nix ];
|
|
|
|
c3d2.hq.statistics.enable = true;
|
|
|
|
services.nginx = {
|
|
enable = true;
|
|
package = pkgs.nginx.override {
|
|
modules = with pkgs.nginxModules; [ fancyindex ];
|
|
};
|
|
virtualHosts = {
|
|
"storage.hq.c3d2.de" = {
|
|
default = true;
|
|
http2 = true;
|
|
# addSSL = true;
|
|
locations = {
|
|
"/" = let authFile = pkgs.writeText "htpasswd" "k-ot:sawCOTsl/fIUY";
|
|
in {
|
|
alias = "/srv/files/";
|
|
extraConfig = ''
|
|
auth_basic "Chaos";
|
|
auth_basic_user_file ${authFile};
|
|
fancyindex on;
|
|
# autoindex on;
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
networking.firewall.enable = false;
|
|
};
|
|
|
|
}
|