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
moolticute: init at 0.30.8 #54090
moolticute: init at 0.30.8 #54090
Conversation
meta = with stdenv.lib; { | ||
description = "Mooltipass crossplatform daemon/tools"; | ||
longDescription = '' | ||
This project aims to be an easy companion to your Mooltipass device and extend the power of the device to more platform/tools. With it you can manage your Mooltipass with a cross-platform app, as well as provide a daemon service that handle all USB communication with the device. |
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.
add some newlines, too long line
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.
fixed
meta = with stdenv.lib; { | ||
description = "Udev rules for mooltipass device"; | ||
longDescription = '' | ||
This project aims to be an easy companion to your Mooltipass device and extend the power of the device to more platform/tools. With it you can manage your Mooltipass with a cross-platform app, as well as provide a daemon service that handle all USB communication with the device. |
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.
too long as well
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.
fixed
version = "0.30.8"; | ||
|
||
src = fetchurl { | ||
url = "https://github.com/mooltipass/moolticute/archive/v${version}.tar.gz"; |
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.
Actually, I see this is same source as above. Why separate derivation then? Can't you install $out/lib/udev/rules.d/50-mooltipass.rules
in moolticute derivation
?
If it is really needed to have them separated, make separate output udev
and install rules there.
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 want moolticute GUI app can be installed for user (nix-env -i
) but the udev rules can't be per-user and they are installed into system (/etc/nixos/
). That's why I've followed the approach for rfkill / rfkill_udev which have separate derivations. Is there another way to reach the goal? I guess separate output doesn't solve that.
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.
There is no problem to have udev rules installed into user Nix profile. What is the problem with that? They are not used, but don't harm also.
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.
Surely, unused udev rules in user Nix profile are ok. The problem I tried to solve is how to install udev rules into the system if moolticute GUI app is in user Nix profile. My solution is to add services.udev.packages = [ moolticute_udev ]
to /etc/nixos/configuration.nix
. So the separate moolticute_udev doesn't depend on Qt and other GUI stuff not related with udev rules.
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.
ok then just install udev rules to separate output.
...
outputs = [ "out" "udev" ];
preInstall = ''
mkdir -p $udev/lib/udev/rules.d
sed -n '/^ \+cat > "$tmpfile" <<- EOF$/,/^EOF$/p' data/moolticute.sh | sed '1d;$d' \
> $udev/lib/udev/rules.d/50-mooltipass.rules
'';
...
Then you can set all-packages as:
moolticute = libsForQt5.callPackage ../applications/misc/moolticute { };
moolticute-udev = moolticute.udev; # or maybe just drop this?
Both moolticute
and moolticute.udev
should work as services.udev.packages
packages. The second one won't depend on Qt, you can check that yourself with nix-store -qR $(nix-build -A moolticute.udev)
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 tried to split outputs. The problems is nix-build -A moolticute.udev
fetches all the dependencies and builds binaries (although doesn't install them). That's why udev.nix
doesn't specify libusb1, qmake, etc. and why it has a line dontBuild = true
. Is it possible to specify different dependencies for multiple outputs? and to disable build step for one of them? I haven't found an answer in nixkpgs' manual.
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 is not a problem since the package will be fetched from binary cache most of the time and then only the dependencies required by the output will be needed.
|
||
buildInputs = [ libusb1 qtbase qtwebsockets ]; | ||
|
||
doCheck = true; |
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.
Isn't this a default?
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.
removed
@kirikaza I'll merge this when duplication is finally removed. The If you don't want to go with multiple outputs (even if this perfectly fine in this case, as I'll explain later), you can also define the package as:
As for dependencies and multiple outputs. Nix distinguishes (very rough) two sets of dependencies: build-time and run-time. Build-time are fetched and used when building derivation. Run-time are determined by Nix automagically (it greps every file in derivation for |
Thank you for good explanation. And sorry for not responding, I missed your answer. I'll upload the new version soon. |
@danbst ready for merge? |
Motivation for this change
I need Moolticute (https://github.com/mooltipass/moolticute/) on my laptop since I have Mooltipass device. I hope there are other people with Mooltipass and NixOS -- and they could use it :)
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
(no more packages depend on this change)./result/bin/
)nix path-info -S
before and after)