Skip to content

Per system option with a different name? #205

Open
@khaled

Description

Building on flake-parts, I'd like to create some base modules that allow developers to define "projects", like so:

{
  some-config = "some-value";
  projects.foo = {
    go.enable = true;
  };
}

Projects will translate to a set of packages on the flake, along with a devshell, based on the language choice.
Customization will be possible, e.g.:

{
  some-config = "some-value"; 
  projects.foo = {pkgs, ...}: {
    go.enable = true;
    shell.packages = [pkgs.bar];
  };
}

So far, using flake-parts, the best I can come up with is:

{
  some-config = "some-value";
  perSystem = {pkgs, ...}: {
    projects.foo = {
      shell.packages = [pkgs.bar];
    };
  };
}

This works OK, but I'm hoping to remove the need for perSystem here, as projects are inherently perSystem. I'm guessing I might be able to use mkPerSystem option in some way, but thus far haven't been able to figure out how. Suggestions would be appreciated!

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions