-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
luaPackages.vicious: Missing Dependencies #158245
Comments
thanks for your bug report, is adding |
@makefu before adding I'm using the latest NixOS, and there is a problem currently with However, I understand that you cannot just add the change without verifying that it works. I can wait until I get the fix for |
I feel In this case maybe just list |
@yipengsun I was trying to explain why we need to add all the dependencies, but I just noticed that you are a contributor! I cannot believe that a contributor to Also, you don't have to get an extra copy, but even if you do, it's not a big deal, it's not like |
OK, I guess maybe I should say, @AmeerTaweel Is that a reasonable compromise? Edit: Not can be, is |
Well, |
Question: |
@yipengsun I started using Nix/NixOS just two weeks ago, so I have no idea how to write package definitions in such a way that makes them customizable by the user. So I don't know how it's done technically, but I kinda agree with you. Most users don't use all of the widgets offered by |
If { pkgs, ... }:
# pretend viciousFake is just a regular package
let
viciousFakeWrapped = pkgs.symlinkJoin {
name = "vicious-wrapped";
paths = [ pkgs.awesome pkgs.viciousFake pkgs.alsa-utils ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
for prog in awesome; do
wrapProgram "$out/bin/$prog" --set PATH "$out/bin"
done
'';
};
in
{
environment.systemPackages = [ viciousFakeWrapped ];
} But I don't think that works in this case (you can always wrap For me, I also use final: prev: {
lua5_3 = prev.lua5_3.override {
packageOverrides = luafinal: luaprev: {
lain = luaprev.toLuaModule (prev.stdenv.mkDerivation {
pname = "lain";
version = "unstable-20210925";
src = prev.fetchFromGitHub {
owner = "lcpz";
repo = "lain";
rev = "4933d6";
sha256 = "NPXsgKcOGp4yDvbv/vouCpDhrEcmXsM2I1IUkDadgjw=";
};
buildInputs = [ luaprev.lua ];
installPhase = ''
mkdir -p $out/lib/lua/${luaprev.lua.luaversion}/
cp -r . $out/lib/lua/${luaprev.lua.luaversion}/lain/
printf "package.path = '$out/lib/lua/${luaprev.lua.luaversion}/?/init.lua;' .. package.path\nreturn require((...) .. '.init')\n" > $out/lib/lua/${luaprev.lua.luaversion}/lain.lua
'';
});
};
};
} But I'm sure how to add these optional dependencies (like (The idea is: I want to get updates from |
Actually, toLuaModule = drv:
drv.overrideAttrs( oldAttrs: {
# Use passthru in order to prevent rebuilds when possible.
passthru = (oldAttrs.passthru or {}) // {
luaModule = lua;
requiredLuaModules = requiredLuaModules drv.propagatedBuildInputs;
};
}); So can we extend that to something like: toLuaModule = drv: attrs: ? {} {
# ...
} So we can optionally override the inputs to |
This reasoning isn't sound, it only makes sense if most people use most of the widgets. E.g. cmus and notmuch would be unnecessarily pulled. Since Vicious is a Lua module, build time is marginal, I strongly suggest disabling optional dependencies by default. |
For now, I think the problem is: We can't specify optional dependencies for By easy, I mean something like this: final: prev: {
lua5_3 = prev.lua5_3.override {
packageOverrides = luafinal: luaprev: {
vicious = luaprev.toLuaModule prev.lua5_3.packages.vicious {
enableAlsaUtils = false;
enableCmus = true;
enableNotmuch = true;
};
};
};
} In this case I'd say some of the optional dependencies can be on by default, like |
Totally makes sense. I also agree. |
@makefu now that the fix has been merged, I updated my flake, and indeed adding |
Describe the bug
Vicious is a widget library, and some of its widgets have dependencies on other programs to work. None of these dependencies are specified in the current package definition. Personally, I use the volume widget, which depends on
alsa-utils
. The widget, of course, does not work becausealsa-utils
is not specified as a runtime dependency.Steps To Reproduce
luaPackages.vicious
as a Lua module for AwesomeWM:xsession.windowManager.awesome.luaModules = [ pkgs.luaPackages.vicious ]
Expected behavior
The volume widget (and other widgets) should have their dependencies declared, and work properly.
Notify maintainers
@makefu
@Mic92
Metadata
The text was updated successfully, but these errors were encountered: