Skip to content

cachix/devenv-nixpkgs

Repository files navigation

devenv-nixpkgs

Battle-tested nixpkgs using devenv's extensive testing infrastructure.

Currently, the only supported release is rolling.

Rolling is based on nixpkgs-unstable plus any patches that improve the integrations and services offered by devenv.

Usage

In your devenv.yaml:

inputs:
  nixpkgs:
    url: github:cachix/devenv-nixpkgs/rolling
    flake: false

Patches

Patches are defined in patches/default.nix with two categories:

  • upstream: Patches from nixpkgs PRs or unreleased fixes
  • local: Patches not yet submitted upstream

Adding an Upstream Patch

Download the PR patch and commit it as a local file:

curl -L https://github.com/NixOS/nixpkgs/pull/12345.patch -o patches/fix-python-darwin.patch

Then add it to patches/default.nix:

upstream = [
  ./fix-python-darwin.patch
];

Note: Avoid using fetchpatch for unmerged PRs — a force-push to the PR branch changes the content at that URL. fetchpatch is fine for merged commits whose content is immutable (e.g. unreleased fixes not yet in nixpkgs-unstable):

(fetchpatch {
  name = "fix-python-darwin.patch";
  url = "https://github.com/NixOS/nixpkgs/commit/abc123.patch";
  sha256 = "sha256-AAAA...";
})

Adding a Local Patch

For patches not yet submitted upstream:

  1. Create your patch in a nixpkgs checkout:

    git format-patch -1 HEAD -o /path/to/devenv-nixpkgs/patches/
  2. Add it to patches/default.nix:

    local = [
      ./001-fix-something.patch
    ];

Testing Locally

Test patches before pushing:

# Build a package with patches applied
nix build .#legacyPackages.x86_64-linux.hello

# Or enter a shell
nix develop

Overlays

For package-level fixes that don't require source patches, use overlays/default.nix:

[
  (final: prev: {
    somePackage = prev.somePackage.overrideAttrs (old: {
      patches = old.patches or [] ++ [ ./fix.patch ];
    });
  })
]

Overlays are more resilient to upstream changes than source patches.

Test Results

Latest test results from devenv's comprehensive test suite:

Nixpkgs revision: 3b32825

Test run: View detailed results

Last updated: 2026-07-16 14:33:07 UTC

Platform Results

Platform Tests Failed/Total Success Rate
aarch64-linux 2/71 97.1%
x86_64-linux 2/70 97.1%
aarch64-darwin 36/71 49.2%

Summary

  • Total test jobs: 212
  • Successful: 171 ✅
  • Failed: 40 ❌
  • Success rate: 80%

Deployment

How It Works

  1. flake.nix imports nixpkgs-unstable and applies patches at evaluation time
  2. flake.lock pins the exact nixpkgs revision
  3. CI runs weekly to update, test, and create release PRs

Branches

  • main: development branch, receives weekly nixpkgs updates
  • rolling: stable release, promoted from main via PR

CI Workflow

Every Monday at 9:00 UTC (or manually triggered):

  1. Update: nix flake update pulls latest nixpkgs-unstable
  2. Validate: Build a test package to verify patches apply
  3. Push: Commit updated flake.lock to main
  4. Test: Run devenv test suite across all platforms
  5. Summary: Update README with test results
  6. Release PR: Create PR to promote mainrolling

Manual Updates

Test locally:

nix flake update
nix build .#legacyPackages.x86_64-linux.hello

Trigger CI manually:

gh workflow run "Update and test"

# Force the tests to run even if nixpkgs is already up to date
gh workflow run "Update and test" -f run_tests=always

The run_tests input accepts auto (default: test only when nixpkgs changed), always, or never.

Release Process

After tests complete, a PR is automatically created to promote mainrolling with the test results summary. Merge the PR to release.

About

Tested nixpkgs pins that work with devenv

Resources

Stars

25 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors