Trying to use qtgreet but not building. It is from someones flake they share there .nix files

programs.qtgreet = { package = fPkgs.qtgreet; enable = true; };
but I am getting this:
`457| */
458| isFunction = f: builtins.isFunction f ||
| ^
459| (f ? __functor && isFunction (f.__functor f));

   error: undefined variable 'fPkgs'

   at /nix/store/gcar2wcwnyxpyj0sm4v1zz5dkki2pr29-source/configuration.nix:211:15:

      210|   programs.qtgreet = {
      211|     package = fPkgs.qtgreet;
         |               ^
      212|     enable = true;`

My .nix files:
configuration.nix
My qtgreet nix file
flake.nix
home.nix

Oh, funny to see my code. As qtgreet is not in nixpkgs, the revision you have picked should also contain a qtgreet package in the package folder.
fPkgs was an custom argument and stands for flakePackages. It’s passing all packages from the flake itself. Depending how you feed your custom packages to the config you have to adapt.

In case you need more input, let me know.

Edit: double hint, at the very end I did not continue using qtgreet, as gtreetd wasn’t able to unlock my wallet without more tweaking and I just wanted to try it out, so not sure if everything is working fine.

1 Like

Yeah, instead of using fPkgs you need something like:

programs.qtgreet = {
  package = inputs.shawn-config.packages.${pkgs.system}.qtgreet;
  enable = true;
};

Assuming you use specialArgs to pass in your flake inputs, and call the arg inputs.

That would not be necessary if @Shawn8901 set a default value for that package option, but this is a user config so you can’t really expect it to have a perfect API intended for third party use.

We are copying here a module that I used for 1 or 2 days and ditched it afterwards (so it’s since then no longer available on my flake, just if you browse the history or if you find other likes to historic files). Also nevertheless as qtgreet is not in nixpkgs, and the thread author is not using the flake but has copied the code, a default value would also not have helped, tho I agree with you, that for production ready modules it make sense to have proper default values.

Edit: assumingly this was the source for the Rev pick of my flake Package request: QtGreet · Issue #235232 · NixOS/nixpkgs · GitHub

2 Likes

Ah, right, completely ignore my comment then. Need to fix it downstream.

No blame on you at all for not having a default, by the way, as I say that’s not at all expected for a random personal repo. We should count ourselves lucky anyone has written a derivation for this, let alone a module.

1 Like