Skip to content

Instantly share code, notes, and snippets.

@Widdershin
Created December 3, 2024 01:24
Show Gist options
  • Save Widdershin/93629d3a5c1e6bda65e3d0c219954b45 to your computer and use it in GitHub Desktop.
Save Widdershin/93629d3a5c1e6bda65e3d0c219954b45 to your computer and use it in GitHub Desktop.
Nix flake for Godot with C# support on MacOS
if has nix; then
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM="
fi
use flake .
fi
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1733129712,
"narHash": "sha256-JTLTaLyfbLLRmHNLvjJD1Om2TBWQX9X/49bQobhQQok=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d93b83e0743720585203621e373bbb6cbcf3549b",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
{
description = "Godot Mono on MacOS";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=release-24.11";
};
outputs = { self, nixpkgs }:
let
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
godotApp = pkgs.fetchzip {
name = "Godot.app";
url = "https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_mono_macos.universal.zip";
hash = "sha256-AD+BYuA9F9KedMCrbynRg85atEWGFguz4gy15BTvpzo=";
};
godot = pkgs.writeScriptBin "godot" ''
open ${godotApp}
'';
in {
devShells.aarch64-darwin.default = pkgs.mkShell {
name = "godot-dev-shell";
packages = with pkgs; [
dotnetCorePackages.sdk_9_0
# run via 'godot' command in nix shell
godot
];
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment