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

Fix formats/sd* #203

Closed
wants to merge 3 commits into from
Closed

Conversation

CollinDewey
Copy link
Contributor

During the movement of the nixpkgs module paths for sd*, more than just the cd-dvd -> sd-card was changed. As noted within the old nixpkgs module location, the intended change of location was sd-card/sd-image-aarch64-installer, rather than just a path change.

For the non installer version for sd-aarch64, I've updated the version here with the version from nixpkgs, minus the import of profiles/base.nix. This means that the images produced should work on the Pi 4 as well as the Pi 3. Although I have not personally tested on hardware. The removal of the CMA kernel param is deliberate, as 32M is too low for the Pi 4, and that it would need to be either upped to the default for the Pi 4 of 64M, or the option removed and let defaults take care of it.

More information about the motivation of these changes can be seen in this comment #168 (comment).

In regards to a bit of discussion, is it worth having our own copy of the nixpkgs version of sd-aarch64? The only difference I could really tell is that the version in nixos-generators doesn't include profiles/base. In my opinion there's not much of a need for profiles/base to be included, but does it hurt to do so? I'm pretty new to Nix so I'm not fully aware of its features, but as far as I understand it, I don't think there's a way to override what gets imported in an import.

@CollinDewey
Copy link
Contributor Author

Tested working on both the Pi 3 Model B and Pi 4 Model B 1GB.

@Mic92
Copy link
Member

Mic92 commented Jan 25, 2023

@LegitMagic I suspect that at some point in time there was no upstream support for the rpi in nixpkgs and hence it was copied here. However if it works we should just drop the duplicated code here and use nixpkgs has to offer if you can confirm it works.

};

in {
{
imports = [
"${toString modulesPath}/installer/sd-card/sd-image.nix"
Copy link
Member

@Mic92 Mic92 Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this would just work without us having to duplicate all the code below, than I am fine with that:

Suggested change
"${toString modulesPath}/installer/sd-card/sd-image.nix"
"${toString modulesPath}/installer/sd-card/sd-image-aarch64.nix"

Less code to maintain in nixos-generators. After all nixos-generators is just a cli to navigate all the images found in nixpkgs through a convenient, discoverable interface.

@CollinDewey
Copy link
Contributor Author

Should be good now

@Mic92
Copy link
Member

Mic92 commented Jan 25, 2023

bors merge

bors bot added a commit that referenced this pull request Jan 25, 2023
203: Fix formats/sd* r=Mic92 a=LegitMagic

During the [movement](NixOS/nixpkgs#110827) of the nixpkgs module paths for sd*, more than just the cd-dvd -> sd-card was changed. As noted within the [old nixpkgs module location](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix), the intended change of location was sd-card/sd-image-aarch64-installer, rather than just a path change.

For the non installer version for sd-aarch64, I've updated the version here with the version from nixpkgs, minus the import of profiles/base.nix. This means that the images produced should work on the Pi 4 as well as the Pi 3. Although I have not personally tested on hardware. The removal of the CMA kernel param is deliberate, as 32M is too low for the Pi 4, and that it would need to be either upped to the default for the Pi 4 of 64M, or the option removed and let defaults take care of it.

More information about the motivation of these changes can be seen in this comment #168 (comment).

In regards to a bit of discussion, is it worth having our own copy of the nixpkgs version of sd-aarch64? The only difference I could really tell is that the version in nixos-generators doesn't include profiles/base. In my opinion there's not much of a need for profiles/base to be included, but does it hurt to do so? I'm pretty new to Nix so I'm not fully aware of its features, but as far as I understand it, I don't think there's a way to override what gets imported in an import.

Co-authored-by: LegitMagic <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jan 25, 2023

Canceled.

@Mic92
Copy link
Member

Mic92 commented Jan 25, 2023

bors merge

bors bot added a commit that referenced this pull request Jan 25, 2023
203: Fix formats/sd* r=Mic92 a=LegitMagic



Co-authored-by: LegitMagic <[email protected]>
Co-authored-by: Jörg Thalheim <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jan 25, 2023

Build succeeded:

@Mic92
Copy link
Member

Mic92 commented Jan 25, 2023

Mhm. Look like it got merged but the pr was not closed: https://github.com/nix-community/nixos-generators/commits/master

@Mic92 Mic92 closed this Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants