File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 22{
33 perSystem =
44 {
5- pkgs ,
6- lib ,
75 makeNixvimWithModule ,
6+ system ,
87 ...
98 } :
109 {
1312 makeNixvim = module : makeNixvimWithModule { inherit module ; } ;
1413
1514 nixvimConfiguration = helpers . modules . evalNixvim {
16- modules = [
17- {
18- _file = ./legacy-packages.nix ;
19- nixpkgs . pkgs = lib . mkDefault pkgs ;
20- }
21- ] ;
15+ inherit system ;
2216 } ;
2317 } ;
2418 } ;
Original file line number Diff line number Diff line change 2121 {
2222 modules ? [ ] ,
2323 extraSpecialArgs ? { } ,
24+ system ? null , # Can also be defined using the `nixpkgs.hostPlatform` option
2425 } :
2526 # Ensure a suitable `lib` is used
2627 # TODO: offer a lib overlay that end-users could use to apply nixvim's extensions to their own `lib`
2728 assert lib . assertMsg ( extraSpecialArgs ? lib -> extraSpecialArgs . lib ? nixvim ) ''
2829 Nixvim requires a lib that includes some custom extensions, however the `lib` from `specialArgs` does not have a `nixvim` attr.
2930 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.'' ;
3034 lib . evalModules {
3135 modules = modules ++ [
3236 ../modules/top-level
3337 {
3438 _file = "<nixvim-flake>" ;
3539 flake = lib . mkOptionDefault flake ;
3640 }
41+ ( lib . optionalAttrs ( lib . isString system ) {
42+ _file = "evalNixvim" ;
43+ nixpkgs . hostPlatform = lib . mkOptionDefault { inherit system ; } ;
44+ } )
3745 ] ;
3846 specialArgs = {
3947 inherit lib ;
Original file line number Diff line number Diff line change 164164 apply = lib . systems . elaborate ;
165165 defaultText = lib . literalMD ''
166166 - Inherited from the "host" configuration's `pkgs`
167- - Must be specified manually when building a standalone nixvim
167+ - Or `evalNixvim`'s `system` argument
168+ - Otherwise, must be specified manually
168169 '' ;
169170 description = ''
170171 Specifies the platform where the Nixvim configuration will run.
You can’t perform that action at this time.
0 commit comments