Retry factorio server

This commit is contained in:
Erwin Boskma 2024-11-14 13:13:24 +01:00
parent 3e8eddd653
commit 8579123250
Signed by: erwin
SSH key fingerprint: SHA256:/Wk1WZdLg+vQHs3in9qq7PsIp8SMzwGSk/RLZ5zPuZk
17 changed files with 195 additions and 0 deletions

View file

@ -3,6 +3,7 @@ keys:
- &erwin_horus age1435gxhlpu55pp86r8pullhc6wg43nv6qm5l3g2vl5000xhn8apdqtlf8cg
- &loki age1m93jeyexus2uqvrk99r7hh0xp7qxk55tgmju4h422dfkf92jce2sxpntu5
- &ci age1tmlx45s4f6qp929839yd5y5vxkj2z4z8wmhqsnne9j8j5uwx6p8qssun8l
- &factorio age1vvxx738y8aq6sgvagz4rrjgnzuekdl20vltmp026qfnax7mdldrs3j4nrf
- &frigate age1gtzlyyxdnt23xzyq6lq5ye645egxl7up25agxw23nuhjl6ax0dmqrlqvpf
- &gitea age1mh39yv2j3ltl50tjnqqgjctxth3nxa74ggwn29dpvcv08qd0psnssajsmd
- &gitea-runner age19jrte20w4e5u83m5s8m8c2ca6sha6e2l2k66g28jz4mpkfs0f3jq26rdp2
@ -29,6 +30,12 @@ creation_rules:
- *erwin
- *erwin_horus
- *ci
- path_regex: machines/factorio/[^/]+\.yaml$
key_groups:
- age:
- *erwin
- *erwin_horus
- *factorio
- path_regex: machines/frigate/[^/]+\.yaml$
key_groups:
- age:

View file

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

View file

@ -0,0 +1,99 @@
{
self,
...
}:
{
modulesPath,
...
}:
{
imports = [
(modulesPath + "/virtualisation/lxc-container.nix")
../../users/root
../../users/erwin
./factorio.nix
];
eboskma = {
users.erwin = {
enable = true;
server = true;
};
nix-common = {
enable = true;
remote-builders = true;
};
rust-motd.enable = true;
tailscale.enable = true;
};
boot = {
isContainer = true;
};
time.timeZone = "Europe/Amsterdam";
system.configurationRevision = self.inputs.nixpkgs.lib.mkIf (self ? rev) self.rev;
networking = {
hostName = "factorio";
useDHCP = false;
useHostResolvConf = false;
networkmanager.enable = false;
useNetworkd = true;
nftables.enable = true;
firewall.trustedInterfaces = [ "tailscale0" ];
};
systemd = {
services = {
factorio.serviceConfig = {
User = "factorio";
};
logrotate-checkconf.enable = false;
};
network = {
enable = true;
wait-online.anyInterface = true;
networks = {
"40-eth0" = {
matchConfig = {
Name = "eth0";
};
networkConfig = {
Address = "10.0.0.208/24";
Gateway = "10.0.0.1";
DNS = "10.0.0.206";
DHCP = "no";
};
};
};
};
};
security = {
sudo-rs = {
enable = true;
execWheelOnly = true;
wheelNeedsPassword = false;
};
sudo.enable = false;
};
sops.defaultSopsFile = ./secrets.yaml;
sops.secrets = {
factorio-config = {
owner = "factorio";
group = "factorio";
};
};
system.stateVersion = "24.11";
}

View file

@ -0,0 +1,41 @@
{ pkgs, lib, ... }:
let
modDir = ./mods;
modList = lib.pipe modDir [
builtins.readDir
(lib.filterAttrs (_: v: v == "regular"))
(lib.mapAttrsToList (k: _: k))
(builtins.filter (lib.hasSuffix ".zip"))
];
validPath =
modFileName:
builtins.path {
path = "${modDir}/${modFileName}";
name = lib.strings.sanitizeDerivationName modFileName;
};
modToDrv =
modFileName:
pkgs.runCommand "copy-factorio-mods" { } ''
mkdir $out
ln -s '${validPath modFileName}' $out/'${modFileName}'
''
// {
deps = [ ];
};
in
{
services = {
factorio = {
enable = true;
game-name = "stats-export-test";
saveName = "stats-export-test";
mods = builtins.map modToDrv modList;
lan = true;
admins = [ "eboskma" ];
nonBlockingSaving = true;
};
};
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,39 @@
factorio-config: ENC[AES256_GCM,data:Nso4QXpdmTL7jzWYJfv4TwZ68VQ8GflOpiuQx2t9kWEgeAQ1Ajq7TlG61gLKROKKGLt2FOok9tJb63Hm+HPiIyI=,iv:eMjhMhJ7kkxfJyZ0PIA72tygOFFamKneHHm5Ee+xYjs=,tag:flOiObW4RZ1ZTv/3TrWszw==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1h7ddyj66gcqt5vnzphjfn6y5tul79q0glcdl0et9w44z2evl999qe02wht
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBLMDJ4clJoa01OVmxYZVVL
Skxuc25VN2FNaXFDc2R3VXBrSWxBRmRlREcwClhoV3NlQkU5NHpKRStkWldZMXJK
ZVVDRE84c3NpUDJuTzZZa1hYMkIvQXcKLS0tIG5kYUx6L01JSDg3aklnVlY5bnNP
MUwvbzlackF2MW43R0k1M0piNEJtOEEKSuni5C7DZj8wmmLLvNg/TzaC8RNYr+kL
44rMX6m34fl9dNjSthsYrc21ygXTYgDvQ2AxeRqKZtFQLOTUxcXerQ==
-----END AGE ENCRYPTED FILE-----
- recipient: age1435gxhlpu55pp86r8pullhc6wg43nv6qm5l3g2vl5000xhn8apdqtlf8cg
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA0UllsRkx1MG9QM0U4aTdl
TUtySG9BamdmcjBKOWdSakdORTdaZ2pVNXhNCnhWRlBxT2p6Yyt5RXZRR3c5endR
cXlobm5oRERzMEZvTkNEVHBsNWZMemMKLS0tIGVablNKMnVnaGxYVXpGZENic3p4
UDVBZEZBREMveXJSZHJNTk5vT05WMWMKKzwG7SXFEqhr4xYXVYTMkkhuRHkUcpt/
I/f991vQHNpBP0ogOIx8O8wLa8fhzaBCcHwh3a2sdSLJJk7C22lBDQ==
-----END AGE ENCRYPTED FILE-----
- recipient: age1vvxx738y8aq6sgvagz4rrjgnzuekdl20vltmp026qfnax7mdldrs3j4nrf
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA0ZnQ3MlE1eDU5ZXdIelAr
NXZkWDhlaFFGSUd4ZHdUL1U0TStCS281RDBjCjJpclJTdWNVSUxQUFhENWU5M01u
RTNjcy8zK1pYcjE1cWIwNDJMQ25TcjgKLS0tIEs5NHh4QXB2M3pnSXkzYStVeGU1
a1hiTjkvSHNWbFg0bWVHMHRtYVAxeEkKjZu0JJLN8gvEOnRuNVZjNEei83NGAJVW
YX0/keyoJmkq+y7A4em17NVlEwXrGL5lUpLkx+Ziwx1+uUYH6QV6Ag==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-11-12T19:30:54Z"
mac: ENC[AES256_GCM,data:PQ7b7fTauWCmI9TOujBDT4RO6WyPsBOEKL9AAYh06Xoczb4n9b1n/jMX5JN4vx4ZKq7CanlA0D9SzF5CwkoYYQPwD/R5Zg3ln14i6uQ85z5zmoizxwHrhqAJyRUniYKFqZQvQ8XelcXEbteZ32EejeTaM3TMALivFDMgSBHc+To=,iv:xQKfg9mCXjee1AetwSk17r9Uchpgy62p3Zk19COgyOw=,tag:0tqAmzUZ5dRwgI/nMRvWYA==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.1