]> git.scottworley.com Git - warn-nixpkgs/commitdiff
Help get-version-suffix find itself master
authorScott Worley <scottworley@scottworley.com>
Mon, 23 Aug 2021 20:17:45 +0000 (13:17 -0700)
committerScott Worley <scottworley@scottworley.com>
Mon, 23 Aug 2021 20:17:45 +0000 (13:17 -0700)
get-version-suffix assumes that nixpkgs is always installed at <nixpkgs>.
This is not true when using a nixpkgs wrapper, such as this warn-nixpkgs.

nixos/modules/installer/tools/get-version-suffix

index fceb513b17d9bb6a3737b0073a3e661a3d945dd2..9b73e1efdb59e1213ef2605f98114209417c1744 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
-echo "warning: Using legacy channel get-version-suffix from `nix-instantiate --find-file nixpkgs-warned "$@"`/nixos/modules/installer/tools/get-version-suffix" >&2
+warn_nixpkgs_actual_nixpkgs_path="`nix-instantiate --find-file nixpkgs-warned "$@"`"
 
-/bin/sh `nix-instantiate --find-file nixpkgs-warned "$@"`/nixos/modules/installer/tools/get-version-suffix "$@"
+echo "warning: Using legacy channel get-version-suffix from $warn_nixpkgs_actual_nixpkgs_path/nixos/modules/installer/tools/get-version-suffix" >&2
+
+/bin/sh "$warn_nixpkgs_actual_nixpkgs_path/nixos/modules/installer/tools/get-version-suffix" -I nixpkgs="$warn_nixpkgs_actual_nixpkgs_path" "$@"