-
Notifications
You must be signed in to change notification settings - Fork 409
Allow configuration of the Nixpkgs instance on a per-system basis #1892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow configuration of the Nixpkgs instance on a per-system basis #1892
Conversation
0f3fce7
to
90c3911
Compare
90c3911
to
ef5eb41
Compare
Hey! I'd change a bit the way the config is structured: nixpkgs:
allowUnfree: true
allowBroken: false
per-platform:
x86_64-linux:
allowUnfree: true
allowBroken: true
aarch64-darwin:
allowUnfree: false |
Sure. I'll make those changes and push a new commit. Are you otherwise ok with how I structured the changes? |
Yeah, really good stuff :) |
Given the changes you are proposing, should the old syntax still be accepted? allowUnfree: true Or should the only way to configure be: nixpkgs:
allowUnfree: true |
Yeah, we should still support the old way. And change docs for the |
- Rename `config` to `nixpkgs` - Change config format to the one proposed by @domenkozar - Update documentation - Update JSON schema
ef5eb41
to
8e27fd7
Compare
Now that think about it, the followings would be introduced with this PR at the top-level:
Do you want those to only be allowed within |
Yes, thank you! |
Note that jsonschema will get automatically generated, see https://github.com/cachix/devenv/actions/runs/15467562476/job/43544279281#step:15:23 |
Ah neat. I will remove those changes then. |
4832477
to
7abf763
Compare
7abf763
to
3c3ab4b
Compare
Description
This PR aims to allow setting some of the attribute of the
config
attribute set that is normally passed as argument when importing Nixpkgs.An example that is currently not supported (but would be after this PR):
Context
We have a project where we work with CUDA and override various packages (e.g. OpenCV) to have CUDA support enabled. Currently, we are using
devenv
with the flake integration, but would like to now migrate to using thedevenv
command anddevenv.yaml
/devenv.nix
to benefit from faster load times.We also have the added complexity of supporting 2 architectures: x86 and aarch64 with incompatible sets of CUDA capabilities. We therefore needed to patch
devenv
in order to allow us to configure those settings on a per-system basis.Changes in a nutshell
This PR modifies the config structure of the
devenv.yaml
file in the following ways:nixpkgs
globally:cudaSupport
config
that can be used to configure on a per-system basis howdevenv
later configures its Nixpkgs instanceHere's an example of this new format for the config file:
The
devenv/src/flake.tmpl.nix
was modified in such a way that theconfig.<system>.<keys>
take precedence over<keys>
if present, but should not otherwise have an impact on existing configurations.