I get this error when I callPackage my derivation of sddm-sugar-dark in my system packages list in configuration.nix and when I run nix-build -A sddm-sugar-dark in the root dir of my local nixpkgs repo.
error: Function called without required argument "mkDerivation" at /home/<user>/clonedrepos/nixpkgs/pkgs/data/themes/sddm-sugar-dark/default.nix:3
I don’t know if by “function called” it means the function that calls the derivation in all-packages.nix but my entry for sddm-sugar-dark in this file is just sddm-sugar-dark = callPackage ../data/themes/sddm-sugar-dark { };
The derivation was working until I added the qt deps specified in the sddm-sugar-dark gh repo:
Taking all your advice on board, I changed it to stdenv.mkDerivation and added wrapQtAppsHook to nativeBuildInputs, but now I’m getting:
error: Function called without required argument "qtgraphicaleffects" at /home/<user>/clonedrepos/nixpkgs/pkgs/data/themes/sddm-sugar-dark/default.nix:3
When I comment out qtgraphicaleffects in default.nix, I get a similar error:
error: Function called without required argument "qtquickcontrols2" at /home/<user>/clonedrepos/nixpkgs/pkgs/data/themes/sddm-sugar-dark/default.nix:4
EDIT: I’m looking through other derivations that use these qt packages. Eg. pineapple-pictures uses qtgraphicaleffects and also uses cmake as a nativeBuildInput. I don’t know what I’m doing so I tried including it in my derivation but to no effect. Including qtbase gets an error of a different sort:
error: Function called without required argument "qtbase" at /home/mips/clonedrepos/nixpkgs/pkgs/data/themes/sddm-sugar-dark/default.nix:3, did you mean "hbase", "qtpass" or "xbase"?
When I include libsForQt5 the derivation in my local nixpkgs repo builds correctly, thanks.
On my system, the rebuild is also successful but when I log out, I get the default SDDM theme with an error:
The current theme cannot be loaded due to the errors below, please select another theme.
file:///run/current-system/sw/share/sddm/themes/sugar-dark/Main.qml:28:1: module “QtGraphicalEffects” is not installed
It is though, and when I previously didn’t include the deps in the derivation but installed them separately along with the derivations, it worked fine.
sddm.nix (part of configuration.nix that has SDDM settings):