Move grav

This commit is contained in:
muon 2025-01-02 15:13:55 +00:00
parent aaa78b5079
commit 7074efe217
2 changed files with 22 additions and 2 deletions

View file

@ -12,10 +12,13 @@ in with lib; {
};
};
config = {
networking.firewall = { allowedTCPPorts = [ 443 80 ]; };
config = let port = 5001;
in {
networking.firewall = { allowedTCPPorts = [ port ]; };
services.grav = mkIf cfg.grav.enable {
inherit port;
enable = true;
root = "/curr/grav/grav";
phpPackage = pkgs.php81;
};
users.users.${config.mods.user.name}.extraGroups = lib.mkAfter [ "grav" ];

View file

@ -59,6 +59,17 @@ in {
'';
};
addr = mkOption {
type = types.str;
description = "IP address.";
default = "0.0.0.0";
};
port = mkOption {
type = types.nullOr types.port;
description = "Port number.";
default = 3000;
};
phpPackage = mkPackageOption pkgs "php" { };
maxUploadSize = mkOption {
@ -153,10 +164,16 @@ in {
services.nginx = mkIf (cfg.virtualHost != null) {
enable = true;
virtualHosts = {
${cfg.virtualHost} = {
root = "${servedRoot}";
listen = [{
addr = cfg.addr;
port = cfg.port;
}];
locations = {
"= /robots.txt" = {
priority = 100;