Skip to content

Add nixpkgs module (fix #74)#147

Closed
Atry wants to merge 3 commits intohercules-ci:mainfrom
Atry:nixpkgs
Closed

Add nixpkgs module (fix #74)#147
Atry wants to merge 3 commits intohercules-ci:mainfrom
Atry:nixpkgs

Conversation

@Atry
Copy link
Copy Markdown
Contributor

@Atry Atry commented May 7, 2023

No description provided.

@roberth
Copy link
Copy Markdown
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.

Comment thread extras/nixpkgs.nix
{inputs, ...}: {
options.perSystem = mkPerSystemOption ({ pkgs, system, ... }: {
imports = [
"${inputs.nixpkgs}/nixos/modules/misc/nixpkgs.nix"
Copy link
Copy Markdown
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
Copy Markdown
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