1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

less: generate lesskey only when non-empty

This commit is contained in:
Benedikt Rips 2025-08-04 10:37:53 +02:00 committed by Austin Horstman
parent 18ea6d7a8f
commit 9a132f2971
4 changed files with 12 additions and 2 deletions

View file

@ -34,6 +34,6 @@ in
config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."lesskey".text = cfg.keys;
xdg.configFile."lesskey" = lib.mkIf (cfg.keys != "") { text = cfg.keys; };
};
}

View file

@ -1 +1,4 @@
{ less-with-custom-keys = ./less-with-custom-keys.nix; }
{
less-custom-keys = ./custom-keys.nix;
less-no-keys = ./no-keys.nix;
}

View file

@ -0,0 +1,7 @@
{
programs.less.enable = true;
nmt.script = ''
assertPathNotExists home-files/.config/lesskey
'';
}