Godot: Difference between revisions
→Export Templates: Fixes reference for Godot, "-" is replaced with "." |
|||
Line 21: | Line 21: | ||
=== Android Export Target === | === Android Export Target === | ||
Accept Android license: | |||
nixpkgs.config.android_sdk.accept_license = true; | |||
Add to your system the usual Android and Java development packages, such as: | |||
environment.systemPackages = with pkgs; [ | |||
android-studio | |||
android-tools | |||
androidenv.androidPkgs.androidsdk | |||
androidenv.androidPkgs.emulator | |||
androidenv.androidPkgs.ndk-bundle | |||
jdk # Java | |||
]; | |||
Configure Godot's '''Editor''' -> '''Editor Settings''' -> '''General''' [Tab] -> '''Export''' [Category] -> '''Android''' [Sub-item], as such: | |||
* '''Android SDK Path:''' Reference <code>pkgs.androidenv.androidPkgs.androidsdk</code> path. Like: <code>/nix/store/p2cdj75bbzswjc84789cmlwhy6ll7avr-androidsdk/libexec/android-sdk/</code> | |||
* '''Java SDK Path:''' Reference <code>pkgs.jdk</code> path. Like: <code>/nix/store/55qm2mvhmv7n2n6yzym1idrvnlwia73z-openjdk-21.0.5+11</code> | |||
== Configuring VSCode Editor for Godot-Mono (C#) == | == Configuring VSCode Editor for Godot-Mono (C#) == |
Revision as of 23:39, 10 April 2025
Godot is an open-source game engine, capable of creating both 2D and 3D games.
Usage in NixOS
Use steam-run
to run a Godot exported project (without having to fix paths for Nix).
Installation
Add either pkgs.godot
(GDScript) or pkgs.godot-mono
(GDScript + C#) to environment.systemPackages
.
Export Templates
Automatically enable `godot-templates` in your host using:
home.file.".local/share/godot/export_templates/${builtins.replaceStrings [ "-" ] [ "." ] pkgs.godot_4-export-templates.version}".source = pkgs.godot_4-export-templates;
Whenever Godot application is upgraded, the new template version will be automatically provisioned.
For `godot-mono`, should reference `pkgs.godot-mono_4-export-templates` but package is still pending in nixpkgs.
Android Export Target
Accept Android license:
nixpkgs.config.android_sdk.accept_license = true;
Add to your system the usual Android and Java development packages, such as:
environment.systemPackages = with pkgs; [ android-studio android-tools androidenv.androidPkgs.androidsdk androidenv.androidPkgs.emulator androidenv.androidPkgs.ndk-bundle jdk # Java ];
Configure Godot's Editor -> Editor Settings -> General [Tab] -> Export [Category] -> Android [Sub-item], as such:
- Android SDK Path: Reference
pkgs.androidenv.androidPkgs.androidsdk
path. Like:/nix/store/p2cdj75bbzswjc84789cmlwhy6ll7avr-androidsdk/libexec/android-sdk/
- Java SDK Path: Reference
pkgs.jdk
path. Like:/nix/store/55qm2mvhmv7n2n6yzym1idrvnlwia73z-openjdk-21.0.5+11
Configuring VSCode Editor for Godot-Mono (C#)
As Godot editor has poor support for C#, VSCode editor is recommended.
Install and configure VSCode as such:
programs.vscode = { enable = true; package = pkgs.codium; profiles.default = { "godotTools.lsp.serverPort" = 6005; # port should match your Godot configuration "dotnetAcquisitionExtension.sharedExistingDotnetPath" = "${pkgs.dotnet-sdk_8}/bin/dotnet"; "dotnetAcquisitionExtension.existingDotnetPath" = [ { "extensionId" = "ms-dotnettools.csharp"; "path" = "${pkgs.dotnet-sdk_8}/bin/dotnet"; } { "extensionId" = "ms-dotnettools.csdevkit"; "path" = "${pkgs.dotnet-sdk_8}/bin/dotnet"; } ]; extensions = with pkgs.vscode-extensions; [ geequlim.godot-tools # For Godot GDScript ms-dotnettools.csdevkit ms-dotnettools.csharp ms-dotnettools.vscode-dotnet-runtime ]; };
Configure Godot's Editor → Editor Settings menu:
- Set Dotnet -> Editor -> External Editor to Visual Studio Code.
Configure Godot 4 for External VSCode Integration
Click Editor [top menu] -> Editor Settings [menu item] -> General [Tab] -> Text Editor [Category] -> External [Sub-Category]:
- Exec Path -> Add the output of
which codium
, on my case would be:/etc/profiles/per-user/REPLACE-USERNAME/bin/codium
- Exec Flags ->
{project} --goto {file}:{line}:{col}
- Use External Editor ->
On