mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
man-db: add assertion for man.man-db.extraConfig when man.generateCaches is false
This commit is contained in:
committed by
Austin Horstman
parent
1b4806c50b
commit
71ad461413
@@ -33,6 +33,10 @@ in
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable && cfgManDb.enable) {
|
||||
warnings = lib.optional (
|
||||
cfgManDb.extraConfig != "" && !cfg.generateCaches
|
||||
) "programs.man.man-db.extraConfig has no effect when programs.man.generateCaches is false";
|
||||
|
||||
# This is mostly copy/pasted/adapted from NixOS' documentation.nix.
|
||||
home.file = mkIf (cfg.generateCaches && cfg.package != null) {
|
||||
".manpath".text =
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
man-disabled-man-db = ./disabled-man-db.nix;
|
||||
man-disabled-mandoc = ./disabled-mandoc.nix;
|
||||
man-extra-config = ./extra-config.nix;
|
||||
man-extra-config-and-no-cache = ./extra-config-and-no-cache.nix;
|
||||
man-mandoc = ./mandoc.nix;
|
||||
man-no-manpath = ./no-manpath.nix;
|
||||
man-no-caches-without-package = ./no-caches-without-package.nix;
|
||||
|
||||
16
tests/modules/programs/man/extra-config-and-no-cache.nix
Normal file
16
tests/modules/programs/man/extra-config-and-no-cache.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
config = {
|
||||
test.asserts.warnings.expected = [
|
||||
"programs.man.man-db.extraConfig has no effect when programs.man.generateCaches is false"
|
||||
];
|
||||
|
||||
programs.man = {
|
||||
enable = true;
|
||||
generateCaches = false;
|
||||
man-db.extraConfig = ''
|
||||
MANDATORY_MANPATH /usr/man
|
||||
SECTION 1 n l 8
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user