-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add Nix support #25
base: main
Are you sure you want to change the base?
Add Nix support #25
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.
Hey, thanks for helping improve the project! I don't use Nix myself but happy to merge this if it makes peoples lives easier.
Some docs would be awesome too!
Is there a reason the full path was specified for the
install
binary?
Can't recall there being any specific reason, all good 👍🏻
flake.nix
Outdated
|
||
hardeningDisable = [ "pic" "format" ]; | ||
# Install kmod for depmod dependency if we need it | ||
#nativeBuildInputs = kernel.moduleBuildDependencies ++ [ kmod ]; |
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.
What's the motivation for leaving this commented? If it's a common-use case, is there a better way to support it?
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 noticed that depmod
is used in the Makefile
, but everything seems to work without. Is it OK, if I skip it? I didn't really understand its purpose.
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.
depmod
is required for modprobe
to work properly, I think it uses it to figure out what other modules to implicitly load, so it should be run after new modules have been installed.
It might have worked on your system without depmod by chance, but I wouldn't rely on that behavior.
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 will remove it, because it seems to work and I saw that line being disabled in other NixOS kernel modules. It probably works differently.
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'm not familiar with Nix, but this is surprising.
You may wanna ask other Nix developers/maintainers who may know about such things why it's not needed there (maybe Nix calls depmod or something equivalent automatically for kernel modules? Just a possible explanation, I really don't know)
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 asked and they said it is not required during build time.
Thank you for the awesome work! I have added some documentation. This is enough to get the basics working on NixOS. If other people start using it, we could consider adding more options to enhance its functionality and flexibility. Two things that come to mind are automatically disabling the blinking and adding an option to set the brightness. |
This change allows NixOS users to easily activate the asustor-platform-driver modules. Basically they only need to include the repository and set
hardware.asustor.enable = true
. I will also add some documentation if you are willing to merge this change.Is there a reason the full path was specified for the
install
binary?