factorio: Attempt at making the server work

This commit is contained in:
Erwin Boskma 2024-11-15 12:11:39 +01:00
parent 30c39a058c
commit 9c06295dd1
Signed by: erwin
SSH key fingerprint: SHA256:9LmFDe1C6jSrEyqxxvX8NtJBmcbB105XoqyUZF092bg
8 changed files with 97 additions and 9 deletions

View file

@ -13,8 +13,8 @@ inputs: {
factorio = {
config = import ./factorio/configuration.nix inputs;
deploy = {
host = "10.0.0.82";
# host = "factorio.barn-beaver.ts.net";
# host = "10.0.0.82";
host = "factorio.barn-beaver.ts.net";
targetUser = "erwin";
tags = [ "container" ];
};

View file

@ -50,9 +50,6 @@
systemd = {
services = {
factorio.serviceConfig = {
User = "factorio";
};
logrotate-checkconf.enable = false;
};
@ -89,10 +86,10 @@
sops.defaultSopsFile = ./secrets.yaml;
sops.secrets = {
factorio-config = {
owner = "factorio";
group = "factorio";
};
# factorio-config = {
# owner = "factorio";
# group = "factorio";
# };
};
system.stateVersion = "24.11";

View file

@ -24,6 +24,15 @@ let
// {
deps = [ ];
};
disableSpaceAge = pkgs.writeShellScript "disable-space-age" ''
space_age_mods=("elevated-rails" "quality" "space-age")
for mod in "''${space_age_mods[@]}"; do
${lib.getExe pkgs.jaq} --arg mod_name "''${mod}" 'if .mods | map(.name) | index($mod_name) then .mods |= map(if .name == $mod_name and .enabled == true then .enabled = false else . end) else .mods += [{"name": $mod_name, "enabled": false}] end' /var/lib/factorio/mod-list.json > /var/lib/factorio/mod-list.json.tmp
mv /var/lib/factorio/mod-list.json.tmp /var/lib/factorio/mod-list.json
done
'';
in
{
services = {
@ -32,10 +41,22 @@ in
game-name = "stats-export-test";
saveName = "stats-export-test";
mods = builtins.map modToDrv modList;
mods-dat = ./mods/mod-settings.dat;
lan = true;
admins = [ "eboskma" ];
nonBlockingSaving = true;
requireUserVerification = false;
};
};
systemd = {
services = {
factorio.serviceConfig = {
User = "factorio";
ExecStartPre = [
disableSpaceAge
];
};
};
};
}

View file

@ -0,0 +1,70 @@
{
"mods":
[
{
"name": "base",
"enabled": true
},
{
"name": "elevated-rails",
"enabled": false
},
{
"name": "quality",
"enabled": false
},
{
"name": "space-age",
"enabled": false
},
{
"name": "calculator-ui",
"enabled": true
},
{
"name": "car-finder",
"enabled": true
},
{
"name": "even-distribution",
"enabled": true
},
{
"name": "flib",
"enabled": true
},
{
"name": "OrePatchOrganizer",
"enabled": true
},
{
"name": "power-grid-comb",
"enabled": true
},
{
"name": "RateCalculator",
"enabled": true
},
{
"name": "squeak-through-2",
"enabled": true
},
{
"name": "VehicleSnap",
"enabled": true
}
]
}

Binary file not shown.