Skip to content

feature: add NixOS integration tests via GitHub Actions#314

Open
lukehinds wants to merge 10 commits into
mainfrom
worktree-nix-int
Open

feature: add NixOS integration tests via GitHub Actions#314
lukehinds wants to merge 10 commits into
mainfrom
worktree-nix-int

Conversation

@lukehinds

Copy link
Copy Markdown
Contributor

NxOS users frequently report sandbox failures due to Nix's unique filesystem layout (/nix/store binaries, symlink chains, wrapper scripts). Add a dedicated CI workflow that installs Nix on ubuntu-latest and tests the nono binary against Nix-installed programs.

Test suite covers:

The test suite auto-skips on non-Nix systems, so adding it to the main SUITES array is safe for existing macOS integration runs.

Refs: #19, #76, #93, #205, #262, #287

NxOS users frequently report sandbox failures due to Nix's unique
filesystem layout (/nix/store binaries, symlink chains, wrapper scripts).
Add a dedicated CI workflow that installs Nix on ubuntu-latest and tests
the nono binary against Nix-installed programs.

Test suite covers:
- Binary execution from /nix/store paths (#19)
- Dynamic linker shared library loading via openat(dirfd) (#205, #262)
- Wrapper script resolution to correct runtime (#287)
- Symlink chain traversal through ~/.nix-profile (#76)
- nix_runtime policy group validation

The test suite auto-skips on non-Nix systems, so adding it to the main
SUITES array is safe for existing macOS integration runs.

Refs: #19, #76, #93, #205, #262, #287

Signed-off-by: Luke Hinds <lukehinds@gmail.com>
@lukehinds lukehinds changed the title ci: add NixOS integration tests via GitHub Actions ci: add NixOS integration tests via GitHub Actions Mar 10, 2026
@lukehinds lukehinds changed the title ci: add NixOS integration tests via GitHub Actions chore: add NixOS integration tests via GitHub Actions Mar 10, 2026
Signed-off-by: Luke Hinds <lukehinds@gmail.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive integration tests for NixOS environments to address and prevent sandbox failures caused by Nix's unique filesystem structure. By adding a dedicated CI workflow, it ensures that the nono binary correctly interacts with Nix-installed programs, handling aspects like /nix/store paths, symlinks, and wrapper scripts, thereby improving compatibility and stability for NixOS users.

Highlights

  • NixOS Integration Tests: Added a dedicated CI workflow to run integration tests specifically for NixOS environments, installing Nix on ubuntu-latest.
  • Nix Filesystem Compatibility: The new test suite validates nono's correct handling of Nix's unique filesystem layout, including /nix/store binaries, symlink chains, and wrapper scripts.
  • Dynamic Linker and Shared Libraries: Tests now cover dynamic linker shared library loading, particularly for openat(dirfd) behavior on NixOS, addressing issues Shared libraries error on NixOS #205 and seccomp-notify handler ignores dirfd, fails on relative openat paths #262.
  • Wrapper Script Resolution: Ensured that nono correctly resolves wrapper scripts to their intended runtimes, preventing issues like opencode resolving to incorrect binaries (e.g., Bun instead of Python), addressing issue run/supervised with opencode falls back to Bun; debug shows /proc/<pid>/maps blocked #287.
  • Symlink Chain Traversal: Validated nono's ability to traverse symlink chains, such as those found in ~/.nix-profile, to access binaries and resources, addressing issue [MacOS] Symbolic links & permissions #76.
  • Policy Group Validation: Included tests for the nix_runtime policy group to ensure proper profile validation and access to Nix-related paths.
  • Platform Agnostic: The new test suite is designed to auto-skip on non-Nix systems, allowing for safe integration into existing macOS and other platform test runs.
Changelog
  • tests/integration/test_nix_paths.sh
    • Added a new integration test script for validating nono's behavior with Nix paths and binaries.
  • tests/lib/test_helpers.sh
    • Introduced require_nix to check for Nix installation and nix_realpath to resolve Nix store paths.
  • tests/run_integration_tests.sh
    • Included the new test_nix_paths.sh suite in the main integration test runner.
  • tests/run_nix_integration_tests.sh
    • Created a standalone runner script specifically for Nix integration tests, designed for CI environments.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/nix-integration.yml
Activity
  • A new CI workflow has been added to install Nix on ubuntu-latest and run the nono binary against Nix-installed programs.
  • The integration tests cover various aspects of Nix's filesystem, including /nix/store binaries, dynamic linker behavior, wrapper script resolution, and symlink traversal.
  • The test suite is designed to automatically skip on non-Nix systems, ensuring it can be safely integrated into existing test pipelines.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces dedicated integration tests for NixOS, which is a significant improvement for ensuring nono's compatibility with Nix's unique filesystem layout. The new test_nix_paths.sh script covers important scenarios like binary execution from /nix/store, dynamic linker behavior, wrapper script resolution, and symlink chain traversal. The addition of require_nix and nix_realpath helpers in test_helpers.sh is also valuable. The new run_nix_integration_tests.sh provides a clear entry point for these specific tests. Overall, this is a well-structured and necessary addition to the test suite.

Comment thread tests/lib/test_helpers.sh
local cmd="$1"
local path
path=$(command -v "$cmd" 2>/dev/null) || return 1
readlink -f "$path" 2>/dev/null || realpath "$path" 2>/dev/null || echo "$path"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The nix_realpath function falls back to echo "$path" if readlink -f and realpath both fail. If the primary goal of nix_realpath is to resolve a command to its canonical /nix/store path, then failing to do so should probably be treated as an error. Returning the original path might lead to tests passing under false assumptions if nono is expected to interact with the canonical /nix/store path but receives a different, unresolved path.

Suggested change
readlink -f "$path" 2>/dev/null || realpath "$path" 2>/dev/null || echo "$path"
readlink -f "$path" 2>/dev/null || realpath "$path" 2>/dev/null || { echo "Error: Could not resolve real path for $cmd"; return 1; }

if [[ -L "$NIX_PROFILE" || -d "$NIX_PROFILE" ]]; then
# The profile itself should be listable
expect_success "list ~/.nix-profile/bin" \
"$NONO_BIN" run --read /nix --read "$HOME/.nix-profile" --read "$HOME/.local/state" --allow "$TMPDIR" -- \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The --read "$HOME/.local/state" argument seems specific to the python3 test case and might not be universally required for ~/.nix-profile access. To adhere to the principle of least privilege, consider if this read permission is strictly necessary for the ls command on ~/.nix-profile/bin or if it can be scoped more narrowly to only the python3 execution if needed.

lukehinds and others added 7 commits March 10, 2026 22:12
* feat: ABI-aware Landlock capability system (#256, #306)

Replace the hardcoded TARGET_ABI V5 constant with runtime ABI detection
that probes V6 down to V1 using HardRequirement. The detected ABI is
threaded through sandbox application so access flags are intersected with
what the kernel actually supports, with tracing warnings when flags are
dropped. This makes enforcement degradation explicit instead of relying
on the landlock crate's silent BestEffort flag masking.

apply_with_abi() uses HardRequirement for filesystem handle_access(),
so passing a forged or stale ABI higher than the kernel supports will
fail rather than silently dropping flags.

Supersede the IoctlDev fix from #310 (hardcoded TTY path list) with
stat()-based device detection: IoctlDev is granted only when the path
is an actual char/block device or a directory under /dev, checked at
rule-addition time. Remove /dev/pts from system_write_linux in
policy.json — /dev/tty (the process's controlling terminal) is
sufficient for the base policy. Programs needing PTY allocation can
add /dev/pts in their specific profiles.

Library changes:
- Add DetectedAbi struct with feature query methods (has_refer,
  has_truncate, has_network, has_ioctl_dev, has_scoping)
- Add detect_abi() probing V6..V1 with HardRequirement
- Add apply_with_abi() with kernel-validated ABI
- Add is_device_path() and is_device_directory() for selective
  IoctlDev grants
- Remove IoctlDev from generic Write flags and #310's
  is_tty_device_path / access_to_landlock_for_capability
- Update is_supported() and support_info() to use detect_abi()

CLI changes:
- Replace local probe_landlock_abi / probe_landlock_abi_candidate /
  select_highest_supported_landlock_abi / landlock_feature_lines with
  library detect_abi() and DetectedAbi
- Add ABI info to banner output on Linux (version + features + degraded)
- Direct mode uses apply_with_abi() with pre-detected ABI
- Remove /dev/pts from system_write_linux base policy

Closes #256 #306

Signed-off-by: Luke Hinds <lukehinds@gmail.com>

* fix:rebased Landlock ABI follow-up

resolving the remaining sandbox/linux merge state and keeping the
ioctl narrowing intact.

This preserves the ABI-aware enforcement changes, removes the broad /dev/pts
write grant, and restores the test/build state expected by CI.

Signed-off-by: Luke Hinds <lukehinds@gmail.com>

* fix: remove stale imports

Signed-off-by: Luke Hinds <lukehinds@gmail.com>

---------

Signed-off-by: Luke Hinds <lukehinds@gmail.com>
Replace inline nono CLI invocation with the official nono-attest GitHub
Action. This consolidates signing logic into a reusable, versioned action
and reduces workflow complexity by 25 lines.

Signed-off-by: Luke Hinds <lukehinds@gmail.com>
* fix: add uv paths to python_runtime group

uv-installed tools and virtual python interpreters couldn't execute
due to missing ~/.local/bin and ~/.local/share/uv in the group.

Signed-off-by: Frank Denis <github@pureftpd.org>

* fix: remove redundant ~/.local/bin from python_runtime, update docs

---------

Signed-off-by: Frank Denis <github@pureftpd.org>
Replace the custom tap update job with mislav/bump-homebrew-formula-action
to open PRs against Homebrew/homebrew-core on release. Remove brew tap
instructions from README, CLI docs, and installation guide.

Signed-off-by: Luke Hinds <lukehinds@gmail.com>
Adding pnpm paths to policy.json. This allows pnpm support for MacOS and Linux.

Signed-off-by: Robbie Gore <67965823+wrgore@users.noreply.github.com>
Add a bypass mechanism so that specific domains skip the enterprise
proxy and connect directly. Supports exact hostnames and `*.` wildcard
suffixes (case-insensitive), configurable via CLI flag, environment
variable (`NONO_EXTERNAL_PROXY_BYPASS`), or profile JSON.

The bypass matcher is built once at startup in ProxyState and checked
per-CONNECT before routing. Bypassed connections enforce strict session
token validation and go through the standard host filter, preserving
the same security guarantees as external-proxy mode.

Signed-off-by: Luke Hinds <lukehinds@gmail.com>
Signed-off-by: Luke Hinds <lukehinds@gmail.com>
@lukehinds lukehinds changed the title chore: add NixOS integration tests via GitHub Actions feature: add NixOS integration tests via GitHub Actions Mar 16, 2026
…lution

Signed-off-by: Luke Hinds <lukehinds@gmail.com>
craigamcw pushed a commit to craigamcw/nono that referenced this pull request Mar 27, 2026
* docs: add local Ollama inference setup section

Includes changes done in PR nolabs-ai#735.

Fixes nolabs-ai#314, nolabs-ai#385

Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>

* docs: fix style and remove stale experimental gate

Remove numbered section titles and colons from the Ollama setup section
in spark-install.md per doc style guide.

Remove the NEMOCLAW_EXPERIMENTAL=1 gate from inference-profiles.md —
local providers are GA and the gate no longer exists in source.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>

---------

Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants