mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
scrabble: host without containers
This commit is contained in:
@@ -1,20 +1,59 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
let
|
let
|
||||||
port = 9090;
|
port = 9090;
|
||||||
|
scrabbleDirectory = "/var/lib/xanado";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
virtualisation.oci-containers = {
|
users.extraUsers.scrabble = {
|
||||||
backend = "podman";
|
isSystemUser = true;
|
||||||
containers.xanado = {
|
group = "scrabble";
|
||||||
volumes = [ ];
|
home = scrabbleDirectory;
|
||||||
ports = [ "${toString port}:9093" ];
|
createHome = true;
|
||||||
environment.TZ = "Europe/Berlin";
|
};
|
||||||
image = "ghcr.io/cdot/xanado:v3.1.6";
|
users.extraGroups.scrabble = {};
|
||||||
|
|
||||||
|
systemd.services.scrabble = {
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
enable = true;
|
||||||
|
preStart = "npm install @cdot/xanado";
|
||||||
|
path = [ pkgs.nodejs ];
|
||||||
|
script = ''
|
||||||
|
${scrabbleDirectory}/node_modules/.bin/xanado --config ${(pkgs.formats.json {}).generate "config.json" {
|
||||||
|
port = port;
|
||||||
|
host = "localhost";
|
||||||
|
game_defaults = {
|
||||||
|
edition = "Deutsch_Scrabble";
|
||||||
|
dictionary = "German";
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
User = "scrabble";
|
||||||
|
Group = "scrabble";
|
||||||
|
WorkingDirectory = scrabbleDirectory;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."scrabble.kmein.de" = {
|
services.nginx.virtualHosts."scrabble.kmein.de" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/".proxyPass = "http://localhost:${toString port}";
|
locations."/".proxyPass = "http://localhost:${toString port}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.scrabble-fix = {
|
||||||
|
startAt = "hourly";
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
enable = false;
|
||||||
|
script = ''
|
||||||
|
${pkgs.gnused}/bin/sed -i s/encadefrit/en/ sessions/*.json passwd.json"
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
User = "scrabble";
|
||||||
|
Group = "scrabble";
|
||||||
|
WorkingDirectory = scrabbleDirectory;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.restic.backups.niveum.paths = [ scrabbleDirectory ];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user