Sponsored Content
Skip to content

chore: Add nix development environment - #6314

Merged
ximinez merged 27 commits into
XRPLF:developfrom
kuznetsss:Add_nix_devshell
Feb 24, 2026
Merged

chore: Add nix development environment#6314
ximinez merged 27 commits into
XRPLF:developfrom
kuznetsss:Add_nix_devshell

Conversation

@kuznetsss

Copy link
Copy Markdown
Contributor

High Level Overview of Change

This PR adds a development environment provided by the Nix package manager, along with documentation on how to use it and provides minor updates to the .gitignore file.

Type of Change

  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)

Copilot AI review requested due to automatic review settings February 2, 2026 17:23
@kuznetsss
kuznetsss requested a review from mathbunnyru February 2, 2026 17:26

Copilot AI 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.

Pull request overview

This PR adds Nix flakes support to provide reproducible development environments for xrpld. The changes include Nix configuration files, documentation on how to use the Nix development shell, and updates to .gitignore for Nix-related directories.

Changes:

  • Adds Nix flake configuration with support for multiple compiler versions (GCC 13-15, Clang 18-21)
  • Provides comprehensive documentation for using the Nix development environment
  • Updates .gitignore to exclude Nix and direnv artifacts

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
flake.nix Main Nix flake configuration defining inputs and development shell outputs
flake.lock Lock file pinning nixpkgs version for reproducibility
nix/utils.nix Helper utilities for multi-platform support
nix/devshell.nix Development shell definitions with multiple compiler configurations
docs/build/nix.md Comprehensive guide for using Nix development environments
docs/build/environment.md Added reference to Nix as an alternative setup method
.gitignore Added entries for Nix, direnv, and clangd cache directories
.envrc direnv configuration for automatic Nix shell activation
.config/cspell.config.yaml Added Nix-related terms to spell checker dictionary

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/build/nix.md Outdated
Comment thread nix/devshell.nix Outdated
Comment thread docs/build/nix.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 2, 2026 17:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI 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.

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/build/nix.md
Comment thread docs/build/nix.md Outdated
Comment thread nix/devshell.nix Outdated
Comment thread flake.nix Outdated
Comment thread flake.nix Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 2, 2026 17:37
Comment thread nix/devshell.nix
Comment thread nix/devshell.nix Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/build/nix.md
Comment thread nix/devshell.nix Outdated
Comment thread nix/devshell.nix Outdated
Comment thread nix/devshell.nix
Comment thread docs/build/nix.md
Comment thread nix/devshell.nix
Comment thread nix/devshell.nix Outdated
ccache
pkg-config
gnumake
llvmPackages_18.clang-tools

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.

Maybe let's use the latest which works well for us?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As I understand currently ci is using tools from llvm 18. Bringing something newer may cause formatting issues.

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.

Makes sense 👍

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.

now that you moved develop to clang-formal 21(?), maybe this needs an update as well

Comment thread nix/devshell.nix Outdated
Comment thread nix/devshell.nix Outdated
Comment thread nix/devshell.nix Outdated
Comment thread nix/devshell.nix Outdated
Comment thread nix/devshell.nix Outdated
Comment thread nix/devshell.nix
Comment thread nix/devshell.nix
Comment thread flake.nix
@kuznetsss
kuznetsss requested a review from vvysokikh1 February 3, 2026 11:17
Copilot AI review requested due to automatic review settings February 3, 2026 14:32

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread flake.nix
Copilot AI review requested due to automatic review settings February 17, 2026 17:51
@kuznetsss
kuznetsss requested a review from vvysokikh1 February 17, 2026 17:57

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 11 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kuznetsss kuznetsss added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Feb 18, 2026
@codecov

codecov Bot commented Feb 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.8%. Comparing base (3542daa) to head (e624d35).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #6314     +/-   ##
=========================================
- Coverage     79.8%   79.8%   -0.0%     
=========================================
  Files          846     846             
  Lines        67746   67746             
  Branches      7561    7559      -2     
=========================================
- Hits         54061   54050     -11     
- Misses       13685   13696     +11     

see 4 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ximinez ximinez added the Needs additional review PR requires at least one more code review approval before it can be merged label Feb 19, 2026
Copilot AI review requested due to automatic review settings February 20, 2026 11:11

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 11 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

.envrc:1

  • .envrc uses use flake, which requires nix-direnv; with plain direnv this will error once a user runs direnv allow. Consider either adding a compatibility/bootstrapping snippet (installing or sourcing nix-direnv) or updating the Nix docs to state that auto-activation via the checked-in .envrc requires nix-direnv specifically.
use flake

docs/build/nix.md:84

  • This section says "direnv or nix-direnv" can auto-activate, but the repo now ships an .envrc that uses use flake (a nix-direnv feature). To avoid confusion, document that the provided .envrc requires nix-direnv, or adjust .envrc to work with plain direnv as well.
## Automatic Activation with direnv

[direnv](https://direnv.net/) or [nix-direnv](https://github.com/nix-community/nix-direnv) can automatically activate the Nix development shell when you enter the repository directory.

docs/build/nix.md:55

  • nix/devshell.nix exports the shell as no-compiler, but the docs instruct nix develop .#no_compiler. That attribute name won't resolve; update the docs to use nix develop .#no-compiler (or rename the devShell attribute to match the docs).
A compiler can be chosen by providing its name with the `.#` prefix, e.g. `nix develop .#gcc15`.
Use `nix flake show` to see all the available development shells.

Use `nix develop .#no_compiler` to use the compiler from your system.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ximinez ximinez 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.

Adding an .envrc messes things up for anyone who is already using direnv, but doesn't want to use nix. Unless I missed something, there's no way to skip/ignore the .envrc in the current directory to find one in a parent.

Copilot AI review requested due to automatic review settings February 23, 2026 10:01
@kuznetsss

Copy link
Copy Markdown
Contributor Author

@ximinez, I have removed .envrc.

Copilot AI 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.

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

nix/devshell.nix:43

  • clangPkg = pkgs."llvmPackages_${toString version}".stdenv or null; will still throw if llvmPackages_${version} itself is missing, so the intended "Invalid Clang version" error won’t be reached. Guard the llvmPackages_${version} lookup first (get it with or null, then access .stdenv).
          clangPkg = pkgs."llvmPackages_${toString version}".stdenv or null;
        in
        if clangPkg != null && builtins.elem version clangVersions then
          clangPkg
        else

docs/build/nix.md:55

  • The docs reference nix develop .#no_compiler, but the devShell is exported as no-compiler (with a hyphen) in nix/devshell.nix. This command won’t work as written; update the docs to match the actual shell attribute name.
A compiler can be chosen by providing its name with the `.#` prefix, e.g. `nix develop .#gcc15`.
Use `nix flake show` to see all the available development shells.

Use `nix develop .#no_compiler` to use the compiler from your system.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ximinez

ximinez commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

@kuznetsss

I have removed .envrc.

Thanks. I'll remove my review and merge.

@ximinez
ximinez dismissed their stale review February 24, 2026 01:09

My issue was addressed, though I haven't reviewed the whole PR

@ximinez
ximinez merged commit 0fd237d into XRPLF:develop Feb 24, 2026
3 checks passed
@ximinez ximinez removed the Needs additional review PR requires at least one more code review approval before it can be merged label Feb 25, 2026
@mvadari mvadari added this to the 3.2.0 milestone May 20, 2026
beartec-jpg pushed a commit to beartec-jpg/FalconLedger that referenced this pull request Jun 1, 2026
---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants