home-manager: prioritize -I parameters

In 176e455 the order between the action of `-I` parameters getting
added to `EXTRA_NIX_PATH` and the action of a static path getting
added to `EXTRA_NIX_PATH` was reversed, also reversing the order of
`-I` parameters and the static `-I home-manager=...` leading to the
static `-I home-manager=...` to always come before any of the `-I`
parameters to later calls to Nix commands.

This made it impossible to override the static Home Manager path when
calling the home-manager tool with `-I home-manager=...`. This was
previously possible.

(cherry picked from commit edf9cf6523)
This commit is contained in:
Rosario Pulella 2023-06-16 19:18:26 -04:00 committed by Robert Helgesson
parent 61e5d1c38e
commit a8d549351d
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -883,7 +883,6 @@ COMMAND=""
COMMAND_ARGS=() COMMAND_ARGS=()
FLAKE_ARG="" FLAKE_ARG=""
setHomeManagerNixPath
setHomeManagerPathVariables setHomeManagerPathVariables
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
@ -979,6 +978,8 @@ while [[ $# -gt 0 ]]; do
esac esac
done done
setHomeManagerNixPath
if [[ -z $COMMAND ]]; then if [[ -z $COMMAND ]]; then
doHelp >&2 doHelp >&2
exit 1 exit 1