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

image/images: init #359328

Merged
merged 2 commits into from
Nov 26, 2024
Merged

image/images: init #359328

merged 2 commits into from
Nov 26, 2024

Conversation

phaer
Copy link
Member

@phaer phaer commented Nov 26, 2024

This PR adds two new image-related modules:

  • nixos/modules/image/file-options.nix defines a re-usable set of options to handle image file names. It will be used in follow-up PRs to normalize the names of disk images generated in nixpkgs.

  • nixos/modules/image/images.nix adds two new options:

    • image.modules: An attrset mapping image variant names to a list of nixos
      modules to use when building such images.

    • system.build.images: An attrset mapping image variant names to a nixos instance
      based on the current config plus variant-specific modules (see
      image.modules above.

It does not contain any actual modules in images.modules yet, they will follow in upcoming PRs such as in #359339

It was split off #347275 in order to upstream that one in smaller chunks, easier to review, test and (hopefully not) revert.

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 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Nov 26, 2024
@phaer phaer force-pushed the virtualisation-images-phase-one branch from 176097d to 818d1c6 Compare November 26, 2024 16:52
Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

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

LGTM after indent fixes

nixos/modules/image/file-options.nix Outdated Show resolved Hide resolved
nixos/modules/image/file-options.nix Outdated Show resolved Hide resolved
A new NixOS module that adds two new options to `system.build`:

- imageModules: An attrset mapping image variant names to a list of nixos
  modules to use when building such images.

- images: An attrset mapping image variant names to a nixos instance
  based on the current config plus variant-specific modules (see
  `system.build.imageModules` above.
@phaer phaer force-pushed the virtualisation-images-phase-one branch from 818d1c6 to 08b9155 Compare November 26, 2024 18:05
@Mic92 Mic92 merged commit 43f6a89 into NixOS:master Nov 26, 2024
17 of 18 checks passed
@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Nov 27, 2024
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 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants