Skip to content
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

Remove nixpkgs input #16

Merged
merged 3 commits into from
Mar 4, 2025
Merged

Remove nixpkgs input #16

merged 3 commits into from
Mar 4, 2025

Conversation

alexdavid
Copy link
Contributor

The nixpkgs dependency was only being used for library functions, and
these functions are only needed within garnixModules.default which
receives lib from garnix-lib. By removing the nixpkgs input we can
be assured that there is only one nixpkgs being used: the one passed
in from garnix-lib.

One note that differs with the nodejs-module: the dream2nix
input needs a nixpkgs flake input so there still may be a discrepancy
here. However, as far as I can tell, this will only affect what NodeJS
will be used, all of the NixOS configuration will be based on the
nixpkgs provided by garnix-lib. That being said, do we still want an
unused nixpkgs input for this module so that downstream users can easily
use inputs.nodejs-module.inputs.nixpkgs.follows to change the nixpkgs
version providing NodeJS?

The `nixpkgs` dependency was only being used for library functions, and
these functions are only needed within `garnixModules.default` which
receives `lib` from `garnix-lib`. By removing the `nixpkgs` input we can
be assured that there is only one `nixpkgs` being used: the one passed
in from `garnix-lib`.

One note that differs with the `nodejs-module`: the `dream2nix`
input needs a `nixpkgs` flake input so there still may be a discrepancy
here. However, as far as I can tell, this will only affect what NodeJS
will be used, all of the NixOS configuration will be based on the
`nixpkgs` provided by `garnix-lib`. That being said, do we still want an
unused `nixpkgs` input for this module so that downstream users can easily
use `inputs.nodejs-module.inputs.nixpkgs.follows` to change the `nixpkgs`
version providing NodeJS?

To make this commit easier to review, I am only moving the function
definition around and not changing formatting at all. I will reformat
with `nixfmt` in the next commit.
@soenkehahn
Copy link
Contributor

[...] do we still want an unused nixpkgs input for this module so that downstream users can easily use inputs.nodejs-module.inputs.nixpkgs.follows to change the nixpkgs version providing NodeJS?

I think so, yes. Also to document that there is another nixpkgs in the mix.

Copy link
Contributor

@soenkehahn soenkehahn left a comment

Choose a reason for hiding this comment

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

Apart from my comment, LGTM.

This makes it clear that `dream2nix` is consuming a `nixpkgs` and makes
it easy to override. However, all other usage of `nixpkgs` within this
flake are still removed.
@alexdavid alexdavid merged commit 481e1bc into main Mar 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants