fix: nix build and devshell on darwin #1628

Merged
nex merged 3 commits from Henry-Hiles/continuwuity:quad/fix/nix-darwin into main 2026-04-08 20:14:37 +00:00
Contributor

Co-authored-by: thetayloredman nutdriver716@gmail.com

This pull request fixes the nix devshell on Darwin systems by making jemalloc and liburing only added as an input on Linux, supersedes #1608. This PR also makes nix build work to build a binary on darwin by skipping the patchelf step on Darwin, and fixing the platforms meta attribute.

Pull request checklist:

  • This pull request targets the main branch, and the branch is named something other than
    main.
  • I have written an appropriate pull request title and my description is clear.
  • I understand I am responsible for the contents of this pull request.
  • I have followed the contributing guidelines:
Co-authored-by: thetayloredman <nutdriver716@gmail.com> <!-- In order to help reviewers know what your pull request does at a glance, you should ensure that 1. Your PR title is a short, single sentence describing what you changed 2. You have described in more detail what you have changed, why you have changed it, what the intended effect is, and why you think this will be beneficial to the project. If you have made any potentially strange/questionable design choices, but didn't feel they'd benefit from code comments, please don't mention them here - after opening your pull request, go to "files changed", and click on the "+" symbol in the line number gutter, and attach comments to the lines that you think would benefit from some clarification. --> This pull request fixes the nix devshell on Darwin systems by making jemalloc and liburing only added as an input on Linux, supersedes #1608. This PR also makes `nix build` work to build a binary on darwin by skipping the patchelf step on Darwin, and fixing the `platforms` meta attribute. <!-- Example: This pull request allows us to warp through time and space ten times faster than before by double-inverting the warp drive with hyperheated jump fluid, both making the drive faster and more efficient. This resolves the common issue where we have to wait more than 10 milliseconds to engage, use, and disengage the warp drive when travelling between galaxies. --> <!-- Closes: #... --> <!-- Fixes: #... --> <!-- Uncomment the above line(s) if your pull request fixes an issue or closes another pull request by superseding it. Replace `#...` with the issue/pr number, such as `#123`. --> **Pull request checklist:** <!-- You need to complete these before your PR can be considered. If you aren't sure about some, feel free to ask for clarification in #dev:continuwuity.org. --> - [x] This pull request targets the `main` branch, and the branch is named something other than `main`. - [x] I have written an appropriate pull request title and my description is clear. - [x] I understand I am responsible for the contents of this pull request. - I have followed the [contributing guidelines][c1]: - [x] My contribution follows the [code style][c2], if applicable. - [ ] I ran [pre-commit checks][c1pc] before opening/drafting this pull request. - [ ] I have [tested my contribution][c1t] (or proof-read it for documentation-only changes) myself, if applicable. This includes ensuring code compiles. - [x] My commit messages follow the [commit message format][c1cm] and are descriptive. - [ ] I have written a [news fragment][n1] for this PR, if applicable<!--(can be done after hitting open!)-->. <!-- Notes on these requirements: - While not required, we encourage you to sign your commits with GPG or SSH to attest the authenticity of your changes. - While we allow LLM-assisted contributions, we do not appreciate contributions that are low quality, which is typical of machine-generated contributions that have not had a lot of love and care from a human. Please do not open a PR if all you have done is asked ChatGPT to tidy up the codebase with a +-100,000 diff. - In the case of code style violations, reviewers may leave review comments/change requests indicating what the ideal change would look like. For example, a reviewer may suggest you lower a log level, or use `match` instead of `if/else` etc. - In the case of code style violations, pre-commit check failures, minor things like typos/spelling errors, and in some cases commit format violations, reviewers may modify your branch directly, typically by making changes and adding a commit. Particularly in the latter case, a reviewer may rebase your commits to squash "spammy" ones (like "fix", "fix", "actually fix"), and reword commit messages that don't satisfy the format. - Pull requests MUST pass the `Checks` CI workflows to be capable of being merged. This can only be bypassed in exceptional circumstances. If your CI flakes, let us know in matrix:r/dev:continuwuity.org. - Pull requests have to be based on the latest `main` commit before being merged. If the main branch changes while you're making your changes, you should make sure you rebase on main before opening a PR. Your branch will be rebased on main before it is merged if it has fallen behind. - We typically only do fast-forward merges, so your entire commit log will be included. Once in main, it's difficult to get out cleanly, so put on your best dress, smile for the cameras! --> [c1]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md [c2]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/docs/development/code_style.mdx [c1pc]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#pre-commit-checks [c1t]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#running-tests-locally [c1cm]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#commit-messages [n1]: https://towncrier.readthedocs.io/en/stable/tutorial.html#creating-news-fragments
fix: devshell on darwin
Some checks failed
Update flake hashes / update-flake-hashes (pull_request) Waiting to run
Check Changelog / Check for changelog (pull_request_target) Successful in 10s
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m51s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
a2f9d36b8f
Co-authored-by: thetayloredman <
nutdriver716@gmail.com>
Author
Contributor

Since I don't have a darwin/macos system, myself, I'd greatly appreciate if someone else is able to test this.
Otherwise, I can spin up a VM, but it would be nice for someone to test on regular macos.

Since I don't have a darwin/macos system, myself, I'd greatly appreciate if someone else is able to test this. Otherwise, I can spin up a VM, but it would be nice for someone to test on regular macos.
Author
Contributor

To be honest, this can also be merged without testing, it doesn't affect Linux, and certainly makes MacOS closer to building than it would be otherwise, so it can be merged and further changes can be made later.

To be honest, this can also be merged without testing, it doesn't affect Linux, and certainly makes MacOS closer to building than it would be otherwise, so it can be merged and further changes can be made later.
Owner

You've got a spurious newline in your co-authored-by

You've got a spurious newline in your co-authored-by
Author
Contributor

@Jade wrote in #1628 (comment):

You've got a spurious newline in your co-authored-by

oops :3

@Jade wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1628#issuecomment-27626: > You've got a spurious newline in your co-authored-by oops :3
Henry-Hiles force-pushed quad/fix/nix-darwin from a2f9d36b8f
Some checks failed
Update flake hashes / update-flake-hashes (pull_request) Waiting to run
Check Changelog / Check for changelog (pull_request_target) Successful in 10s
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m51s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
to 810fe11faf
Some checks failed
Check Changelog / Check for changelog (pull_request_target) Successful in 10s
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m58s
Update flake hashes / update-flake-hashes (pull_request) Successful in 2m7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
2026-04-08 14:40:02 +00:00
Compare
Author
Contributor

@Jade wrote in #1628 (comment):

You've got a spurious newline in your co-authored-by

Fixed!

@Jade wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1628#issuecomment-27626: > You've got a spurious newline in your co-authored-by Fixed!
Contributor

@Henry-Hiles naur

% nix develop             
error:
       … while evaluating the attribute 'optionalValue.value'
         at /nix/store/hz9wgm1chlnk6yj9i3gsqrx8k361j5h5-source/lib/modules.nix:1298:5:
         1297|
         1298|     optionalValue = if isDefined then { value = mergedValue; } else { };
             |     ^
         1299|   };

       … while evaluating a branch condition
         at /nix/store/hz9wgm1chlnk6yj9i3gsqrx8k361j5h5-source/lib/modules.nix:1298:21:
         1297|
         1298|     optionalValue = if isDefined then { value = mergedValue; } else { };
             |                     ^
         1299|   };

       … while evaluating definitions from `/nix/store/2a9ylipb88x2sp2xn6cg58p5xm6qamai-source/modules/transposition.nix':

       … while evaluating definitions from `/nix/store/bg6nm63xv9ffpzchi2wx57860rr7bnz0-source/nix/devshell.nix, via option perSystem':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: expected a list but found a set: { LD_LIBRARY_PATH = «thunk»; LIBCLANG_PATH = «thunk»;

Darwin 25.3.0 arm64
nix (Nix) 2.31.3+1

@Henry-Hiles naur ``` % nix develop error: … while evaluating the attribute 'optionalValue.value' at /nix/store/hz9wgm1chlnk6yj9i3gsqrx8k361j5h5-source/lib/modules.nix:1298:5: 1297| 1298| optionalValue = if isDefined then { value = mergedValue; } else { }; | ^ 1299| }; … while evaluating a branch condition at /nix/store/hz9wgm1chlnk6yj9i3gsqrx8k361j5h5-source/lib/modules.nix:1298:21: 1297| 1298| optionalValue = if isDefined then { value = mergedValue; } else { }; | ^ 1299| }; … while evaluating definitions from `/nix/store/2a9ylipb88x2sp2xn6cg58p5xm6qamai-source/modules/transposition.nix': … while evaluating definitions from `/nix/store/bg6nm63xv9ffpzchi2wx57860rr7bnz0-source/nix/devshell.nix, via option perSystem': (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: expected a list but found a set: { LD_LIBRARY_PATH = «thunk»; LIBCLANG_PATH = «thunk»; ``` Darwin 25.3.0 arm64 nix (Nix) 2.31.3+1
Author
Contributor

@thetayloredman wrote in #1628 (comment):

@Henry-Hiles naur

% nix develop             
error:
       … while evaluating the attribute 'optionalValue.value'
         at /nix/store/hz9wgm1chlnk6yj9i3gsqrx8k361j5h5-source/lib/modules.nix:1298:5:
         1297|
         1298|     optionalValue = if isDefined then { value = mergedValue; } else { };
             |     ^
         1299|   };

       … while evaluating a branch condition
         at /nix/store/hz9wgm1chlnk6yj9i3gsqrx8k361j5h5-source/lib/modules.nix:1298:21:
         1297|
         1298|     optionalValue = if isDefined then { value = mergedValue; } else { };
             |                     ^
         1299|   };

       … while evaluating definitions from `/nix/store/2a9ylipb88x2sp2xn6cg58p5xm6qamai-source/modules/transposition.nix':

       … while evaluating definitions from `/nix/store/bg6nm63xv9ffpzchi2wx57860rr7bnz0-source/nix/devshell.nix, via option perSystem':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: expected a list but found a set: { LD_LIBRARY_PATH = «thunk»; LIBCLANG_PATH = «thunk»;

Darwin 25.3.0 arm64 nix (Nix) 2.31.3+1

Huh. Can you give me a log with --show-trace?

@thetayloredman wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1628#issuecomment-27632: > @Henry-Hiles naur > > ```text > % nix develop > error: > … while evaluating the attribute 'optionalValue.value' > at /nix/store/hz9wgm1chlnk6yj9i3gsqrx8k361j5h5-source/lib/modules.nix:1298:5: > 1297| > 1298| optionalValue = if isDefined then { value = mergedValue; } else { }; > | ^ > 1299| }; > > … while evaluating a branch condition > at /nix/store/hz9wgm1chlnk6yj9i3gsqrx8k361j5h5-source/lib/modules.nix:1298:21: > 1297| > 1298| optionalValue = if isDefined then { value = mergedValue; } else { }; > | ^ > 1299| }; > > … while evaluating definitions from `/nix/store/2a9ylipb88x2sp2xn6cg58p5xm6qamai-source/modules/transposition.nix': > > … while evaluating definitions from `/nix/store/bg6nm63xv9ffpzchi2wx57860rr7bnz0-source/nix/devshell.nix, via option perSystem': > > (stack trace truncated; use '--show-trace' to show the full, detailed trace) > > error: expected a list but found a set: { LD_LIBRARY_PATH = «thunk»; LIBCLANG_PATH = «thunk»; > ``` > > Darwin 25.3.0 arm64 nix (Nix) 2.31.3+1 Huh. Can you give me a log with `--show-trace`?
Henry-Hiles changed title from fix: devshell on darwin to WIP: fix: devshell on darwin 2026-04-08 14:44:45 +00:00
Author
Contributor

Nevermind, I found it

Nevermind, I found it
Henry-Hiles force-pushed quad/fix/nix-darwin from 810fe11faf
Some checks failed
Check Changelog / Check for changelog (pull_request_target) Successful in 10s
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m58s
Update flake hashes / update-flake-hashes (pull_request) Successful in 2m7s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
to 7ba0cf474e
Some checks are pending
Check Changelog / Check for changelog (pull_request_target) Waiting to run
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 3m7s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m53s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 14m33s
2026-04-08 14:46:54 +00:00
Compare
Henry-Hiles changed title from WIP: fix: devshell on darwin to fix: devshell on darwin 2026-04-08 14:47:00 +00:00
Author
Contributor

Fixed now?

Fixed now?
Author
Contributor

Cargo test passes on linux.

Cargo test passes on linux.
Author
Contributor

Waiting for testing by LogN.

Waiting for testing by LogN.
Contributor

nix build gives me this error:

error:
       … while evaluating condition
         at /nix/store/l6swpsz0772pwm719pq1bhl576jrrs30-source/lib/customisation.nix:446:16:
          445|       drvPath =
          446|         assert condition;
             |                ^
          447|         drv.drvPath;

       … while evaluating the attribute 'handled'
         at /nix/store/l6swpsz0772pwm719pq1bhl576jrrs30-source/pkgs/stdenv/generic/check-meta.nix:708:9:
          707|         valid = "no";
          708|         handled = handle {
             |         ^
          709|           inherit attrs meta;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: Refusing to evaluate package 'conduwuit-0.5.7-alpha.1' in /nix/store/cnccdhj7596mh2ajhmb7z9wxw3pknjpl-source/nix/packages/continuwuity.nix:59 because it is not available on the requested hostPlatform:
         hostPlatform.system = "aarch64-darwin"
         package.meta.platforms = [
           "aarch64-linux"
           "armv5tel-linux"
           "armv6l-linux"
           "armv7a-linux"
           "armv7l-linux"
           "i686-linux"
           "loongarch64-linux"
           "m68k-linux"
           "microblaze-linux"
           "microblazeel-linux"
           "mips-linux"
           "mips64-linux"
           "mips64el-linux"
           "mipsel-linux"
           "powerpc-linux"
           "powerpc64-linux"
           "powerpc64le-linux"
           "riscv32-linux"
           "riscv64-linux"
           "s390-linux"
           "s390x-linux"
           "x86_64-linux"
         ]
         package.meta.badPlatforms = [ ]

       a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnsupportedSystem = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnsupportedSystem = true; }
       to ~/.config/nixpkgs/config.nix.
nix build gives me this error: ``` error: … while evaluating condition at /nix/store/l6swpsz0772pwm719pq1bhl576jrrs30-source/lib/customisation.nix:446:16: 445| drvPath = 446| assert condition; | ^ 447| drv.drvPath; … while evaluating the attribute 'handled' at /nix/store/l6swpsz0772pwm719pq1bhl576jrrs30-source/pkgs/stdenv/generic/check-meta.nix:708:9: 707| valid = "no"; 708| handled = handle { | ^ 709| inherit attrs meta; (stack trace truncated; use '--show-trace' to show the full trace) error: Refusing to evaluate package 'conduwuit-0.5.7-alpha.1' in /nix/store/cnccdhj7596mh2ajhmb7z9wxw3pknjpl-source/nix/packages/continuwuity.nix:59 because it is not available on the requested hostPlatform: hostPlatform.system = "aarch64-darwin" package.meta.platforms = [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "loongarch64-linux" "m68k-linux" "microblaze-linux" "microblazeel-linux" "mips-linux" "mips64-linux" "mips64el-linux" "mipsel-linux" "powerpc-linux" "powerpc64-linux" "powerpc64le-linux" "riscv32-linux" "riscv64-linux" "s390-linux" "s390x-linux" "x86_64-linux" ] package.meta.badPlatforms = [ ] a) To temporarily allow packages that are unsupported for this system, you can use an environment variable for a single invocation of the nix tools. $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake, then pass `--impure` in order to allow use of environment variables. b) For `nixos-rebuild` you can set { nixpkgs.config.allowUnsupportedSystem = true; } in configuration.nix to override this. c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add { allowUnsupportedSystem = true; } to ~/.config/nixpkgs/config.nix. ```
Author
Contributor

Just needs fixing at

platforms = lib.platforms.linux;


I'll do it in a minute.

EDIT: Done.

Just needs fixing at https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/915643c9655135e8194d27decc85ec45749cc379/nix/packages/continuwuity.nix#L61 I'll do it in a minute. EDIT: Done.
fix: fix continuwuity build on nix-darwin
All checks were successful
Check Changelog / Check for changelog (pull_request_target) Successful in 11s
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m57s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 22m18s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m43s
098ab87d8a
Henry-Hiles changed title from fix: devshell on darwin to fix: nix stuff on darwin 2026-04-08 15:34:39 +00:00
Author
Contributor

Devshell confirmed working on MacOS by LogN and Odd. Nix build is being tested.

Devshell confirmed working on MacOS by LogN and Odd. Nix build is being tested.
fix: only run patchelf on linux
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Check Changelog / Check for changelog (pull_request_target) Successful in 10s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 3m3s
Update flake hashes / update-flake-hashes (pull_request) Successful in 2m4s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 13m44s
372ac36cfb
Author
Contributor

Tested by Odd, nix builds works. Ready for merge.

Tested by Odd, nix builds works. Ready for merge.
nex approved these changes 2026-04-08 20:12:22 +00:00
Henry-Hiles changed title from fix: nix stuff on darwin to fix: nix build and devshell on darwin 2026-04-08 20:13:09 +00:00
nex merged commit 379ef5014c into main 2026-04-08 20:14:37 +00:00
Henry-Hiles deleted branch quad/fix/nix-darwin 2026-04-08 21:42:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity!1628
No description provided.