forked from nix-community/nixvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdarwin.nix
49 lines (47 loc) · 939 Bytes
/
darwin.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 {
defaultPkgs = pkgs;
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; }
]);
}