diff --git a/machines/default.nix b/machines/default.nix index c00f3a1..21d2f3c 100644 --- a/machines/default.nix +++ b/machines/default.nix @@ -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" ]; }; diff --git a/machines/factorio/configuration.nix b/machines/factorio/configuration.nix index 7d4b9f1..cff5ec8 100644 --- a/machines/factorio/configuration.nix +++ b/machines/factorio/configuration.nix @@ -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"; diff --git a/machines/factorio/factorio.nix b/machines/factorio/factorio.nix index c9973be..2a12770 100644 --- a/machines/factorio/factorio.nix +++ b/machines/factorio/factorio.nix @@ -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 + ]; + }; + }; + }; } diff --git a/machines/factorio/mods/EditorExtensions_2.3.1.zip b/machines/factorio/mods/EditorExtensions_2.3.1.zip deleted file mode 100644 index 9505217..0000000 Binary files a/machines/factorio/mods/EditorExtensions_2.3.1.zip and /dev/null differ diff --git a/machines/factorio/mods/blueprint-sandboxes_2.1.6.zip b/machines/factorio/mods/blueprint-sandboxes_2.1.6.zip deleted file mode 100644 index 155053c..0000000 Binary files a/machines/factorio/mods/blueprint-sandboxes_2.1.6.zip and /dev/null differ diff --git a/machines/factorio/mods/factorio-prometheus-exporter_0.2.2.zip b/machines/factorio/mods/factorio-prometheus-exporter_0.2.2.zip deleted file mode 100644 index f32dd1f..0000000 Binary files a/machines/factorio/mods/factorio-prometheus-exporter_0.2.2.zip and /dev/null differ diff --git a/machines/factorio/mods/mod-list.json b/machines/factorio/mods/mod-list.json new file mode 100644 index 0000000..abe007b --- /dev/null +++ b/machines/factorio/mods/mod-list.json @@ -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 + } + ] +} diff --git a/machines/factorio/mods/mod-settings.dat b/machines/factorio/mods/mod-settings.dat new file mode 100644 index 0000000..32aedeb Binary files /dev/null and b/machines/factorio/mods/mod-settings.dat differ