surgat: add share service

This commit is contained in:
Tim Schubert 2020-12-31 18:44:43 +01:00
parent 6a547c729d
commit 2095c51d7b
No known key found for this signature in database
GPG key ID: 99658A3EB5CD7C13
4 changed files with 33 additions and 0 deletions

30
modules/share.nix Normal file
View file

@ -0,0 +1,30 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.dadada.share;
in {
options.dadada.share = {
enable = mkEnableOption "Enable file share";
};
config = mkIf cfg.enable {
services.nginx.enable = true;
services.nginx.virtualHosts."share.dadada.li" = {
enableACME = true;
forceSSL = true;
root = "/var/lib/share";
locations = {
"/robots.txt" = {
extraConfig = ''
add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: /\n";
'';
};
};
};
};
}