From a2cc7b0babaec66350a1f1e23db083c4c041de9a Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 8 Jan 2026 11:25:39 -0600 Subject: [PATCH] less: migrate to lib.cli.toCommandLineGNU Migrates from the deprecated toCommandLine to toCommandLineGNU. This changes the output format to use GNU-style options with equals (--wheel-lines=3). Both formats were verified to work correctly with less. Signed-off-by: Austin Horstman --- modules/programs/less.nix | 2 +- tests/modules/programs/less/correct-option-order.nix | 2 +- tests/modules/programs/less/custom-options-and-config.nix | 2 +- tests/modules/programs/less/custom-options.nix | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/programs/less.nix b/modules/programs/less.nix index 60a67e241..d0759577f 100644 --- a/modules/programs/less.nix +++ b/modules/programs/less.nix @@ -45,7 +45,7 @@ in ]; attrs = attrsOf (either scalar (listOf scalar)); in - coercedTo attrs (lib.cli.toGNUCommandLine { }) (listOf str); + coercedTo attrs (lib.cli.toCommandLineGNU { }) (listOf str); default = [ ]; description = "Options to be set via {env}`$LESS`."; example = { diff --git a/tests/modules/programs/less/correct-option-order.nix b/tests/modules/programs/less/correct-option-order.nix index 6376898d3..56eb7baaf 100644 --- a/tests/modules/programs/less/correct-option-order.nix +++ b/tests/modules/programs/less/correct-option-order.nix @@ -24,7 +24,7 @@ assertFileExists home-files/.config/lesskey assertFileContent home-files/.config/lesskey ${builtins.toFile "lesskey.expected" '' #env - LESS = --quiet --use-color --color HkK --color Mkb --prompt s%f + LESS = --quiet --use-color --color=HkK --color=Mkb --prompt=s%f ''} ''; } diff --git a/tests/modules/programs/less/custom-options-and-config.nix b/tests/modules/programs/less/custom-options-and-config.nix index 787c8473a..b301c995f 100644 --- a/tests/modules/programs/less/custom-options-and-config.nix +++ b/tests/modules/programs/less/custom-options-and-config.nix @@ -23,7 +23,7 @@ in assertFileExists home-files/.config/lesskey assertFileContent home-files/.config/lesskey ${builtins.toFile "less.expected" '' #env - LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines 3 --wheel-lines 1 + LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines=3 --wheel-lines=1 ${config}''} ''; diff --git a/tests/modules/programs/less/custom-options.nix b/tests/modules/programs/less/custom-options.nix index 81abfd963..1e4e3d389 100644 --- a/tests/modules/programs/less/custom-options.nix +++ b/tests/modules/programs/less/custom-options.nix @@ -15,7 +15,7 @@ assertFileExists home-files/.config/lesskey assertFileContent home-files/.config/lesskey ${builtins.toFile "lesskey.expected" '' #env - LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines 3 --wheel-lines 1 + LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines=3 --wheel-lines=1 ''} ''; }