Skip to content

Commit

Permalink
modules/output: add manDocsPackage
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSturgeon committed Dec 23, 2024
1 parent 9487403 commit 8938e09
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
13 changes: 13 additions & 0 deletions modules/top-level/output.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let
inherit (lib) types mkOption mkPackageOption;
inherit (lib) optional optionalAttrs;
builders = lib.nixvim.builders.withPkgs pkgs;
inherit (pkgs.stdenv.hostPlatform) system;
in
{
options = {
Expand Down Expand Up @@ -146,6 +147,16 @@ in
readOnly = true;
visible = false;
};

manDocsPackage = mkOption {
type = types.package;
defaultText = lib.literalMD "`packages.<system>.man-docs` from Nixvim's flake";
description = ''
Nixvim's manpage documentation.
'';
readOnly = true;
visible = false;
};
};
};

Expand Down Expand Up @@ -370,6 +381,8 @@ in
bat --language=lua "$init"
'';
};

manDocsPackage = config.flake.packages.${system}.man-docs;
};

# Set `wrapRc` and `impureRtp`s option defaults with even lower priority than `mkOptionDefault`
Expand Down
3 changes: 1 addition & 2 deletions wrappers/darwin.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
self:
{
pkgs,
config,
lib,
...
Expand Down Expand Up @@ -28,6 +27,6 @@ in
environment.systemPackages = [
cfg.build.package
cfg.build.printInitPackage
] ++ lib.optional cfg.enableMan self.packages.${pkgs.stdenv.hostPlatform.system}.man-docs;
] ++ lib.optional cfg.enableMan cfg.build.manDocsPackage;
};
}
3 changes: 1 addition & 2 deletions wrappers/hm.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
self:
{
pkgs,
config,
lib,
...
Expand Down Expand Up @@ -36,7 +35,7 @@ in
home.packages = [
cfg.build.package
cfg.build.printInitPackage
] ++ lib.optional cfg.enableMan self.packages.${pkgs.stdenv.hostPlatform.system}.man-docs;
] ++ lib.optional cfg.enableMan cfg.build.manDocsPackage;

home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "nvim"; };

Expand Down
3 changes: 1 addition & 2 deletions wrappers/nixos.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
self:
{
pkgs,
config,
lib,
...
Expand Down Expand Up @@ -37,7 +36,7 @@ in
environment.systemPackages = [
cfg.build.package
cfg.build.printInitPackage
] ++ lib.optional cfg.enableMan self.packages.${pkgs.stdenv.hostPlatform.system}.man-docs;
] ++ lib.optional cfg.enableMan cfg.build.manDocsPackage;

environment.variables = {
VIM = mkIf (!cfg.wrapRc) "/etc/nvim";
Expand Down
2 changes: 1 addition & 1 deletion wrappers/standalone.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let
paths = [
build.package
build.printInitPackage
] ++ pkgs.lib.optional enableMan self.packages.${pkgs.stdenv.hostPlatform.system}.man-docs;
] ++ lib.optional enableMan build.manDocsPackage;
meta.mainProgram = "nvim";
})
// rec {
Expand Down

0 comments on commit 8938e09

Please sign in to comment.