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

Support other package sets #31

Open
infinisil opened this issue Mar 28, 2024 · 0 comments
Open

Support other package sets #31

infinisil opened this issue Mar 28, 2024 · 0 comments

Comments

@infinisil
Copy link
Member

We want to use the pkgs/by-name convention for other package sets, e.g. NixOS/nixpkgs#299347.

Here's a rough idea how this could look like:

Package set config

Define some Nix config file to determine which package sets exist:

# pkgs/top-level/by-name-sets-config.nix
{
  packageSets = {
    toplevel = {
      attrPath = [ ];
      path = ./pkgs/by-name;
      shardLength = 2;
    };
    mySet = {
      # Any attrpath that will contain the attributes
      attrPath = [ "mySet" ];
      path = ./pkgs/mySet/by-name;
      # No sharding
      shardLength = null;
    };
  };
}

Read the packages in Nix

Create a Nix file to automatically call all of them like the current by-name-overlay.nix:

# pkgs/top-level/by-name-sets.nix
{
  toplevel = callPackage: {
    hello = <...>;
  };
  mySet = callPackage: {
    hi = <...>;
  };
}

For each package set declared, define it by importing by-name-sets.nix, like

mySet = lib.makeScope pkgs.newScope (self:
  (import ./pkgs/top-level/by-name-sets.nix).mySet self.callPackage
) 

Check the packages with the tool

Adjust this tool to read a by-name-sets-config.nix file for determining what it needs to check and how.

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

No branches or pull requests

1 participant