Add Nix Package Manager Support#6790
Closed
ZZBaron wants to merge 6 commits intoxmake-io:devfrom
ZZBaron:feature/nix-support
Closed
Add Nix Package Manager Support#6790ZZBaron wants to merge 6 commits intoxmake-io:devfrom ZZBaron:feature/nix-support
ZZBaron wants to merge 6 commits intoxmake-io:devfrom
ZZBaron:feature/nix-support
Conversation
…_nix detection tool
Merge branch 'dev' into feature/nix-support
waruqi
reviewed
Sep 10, 2025
Contributor
Author
There was a problem hiding this comment.
Apologies, that was unintended.
waruqi
reviewed
Sep 10, 2025
| -- validate that nix is working | ||
| if program then | ||
| local ok = try {function () | ||
| return os.iorunv(program, {"--version"}, {stdout = os.nuldev()}) |
Member
There was a problem hiding this comment.
please remove it, find_program will check it.
Contributor
Author
There was a problem hiding this comment.
please see the new commit
waruqi
reviewed
Sep 10, 2025
| -- nix might be installed in different locations | ||
| if not program and not opt.program then | ||
| -- check common nix installation paths | ||
| local paths = { |
Member
There was a problem hiding this comment.
you can pass paths to find_program
Member
There was a problem hiding this comment.
Contributor
Author
There was a problem hiding this comment.
okay, thanks. is it good now?
This reverts commit c1f34fc.
waruqi
reviewed
Sep 11, 2025
| sudo apt install -y dh-make rng-tools devscripts lintian | ||
| echo "$PPA_GPG_PRIKEY_2C0C68C9" > ppa_gpg.key | ||
| gpg --import ppa_gpg.key | ||
| scripts/makeppa plucky # 25.04 |
waruqi
reviewed
Sep 11, 2025
| ## Plugins | ||
|
|
||
| #### Generate IDE project file plugin(makefile, vs2002 - vs2026 .. ) | ||
| #### Generate IDE project file plugin(makefile, vs2002 - vs2022 .. ) |
Member
|
please rebase to dev , you merged some others patches. |
please rebase to dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces comprehensive support for the Nix package manager in XMake, enabling users to find, install, and use packages from the Nixpkgs ecosystem.
Core Functionality
Package Detection: Automatically detects Nix installations in common locations
Package Finding: Searches through available Nix store paths and can build packages on-demand
Package Installation: Supports both modern Nix (with flakes) and legacy nix-env workflows
Package Search: Comprehensive search functionality with JSON parsing for modern Nix
used like:
add_requires("nix::zlib.dev", {alias = "zlib"})
add_requires("nix::openssl")
add_requires("nix::boost.dev")
Key Components
find_nix.lua: Tool detection module that handles various Nix installation scenarios
nix/find_package.lua: Main package resolution logic with intelligent path scanning
nix/install_package.lua: Package installation using both modern and legacy Nix commands
nix/search_package.lua: Package search functionality with fallback support
Smart Package Resolution
Scans existing Nix store paths from environment ($PATH, $NIX_PROFILES, etc.)
Falls back to building packages on-demand if not found in available paths
Supports both modern Nix flakes (nix build nixpkgs#package) and legacy (nix-build -A package)
Integrates with pkg-config when available for better metadata extraction