sbt: allow irregular plugins to be configured
Sometimes plugins doesn't follow the form
```
addSbtPlugin("${plugin.org}" % "${plugin.artifact}" % "${plugin.version}")
```
for instance
```
addDependencyTreePlugin
```
This commit allow free form plugin dependency.
This commit is contained in:
parent
495de1e197
commit
1e36429705
2 changed files with 20 additions and 2 deletions
|
|
@ -130,6 +130,20 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
pluginsExtra = mkOption {
|
||||
type = types.listOf (types.str);
|
||||
default = [ ];
|
||||
example = literalExpression ''
|
||||
[
|
||||
"addDependencyTreePlugin"
|
||||
]
|
||||
'';
|
||||
description = ''
|
||||
A list of extra commands to put in plugins conf file.
|
||||
Use it in last resort when you can't use the `plugins` option.
|
||||
'';
|
||||
};
|
||||
|
||||
credentials = mkOption {
|
||||
type = types.listOf (sbtTypes.credential);
|
||||
default = [ ];
|
||||
|
|
@ -183,9 +197,10 @@ in {
|
|||
config = mkIf cfg.enable (mkMerge [
|
||||
{ home.packages = [ cfg.package ]; }
|
||||
|
||||
(mkIf (cfg.plugins != [ ]) {
|
||||
(mkIf (cfg.plugins != [ ] || cfg.pluginsExtra != [ ]) {
|
||||
home.file."${cfg.baseUserConfigPath}/1.0/plugins/plugins.sbt".text =
|
||||
concatStrings (map renderPlugin cfg.plugins);
|
||||
concatStrings (map renderPlugin cfg.plugins)
|
||||
+ concatStringsSep "\n" cfg.pluginsExtra + "\n";
|
||||
})
|
||||
|
||||
(mkIf (cfg.credentials != [ ]) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue