-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
nixos/swapspace: init module #348588
nixos/swapspace: init module #348588
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This already looks very good and I only have a couple small improvement suggestions.
There was a previous attempt in #88093 but the original author seems to have lost interest. |
c8a1ea3
to
24fb007
Compare
24fb007
to
60fb16b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think extraArgs
should be a list of strings instead of a single string. This seems to be what most NixOS modules do. It allows setting different options in different places without overriding previous ones.
12b3126
to
5a51815
Compare
Your latest changes removed
While it is true, that those changes are in the upstream unit config and thus will be readable by systemd, the same is not true for Nix itself. Nix can't read the upstream unit config during evaluation. Having information such as |
13a56c1
to
8a0eb6e
Compare
Sorry for the force push spam, I have another branch in my fork to test with my system flake, mistakenly pushed to this a few times before testing. I've re-added those I've removed, and also fixed |
8a0eb6e
to
46b7f3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good. There is one small non-blocking nit-pick that can be safely ignored.
No worries.
Good catch! I forgot that this was needed. |
I just had a look at the source, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't run the module, but the diff LGTM.
@phanirithvij maybe a nixos VM test would be useful? To check that everything starts correctly. |
b604675
to
8b294f1
Compare
@ofborg test swapspace |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Signed-off-by: phanirithvij <phanirithvij2000@gmail.com> Co-authored-by: Luflosi <luflosi@luflosi.de>
Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
8b294f1
to
e4c898c
Compare
@ofborg test swapspace |
Tested locally tons of times nix-build -A nixosTests.swapspace; for i in {1..100}; do echo $i > run; nix-build -A nixosTests.swapspace --check || break; done It is not flaky anymore on my x86_64-linux. And runs on aarch64-linux, So it is good to go. The test can be improved later. I've tried for a while to simplify the test but it was getting killed randomly due to oom (very flaky). Requesting review again @r-vdp @Luflosi @Pandapip1 |
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-24.05
git worktree add -d .worktree/backport-348588-to-release-24.05 origin/release-24.05
cd .worktree/backport-348588-to-release-24.05
git switch --create backport-348588-to-release-24.05
git cherry-pick -x 80ea320fe72bd16d9add8a34a6b6aa3880bb9f58 e4c898c8071c5333cc283620dd14a5638a09957e |
Adds a swapspace nixos module.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)cc @Luflosi