nix-community / nixbox

NixOS Vagrant boxes [maintainer=@ifurther]
https://app.vagrantup.com/nixbox/
MIT License
309 stars 101 forks source link

PostInstallation script #44

Closed PierreR closed 5 years ago

PierreR commented 5 years ago

@zimbatm would you mind explaining this line to me ?

Are you sure the postinstall.sh script is executed ?

Here is my output:

    vmware-iso: building the configuration in /mnt/etc/nixos/configuration.nix...
    vmware-iso: copying channel...
    vmware-iso: installing the boot loader...
==> vmware-iso: setting up /etc...
==> vmware-iso: updating GRUB 2 menu...
==> vmware-iso: installing the GRUB 2 boot loader on /dev/sda...
==> vmware-iso: Installing for i386-pc platform.
==> vmware-iso: Installation finished. No error reported.
    vmware-iso: installation finished!
    vmware-iso: building the configuration in /mnt/etc/nixos/configuration.nix...
==> vmware-iso:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
==> vmware-iso:                                  Dload  Upload   Total   Spent    Left  Speed
==> vmware-iso: 100   618  100   618    0     0  18176      0 --:--:-- --:--:-- --:--:-- 18176
    vmware-iso: copying channel...
    vmware-iso: installing the boot loader...
==> vmware-iso: setting up /etc...
==> vmware-iso: updating GRUB 2 menu...
==> vmware-iso: installing the GRUB 2 boot loader on /dev/sda...
==> vmware-iso: Installing for i386-pc platform.
==> vmware-iso: Installation finished. No error reported.
    vmware-iso: installation finished!

The installer is running twice. Is this intended ?

Thx

PierreR commented 5 years ago

If I replace the line with

curl "$packer_http/postinstall.sh" | sh

Then I see the postinstall script output.

zimbatm commented 5 years ago

The script is supposed to be executed within the nixos chroot. It's possible that the fix here didn't do what was intended: https://github.com/nix-community/nixbox/commit/ba8b646ada9fae88c188e05e49b310cf4c7d9065

PierreR commented 5 years ago

Just submit a fix. I guess this needs to be nix-enter. See https://github.com/NixOS/nixpkgs/issues/34033

zimbatm commented 5 years ago

yeah good call, looks like curl "$packer_http/postinstall.sh" | nixos-enter should do the trick.