From 09c5f8e6a8d38850ee779bd1bfab583cb3005032 Mon Sep 17 00:00:00 2001 From: wo2w <189177184+wo2wz@users.noreply.github.com> Date: Sun, 22 Feb 2026 11:17:12 -0500 Subject: [PATCH] playit.gg: init --- flake.lock | 88 +++++++++++++++++++ flake.nix | 5 ++ modules/nixos/services/gameserver/default.nix | 1 + modules/nixos/services/gameserver/playit.nix | 16 ++++ .../nixos/services/gameserver/velocity.nix | 14 ++- secrets/gutterman.yaml | 6 +- 6 files changed, 119 insertions(+), 11 deletions(-) create mode 100644 modules/nixos/services/gameserver/playit.nix diff --git a/flake.lock b/flake.lock index 2122a17..982cf79 100755 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1768135262, + "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -132,6 +150,21 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1765674936, + "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs-pin": { "locked": { "lastModified": 1708814358, @@ -148,6 +181,45 @@ "type": "github" } }, + "playit": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ], + "playit-agent-source": "playit-agent-source", + "systems": "systems" + }, + "locked": { + "lastModified": 1771722820, + "narHash": "sha256-7sVQOFNFS96NIC2Fi43i46LpNwhrVFDuB2SQqhb2b/0=", + "owner": "pedorich-n", + "repo": "playit-nixos-module", + "rev": "9bc87648bc22f1aa76191dd6a55cb7b17287f121", + "type": "github" + }, + "original": { + "owner": "pedorich-n", + "repo": "playit-nixos-module", + "type": "github" + } + }, + "playit-agent-source": { + "flake": false, + "locked": { + "lastModified": 1768357514, + "narHash": "sha256-kT7NLUcgGM/hxwK4PUDZ71PtYJqjR8i4yj/LhbXX1i0=", + "owner": "playit-cloud", + "repo": "playit-agent", + "rev": "3adf0fd4fb72c866511890eabb766732734f3cda", + "type": "github" + }, + "original": { + "owner": "playit-cloud", + "repo": "playit-agent", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", @@ -156,6 +228,7 @@ "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixpkgs-pin": "nixpkgs-pin", + "playit": "playit", "sops-nix": "sops-nix" } }, @@ -179,6 +252,21 @@ "type": "github" } }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "xwayland-satellite-stable": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 04837a6..fd2ee3d 100755 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,11 @@ }; }; + playit = { + url = "github:pedorich-n/playit-nixos-module"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/nixos/services/gameserver/default.nix b/modules/nixos/services/gameserver/default.nix index f106cdc..20527b4 100644 --- a/modules/nixos/services/gameserver/default.nix +++ b/modules/nixos/services/gameserver/default.nix @@ -3,6 +3,7 @@ { imports = [ ./minecraft-server.nix + ./playit.nix ./restic.nix ./sops.nix ./velocity.nix diff --git a/modules/nixos/services/gameserver/playit.nix b/modules/nixos/services/gameserver/playit.nix new file mode 100644 index 0000000..eabc8b5 --- /dev/null +++ b/modules/nixos/services/gameserver/playit.nix @@ -0,0 +1,16 @@ +{ inputs, config, ... }: + +{ + imports = [ inputs.playit.nixosModules.default ]; + nix.settings = { + trusted-substituters = [ "https://playit-nixos-module.cachix.org" ]; + trusted-public-keys = [ "playit-nixos-module.cachix.org-1:22hBXWXBbd/7o1cOnh+p0hpFUVk9lPdRLX3p5YSfRz4=" ]; + }; + + sops.secrets."playit/playit.toml" = {}; + + services.playit = { + enable = true; + secretPath = config.sops.secrets."playit/playit.toml".path; + }; +} \ No newline at end of file diff --git a/modules/nixos/services/gameserver/velocity.nix b/modules/nixos/services/gameserver/velocity.nix index 0405e73..ae3338c 100644 --- a/modules/nixos/services/gameserver/velocity.nix +++ b/modules/nixos/services/gameserver/velocity.nix @@ -11,11 +11,6 @@ mode = "440"; }; - networking.firewall = { - allowedTCPPorts = [ 10000 ]; - allowedUDPPorts = [ 19132 ]; # for geyser - }; - users = { users.velocity = { group = "velocity"; @@ -27,7 +22,7 @@ environment.etc."velocity/velocity.toml".source = pkgs.writers.writeTOML "velocity.toml" { config-version = "2.7"; - bind = "0.0.0.0:10000"; + bind = "127.0.0.1:10000"; motd = "if you see this the server is not working"; show-max-players = 2147483647; @@ -60,8 +55,9 @@ }; forced-hosts = { - "dj2.mc.wo2wz.fyi" = [ "divine-journey-2" ]; - "countries.mc.wo2wz.fyi" = [ "countries" ]; + "entire-identity.gl.at.ply.gg" = [ "divine-journey-2" ]; + "sample-moments.gl.at.ply.gg" = [ "countries" ]; + "paris-character.gl.at.ply.gg" = [ "countries" ]; }; advanced = { @@ -71,7 +67,7 @@ connection-timeout = 5000; read-timeout = 30000; - haproxy-protocol = false; + haproxy-protocol = true; tcp-fast-open = true; bungee-plugin-message-channel = true; diff --git a/secrets/gutterman.yaml b/secrets/gutterman.yaml index 7845bdb..bf4c19e 100644 --- a/secrets/gutterman.yaml +++ b/secrets/gutterman.yaml @@ -1,3 +1,5 @@ +playit: + playit.toml: ENC[AES256_GCM,data:gEvK5ABy+EZhM9PhwnKqryoqc4hG3hTjXRWI1pGvl/D8QEkf7xaFqMZ1tIEvRpqA4PgK59BNfLCWpyfMh3jclrM3foEp61v+Izu+Fm/tWw==,iv:YrE5RFRuI88A8e2h679TzW9VE3ysew1Qrw6ky8dcswo=,tag:koLgdN/8Y7K0sp9In3izgw==,type:str] restic: password: ENC[AES256_GCM,data:XQHv85l9cRNmJVknIhNuj7+o5oRvot7rtKdtXY0xO58=,iv:mwV373WSqMxh6ATYPnl4Qcxdim0uCVj/ooXFsturY9c=,tag:a/wCIsMQPVq5+jPf2QVZVA==,type:str] rest-auth.env: ENC[AES256_GCM,data:O6ujHcZuN2qi4oDknqjNKXtWIil2AIgkeNqhTDWr2XfKxVKeiNEz8cW0a5gXXmqicS0+KHwv32fITN6mA2t4hgJgFItMkAj9dVrnhTFX9UmrV+6qIGZVg+e1L6ZBdFxYJcrughepfvMVT01lG/DU1TJ/aDbK,iv:683BKhhcJOfKR4zu50fGit01bAChooCjt0zpcyJzmAQ=,tag:3ymmH4PU9+Q+J3TmJgZ2YA==,type:str] @@ -14,7 +16,7 @@ sops: UFR2UTJWSHJGcGFIV25Wb1B5U1ZCalkKapZc3gwAVsVyStau64dSYuperbTvw73c EKfjlFriowQ6V5MUewoV1OaXx4SW2ExzccnhMXE6UdpoDGRZkNGk6Q== -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-12-02T17:20:47Z" - mac: ENC[AES256_GCM,data:vs3UxmNlHbZIJFubaqB4M39V+0uOTB7kBH5n4COv2MmGX+ZWHHvsj8Wa9Hr8aHoySCtzgKohB4SQAyQ+abYzaEuczBmtmKAwjxs8+c3B02IHib4iRxJkXAssNKuHmfkxj3HekVmxidvnqHVhJBKzMTX72nldZOBMvPJOQ+HXgKM=,iv:Yl/6ky7ldxbr79+O+h0JvndrP0Jwlr1jrfouLUFISK4=,tag:9RaWHAhFNhIRF2XYaAFf8g==,type:str] + lastmodified: "2026-02-21T19:32:31Z" + mac: ENC[AES256_GCM,data:0MulB+A0O/okjMVhYGc0ZKzJPXHCiTVjI/h+LpzN/hzqe72m4/G5fDa6IvQayTjerBT2ViWAFKaWPRKYbYS3y0ODM5xJz5f/ZU+88ZOPzVihyZFOvsE3FQNMxN99gr11JUuj/H2gn/NlfgO93/fj6xY0K10zxWouwMghQTJlqVU=,iv:pmZEryCtTRB2cUXmY9O16WYdU50KLiQMS2dmB46ul8Q=,tag:3tMUwuQJQHHgXq/9eJWvbg==,type:str] unencrypted_suffix: _unencrypted version: 3.11.0