mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
Support nix-on-droid
This commit is contained in:
parent
d9b2c8c9be
commit
0abdb5f01b
2 changed files with 16 additions and 6 deletions
|
@ -9,8 +9,9 @@
|
||||||
inputs.neovim-nightly.overlay
|
inputs.neovim-nightly.overlay
|
||||||
];
|
];
|
||||||
|
|
||||||
nixosModules.nixvim = import ./nixvim.nix false;
|
nixosModules.nixvim = import ./nixvim.nix { nixos = true; };
|
||||||
homeManagerModules.nixvim = import ./nixvim.nix true;
|
homeManagerModules.nixvim = import ./nixvim.nix { homeManager = true; };
|
||||||
|
nixOnDroidModules.nixvim = import ./nixvim.nix { nixOnDroid = true; };
|
||||||
|
|
||||||
# This is a simple container for testing
|
# This is a simple container for testing
|
||||||
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
|
||||||
|
|
17
nixvim.nix
17
nixvim.nix
|
@ -1,4 +1,4 @@
|
||||||
homeManager:
|
{ nixos ? false, nixOnDroid ? false, homeManager ? false }:
|
||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
|
@ -270,7 +270,7 @@ in
|
||||||
(helpers.genMaps "!" cfg.maps.insertCommand) ++
|
(helpers.genMaps "!" cfg.maps.insertCommand) ++
|
||||||
(helpers.genMaps "c" cfg.maps.command);
|
(helpers.genMaps "c" cfg.maps.command);
|
||||||
|
|
||||||
in mkIf cfg.enable (if (!homeManager) then {
|
in mkIf cfg.enable (if nixos then {
|
||||||
environment.systemPackages = [ wrappedNeovim ];
|
environment.systemPackages = [ wrappedNeovim ];
|
||||||
programs.nixvim = {
|
programs.nixvim = {
|
||||||
configure = configure;
|
configure = configure;
|
||||||
|
@ -279,7 +279,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc."xdg/nvim/sysinit.vim".text = neovimConfig.neovimRcContent;
|
environment.etc."xdg/nvim/sysinit.vim".text = neovimConfig.neovimRcContent;
|
||||||
} else {
|
} else (if homeManager then {
|
||||||
programs.nixvim.extraConfigLua = extraConfigLua;
|
programs.nixvim.extraConfigLua = extraConfigLua;
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -287,5 +287,14 @@ in
|
||||||
extraPackages = cfg.extraPackages;
|
extraPackages = cfg.extraPackages;
|
||||||
configure = configure;
|
configure = configure;
|
||||||
};
|
};
|
||||||
});
|
} else {
|
||||||
|
environment.packages = [ wrappedNeovim ];
|
||||||
|
programs.nixvim = {
|
||||||
|
configure = configure;
|
||||||
|
|
||||||
|
extraConfigLua = extraConfigLua;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.etc."xdg/nvim/sysinit.vim".text = neovimConfig.neovimRcContent;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue