infra/pastila/srv.nix

31 lines
665 B
Nix
Raw Normal View History

2024-06-01 10:53:00 +00:00
{ config, lib, pkgs, ... }:
{
services.nginx.enable = true;
2024-06-01 16:45:55 +00:00
# nginx runs under ProtectHome=true which disallows reading anywhere
# in /home. So we need to use a different location.
2024-06-01 10:53:00 +00:00
users.users."up" = {
isNormalUser = true;
2024-06-01 16:45:55 +00:00
home = /srv/up;
2024-06-01 10:53:00 +00:00
group = config.services.nginx.group;
createHome = true;
2024-06-01 16:45:55 +00:00
homeMode = "750";
2024-06-01 10:53:00 +00:00
};
services.nginx.virtualHosts."srv.isomorphis.me" = {
forceSSL = true;
enableACME = true;
root = config.users.users."up".home;
locations."/" = {
extraConfig = ''
autoindex on;
'';
};
locations."/i/" = {
extraConfig = ''
autoindex off;
'';
};
};
}