mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
languages/dart: add flutter-tools.flutterPackage option
Previously, flutter-tools was dependent on the flutter SDK, which it found in the PATH. Having such undeclared and non-reproducible dependencies is against the principles of nix. The flutterPackage option has been made optional for people who have installed the flutter SDK differently and want to keep it that way. The enableNoResolvePatch option has been retained for people who have installed the flutter SDK using nix outside the scope of nvf and do not want to have to install it twice. The default value has been changed to false, assuming that most people who use nix to install flutter will use the flutterPackage option instead.
This commit is contained in:
parent
99d600f40f
commit
df0e2060c6
2 changed files with 14 additions and 5 deletions
|
@ -332,4 +332,5 @@
|
||||||
[Noah765](https://github.com/Noah765):
|
[Noah765](https://github.com/Noah765):
|
||||||
|
|
||||||
- Add missing `flutter-tools.nvim` dependency `plenary.nvim`.
|
- Add missing `flutter-tools.nvim` dependency `plenary.nvim`.
|
||||||
- Add necessary dependency of `flutter-tools.nvim` on lsp
|
- Add necessary dependency of `flutter-tools.nvim` on lsp.
|
||||||
|
- Add the `vim.languages.dart.flutter-tools.flutterPackage` option.
|
||||||
|
|
|
@ -81,16 +81,23 @@ in {
|
||||||
description = "Enable flutter-tools for flutter support";
|
description = "Enable flutter-tools for flutter support";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
flutterPackage = mkOption {
|
||||||
|
type = nullOr package;
|
||||||
|
default = pkgs.flutter;
|
||||||
|
description = "Flutter package, or null to detect the flutter path at runtime instead.";
|
||||||
|
};
|
||||||
|
|
||||||
enableNoResolvePatch = mkOption {
|
enableNoResolvePatch = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = true;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to patch flutter-tools so that it doesn't resolve
|
Whether to patch flutter-tools so that it doesn't resolve
|
||||||
symlinks when detecting flutter path.
|
symlinks when detecting flutter path.
|
||||||
|
|
||||||
This is required if you want to use a flutter package built with nix.
|
This is required if flutterPackage is set to null and the flutter
|
||||||
If you are using a flutter SDK installed from a different source
|
package in your PATH was built with nix. If you are using a flutter
|
||||||
and encounter the error "`dart` missing from PATH", disable this option.
|
SDK installed from a different source and encounter the error "`dart`
|
||||||
|
missing from PATH", leave this option disabled.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -147,6 +154,7 @@ in {
|
||||||
|
|
||||||
pluginRC.flutter-tools = entryAfter ["lsp-setup"] ''
|
pluginRC.flutter-tools = entryAfter ["lsp-setup"] ''
|
||||||
require('flutter-tools').setup {
|
require('flutter-tools').setup {
|
||||||
|
${optionalString (ftcfg.flutterPackage != null) "flutter_path = \"${ftcfg.flutterPackage}/bin/flutter\","}
|
||||||
lsp = {
|
lsp = {
|
||||||
color = { -- show the derived colours for dart variables
|
color = { -- show the derived colours for dart variables
|
||||||
enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue