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

Expose nixosModules and homeModules in nixpkgs-matrix for OS packages #6

Open
CMCDragonkai opened this issue Oct 22, 2024 · 1 comment
Assignees
Labels
development Standard development

Comments

@CMCDragonkai
Copy link
Member

CMCDragonkai commented Oct 22, 2024

Specification

We discussed previously that in the case of flake.nix there can be many kinds of "outputs"/exports.

This includes not just packages, but also nixosModules and homeModules.

The current flake.nix in this package set doesn't export that. It is however being done in nixpkgs-matrix-private.

We would want to do it here, and have nixpkgs-matrix-private inherit that.

So this flake.nix should take nixosModules and homeModules from polykey-cli package and also export it out.

However we would not want to do it directly via flake inputs, we know that flake inputs are eager, and as a package set, we would want to avoid having to eagerly load all input packages. Instead it should be using builtins.getFlake like we are currently doing in /packages.nix.

I propose that builtins.getFlake gets abstracted out. You could call it deps.nix or something.

Then create modules.nix, and that should define modules, in this case referencing the deps.nix output. Ideally we can share it.

I'm not sure what would happen if you just import deps.nix twice in 2 places, I suspect that the nix runtime should share the same object structure, since it's the same deps.nix...? Or at least load the same /nix/store path.

Anyway, then we can share the flake output from deps.nix between packages.nix and modules.nix.

Additional context

Tasks

  1. Create deps.nix and use builtins.getFlake to lazily get flakes.
  2. Share the output between packages.nix and modules.nix
  3. Export nixosModules and homeModules out of nixpkgs-matrix - make sure to get the polykey-cli ones
  4. Ensure that nixpkgs-matrix-private can use the output and extend it
  5. Remove the unnecessary flake input on polykey-cli in nixpkgs-matrix-private.
@CMCDragonkai CMCDragonkai added the development Standard development label Oct 22, 2024
Copy link

linear bot commented Oct 22, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development
Development

No branches or pull requests

2 participants