nixpkgs icon indicating copy to clipboard operation
nixpkgs copied to clipboard

nixos: Support fileSystems.<name>.depends with fstab-generator

Open ElvishJerricco opened this issue 2 years ago • 2 comments

Description of changes

I have barely tested this, so I'm not entirely sure it's correct. Closes #217179

Things done
  • Built on platform(s)
    • [x] x86_64-linux
    • [ ] aarch64-linux
    • [ ] x86_64-darwin
    • [ ] aarch64-darwin
  • [ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • [x] 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.

ElvishJerricco avatar May 23 '23 23:05 ElvishJerricco

This would fix #217179

ElvishJerricco avatar May 29 '23 16:05 ElvishJerricco

@nikstur I updated this with a little bit of tweaking to the overlay fs stuff. The depends functionality should be the same on systemd initrd, with slightly better behavior in scripted initrd. While testing with scripted, I noticed it doesn't work with the ro overlays, so I just added an assertion to disallow that, rather than trying to implement it.

(I also nixfmt'd some of this, so forgive the reformatting).

ElvishJerricco avatar Aug 27 '24 20:08 ElvishJerricco

I'll note that ofBorg is unhappy for the same reason that I created https://github.com/NixOS/nixpkgs/pull/320846: the value of the message depends on the assertion failing, and as written it doesn't protect against that being so.

philiptaron avatar Aug 30 '24 18:08 philiptaron

the value of the message depends on the assertion failing, and as written it doesn't protect against that being so.

@philiptaron No, that's not what's causing ofborg to fail. I apparently committed the assertion without testing that it works correctly. It should be fs.overlay.upperdir, not fs.upperdir. My bad. The message only depends on fs.mountPoint, which should always exist.

ElvishJerricco avatar Aug 30 '24 18:08 ElvishJerricco