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

nixos-rebuild-ng: implement build-image #371142

Merged
merged 4 commits into from
Jan 9, 2025

Conversation

thiagokokada
Copy link
Contributor

Port of #347275 to nixos-rebuild-ng.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Jan 5, 2025
@thiagokokada
Copy link
Contributor Author

CC @phaer.

@thiagokokada thiagokokada force-pushed the implement-build-image-ng branch 2 times, most recently from d176773 to 639a5a0 Compare January 5, 2025 16:40
@thiagokokada thiagokokada force-pushed the implement-build-image-ng branch from 639a5a0 to b747c67 Compare January 5, 2025 16:43
Copy link
Member

@phaer phaer left a comment

Choose a reason for hiding this comment

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

Very nice! Was planning to implement this next week and there it is - with tests and all, thank you! 🎉

Code LGTM - but i haven't run anything yet, but can do so tomorrow or on Tuesday.

(build-image will become much more useful once #359345 is merged in case you or other readers have time for a review)

@thiagokokada
Copy link
Contributor Author

Very nice! Was planning to implement this next week and there it is - with tests and all, thank you! 🎉

Code LGTM - but i haven't run anything yet, but can do so tomorrow or on Tuesday.

(build-image will become much more useful once #359345 is merged in case you or other readers have time for a review)

I would appreciate the testing, especially if you can test the non-Flakes code path since I have no systems to test it.

@phaer
Copy link
Member

phaer commented Jan 9, 2025

Successfully built images with this :)

I would appreciate the testing, especially if you can test the non-Flakes code path since I have no systems to test it.

For a simple test of the CLI, I think it's enough do to that with a minimal nixos instance? i.e. with file.nix being

{
  pkgs ? import <nixpkgs> { },
}:
pkgs.nixos {
  system.stateVersion = "25.05";
}

You could test the --file param with i.e.:
nixos-rebuild-ng build-image --image-variant lxc --file file.nix

And given an attrs.nix defined as

{
  host = import ./file.nix { };
}

You could then do nixos-rebuild-ng build-image --image-variant lxc --file attrs.nix --attr host.

@thiagokokada thiagokokada merged commit e0d9824 into NixOS:master Jan 9, 2025
24 of 27 checks passed
@thiagokokada thiagokokada deleted the implement-build-image-ng branch January 9, 2025 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants