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

View File

@@ -42,6 +42,7 @@
./system-modules/ydotool.nix
]) ++ (if (host == "NxACE") then [
./system-modules/nx2site.nix
./system-modules/hugo.nix
./system-modules/postgres.nix
./system-modules/nx2site/proxy.nix
./system-modules/nx2site/audiobookshelf.nix

View File

@@ -1,7 +0,0 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
hugo
dart-sass
];
}

View File

@@ -62,7 +62,6 @@
./home-modules/zathura.nix
./home-modules/zoxide.nix
] ++ (if (host == "NxACE") then [
./home-modules/hugo.nix
./home-modules/nx2site.nix
./home-modules/nx2site-backup.nix
] else []);

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 // {