nix-community.nixvim/wrappers/hm.nix
Matt Sturgeon 6a1bf6bdc3
modules/output: check warnings+assertions on build.package
Add a `build.packageUnchecked` option for use instead of the old `check`
evalNixvim argument.
2024-09-26 18:04:36 +01:00

69 lines
1.3 KiB
Nix

self:
{
pkgs,
config,
lib,
...
}@args:
let
inherit (lib)
mkEnableOption
mkOption
mkOptionType
mkMerge
mkIf
types
;
cfg = config.programs.nixvim;
nixvimConfig = config.lib.nixvim.modules.evalNixvim {
extraSpecialArgs = {
defaultPkgs = pkgs;
hmConfig = config;
};
modules = [
./modules/hm.nix
# FIXME: this can't go in ./modules/hm.nix because we eval that module in the docs _without_ nixvim's modules
{
_file = ./hm.nix;
config = {
wrapRc = lib.mkOptionDefault false;
impureRtp = lib.mkOptionDefault true;
};
}
];
};
in
{
_file = ./hm.nix;
options = {
programs.nixvim = mkOption {
inherit (nixvimConfig) type;
default = { };
};
};
imports = [
(import ./_shared.nix {
filesOpt = [
"xdg"
"configFile"
];
})
];
config = mkIf cfg.enable {
home.packages = [
cfg.build.package
cfg.build.printInitPackage
] ++ lib.optional cfg.enableMan self.packages.${pkgs.stdenv.hostPlatform.system}.man-docs;
home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "nvim"; };
programs = mkIf cfg.vimdiffAlias {
bash.shellAliases.vimdiff = "nvim -d";
fish.shellAliases.vimdiff = "nvim -d";
zsh.shellAliases.vimdiff = "nvim -d";
};
};
}