Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

21.05 nixos-install process does not work with environment.systemPackages #125860

Closed
samuela opened this issue Jun 5, 2021 · 10 comments
Closed
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Comments

@samuela
Copy link
Member

samuela commented Jun 5, 2021

Describe the bug
https://github.com/samuela/nixos-up is a simple, completely automated install process for NixOS. The process works wonderfully with the 20.09 installer ISO, but something in the 21.05 ISO has broken it as reported here (samuela/nixos-up#9). I've also been able to reproduce the issue.

I've consulted the NixOS manual, and the installation instructions do not seem to have changed between versions, which suggests to me that this is a regression.

To Reproduce
Either via nixos-up:

  1. Set up a new virtual machine (both VMWare Fusion and VirtualBox are confirmed to have the issue)
  2. Insert the 21.05 minimal installer ISO into the virtual CD drive.
  3. Boot into the installer.
  4. Run sudo nix-shell https://github.com/samuela/nixos-up/archive/main.tar.gz.
  5. Note that the nixos-install step fails.

Alternatively,

  1. Create GPT partition table: parted /dev/XXX -- mklabel gpt
  2. Create boot partition with first 512MiB: parted /dev/XXX -- mkpart ESP fat32 1MiB 512MiB
  3. Set the partition as bootable: parted /dev/XXX -- set 1 esp on
  4. Create root partition after the boot partition: parted /dev/XXX -- mkpart primary 512MiB 100%
  5. Format boot partition: mkfs.fat -F 32 -n boot /dev/XXX1
  6. Format root partition: mkfs.ext4 -L nixos /dev/XXX2
  7. mount /dev/disk/by-label/nixos /mnt
  8. mkdir -p /mnt/boot
  9. mount /dev/disk/by-label/boot /mnt/boot
  10. nixos-generate-config --root /mnt
  11. nixos-install --no-root-passwd

Expected behavior
The install to be successful.

Screenshots
https://user-images.githubusercontent.com/10327/120901852-14673e00-c5f2-11eb-845f-2ad18ec268ef.png

Additional context
Add any other context about the problem here.

Notify maintainers

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@samuela samuela added the 0.kind: bug Something is broken label Jun 5, 2021
@samuela
Copy link
Member Author

samuela commented Jun 5, 2021

Update: I've narrowed it down to the following line of /mnt/etc/nixos/configuration.nix:

environment.systemPackages = with pkgs; [ home-manager ];

Without this one line everything builds fine, with it nixos-install fails. But this seems like an entirely innocuous setting. Why would this brick the build?

@samuela samuela changed the title nixos-install process does not work in 21.05 minimal installer 21.05 nixos-install process does not work with environment.systemPackages Jun 5, 2021
@mudrii
Copy link
Contributor

mudrii commented Jun 6, 2021

I am not 100% sure but before running nixos-install try to refresh channel nix-channel --update

@samuela
Copy link
Member Author

samuela commented Jun 6, 2021

Unfortunately that doesn't make a difference for me. I ran nix-channel --update and sudo nix-channel --update, but nixos-install is still failing in the same way.

@samuela
Copy link
Member Author

samuela commented Jun 6, 2021

Oddly enough, nix-env -iA nixos.home-manager runs without issue when booting from the ISO.

@gcv
Copy link
Contributor

gcv commented Jun 6, 2021

Home-manager breaks when installed in any way other than with its own dedicated channel. I just ran into this problem: nix-community/home-manager#1267

Could it be related?

@samuela
Copy link
Member Author

samuela commented Jun 7, 2021

Interesting, I'm not sure if that's related but it is at least another data point to suggest that nixos-up should install home-manager some other way. I'm a bit concerned that home-manger is pushing so many people towards the channel installation. My understanding is that channels are known to be suboptimal and are on the way out. I wish it wasn't the recommended home-manager installation method.

@samuela
Copy link
Member Author

samuela commented Jun 16, 2021

Possible dup of #126141.

@gcv
Copy link
Contributor

gcv commented Jun 16, 2021

Possibly-related Discourse link: https://discourse.nixos.org/t/21-05-not-installing/13547

@veprbl veprbl added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Jun 18, 2021
@stale
Copy link

stale bot commented May 2, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 2, 2022
@Artturin
Copy link
Member

nix has been updated for a long time

@Artturin Artturin closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
None yet
Development

No branches or pull requests

5 participants