Re: [Nix-dev] [PATCH 1/2] nixos-install: Fix password prompt failing outside NixOS.
Well, on github we have travis, and line comments, and bug references etc. It's just nicer, and I haven't seen many patches come in via ML (this was the first I noticed) so I didn't really have a workflow ready... On Tue, Apr 28, 2015 at 12:40 PM Shea Levy s...@shealevy.com wrote: As long as I’ve been around we’ve also accepted patches via ML, why not? On Apr 28, 2015, at 2:34 AM, Wout Mertens wout.mert...@gmail.com wrote: These patches look useful, but normally we work via github... On Tue, Apr 28, 2015, 4:17 AM Jookia 166...@gmail.com wrote: When bootstrapping from other distributions, nixos-install is unable to find various tools in the chroot since their paths aren't aware of NixOS conventions. This makes a small change to existing code by specifying nixpkgs/nixos instead of just nixos when running nix-instantiate in the chroot. I haven't tested this outside of bootstrapping, but the same specification is used elsewhere in the code so I don't see why it wouldn't work. --- nixos/modules/installer/tools/nixos-install.sh | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh index 14ae3da..86e57f7 100644 --- a/nixos/modules/installer/tools/nixos-install.sh +++ b/nixos/modules/installer/tools/nixos-install.sh @@ -254,8 +254,14 @@ NIXOS_INSTALL_GRUB=1 chroot $mountPoint \ chroot $mountPoint /nix/var/nix/profiles/system/activate +# Some systems may not be prepared to use NixOS' paths. +export PATH=/run/current-system/sw/bin:/run/current-system/sw/sbin:$PATH +export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs +export NIX_PATH=$NIX_PATH:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels + + # Ask the user to set a root password. -if [ $(chroot $mountPoint nix-instantiate --eval 'nixos' -A config.users.mutableUsers) = true ] [ -t 0 ] ; then +if [ $(chroot $mountPoint nix-instantiate --eval 'nixpkgs/nixos' -A config.users.mutableUsers) = true ] [ -t 1 ] ; then echo setting root password... chroot $mountPoint /var/setuid-wrappers/passwd fi -- 2.3.6 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] [PATCH 1/2] nixos-install: Fix password prompt failing outside NixOS.
These patches look useful, but normally we work via github... On Tue, Apr 28, 2015, 4:17 AM Jookia 166...@gmail.com wrote: When bootstrapping from other distributions, nixos-install is unable to find various tools in the chroot since their paths aren't aware of NixOS conventions. This makes a small change to existing code by specifying nixpkgs/nixos instead of just nixos when running nix-instantiate in the chroot. I haven't tested this outside of bootstrapping, but the same specification is used elsewhere in the code so I don't see why it wouldn't work. --- nixos/modules/installer/tools/nixos-install.sh | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh index 14ae3da..86e57f7 100644 --- a/nixos/modules/installer/tools/nixos-install.sh +++ b/nixos/modules/installer/tools/nixos-install.sh @@ -254,8 +254,14 @@ NIXOS_INSTALL_GRUB=1 chroot $mountPoint \ chroot $mountPoint /nix/var/nix/profiles/system/activate +# Some systems may not be prepared to use NixOS' paths. +export PATH=/run/current-system/sw/bin:/run/current-system/sw/sbin:$PATH +export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs +export NIX_PATH=$NIX_PATH:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels + + # Ask the user to set a root password. -if [ $(chroot $mountPoint nix-instantiate --eval 'nixos' -A config.users.mutableUsers) = true ] [ -t 0 ] ; then +if [ $(chroot $mountPoint nix-instantiate --eval 'nixpkgs/nixos' -A config.users.mutableUsers) = true ] [ -t 1 ] ; then echo setting root password... chroot $mountPoint /var/setuid-wrappers/passwd fi -- 2.3.6 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] [PATCH 1/2] nixos-install: Fix password prompt failing outside NixOS.
Applied in 7b37a5f168706db5efa33599354f5c1967ac4c51, thanks! On Apr 27, 2015, at 10:16 PM, Jookia 166...@gmail.com wrote: When bootstrapping from other distributions, nixos-install is unable to find various tools in the chroot since their paths aren't aware of NixOS conventions. This makes a small change to existing code by specifying nixpkgs/nixos instead of just nixos when running nix-instantiate in the chroot. I haven't tested this outside of bootstrapping, but the same specification is used elsewhere in the code so I don't see why it wouldn't work. --- nixos/modules/installer/tools/nixos-install.sh | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh index 14ae3da..86e57f7 100644 --- a/nixos/modules/installer/tools/nixos-install.sh +++ b/nixos/modules/installer/tools/nixos-install.sh @@ -254,8 +254,14 @@ NIXOS_INSTALL_GRUB=1 chroot $mountPoint \ chroot $mountPoint /nix/var/nix/profiles/system/activate +# Some systems may not be prepared to use NixOS' paths. +export PATH=/run/current-system/sw/bin:/run/current-system/sw/sbin:$PATH +export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs +export NIX_PATH=$NIX_PATH:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels + + # Ask the user to set a root password. -if [ $(chroot $mountPoint nix-instantiate --eval 'nixos' -A config.users.mutableUsers) = true ] [ -t 0 ] ; then +if [ $(chroot $mountPoint nix-instantiate --eval 'nixpkgs/nixos' -A config.users.mutableUsers) = true ] [ -t 1 ] ; then echo setting root password... chroot $mountPoint /var/setuid-wrappers/passwd fi -- 2.3.6 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] [PATCH 1/2] nixos-install: Fix password prompt failing outside NixOS.
As long as I’ve been around we’ve also accepted patches via ML, why not? On Apr 28, 2015, at 2:34 AM, Wout Mertens wout.mert...@gmail.com wrote: These patches look useful, but normally we work via github... On Tue, Apr 28, 2015, 4:17 AM Jookia 166...@gmail.com wrote: When bootstrapping from other distributions, nixos-install is unable to find various tools in the chroot since their paths aren't aware of NixOS conventions. This makes a small change to existing code by specifying nixpkgs/nixos instead of just nixos when running nix-instantiate in the chroot. I haven't tested this outside of bootstrapping, but the same specification is used elsewhere in the code so I don't see why it wouldn't work. --- nixos/modules/installer/tools/nixos-install.sh | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh index 14ae3da..86e57f7 100644 --- a/nixos/modules/installer/tools/nixos-install.sh +++ b/nixos/modules/installer/tools/nixos-install.sh @@ -254,8 +254,14 @@ NIXOS_INSTALL_GRUB=1 chroot $mountPoint \ chroot $mountPoint /nix/var/nix/profiles/system/activate +# Some systems may not be prepared to use NixOS' paths. +export PATH=/run/current-system/sw/bin:/run/current-system/sw/sbin:$PATH +export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs +export NIX_PATH=$NIX_PATH:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels + + # Ask the user to set a root password. -if [ $(chroot $mountPoint nix-instantiate --eval 'nixos' -A config.users.mutableUsers) = true ] [ -t 0 ] ; then +if [ $(chroot $mountPoint nix-instantiate --eval 'nixpkgs/nixos' -A config.users.mutableUsers) = true ] [ -t 1 ] ; then echo setting root password... chroot $mountPoint /var/setuid-wrappers/passwd fi -- 2.3.6 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] [PATCH 1/2] nixos-install: Fix password prompt failing outside NixOS.
When bootstrapping from other distributions, nixos-install is unable to find various tools in the chroot since their paths aren't aware of NixOS conventions. This makes a small change to existing code by specifying nixpkgs/nixos instead of just nixos when running nix-instantiate in the chroot. I haven't tested this outside of bootstrapping, but the same specification is used elsewhere in the code so I don't see why it wouldn't work. --- nixos/modules/installer/tools/nixos-install.sh | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh index 14ae3da..86e57f7 100644 --- a/nixos/modules/installer/tools/nixos-install.sh +++ b/nixos/modules/installer/tools/nixos-install.sh @@ -254,8 +254,14 @@ NIXOS_INSTALL_GRUB=1 chroot $mountPoint \ chroot $mountPoint /nix/var/nix/profiles/system/activate +# Some systems may not be prepared to use NixOS' paths. +export PATH=/run/current-system/sw/bin:/run/current-system/sw/sbin:$PATH +export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs +export NIX_PATH=$NIX_PATH:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels + + # Ask the user to set a root password. -if [ $(chroot $mountPoint nix-instantiate --eval 'nixos' -A config.users.mutableUsers) = true ] [ -t 0 ] ; then +if [ $(chroot $mountPoint nix-instantiate --eval 'nixpkgs/nixos' -A config.users.mutableUsers) = true ] [ -t 1 ] ; then echo setting root password... chroot $mountPoint /var/setuid-wrappers/passwd fi -- 2.3.6 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev