all repos — nixfiles @ 48e0947b4feb2bf80a4c416608ab7f1ac11fa0c1

System and user configuration, managed by nix and home-manager

extract file server role

Alin
commit

48e0947b4feb2bf80a4c416608ab7f1ac11fa0c1

parent

33dfa80268f01c24d989d2861a43333a89a8fda3

2 files changed, 24 insertions(+), 8 deletions(-)

changed files
M system/hosts/linde.nix → system/hosts/linde.nix
@@ -32,6 +32,7 @@ ../roles/reverse-proxy.nix
../roles/auth-dns.nix ../roles/binary-cache.nix ../roles/calendar-anonymiser.nix + ../roles/file-server.nix ../roles/forgejo-runner.nix ../roles/goatcounter.nix ../roles/mailer.nix
@@ -174,14 +175,6 @@ let
inherit (import ../../lib/caddy.nix { inherit lib; }) security-headers; in { - "files.${domain}" = { - extraConfig = '' - encode zstd gzip - ${security-headers { }} - root * /srv/http/files - file_server browse - ''; - }; "go.${domain}" = { extraConfig = '' encode zstd gzip
A system/roles/file-server.nix
@@ -0,0 +1,23 @@
+{ + config, + lib, + ... +}: +let + inherit (import ../../lib/caddy.nix { inherit lib; }) security-headers; + domain = config.networking.domain; +in +{ + services.caddy = { + virtualHosts = { + "files.${domain}" = { + extraConfig = '' + encode zstd gzip + ${security-headers { }} + root * /srv/http/files + file_server browse + ''; + }; + }; + }; +}