Kieran's opinionated (and probably slightly dumb) nix config

feat(battleship-arena): add manual Glicko-2 recalculation service

Added systemd service for manual Glicko-2 rating recalculation.
Ratings automatically recalculate after each round-robin, but this
provides a manual trigger for edge cases like recovery from errors
or algorithm upgrades.

Usage: sudo systemctl start battleship-arena-recalculate

Updated flake input to include proper rating period implementation
that fixes last-submitter bias.

💘 Generated with Crush

Assisted-by: Claude Sonnet 4.5 via Crush <crush@charm.land>

dunkirk.sh 395cef59 b51927b4

verified
Changed files
+22 -3
modules
nixos
+3 -3
flake.lock
···
]
},
"locked": {
-
"lastModified": 1764985699,
-
"narHash": "sha256-U9orv4HzUpmwd5oWgHzDcxBwLX6qxtEwYlXBt2yWBw4=",
+
"lastModified": 1764990902,
+
"narHash": "sha256-C7fri31tZpUEsSALXO8PccOCzL2LuF0jXGcoFTkFuvk=",
"owner": "taciturnaxolotl",
"repo": "battleship-arena",
-
"rev": "9a95d7f7912e9ce398d058efea3ca0ebf8e7f99d",
+
"rev": "318520e36e38d3af5304871723fa90e604e52312",
"type": "github"
},
"original": {
+19
modules/nixos/services/battleship-arena.nix
···
'';
};
+
# Service to recalculate Glicko-2 ratings (manual trigger only)
+
# Ratings automatically recalculate after each round-robin
+
# Use: sudo systemctl start battleship-arena-recalculate
+
systemd.services.battleship-arena-recalculate = {
+
description = "Recalculate Battleship Arena Glicko-2 Ratings";
+
+
environment = {
+
BATTLESHIP_RESULTS_DB = cfg.resultsDb;
+
};
+
+
serviceConfig = {
+
Type = "oneshot";
+
User = "battleship-arena";
+
Group = "battleship-arena";
+
WorkingDirectory = "/var/lib/battleship-arena";
+
ExecStart = "${cfg.package}/bin/battleship-arena recalculate-ratings";
+
};
+
};
+
# Allow battleship-arena user to create transient systemd units for sandboxing
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {