mirror of
https://codeberg.org/muon/home.git
synced 2025-12-05 23:57:46 +00:00
Move grav
This commit is contained in:
parent
aaa78b5079
commit
7074efe217
2 changed files with 22 additions and 2 deletions
|
|
@ -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" ];
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue