From 6500ce6442ad9d48bdb36734aa1b7725e3c23902 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Mon, 28 Sep 2026 10:57:35 +0100 Subject: [PATCH] nixos-version: escape specialisations and use kernel.modDirVersion if available --- nixos/modules/installer/tools/nixos-version.sh | 8 ++++---- nixos/modules/installer/tools/tools.nix | 12 +++++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/nixos/modules/installer/tools/nixos-version.sh b/nixos/modules/installer/tools/nixos-version.sh index c9ca4a634d82..a2aa76db9cd2 100644 --- a/nixos/modules/installer/tools/nixos-version.sh +++ b/nixos/modules/installer/tools/nixos-version.sh @@ -28,15 +28,15 @@ case "$1" in echo "@kernelVersion@" ;; --specialisations) - if [[ -z "@specialisations@" ]]; then + specialisations=@specialisations@ + if [[ -z "$specialisations" ]]; then echo "$0: no specialisations found" >&2 exit 1 - else - echo "@specialisations@" fi + printf '%s\n' "$specialisations" ;; --json) - cat <