-
Notifications
You must be signed in to change notification settings - Fork 307
Added a Nix flake containing everything needed to build, dev and run … #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
f259cf9
9f5ddf5
ca87bcf
abb3c4a
749428e
e55f2b9
6d42da8
97e7db3
312cbc0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| use flake |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| { | ||
| description = "A Nix-flake-based C/C++ development environment"; | ||
|
|
||
| inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
|
|
||
| outputs = { | ||
| self, | ||
| nixpkgs, | ||
| }: let | ||
| supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "flake.nix" -type fRepository: Redot-Engine/redot-engine Length of output: 80 🏁 Script executed: cat -n flake.nix | head -30Repository: Redot-Engine/redot-engine Length of output: 1113 🏁 Script executed: # Search for any PR description or comments mentioning macOS/Darwin
git log --oneline -20Repository: Redot-Engine/redot-engine Length of output: 135 🏁 Script executed: # Look for dependencies related to X11, Wayland
rg -i "x11|wayland" flake.nix -A 3 -B 3Repository: Redot-Engine/redot-engine Length of output: 589 🏁 Script executed: # See more of flake.nix to understand the complete structure
cat -n flake.nixRepository: Redot-Engine/redot-engine Length of output: 2276 🏁 Script executed: # Search for any PR context - check PR files or recent commits
git log --oneline --all -30 | grep -i "mac\|darwin\|nix"Repository: Redot-Engine/redot-engine Length of output: 135 🏁 Script executed: # Check if there are any references to macOS or Darwin support in comments
rg "macos|darwin|mac support" -i flake.nixRepository: Redot-Engine/redot-engine Length of output: 158 🏁 Script executed: # Look for any platform-specific conditionals
rg "lib\.hasSuffix.*darwin|system ==" flake.nix -A 3 -B 3Repository: Redot-Engine/redot-engine Length of output: 51 🏁 Script executed: # Look for PR description or comments
find . -name "*.md" -o -name "*.txt" | head -20Repository: Redot-Engine/redot-engine Length of output: 601 🏁 Script executed: # Search for any README or documentation mentioning macOS
rg "macos|darwin|apple" -i . --type md --type txt | head -20Repository: Redot-Engine/redot-engine Length of output: 3097 🏁 Script executed: # Check git log for PR or commit messages
git log --all --pretty=format:"%h %s" | head -30Repository: Redot-Engine/redot-engine Length of output: 206 🏁 Script executed: # Look for any issue or PR context in the repo
find . -name ".github" -type dRepository: Redot-Engine/redot-engine Length of output: 78 🏁 Script executed: # Check the PR template and any related issues
cat ./.github/PULL_REQUEST_TEMPLATE.mdRepository: Redot-Engine/redot-engine Length of output: 394 🏁 Script executed: # Search for any flake.nix related issues or PRs
git log --all --format="%h %s %b" | grep -i "flake\|nix" -A 5 | head -40Repository: Redot-Engine/redot-engine Length of output: 136 🏁 Script executed: # Check if there's any discussion in recent commits about macOS
git show 7d7283ec89 --statRepository: Redot-Engine/redot-engine Length of output: 50382 🏁 Script executed: # Look for any documentation about the flake in the repo
rg "flake" -i . --type md | head -20Repository: Redot-Engine/redot-engine Length of output: 51 🏁 Script executed: # Look for any branch or PR related messages
git log --all --grep="macos\|darwin\|nix" -i --oneline | head -20Repository: Redot-Engine/redot-engine Length of output: 135 🏁 Script executed: # Check the actual changes made to flake.nix in recent commits
git log --all -p -- flake.nix | head -100Repository: Redot-Engine/redot-engine Length of output: 2200 🏁 Script executed: # Look for any discussions or comments in the repository
find . -name "*.md" -o -name "*.txt" | xargs grep -l "macos\|darwin.*support\|planned" 2>/dev/null | head -10Repository: Redot-Engine/redot-engine Length of output: 95 🏁 Script executed: # Check if there's any environment or conditional logic for Darwin
rg "stdenvNoCC|mkShell|pkgs\." flake.nix -A 5 -B 5Repository: Redot-Engine/redot-engine Length of output: 947 🏁 Script executed: # Let's verify if autoPatchelfHook is Linux-specific
rg "autoPatchelfHook" . --type nix | head -5Repository: Redot-Engine/redot-engine Length of output: 109 🏁 Script executed: # Check if there's any way this flake could handle Darwin gracefully
# Look for mkShell or other derivations that might conditionally handle platforms
rg "system ==" flake.nix -A 3 -B 3Repository: Redot-Engine/redot-engine Length of output: 51 🏁 Script executed: # See what happens when unsupported packages are referenced on Darwin
# Check if there's any Nix documentation references or similar patterns
find . -name "*.nix" -type f | head -10Repository: Redot-Engine/redot-engine Length of output: 80 🏁 Script executed: # Verify if the LD_LIBRARY_PATH is set unconditionally for all systems
cat -n flake.nix | grep -A 10 "mkShell"Repository: Redot-Engine/redot-engine Length of output: 411 🏁 Script executed: # Verify if autoPatchelfHook is actually available for Darwin in nixpkgs
web_search "autoPatchelfHook nixpkgs darwin macos available"Repository: Redot-Engine/redot-engine Length of output: 119 🏁 Script executed: # Check what happens when Nix evaluates unsupported packages for a system
# Look for any error handling or documentation
rg "skipBuildInputs|optional|lib\." flake.nix | head -20Repository: Redot-Engine/redot-engine Length of output: 180 🌐 Web query:
💡 Result: Short answer: autoPatchelfHook is for ELF binaries (Linux) and is not applicable to native macOS (Darwin) Mach-O binaries — so it’s not used on darwin/stdenv. Use macOS tools (install_name_tool/otool) or nix/darwin-specific packaging helpers instead. [1][2][3] Sources
🏁 Script executed: # Check if there's any conditional logic or system-specific handling in the flake
# Look for lib.optionals or similar patterns
rg "optionals|mkIf|system" flake.nixRepository: Redot-Engine/redot-engine Length of output: 172 🏁 Script executed: # Verify the actual behavior - does nixpkgs provide autoPatchelfHook for Darwin?
# Check if there are any .override or conditionals we missed
cat flake.nix | grep -E "system|darwin|linux|condition" -iRepository: Redot-Engine/redot-engine Length of output: 336 Remove Darwin systems until macOS/Nix compatibility is properly implemented. The flake declares
There are no platform-specific conditionals ( Remove Darwin systems from 🤖 Prompt for AI Agents |
||
| forEachSupportedSystem = f: | ||
| nixpkgs.lib.genAttrs supportedSystems (system: | ||
| f rec { | ||
| pkgs = import nixpkgs {inherit system;}; | ||
| isDarwin = pkgs.lib.hasSuffix system "darwin"; | ||
|
|
||
| linuxDeps = with pkgs; [ | ||
| autoPatchelfHook | ||
| xorg.libX11 | ||
| xorg.libXcursor | ||
| xorg.libXinerama | ||
| xorg.libXext | ||
| xorg.libXrandr | ||
| xorg.libXrender | ||
| xorg.libXi | ||
| xorg.libXfixes | ||
| libxkbcommon | ||
| wayland-scanner | ||
| wayland | ||
| libdecor | ||
| alsa-lib | ||
| libpulseaudio | ||
| udev | ||
| dbus | ||
| dbus.lib | ||
| ]; | ||
|
|
||
| darwinDeps = with pkgs; [ | ||
| Foundation | ||
| Cocoa | ||
| AudioToolbox | ||
| CoreAudio | ||
| CoreVideo | ||
| AVFoundation | ||
| ]; | ||
|
|
||
| commonDeps = with pkgs; [ | ||
| pkg-config | ||
| installShellFiles | ||
| python3 | ||
| speechd | ||
| makeWrapper | ||
| mono | ||
| dotnet-sdk_8 | ||
| dotnet-runtime_8 | ||
| vulkan-loader | ||
| libGL | ||
| fontconfig | ||
| fontconfig.lib | ||
| scons | ||
| ]; | ||
|
|
||
| deps = if isDarwin then darwinDeps ++ commonDeps else linuxDeps ++ commonDeps; | ||
| libraryPathVar = if isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; | ||
| platform = if isDarwin then "macos" else "linuxbsd"; | ||
| binary = if isDarwin then "redot.macos.editor.x86_64" else "redot.linuxbsd.editor.x86_64"; | ||
| }); | ||
| in { | ||
| apps = forEachSupportedSystem ({ | ||
| pkgs, | ||
| deps, | ||
| libraryPathVar, | ||
| platform, | ||
| binary, | ||
| }: let | ||
| script = pkgs.writeShellScript "redot" '' | ||
| export ${libraryPathVar}=${pkgs.lib.makeLibraryPath deps} | ||
| if [ ! -f ./bin/${binary} ]; then | ||
| echo "Building Redot..." | ||
| scons platform=${platform} | ||
| fi | ||
| exec ./bin/${binary} "$@" | ||
| ''; | ||
| in { | ||
| default = { | ||
| type = "app"; | ||
| program = "${script}"; | ||
| }; | ||
| }); | ||
|
|
||
| devShells = forEachSupportedSystem ({ | ||
| pkgs, | ||
| deps, | ||
| libraryPathVar, | ||
| }: { | ||
| default = | ||
| pkgs.mkShell.override | ||
| { | ||
| # Override stdenv in order to change compiler: | ||
| # stdenv = pkgs.clangStdenv; | ||
| } | ||
| { | ||
| packages = deps; | ||
| ${libraryPathVar} = pkgs.lib.makeLibraryPath deps; | ||
| }; | ||
| }); | ||
| }; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.