clouvider-lon01: add factorio server

This commit is contained in:
Luke Granger-Brown 2020-11-24 04:50:31 +00:00
parent 0d7ac05454
commit 8c36ae940b

View file

@ -233,6 +233,29 @@ in {
systemd.tmpfiles.rules = [
"d /run/minotarproxy 0700 minotarproxy - -"
];
systemd.mounts = let
bindMount' = dir: {
unitConfig.RequiresMountsFor = dir;
options = "bind";
what = "/persist${dir}";
where = dir;
};
bindMountSvc = dir: svc: (bindMount' dir) // {
bindsTo = [svc];
partOf = [svc];
};
bindMountSvcDynamic = dir: svc: (bindMount' "/var/lib/private/${dir}") // {
requiredBy = [svc];
before = [svc];
wantedBy = ["multi-user.target"];
};
bindMount = dir: (bindMount' dir) // {
wantedBy = ["multi-user.target"];
};
in [
(bindMountSvcDynamic "factorio" "factorio.service")
];
environment.etc."secrets/gitlab-runner-registration" = {
text = ''
@ -262,5 +285,23 @@ in {
nix.gc.automatic = false;
services.factorio = {
inherit (secrets.factorio) username token;
enable = true;
package = pkgs.factorio-headless-experimental;
saveName = "lukegb20201124";
game-name = "Briefcase Full of Bees";
extraSettings = {
admins = ["lukegb"];
auto_pause = true;
only_admins_can_pause_the_game = false;
game_password = secrets.factorioServerPassword;
non_blocking_saving = true;
autosave_only_on_server = true;
autosave_interval = 5;
autosave_slots = 60;
};
};
system.stateVersion = "20.09";
}