diff --git a/modules/misc/news.nix b/modules/misc/news.nix index a850bd8d..8bcd4e68 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -2280,6 +2280,16 @@ in modules. ''; } + + { + time = "2021-12-08T10:23:42+00:00"; + condition = config.programs.less.enable; + message = '' + The 'lesskey' configuration file is now stored under + '$XDG_CONFIG_HOME/lesskey' since it is fully supported upstream + starting from v596. + ''; + } ]; }; } diff --git a/modules/programs/less.nix b/modules/programs/less.nix index 3bee0a82..9e6e6720 100644 --- a/modules/programs/less.nix +++ b/modules/programs/less.nix @@ -19,7 +19,7 @@ in { ''; description = '' Extra configuration for less written to - $HOME/.lesskey. + $XDG_CONFIG_HOME/lesskey. ''; }; }; @@ -27,6 +27,6 @@ in { config = mkIf cfg.enable { home.packages = [ pkgs.less ]; - home.file.".lesskey".text = cfg.keys; + xdg.configFile."lesskey".text = cfg.keys; }; } diff --git a/tests/modules/programs/less/less-with-custom-keys.nix b/tests/modules/programs/less/less-with-custom-keys.nix index 48f52b87..23d44718 100644 --- a/tests/modules/programs/less/less-with-custom-keys.nix +++ b/tests/modules/programs/less/less-with-custom-keys.nix @@ -15,8 +15,8 @@ with lib; test.stubs.less = { }; nmt.script = '' - assertFileExists home-files/.lesskey - assertFileContent home-files/.lesskey ${ + assertFileExists home-files/.config/lesskey + assertFileContent home-files/.config/lesskey ${ builtins.toFile "less.expected" '' s back-line t forw-line