nixos/config/sysfs: init module#391329
Conversation
09c76cf to
c1a036b
Compare
|
The NixOS manual build failure appears to be unrelated to this change. I am able to build the manual locally without any issues: |
4919977 to
cd2a1b7
Compare
15061d8 to
8461f59
Compare
4f517c7 to
ebfe568
Compare
|
One issue here, is that a lot of sysfs paths depend on kernel modules being loaded, which may happen at a later time. I wonder if we'd want to support something like that? Currently the module in this PR will only work for sysfs paths that are present at the time systemd-tmpfiles runs. |
nixos/modules/config/sysfs.nix
Outdated
There was a problem hiding this comment.
types have descriptions? That's new to me.
There was a problem hiding this comment.
The description is usually generated automatically, but due to the nesting this would lead to an infinite recursion. I therefore override the description attribute and describe the type manually.
This description is included in the generated option documentation.
sysctl has the same problem. I usually work around it by loading the kernel module already in the initrd. |
Instead of relying on |
|
I tested enabling |
Did you mean "zswap"? That's a great news! |
|
It also works well configuring |
jopejoe1
left a comment
There was a problem hiding this comment.
This looks interesting, would be nice to get this merged.
b07085f to
1305aee
Compare
|
|
I think this has broken nixfmt formatting, because the treefmt job ran last before the nixfmt 1.0.0 bump. PRs are failing now. |
Fix in #432729. |
This module introduces a config option
boot.kernel.sysfs, which permits setting of sysfs parameters.The configuration option accepts a nested attribute set of sysfs path components with arbitrary values, for example:
The options will be applied through systemd path units watching the individual files or glob patterns and writing the configured value through a small service using systemd-tmpfiles once they exist.
The supplied NixOS test checks if configured parameters are actually applied.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.