mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
This minimal implementation allows `nixpkgs.pkgs` to be defined, but does not implement evaluating an instance from a pkgsPath when _not_ defined. The `defaultPkgs` specialArg is dropped in favour of `nixpkgs.pkgs` being defined. If it's not defined, an assertion is thrown. In the future, a nixpkgs source path can be supplied, defaulting to the flake's `inputs.nixpkgs`. Along with other `nixpkgs.*` options, this will allow a `pkgs` instance to be evaluated within the module eval.
46 lines
783 B
Nix
46 lines
783 B
Nix
self:
|
|
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}@args:
|
|
let
|
|
inherit (lib)
|
|
mkEnableOption
|
|
mkOption
|
|
mkOptionType
|
|
mkForce
|
|
mkMerge
|
|
mkIf
|
|
types
|
|
;
|
|
cfg = config.programs.nixvim;
|
|
nixvimConfig = config.lib.nixvim.modules.evalNixvim {
|
|
extraSpecialArgs = {
|
|
darwinConfig = config;
|
|
};
|
|
modules = [
|
|
./modules/darwin.nix
|
|
];
|
|
};
|
|
in
|
|
{
|
|
_file = ./darwin.nix;
|
|
|
|
options = {
|
|
programs.nixvim = mkOption {
|
|
inherit (nixvimConfig) type;
|
|
default = { };
|
|
};
|
|
};
|
|
|
|
imports = [ (import ./_shared.nix { }) ];
|
|
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = [
|
|
cfg.build.package
|
|
cfg.build.printInitPackage
|
|
] ++ lib.optional cfg.enableMan self.packages.${pkgs.stdenv.hostPlatform.system}.man-docs;
|
|
};
|
|
}
|