This commit is contained in:
Lennart J. Kurzweg (Nx2)
2025-03-31 01:24:45 +02:00
parent 921f8fc6a7
commit 8a8780ff71
5 changed files with 47 additions and 11 deletions

32
system-modules/hugo.nix Normal file
View File

@@ -0,0 +1,32 @@
{ pkgs-unstable, user, ... }:
let p = pkgs-unstable; in
{
environment.systemPackages = with p; [
hugo
dart-sass
];
users = {
groups = {
"hugo".name = "hugo";
};
users = {
"${user}".extraGroups = [ "hugo" ];
"nginx".extraGroups = [ "hugo" ];
"hugo" = {
isSystemUser = true;
group = "hugo";
};
};
};
systemd.services."hugo" = {
script = with p; /* shell */ ''
${hugo}/bin/hugo serve --port 8000 --bind 10.0.1.1 --baseURL http://10.0.1.1:8000 -s /var/lib/hugo/nx2site/
'';
serviceConfig = {
Type = "simple";
User = "hugo";
};
};
}

View File

@@ -14,7 +14,7 @@
};
certs = {
"${domain}" = {
extraDomainNames = builtins.map (subd: "${subd}.${domain}") [ "sync" ];
extraDomainNames = builtins.map (subd: "${subd}.${domain}") [ "sync" "dev" ];
};
};
};
@@ -145,10 +145,21 @@
# };
"abs.${domain}" = vh // {
listen = dl;
locations = { "/" = {
locations."/" = {
proxyPass = "http://127.0.0.1:${builtins.toString config.services.audiobookshelf.port}";
proxyWebsockets = true;
}; };
};
};
"dev.${domain}" = vh // {
listen = dl ++ [
# { addr = "0.0.0.0"; port = 8000; ssl = true; }
# { addr = "[::0]"; port = 8000; ssl = true; }
];
root = "/var/lib/hugo/nx2site/public";
# locations."/" = {
# proxyPass = "http://127.0.0.1:8000";
# proxyWebsockets = true;
# };
};
# is done atomatically
# "cal.${domain}" = vh // {