Godot: Difference between revisions

Klinger (talk | contribs)
m Category:IDE added
 
(5 intermediate revisions by one other user not shown)
Line 3: Line 3:
[https://godotengine.org/ Godot] is an open-source game engine, capable of creating both 2D and 3D games.  
[https://godotengine.org/ Godot] is an open-source game engine, capable of creating both 2D and 3D games.  


== Usage in NixOS ==
== Installation ==


Use <code>steam-run</code> to run a Godot exported project (without having to fix paths for Nix).
Add <code>pkgs.godot</code> (GDScript only) to <code>environment.systemPackages</code>.


== Installation ==
For installing Godot-Mono (C#), see [[Godot-Mono]] article.


Add either <code>pkgs.godot</code> (GDScript) or <code>pkgs.godot-mono</code> (GDScript + C#) to <code>environment.systemPackages</code>.
== Export Templates ==
On Godot upgrade, the new export template can be automatically provisioned this way:


==== Enabling VSCode Editor for Godot-Mono (C#) ====
<code>home.file.".local/share/godot/export_templates/${builtins.replaceStrings [ "-" ] [ "." ] pkgs.godot_4-export-templates.version}".source = pkgs.godot_4-export-templates;</code>
As Godot editor has poor support for C#, VSCode editor is recommended.


Install and configure VSCode as such:
=== Android Export Target ===
programs.vscode = {
Accept Android license:
  enable = true;
nixpkgs.config.android_sdk.accept_license = true;
  package = pkgs.codium;
Add to your system the usual Android and Java development packages, such as:
  profiles.default = {
environment.systemPackages = with pkgs; [
    "godotTools.lsp.serverPort" = 6005; # port should match your Godot configuration
    android-studio
    "dotnetAcquisitionExtension.sharedExistingDotnetPath" = "${pkgs.dotnet-sdk_8}/bin/dotnet";
    android-tools
    "dotnetAcquisitionExtension.existingDotnetPath" = [
    androidenv.androidPkgs.androidsdk
        {
    androidenv.androidPkgs.emulator
            "extensionId" = "ms-dotnettools.csharp";
    androidenv.androidPkgs.ndk-bundle
            "path" = "${pkgs.dotnet-sdk_8}/bin/dotnet";
  jdk # Java
         }
];
         {
Configure Godot's '''Editor''' -> '''Editor Settings''' -> '''General''' [Tab] -> '''Export''' [Category]  -> '''Android''' [Sub-item], as such:
            "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 4 for External VSCode Integration ======
* '''Android SDK Path:''' Reference <code>pkgs.androidenv.androidPkgs.androidsdk</code> path. Like: <code>/nix/store/p2cdj75bbzswjc84789cmlwhy6ll7avr-androidsdk/libexec/android-sdk/</code>
Configure Godot's '''Editor → Editor Settings''' menu:
* '''Java SDK Path:''' Reference <code>pkgs.jdk</code> path. Like: <code>/nix/store/55qm2mvhmv7n2n6yzym1idrvnlwia73z-openjdk-21.0.5+11</code>
* Set '''Dotnet''' -> '''Editor''' -> '''External Editor''' to '''Visual Studio Code'''.
Click '''Editor''' [top menu] -> '''Editor Settings''' [menu item] -> '''General''' [Tab] -> '''Text Editor''' [Category] -> '''External''' [Sub-Category]:


* '''Exec Path''' -> Add the output of <code>which codium</code>, on my case would be: <code>/etc/profiles/per-user/REPLACE-USERNAME/bin/codium</code>
=== Running Exported Application in NixOS ===
* '''Exec Flags''' -> <code>{project} --goto {file}:{line}:{col}</code>
Use <code>steam-run</code> to run a Godot exported project without having to fix paths for Nix.
* '''Use External Editor''' -> <code>On</code>


[[Category:Applications]]
[[Category:Applications]]
[[Category:IDE]]