File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 21
21
{
22
22
modules ? [ ] ,
23
23
extraSpecialArgs ? { } ,
24
+ system ? null , # Can also be defined using the `nixpkgs.hostPlatform` option
24
25
} :
25
26
# Ensure a suitable `lib` is used
26
27
# TODO: offer a lib overlay that end-users could use to apply nixvim's extensions to their own `lib`
27
28
assert lib . assertMsg ( extraSpecialArgs ? lib -> extraSpecialArgs . lib ? nixvim ) ''
28
29
Nixvim requires a lib that includes some custom extensions, however the `lib` from `specialArgs` does not have a `nixvim` attr.
29
30
Remove `lib` from nixvim's `specialArgs` or ensure you apply nixvim's extensions to your `lib`.'' ;
31
+ assert lib . assertMsg ( system != null -> lib . isString system ) ''
32
+ When `system` is supplied to `evalNixvim`, it must be a string.
33
+ To define a more complex system, please use nixvim's `nixpkgs.hostPlatform` option.'' ;
30
34
lib . evalModules {
31
35
modules = modules ++ [
32
36
../modules/top-level
33
37
{
34
38
_file = "<nixvim-flake>" ;
35
39
flake = lib . mkOptionDefault flake ;
36
40
}
41
+ ( lib . optionalAttrs ( lib . isString system ) {
42
+ _file = "evalNixvim" ;
43
+ # FIXME: what priority should this have?
44
+ # If the user has set it as an evalNixvim arg _and_ a module option what behaviour would they expect?
45
+ nixpkgs . hostPlatform = lib . mkOptionDefault { inherit system ; } ;
46
+ } )
37
47
] ;
38
48
specialArgs = {
39
49
inherit lib ;
Original file line number Diff line number Diff line change 190
190
apply = lib . systems . elaborate ;
191
191
defaultText = lib . literalMD ''
192
192
Inherited from the "host" configuration's `pkgs`.
193
- Must be specified manually when building a standalone nixvim.
193
+ Or the `evalNixvim`'s `system` argument.
194
+ Otherwise, must be specified manually.
194
195
'' ;
195
196
description = ''
196
197
Specifies the platform where the Nixvim configuration will run.
You can’t perform that action at this time.
0 commit comments