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

Add nixpkgs module (fix #74) #147

Closed
wants to merge 3 commits into from
Closed

Add nixpkgs module (fix #74) #147

wants to merge 3 commits into from

Conversation

Atry
Copy link
Contributor

@Atry Atry commented May 7, 2023

No description provided.

@roberth
Copy link
Member

roberth commented May 9, 2023

I think this is an interesting idea, but not quite sustainable, and not quite appropriate for the flake-parts core architecture; although feel free to use this module or pattern freely until we have a better solution.

The right approach I think is to make an RFC 78-style implementation of this module in upstream nixpkgs, so that it is well-tested there and can be safely reused in any application (not even just flake-parts).
Without such a framework, this will inevitably lead to something breaking, unproductive discussions back and forth ("why should nixpkgs care? etc"), without working towards a more broadly applicable solution to RFC 78.

{inputs, ...}: {
options.perSystem = mkPerSystemOption ({ pkgs, system, ... }: {
imports = [
"${inputs.nixpkgs}/nixos/modules/misc/nixpkgs.nix"
Copy link
Contributor Author

@Atry Atry May 9, 2023

Choose a reason for hiding this comment

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

inputs.nixpkgs makes an assumption to the name of the user's inputs, which is bad. We still need to solve #157 to properly use an input.

@roberth
Copy link
Member

roberth commented May 29, 2024

Although I like the sort of elegance of such a short solution, I don't think we should be making the module list of perSystem strict in a Nixpkgs input.

For instance, when a flake exports an overlay with easyOverlay, pkgs will be set to the overlay final parameter, and it would be bad to have to fetch an unused Nixpkgs just to load its entrypoint module, and then find out that the only effect of that module is going to be overridden anyway.

So architecturally, it should look more like #137, except perhaps a simpler implementation.

@roberth roberth closed this May 29, 2024
@roberth roberth mentioned this pull request May 29, 2024
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