Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Idea for package creation: using mkOption's apply argument #11

Open
Atry opened this issue May 5, 2023 · 1 comment
Open

Idea for package creation: using mkOption's apply argument #11

Atry opened this issue May 5, 2023 · 1 comment

Comments

@Atry
Copy link

Atry commented May 5, 2023

{
  options.myPackage = mkOption {
    type = lib.types.submoduleWith {
      modules = [{
        freeformType = lib.types.attrsOf lib.types.anything;
      }];
    };
    apply = pkgs.mkDerivation;
  };
}
@infinisil
Copy link
Member

Thanks! For now we're not yet looking at concrete implementations yet, but let's leave this open for then.

Here's some quick thoughts though: apply should generally be discouraged because it's not composable: You can only set it once. Additionally using apply here might lead to the mkDerivation arguments not being inspectable via config.myPackage.* anymore, especially with something like the recently proposed __cleanAttrs (which is generally a good idea).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants