Skip to content

nixos/filesystems: init overlayfs#286176

Merged
lheckemann merged 3 commits intoNixOS:masterfrom
nikstur:writable-overlays
Feb 9, 2024
Merged

nixos/filesystems: init overlayfs#286176
lheckemann merged 3 commits intoNixOS:masterfrom
nikstur:writable-overlays

Conversation

@nikstur
Copy link
Copy Markdown
Contributor

@nikstur nikstur commented Feb 3, 2024

Description of changes

This adds an abstraction to conveniently create writable and read only overlays.

We use functionality like this in multiple places in Nixpkgs:

  • In qemu-vm.nix to mount the host nix store
  • In the ISO image to mount the nix store from a squashfs
  • In perlless activation to mount /etc

In further PRs we can replace all of these with the new abstraction. However, these require different levels of care to not break tests etc. so we shouldn't change them all at once.

Shoutout to @lheckemann for helping in the final stages of the design.

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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.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.

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: documentation This PR adds or changes documentation 8.has: changelog This PR adds or changes release notes 8.has: module (update) This PR changes an existing module in `nixos/` labels Feb 3, 2024
@ofborg ofborg bot added 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 Feb 3, 2024
Copy link
Copy Markdown
Contributor

@ElvishJerricco ElvishJerricco left a comment

Choose a reason for hiding this comment

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

This should be useful!

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 4, 2024
@nikstur
Copy link
Copy Markdown
Contributor Author

nikstur commented Feb 4, 2024

Added the overlay kmod in the initrd and changed wantedBy of the fs from default.target to local-fs.target.

@nikstur
Copy link
Copy Markdown
Contributor Author

nikstur commented Feb 4, 2024

@ofborg test filesystems-overlayfs

@delroth delroth removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 4, 2024
@Ma27
Copy link
Copy Markdown
Member

Ma27 commented Feb 4, 2024

A few minor notes, but other than that it looks nice 👍

@nikstur
Copy link
Copy Markdown
Contributor Author

nikstur commented Feb 7, 2024

@ofborg test filesystems-overlayfs

@nikstur
Copy link
Copy Markdown
Contributor Author

nikstur commented Feb 7, 2024

@ofborg test filesystems-overlayfs

@h7x4 h7x4 added 8.has: module (new) This PR adds a module in `nixos/` 8.has: tests This PR has tests labels Feb 8, 2024
@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 8, 2024
@lheckemann lheckemann merged commit 4916e22 into NixOS:master Feb 9, 2024
@lheckemann
Copy link
Copy Markdown
Member

See #287523 for the dependency issue

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: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: tests This PR has tests 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. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants