Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add Nix support #25

wants to merge 1 commit into from

Conversation

LorenzBischof
Copy link

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?

Copy link
Owner

@mafredri mafredri left a 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 Show resolved Hide resolved
flake.nix Outdated

hardeningDisable = [ "pic" "format" ];
# Install kmod for depmod dependency if we need it
#nativeBuildInputs = kernel.moduleBuildDependencies ++ [ kmod ];
Copy link
Owner

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?

Copy link
Author

@LorenzBischof LorenzBischof Oct 1, 2024

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.

Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Contributor

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)

Copy link
Author

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.

flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
@LorenzBischof
Copy link
Author

LorenzBischof commented Oct 1, 2024

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!

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants