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.
#!/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" "$@"