|
1 | 1 | # rigup flake's self |
2 | | -_flake: |
| 2 | +flake: |
3 | 3 | # Base module that defines common riglet structure |
4 | 4 | { pkgs, ... }: |
5 | 5 | with pkgs.lib; |
6 | 6 | let |
7 | | - packageLike = types.oneOf [ |
8 | | - types.package |
9 | | - types.path |
10 | | - ]; |
| 7 | + riglib = flake.lib.mkRiglib { inherit pkgs; }; |
| 8 | + |
| 9 | + packageLike = types.coercedTo types.path riglib.wrapScriptPath types.package; |
11 | 10 |
|
12 | 11 | packageList = types.listOf packageLike; |
13 | 12 |
|
14 | | - toolset = types.oneOf [ |
15 | | - # If just a list of packages is given as a toolset, these tools are considered _wrapped_: |
16 | | - packageList |
17 | | - # Else, for more explicit control over which tools should be wrapped and which should not, |
18 | | - # the toolset can be given as a { wrapped = [...]; unwrapped [...]; } attrset: |
19 | | - (types.submodule { |
20 | | - options = { |
21 | | - wrapped = mkOption { |
22 | | - description = "Tools that should be wrapped to use the rig's isolated XDG_CONFIG_HOME"; |
23 | | - type = packageList; |
24 | | - default = [ ]; |
25 | | - }; |
26 | | - unwrapped = mkOption { |
27 | | - description = "Tools that must directly use the user's XDG_CONFIG_HOME"; |
28 | | - type = packageList; |
29 | | - default = [ ]; |
30 | | - }; |
31 | | - }; |
32 | | - }) |
33 | | - ]; |
| 13 | + toolset = |
| 14 | + types.coercedTo |
| 15 | + # If just a list of packages is given as a toolset, these tools are considered _wrapped_: |
| 16 | + packageList |
| 17 | + (x: { wrapped = x; }) |
| 18 | + # Else, for more explicit control over which tools should be wrapped and which should not, |
| 19 | + # the toolset can be given as a { wrapped = [...]; unwrapped [...]; } attrset: |
| 20 | + ( |
| 21 | + types.submodule { |
| 22 | + options = { |
| 23 | + wrapped = mkOption { |
| 24 | + description = "Tools that should be wrapped to use the rig's isolated XDG_CONFIG_HOME"; |
| 25 | + type = packageList; |
| 26 | + default = [ ]; |
| 27 | + }; |
| 28 | + unwrapped = mkOption { |
| 29 | + description = "Tools that must directly use the user's XDG_CONFIG_HOME"; |
| 30 | + type = packageList; |
| 31 | + default = [ ]; |
| 32 | + }; |
| 33 | + }; |
| 34 | + } |
| 35 | + ); |
34 | 36 |
|
35 | 37 | localMcpServer = types.submodule { |
36 | 38 | options.command = mkOption { |
|
238 | 240 | Optional entrypoint for the rig. Only ONE riglet in a rig should define this. |
239 | 241 | Takes the rig attrset and should return a folder derivation with a SINGLE bin/xxx executable (e.g. via pkgs.writeShellScriptBin). |
240 | 242 | ''; |
241 | | - type = types.nullOr (types.functionTo packageLike); |
| 243 | + type = types.nullOr (types.functionTo types.package); |
242 | 244 | default = null; |
243 | 245 | }; |
244 | 246 |
|
|
0 commit comments