Files
dotfiles/systems/jeeves/services/gems.nix
T
Richie add7a6a848
treefmt / nix fmt (pull_request) Successful in 6s
test ebook search / test-ebook-search (pull_request) Successful in 39s
pytest / pytest (pull_request) Successful in 40s
build_systems / build-brain (pull_request) Successful in 1m0s
build_systems / build-bob (pull_request) Successful in 1m2s
build_systems / build-rhapsody-in-green (pull_request) Successful in 1m33s
build_systems / build-jeeves (pull_request) Successful in 2m25s
test ebook search / test-ebook-search (push) Successful in 35s
build_systems / build-brain (push) Successful in 37s
build_systems / build-bob (push) Successful in 37s
build_systems / build-jeeves (push) Successful in 2m17s
treefmt / nix fmt (push) Successful in 5s
pytest / pytest (push) Successful in 29s
build_systems / build-rhapsody-in-green (push) Successful in 49s
feat(gems): add multiplayer gem game with custom content packs
- implement FastAPI and HTMX lobby and game interfaces
- support up to four human and AI-controlled players
- add configurable rules, victory conditions, and expansion modules
- support validated JSON cards, patrons, objectives, and outposts
2026-07-22 20:47:03 -04:00

53 lines
1.2 KiB
Nix

{
inputs,
pkgs,
...
}:
let
vars = import ../vars.nix;
stateDir = "${vars.services}/gems";
in
{
users.groups.gems = { };
users.users.gems = {
isSystemUser = true;
group = "gems";
home = stateDir;
};
systemd.tmpfiles.rules = [
"d ${stateDir} 0750 gems gems - -"
];
systemd.services.gems = {
description = "Gems multiplayer game";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
environment = {
PYTHONPATH = "${inputs.self}";
GEMS_DATABASE_PATH = "${stateDir}/gems.sqlite3";
GEMS_KEY_PATH = "${stateDir}/instance.key";
GEMS_PUBLIC_ORIGIN = "https://gems.tmmworkshop.com";
GEMS_SECURE_COOKIES = "true";
};
serviceConfig = {
Type = "simple";
User = "gems";
Group = "gems";
ExecStart = "${pkgs.my_python}/bin/python -m python.gems.main --host 127.0.0.1 --port 8002";
Restart = "on-failure";
RestartSec = "5s";
StandardOutput = "journal";
StandardError = "journal";
NoNewPrivileges = true;
PrivateTmp = true;
ProtectHome = true;
ProtectSystem = "strict";
ReadOnlyPaths = [ "${inputs.self}" ];
ReadWritePaths = [ stateDir ];
};
};
}