diff --git a/flake.lock b/flake.lock index a57deba1..8fa0eaf8 100644 --- a/flake.lock +++ b/flake.lock @@ -206,17 +206,16 @@ "rust-analyzer-src": "rust-analyzer-src_2" }, "locked": { - "lastModified": 1747291057, - "narHash": "sha256-9Wir6aLJAeJKqdoQUiwfKdBn7SyNXTJGRSscRyVOo2Y=", + "lastModified": 1767682236, + "narHash": "sha256-AWf4whMu4V1QA1wUFetWyddSfmhw6/VY5H90lXSDXjY=", "owner": "nix-community", "repo": "fenix", - "rev": "76ffc1b7b3ec8078fe01794628b6abff35cbda8f", + "rev": "ab32805338a72d8d69427426ce4259162e3d68bd", "type": "github" }, "original": { "owner": "nix-community", "repo": "fenix", - "rev": "76ffc1b7b3ec8078fe01794628b6abff35cbda8f", "type": "github" } }, @@ -559,11 +558,11 @@ "rust-analyzer-src_2": { "flake": false, "locked": { - "lastModified": 1746889290, - "narHash": "sha256-h3LQYZgyv2l3U7r+mcsrEOGRldaK0zJFwAAva4hV/6g=", + "lastModified": 1767609612, + "narHash": "sha256-ghz849iTGb+if+co4yGQC2Nfc0H6B/K4JFeul9rm7n4=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "2bafe9d96c6734aacfd49e115f6cf61e7adc68bc", + "rev": "58646b524408a5aecb12d91121ea5825bef3d0c8", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 7e27cbe9..0053aff7 100755 --- a/flake.nix +++ b/flake.nix @@ -68,8 +68,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; fenix = { - # fenix is pinned to that specific hash because we need 1.86 for TGS otherwise openssl can't build - url = "github:nix-community/fenix?rev=76ffc1b7b3ec8078fe01794628b6abff35cbda8f"; + url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; authentik-nix = { diff --git a/systems/game-servers/modules/tgs/EventScripts/tg/PreCompile.sh b/systems/game-servers/modules/tgs/EventScripts/tg/PreCompile.sh index 11af2a72..abde3433 100755 --- a/systems/game-servers/modules/tgs/EventScripts/tg/PreCompile.sh +++ b/systems/game-servers/modules/tgs/EventScripts/tg/PreCompile.sh @@ -15,8 +15,9 @@ mkdir -p $work_directory cd $work_directory -export TARGET_CC=$(which clang) -export TARGET_CXX=$(which clang++) +export TARGET_CC=@NIX_CLANG_PATH@/bin/clang +export TARGET_CXX=@NIX_CLANG_PATH@/bin/clang++ +export CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=@NIX_CLANG_PATH@/bin/clang echo "rust-g: deployment begin" if [ ! -d "rust-g" ]; then echo "rust-g: cloning" @@ -49,8 +50,6 @@ echo "dreamluau: checkout" git checkout "$DREAMLUAU_VERSION" >/dev/null echo "dreamluau: building" -export LIBCLANG_PATH="$(find /nix/store -name *-clang-*-lib | head -n1)/lib" - #cargo build --ignore-rust-version --release --target=i686-unknown-linux-gnu #cp target/i686-unknown-linux-gnu/release/libdreamluau.so "$1/libdreamluau.so" diff --git a/systems/game-servers/modules/tgs/default.nix b/systems/game-servers/modules/tgs/default.nix index 61cffcbd..3301fd2d 100644 --- a/systems/game-servers/modules/tgs/default.nix +++ b/systems/game-servers/modules/tgs/default.nix @@ -16,113 +16,115 @@ #TG "tgs-EventScripts.d/tg/DreamDaemonPreLaunch.sh" = { text = builtins.readFile ./EventScripts/tg/DreamDaemonPreLaunch.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/tg/parse-server.sh" = { text = builtins.readFile ./EventScripts/tg/parse-server.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/tg/PostCompile.sh" = { text = builtins.readFile ./EventScripts/tg/PostCompile.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/tg/PreCompile.sh" = { - text = builtins.readFile ./EventScripts/tg/PreCompile.sh; - group = "tgstation-server"; + text = builtins.readFile (pkgs.replaceVars ./EventScripts/tg/PreCompile.sh { + NIX_CLANG_PATH = "${pkgs.clang_multi}"; + }); + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/tg/tg-Roundend.sh" = { text = builtins.readFile ./EventScripts/tg/tg-Roundend.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/tg/update-config.sh" = { text = builtins.readFile ./EventScripts/tg/update-config.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; #TGMC "tgs-EventScripts.d/tgmc/DreamDaemonPreLaunch.sh" = { text = builtins.readFile ./EventScripts/tgmc/DreamDaemonPreLaunch.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/tgmc/PostCompile.sh" = { text = builtins.readFile ./EventScripts/tgmc/PostCompile.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/tgmc/PreCompile.sh" = { text = builtins.readFile ./EventScripts/tgmc/PreCompile.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/tgmc/tg-Roundend.sh" = { text = builtins.readFile ./EventScripts/tgmc/tg-Roundend.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/tgmc/update-config.sh" = { text = builtins.readFile ./EventScripts/tgmc/update-config.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; #EFFIGY "tgs-EventScripts.d/effigy/DreamDaemonPreLaunch.sh" = { text = builtins.readFile ./EventScripts/effigy/DreamDaemonPreLaunch.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/effigy/PostCompile.sh" = { text = builtins.readFile ./EventScripts/effigy/PostCompile.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/effigy/PreCompile.sh" = { text = builtins.readFile ./EventScripts/effigy/PreCompile.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/effigy/tg-Roundend.sh" = { text = builtins.readFile ./EventScripts/effigy/tg-Roundend.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/effigy/update-config.sh" = { text = builtins.readFile ./EventScripts/effigy/update-config.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; #COOLSTATION "tgs-EventScripts.d/cool/DreamDaemonPreLaunch.sh" = { text = builtins.readFile ./EventScripts/cool/DreamDaemonPreLaunch.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/cool/PostCompile.sh" = { text = builtins.readFile ./EventScripts/cool/PostCompile.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/cool/PreCompile.sh" = { text = builtins.readFile ./EventScripts/cool/PreCompile.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/cool/cool-exciting-roundend.sh" = { text = builtins.readFile ./EventScripts/cool/cool-exciting-roundend.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; "tgs-EventScripts.d/cool/update-config.sh" = { text = builtins.readFile ./EventScripts/cool/update-config.sh; - group = "tgstation-server"; + group = config.services.tgstation-server.groupname; mode = "0755"; }; }; @@ -131,68 +133,68 @@ age.secrets = { tg13-comms = { file = ../../secrets/tg13-comms.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; tg13-dbconfig = { file = ../../secrets/tg13-dbconfig.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; tg13-tts_secrets = { file = ../../secrets/tg13-tts_secrets.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; tg13-webhooks = { file = ../../secrets/tg13-webhooks.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; tg13-extra_config-rclone = { file = ../../secrets/tg13-extra_config-rclone.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; tgmc-dbconfig = { file = ../../secrets/tgmc-dbconfig.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; tgmc-tts_secrets = { file = ../../secrets/tgmc-tts_secrets.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; tgmc-extra_config-rclone = { file = ../../secrets/tgmc-extra_config-rclone.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; effigy-comms = { file = ../../secrets/effigy-comms.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; effigy-dbconfig = { file = ../../secrets/effigy-dbconfig.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; #effigy-tts_secrets = { for a rainy day... #file = ../../secrets/effigy-tts_secrets.age; - #owner = "${config.services.tgstation-server.username}"; - #group = "${config.services.tgstation-server.groupname}"; + #owner = config.services.tgstation-server.username; + #group = config.services.tgstation-server.groupname; #}; effigy-extra_config-rclone = { file = ../../secrets/effigy-extra_config-rclone.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; cool-apitoken = { file = ../../secrets/cool-apitoken.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; }; services.tgstation-server = { @@ -260,12 +262,14 @@ rclone yt-dlp # For Internet Sounds lua # Lua Support + nix-prefetch-github # New rust builder prefetcher + jq # for parsing above output ] ); }; age.secrets.rsc-cdn = { file = ../../secrets/rsc-cdn.age; - owner = "${config.services.tgstation-server.username}"; - group = "${config.services.tgstation-server.groupname}"; + owner = config.services.tgstation-server.username; + group = config.services.tgstation-server.groupname; }; } diff --git a/systems/game-servers/systems/tgsatan/modules/tts/default.nix b/systems/game-servers/systems/tgsatan/modules/tts/default.nix index bbe0c6b1..e53df292 100644 --- a/systems/game-servers/systems/tgsatan/modules/tts/default.nix +++ b/systems/game-servers/systems/tgsatan/modules/tts/default.nix @@ -15,7 +15,12 @@ }; compose-file = pkgs.writeTextFile { name = "tgtts-docker-compose.yml"; - text = builtins.replaceStrings [ "$TGTTS_HAPROXY_CFG_PATH$" "$TGTTS_BLIPS_PATH$" "$TGTTS_IMAGE_NAME$" "$TGTTS_PUBLIC_PORT$" ] [ "${haproxy-cfg}" workspace-directory name "${toString port}" ] (builtins.readFile ./docker-compose.yml); + text = builtins.readFile (pkgs.replaceVars ./docker-compose.yml { + TGTTS_HAPROXY_CFG_PATH = "${haproxy-cfg}"; + TGTTS_BLIPS_PATH = workspace-directory; + TGTTS_IMAGE_NAME = name; + TGTTS_PUBLIC_PORT = toString port; + }); }; in { users = { diff --git a/systems/game-servers/systems/tgsatan/modules/tts/docker-compose.yml b/systems/game-servers/systems/tgsatan/modules/tts/docker-compose.yml index d5ca8923..69334521 100644 --- a/systems/game-servers/systems/tgsatan/modules/tts/docker-compose.yml +++ b/systems/game-servers/systems/tgsatan/modules/tts/docker-compose.yml @@ -10,7 +10,7 @@ services: haproxy: image: docker.io/library/haproxy:3.3.1 # previously 3.3-dev volumes: - - $TGTTS_HAPROXY_CFG_PATH$:/usr/local/etc/haproxy/haproxy.cfg:ro + - @TGTTS_HAPROXY_CFG_PATH@:/usr/local/etc/haproxy/haproxy.cfg:ro networks: # - tts - default @@ -26,45 +26,45 @@ services: - api4 - api5 ports: - - $TGTTS_PUBLIC_PORT$:5002 + - @TGTTS_PUBLIC_PORT@:5002 api1: - image: $TGTTS_IMAGE_NAME$ + image: @TGTTS_IMAGE_NAME@ command: python tts_server.py networks: # - tts - default api2: - image: $TGTTS_IMAGE_NAME$ + image: @TGTTS_IMAGE_NAME@ command: python tts_server.py networks: # - tts - default api3: - image: $TGTTS_IMAGE_NAME$ + image: @TGTTS_IMAGE_NAME@ command: python tts_server.py networks: # - tts - default api4: - image: $TGTTS_IMAGE_NAME$ + image: @TGTTS_IMAGE_NAME@ command: python tts_server.py networks: # - tts - default api5: - image: $TGTTS_IMAGE_NAME$ + image: @TGTTS_IMAGE_NAME@ command: python tts_server.py networks: # - tts - default tts1: - image: $TGTTS_IMAGE_NAME$ + image: @TGTTS_IMAGE_NAME@ command: python tts_api.py networks: # - tts - default volumes: - - $TGTTS_BLIPS_PATH$:/workspace/samples:rw + - @TGTTS_BLIPS_PATH@:/workspace/samples:rw # - /dev:/dev environment: - TORCH_USE_CUDA_DSA=1 @@ -73,13 +73,13 @@ services: devices: - nvidia.com/gpu=all tts2: - image: $TGTTS_IMAGE_NAME$ + image: @TGTTS_IMAGE_NAME@ command: python tts_api.py networks: # - tts - default volumes: - - $TGTTS_BLIPS_PATH$:/workspace/samples:rw + - @TGTTS_BLIPS_PATH@:/workspace/samples:rw # - /dev:/dev environment: - TORCH_USE_CUDA_DSA=1 @@ -88,13 +88,13 @@ services: devices: - nvidia.com/gpu=all tts3: - image: $TGTTS_IMAGE_NAME$ + image: @TGTTS_IMAGE_NAME@ command: python tts_api.py networks: # - tts - default volumes: - - $TGTTS_BLIPS_PATH$:/workspace/samples:rw + - @TGTTS_BLIPS_PATH@:/workspace/samples:rw # - /dev:/dev environment: - TORCH_USE_CUDA_DSA=1 @@ -103,13 +103,13 @@ services: devices: - nvidia.com/gpu=all tts4: - image: $TGTTS_IMAGE_NAME$ + image: @TGTTS_IMAGE_NAME@ command: python tts_api.py networks: # - tts - default volumes: - - $TGTTS_BLIPS_PATH$:/workspace/samples:rw + - @TGTTS_BLIPS_PATH@:/workspace/samples:rw # - /dev:/dev environment: - TORCH_USE_CUDA_DSA=1 @@ -118,24 +118,24 @@ services: devices: - nvidia.com/gpu=all blips: - image: $TGTTS_IMAGE_NAME$ + image: @TGTTS_IMAGE_NAME@ command: python tts_blips_api.py networks: # - tts - default volumes: - - $TGTTS_BLIPS_PATH$:/workspace/samples:rw + - @TGTTS_BLIPS_PATH@:/workspace/samples:rw # - /dev:/dev devices: - nvidia.com/gpu=all tts5: - image: $TGTTS_IMAGE_NAME$ + image: @TGTTS_IMAGE_NAME@ command: python tts_api.py networks: # - tts - default volumes: - - $TGTTS_BLIPS_PATH$:/workspace/samples:rw + - @TGTTS_BLIPS_PATH@:/workspace/samples:rw # - /dev:/dev environment: - TORCH_USE_CUDA_DSA=1