nix-community.nixvim/wrappers/darwin.nix
2024-08-02 14:38:38 +01:00

46 lines
891 B
Nix

self:
{
pkgs,
config,
lib,
...
}@args:
let
inherit (lib)
mkEnableOption
mkOption
mkOptionType
mkForce
mkMerge
mkIf
types
;
cfg = config.programs.nixvim;
in
{
options = {
programs.nixvim = mkOption {
default = { };
type = types.submoduleWith {
shorthandOnlyDefinesConfig = true;
specialArgs = config.lib.nixvim.modules.specialArgsWith { darwinConfig = config; };
modules = [
./modules/darwin.nix
../modules/top-level
];
};
};
};
imports = [ (import ./_shared.nix { }) ];
config = mkIf cfg.enable (mkMerge [
{
environment.systemPackages = [
cfg.finalPackage
cfg.printInitPackage
] ++ (lib.optional cfg.enableMan self.packages.${pkgs.stdenv.hostPlatform.system}.man-docs);
}
{ inherit (cfg) warnings assertions; }
]);
}