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

feat: add polkit rule for battleship-arena systemd sandboxing

dunkirk.sh d572c4ef 2b289411

verified
Changed files
+13 -3
modules
nixos
+3 -3
flake.lock
···
]
},
"locked": {
-
"lastModified": 1764978362,
-
"narHash": "sha256-iTJDq41XwBTCbs5+eLVU4rFEcujzeXv17MZWW0qwEWQ=",
+
"lastModified": 1764979146,
+
"narHash": "sha256-Cs9JvUD5p+Dfd2o3vCNEjSOy/DaBKKqt0mIri6mfWQA=",
"owner": "taciturnaxolotl",
"repo": "battleship-arena",
-
"rev": "072949ae291feeafd5d19c598bf7526d909f94b0",
+
"rev": "e4a5d2409503d77bc31d2a4b3b27211ae837ea06",
"type": "github"
},
"original": {
+10
modules/nixos/services/battleship-arena.nix
···
'';
};
+
# Allow battleship-arena user to create transient systemd units for sandboxing
+
security.polkit.extraConfig = ''
+
polkit.addRule(function(action, subject) {
+
if (action.id == "org.freedesktop.systemd1.manage-units" &&
+
subject.user == "battleship-arena") {
+
return polkit.Result.YES;
+
}
+
});
+
'';
+
networking.firewall.allowedTCPPorts = [ cfg.sshPort ];
};
}