You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+37
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,43 @@ By default, devenv uses `github:cachix/devenv-nixpkgs/rolling` as its nixpkgs so
54
54
55
55
This approach prioritizes having the latest language features over the potential stability benefits of the default channel. For most Elixir development, this trade-off is worthwhile as it provides access to the newest language capabilities.
56
56
57
+
#### Alternative Approach
58
+
59
+
If you encounter issues with our direct method (replacing the nixpkgs source in devenv.yaml), you can follow the [official devenv approach](https://devenv.sh/common-patterns/#getting-a-recent-version-of-a-package-from-nixpkgs-unstable) for using packages from nixpkgs-unstable:
60
+
61
+
1. Keep the default nixpkgs source and add nixpkgs-unstable as an additional input in `devenv.yaml`:
62
+
63
+
```yaml
64
+
inputs:
65
+
nixpkgs:
66
+
url: github:cachix/devenv-nixpkgs/rolling
67
+
nixpkgs-unstable:
68
+
url: github:nixos/nixpkgs/nixpkgs-unstable
69
+
```
70
+
71
+
2. Use the unstable package in `devenv.nix`:
72
+
```nix
73
+
{ pkgs, inputs, ... }:
74
+
let
75
+
pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; };
This method keeps the stability benefits of the default devenv nixpkgs for most packages while still allowing specific access to newer versions from unstable when needed.
87
+
88
+
For more information:
89
+
90
+
- [Devenv documentation on using nixpkgs-unstable](https://devenv.sh/common-patterns/#getting-a-recent-version-of-a-package-from-nixpkgs-unstable)
91
+
- [Discussion about package versioning in Nix](https://github.com/NixOS/nixpkgs/issues/93327)
92
+
- [NixOS search for Elixir packages](https://search.nixos.org/packages?channel=unstable&query=elixir)
0 commit comments