mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
* remove useless nixvim file * reorganize flake outputs * use global config file with home-manager and nixos
23 lines
516 B
Nix
23 lines
516 B
Nix
modules:
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
let
|
|
inherit (lib) mkEnableOption mkOption mkIf mkMerge types;
|
|
cfg = config.programs.nixvim;
|
|
in {
|
|
options = {
|
|
programs.nixvim = lib.mkOption {
|
|
type = types.submodule ((modules pkgs) ++ [{
|
|
options.enable = mkEnableOption "nixvim";
|
|
}]);
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable
|
|
(mkMerge [
|
|
{ home.packages = [ cfg.finalPackage ]; }
|
|
(mkIf (!cfg.wrapRc) {
|
|
xdg.configFile."nvim/init.vim".text = cfg.initContent;
|
|
})
|
|
]);
|
|
}
|