Skip to content

nixos/lib/make-disk-image: introduce noNixStore option#227883

Draft
RaitoBezarius wants to merge 1 commit intomasterfrom
make-disk-image/no-nix-store
Draft

nixos/lib/make-disk-image: introduce noNixStore option#227883
RaitoBezarius wants to merge 1 commit intomasterfrom
make-disk-image/no-nix-store

Conversation

@RaitoBezarius
Copy link
Member

Description of changes

Sometimes, we want to use the host nix store for everything because it's more convenient.

To do so, we need to "not install" the nix store in the target disk image.

We trick nixos-install by mount binding the host nix store into the $root/nix folder and letting Nix do the idempotency thing.

It's unfinished : the mount is visible only *inside the namespace, we run nixos-install outside of it.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.05 Release Notes (or backporting 22.11 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.

Sometimes, we want to use the host nix store for everything because it's
more convenient.

To do so, we need to "not install" the nix store in the target disk
image.

We trick nixos-install by mount binding the host nix store into the
$root/nix folder and letting Nix do the idempotency thing.
@github-actions github-actions bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Apr 23, 2023
@ofborg ofborg bot added 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 23, 2023
@RaitoBezarius RaitoBezarius mentioned this pull request Jun 10, 2023
12 tasks
@wegank wegank added 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 2.status: merge conflict This PR has merge conflicts with the target branch labels Mar 19, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 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 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

Development

Successfully merging this pull request may close these issues.

2 participants