Support nix-on-droid

This commit is contained in:
Pedro Alves 2021-02-09 00:03:28 +00:00
parent d9b2c8c9be
commit 0abdb5f01b
2 changed files with 16 additions and 6 deletions

View file

@ -9,8 +9,9 @@
inputs.neovim-nightly.overlay
];
nixosModules.nixvim = import ./nixvim.nix false;
homeManagerModules.nixvim = import ./nixvim.nix true;
nixosModules.nixvim = import ./nixvim.nix { nixos = true; };
homeManagerModules.nixvim = import ./nixvim.nix { homeManager = true; };
nixOnDroidModules.nixvim = import ./nixvim.nix { nixOnDroid = true; };
# This is a simple container for testing
nixosConfigurations.container = nixpkgs.lib.nixosSystem {

View file

@ -1,4 +1,4 @@
homeManager:
{ nixos ? false, nixOnDroid ? false, homeManager ? false }:
{ pkgs, lib, config, ... }:
with lib;
let
@ -270,7 +270,7 @@ in
(helpers.genMaps "!" cfg.maps.insertCommand) ++
(helpers.genMaps "c" cfg.maps.command);
in mkIf cfg.enable (if (!homeManager) then {
in mkIf cfg.enable (if nixos then {
environment.systemPackages = [ wrappedNeovim ];
programs.nixvim = {
configure = configure;
@ -279,7 +279,7 @@ in
};
environment.etc."xdg/nvim/sysinit.vim".text = neovimConfig.neovimRcContent;
} else {
} else (if homeManager then {
programs.nixvim.extraConfigLua = extraConfigLua;
programs.neovim = {
enable = true;
@ -287,5 +287,14 @@ in
extraPackages = cfg.extraPackages;
configure = configure;
};
});
} else {
environment.packages = [ wrappedNeovim ];
programs.nixvim = {
configure = configure;
extraConfigLua = extraConfigLua;
};
environment.etc."xdg/nvim/sysinit.vim".text = neovimConfig.neovimRcContent;
}));
}