|
30 | 30 | It is used by quickshell using `--path`. |
31 | 31 | ''; |
32 | 32 | }; |
| 33 | + configDir = mkOption { |
| 34 | + type = types.nullOr wlib.types.linkable; |
| 35 | + default = null; |
| 36 | + description = '' |
| 37 | + The full quickshell configuration including the shell.qml file. |
| 38 | +
|
| 39 | + Use either this option or 'configFile' and 'components' |
| 40 | + ''; |
| 41 | + }; |
33 | 42 | components = mkOption { |
34 | 43 | type = types.attrsOf (types.either wlib.types.linkable types.lines); |
35 | 44 | default = { }; |
|
56 | 65 | }/${config.binName}-config"; |
57 | 66 |
|
58 | 67 | config.constructFiles = |
59 | | - mapAttrs' ( |
60 | | - name: val: |
61 | | - let |
62 | | - firstChar = builtins.substring 0 1 name; |
63 | | - rest = builtins.substring 1 (-1) name; |
64 | | - capitalizedName = (lib.toUpper firstChar) + rest; |
65 | | - linkable = isLinkable val; |
66 | | - in |
| 68 | + if config.configDir != null then |
67 | 69 | { |
68 | | - name = "${name}Component"; |
69 | | - value = { |
70 | | - content = mkIf (!linkable) val; |
71 | | - builder = mkIf linkable ''ln -s ${val} "$2"''; |
| 70 | + generatedConfig = { |
| 71 | + builder = ''ln -s ${config.configDir} "$2"''; |
72 | 72 | output = makeForce config.generated.output; |
73 | | - relPath = makeForce "${config.binName}-config/${capitalizedName}.qml"; |
| 73 | + relPath = makeForce "${config.binName}-config"; |
74 | 74 | }; |
75 | 75 | } |
76 | | - ) config.components |
77 | | - // { |
78 | | - generatedConfig = { |
79 | | - content = mkIf (!isLinkable config.configFile) config.configFile; |
80 | | - builder = mkIf (isLinkable config.configFile) ''ln -s ${config.configFile} "$2"''; |
81 | | - output = makeForce config.generated.output; |
82 | | - relPath = makeForce "${config.binName}-config/shell.qml"; |
| 76 | + else |
| 77 | + mapAttrs' ( |
| 78 | + name: val: |
| 79 | + let |
| 80 | + firstChar = builtins.substring 0 1 name; |
| 81 | + rest = builtins.substring 1 (-1) name; |
| 82 | + capitalizedName = (lib.toUpper firstChar) + rest; |
| 83 | + linkable = isLinkable val; |
| 84 | + in |
| 85 | + { |
| 86 | + name = "${name}Component"; |
| 87 | + value = { |
| 88 | + content = mkIf (!linkable) val; |
| 89 | + builder = mkIf linkable ''ln -s ${val} "$2"''; |
| 90 | + output = makeForce config.generated.output; |
| 91 | + relPath = makeForce "${config.binName}-config/${capitalizedName}.qml"; |
| 92 | + }; |
| 93 | + } |
| 94 | + ) config.components |
| 95 | + // { |
| 96 | + generatedConfig = { |
| 97 | + content = mkIf (!isLinkable config.configFile) config.configFile; |
| 98 | + builder = mkIf (isLinkable config.configFile) ''ln -s ${config.configFile} "$2"''; |
| 99 | + output = makeForce config.generated.output; |
| 100 | + relPath = makeForce "${config.binName}-config/shell.qml"; |
| 101 | + }; |
83 | 102 | }; |
84 | | - }; |
85 | 103 |
|
86 | 104 | config.meta.maintainers = [ wlib.maintainers.ormoyo ]; |
87 | 105 | config.meta.platforms = lib.platforms.linux; |
|
0 commit comments