Skip to content

Commit

Permalink
Merge pull request #1536 from zupo/patch-1
Browse files Browse the repository at this point in the history
Document how to get a single package from nixpkgs-unstable
  • Loading branch information
domenkozar authored Oct 17, 2024
2 parents 5b44099 + 6165a7d commit 632d746
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions docs/common-patterns.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
## Using `nixpkgs-unstable` instead of `devenv-nixpkgs`
## Getting a recent version of a package from `nixpkgs-unstable`

### In the file `devenv.yaml` edit the `nixpkgs` input to point to nixpkgs-unstable
By default, devenv [uses a fork of nixpkgs](https://devenv.sh/blog/2024/03/20/devenv-10-rewrite-in-rust/#devenv-nixpkgs) with additional fixes. This fork can be several months behind `nixpkgs-unstable`. You can still get a more recently updated package from `nixpkgs-unstable` into your devenv.

1. Add `nixpkgs-unstable` input to `devenv.yaml`:

```yaml
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
url: github:cachix/devenv-nixpkgs/rolling
nixpkgs-unstable:
url: github:nixos/nixpkgs/nixpkgs-unstable
```
2. Use the package in your `devenv.nix`:

```nix
{ pkgs, inputs, ... }:
let
pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; };
in
{
packages = [
pkgs-unstable.elmPackages.elm-test-rs
];
}
```

## Nix patterns
Expand Down

0 comments on commit 632d746

Please sign in to comment.