feat(filesystems/swap): add discardPolicy, finit-managed randomEncryption, and boot.resumeDevice#125
Open
FixeQD wants to merge 4 commits into
Open
feat(filesystems/swap): add discardPolicy, finit-managed randomEncryption, and boot.resumeDevice#125FixeQD wants to merge 4 commits into
FixeQD wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ports several NixOS swap/hibernation-related options into finix, adapting them to finix’s finit-based boot architecture (including imperative swap setup for random-encrypted swap).
Changes:
- Add
swapDevices.*.discardPolicyand map it to swap options (discard,discard=once|pages). - Add
swapDevices.*.randomEncryptionand create finit-managed encrypted swap tasks instead of generating static/etc/fstabswap entries. - Add
boot.resumeDeviceand injectresume=<device>intoboot.kernelParams.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| modules/filesystems/options.nix | Adds new swap options (discardPolicy, randomEncryption) to the swap device option schema. |
| modules/filesystems/default.nix | Implements discard policy mapping and adds finit tasks + assertions for random-encrypted swap handling. |
| modules/boot/kernel.nix | Introduces boot.resumeDevice and conditionally adds resume= to the kernel cmdline. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…s usage fix(filesystems): simplify comment on randomEncryption swap entries and escape shell arguments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ported standard NixOS swap and hibernation options to work seamlessly within the finix architecture, replacing systemd components with native finit configuration
Changes:
swapDevices.*.discardPolicyoption (once,pages,both), mapping it correctly to standard swap mount options/etc/fstablines, encrypted swaps are now generated imperatively via dedicated stage-1finit.tasks. The tasks execute a lightweight script shell sequence on every boot.Added an assertion to ensure these devices use stable persistent paths rather than volatile labels or UUIDsboot.resumeDeviceoption to inject theresume=string intoboot.kernelParams