Conversation
Replace bash (setup.sh) with nushell (setup.nu) as the builder for mkEkaPackage derivations. stdenv.mkDerivation remains unchanged. Key changes: - Add nushell prebuilt binary package (0.115.1, musl static) - Create stdenv/nushell-builder/setup.nu as the main builder entry point - Create nushell equivalents of fixup hooks (strip, patch-shebangs, multiple-outputs, compress-man-pages, move-docs, move-lib64, move-sbin, propagated-deps) - Force __structuredAttrs = true for all mkEkaPackage derivations - Expose cmake.nushellHook and meson.nushellHook as passthru attrs - Phase override strings are nushell syntax, not bash
Translation of jq from stdenv.mkDerivation (bash) to mkEkaPackage (nushell). Demonstrates the phase syntax differences: - preConfigure: nushell `save` instead of bash `echo >>` - preBuild: `rm -rf` works the same (external command) - postFixup: `^remove-references-to` with $env.dev/$env.man/$env.doc - configureFlags: passed through autotools configure - All phase strings are nushell syntax Also fixes several nushell builder bugs found during testing: - patch-shebangs: use try/catch instead of `complete` on builtins - strip: use hex magic byte check instead of `complete` on open - compress-man-pages: use -f flag and try/catch for existing .gz - fixupPhase: ensure all output directories exist
develop7
reviewed
Sep 16, 2026
| if not ($manDir | path exists) { return } | ||
|
|
||
| # Find and gzip uncompressed man pages | ||
| let files = (do { ^find $manDir -type f -not -name "*.gz" -not -name "*.bz2" -not -name "*.xz" } | complete | get stdout) |
There was a problem hiding this comment.
use glob i.o. find:
Suggested change
| let files = (do { ^find $manDir -type f -not -name "*.gz" -not -name "*.bz2" -not -name "*.xz" } | complete | get stdout) | |
| let files = glob $manDir --exclude [*.gz *.bz2 *.xz] |
something along these lines
develop7
reviewed
Sep 16, 2026
| let destFile = $"($dest)($rel)" | ||
| let destDir = ($destFile | path dirname) | ||
| mkdir $destDir | ||
| ^mv $file $destFile |
There was a problem hiding this comment.
why not builtin mv, they're just fine
Collaborator
Author
There was a problem hiding this comment.
Honestly, just vibed this up, to see if it's possible. But you're right ;)
There was a problem hiding this comment.
yep, slop machines are not very familiar with nushell yet
develop7
reviewed
Sep 16, 2026
| # NIX_BUILD_CORES | ||
| let cores = ($env | get -o NIX_BUILD_CORES | default "1") | ||
| let coresInt = if ($cores | into int) <= 0 { | ||
| try { ^nproc | str trim | into int } catch { 1 } |
There was a problem hiding this comment.
Suggested change
| try { ^nproc | str trim | into int } catch { 1 } | |
| sys cpu | length |
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.
Package
jqusing it to see how it "feels". Pretty different from bash, but it's not like heavy bash usage is pretty, and least the complexity seems more manageable with nu.