Skip to content

Commit 164747e

Browse files
committed
udpate
1 parent ef5dd00 commit 164747e

1 file changed

Lines changed: 43 additions & 26 deletions

File tree

nix-darwin/flakes/monolith/configuration.nix

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
sops
6969
git
7070
vim
71-
factorio-headless
7271
iptables
72+
sysz
7373
];
7474

7575
sops = {
@@ -96,32 +96,49 @@
9696
# Copy/Link the save file (use either C or L)
9797
"C /var/lib/factorio/saves/save1.zip - - - - ${builtins.path { path = ./save1.zip; }}"
9898
];
99-
services.factorio = {
100-
bind = "192.168.4.129";
101-
enable = true;
102-
public = true;
103-
username = builtins.readFile config.sops.secrets."admin".path;
104-
token = builtins.readFile config.sops.secrets."token".path;
105-
openFirewall = true;
106-
stateDirName = "factorio";
107-
extraSettingsFile = pkgs.writeText "server-settings.json" (
108-
builtins.toJSON {
109-
game-password = builtins.readFile config.sops.secrets."game-password".path;
99+
nixpkgs.overlays = [
100+
(
101+
final: prev:
102+
let
103+
version = "2.0.47";
104+
sha256 = "09lsyilaf81jb5v34qx484qqy42pnmq7lqzb4x17k90nfv3j1wzh";
105+
url = "https://factorio.com/get-download/${version}/headless/linux64";
106+
in
107+
{
108+
factorio = prev.factorio.override {
109+
version = version;
110+
sha256 = sha256;
111+
url = url;
112+
};
113+
114+
services.factorio = {
115+
bind = "192.168.4.129";
116+
package = final.factorio;
117+
enable = true;
118+
public = true;
119+
username = builtins.readFile config.sops.secrets."admin".path;
120+
token = builtins.readFile config.sops.secrets."token".path;
121+
openFirewall = true;
122+
stateDirName = "factorio";
123+
extraSettingsFile = pkgs.writeText "server-settings.json" (
124+
builtins.toJSON {
125+
game-password = builtins.readFile config.sops.secrets."game-password".path;
126+
}
127+
);
128+
extraSettings = {
129+
max_players = 16;
130+
};
131+
autosave-interval = 20;
132+
saveName = "save1";
133+
game-name = "[NixOs] factorio";
134+
description = "Factorio on nixos";
135+
admins = [
136+
(builtins.readFile config.sops.secrets."admin".path)
137+
];
138+
};
110139
}
111-
);
112-
extraSettings = {
113-
max_players = 16;
114-
};
115-
autosave-interval = 20;
116-
# When not present in /var/lib/${config.services.factorio.stateDirName}/saves, a new map with default settings will be generated before starting the service.
117-
saveName = "save1";
118-
game-name = "[NixOs] factorio";
119-
description = "Factorio on nixos";
120-
admins = [
121-
(builtins.readFile config.sops.secrets."admin".path)
122-
];
123-
};
124-
140+
)
141+
];
125142
# networking
126143
networking = {
127144
defaultGateway = "192.168.4.1"; # Point to Proxmox

0 commit comments

Comments
 (0)