frappix icon indicating copy to clipboard operation
frappix copied to clipboard

Missing `mkSiteAssets` attribute on `pkgs` in this scope.

Open kurogeek opened this issue 9 months ago • 2 comments

https://github.com/blaggacao/frappix/blob/1f2553179c06d3151f179caeba2db36913550ac6/src/nixos/main.nix#L248

Am I the only one experiencing this issue? I am using it on NixOS module. Below is my error.

       … while evaluating the attribute 'value'
         at /nix/store/4w6dn0aiyasb2dk8lr1fjj60d3hj82hr-source/lib/modules.nix:1083:7:
         1082|     // {
         1083|       value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |       ^
         1084|       inherit (res.defsFinal') highestPrio;

       … while evaluating the option `services.frappe.combinedAssets':

       … while evaluating the attribute 'mergedValue'
         at /nix/store/4w6dn0aiyasb2dk8lr1fjj60d3hj82hr-source/lib/modules.nix:1130:5:
         1129|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
         1130|     mergedValue =
             |     ^
         1131|       if isDefined then

       … while evaluating definitions from `/nix/store/jmznwkf19h2zas6agda5c17z8qgik2ny-incl/src/nixos/main.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'mkSiteAssets' missing
       at /nix/store/jmznwkf19h2zas6agda5c17z8qgik2ny-incl/src/nixos/main.nix:248:31:
          247|       # - preprocessed inputs
          248|       frappe.combinedAssets = pkgs.mkSiteAssets cfg.apps;
             |                               ^
          249|       frappe.penv = cfg.package.pythonModule.buildEnv.override {extraLibs = cfg.apps;};

kurogeek avatar May 15 '25 10:05 kurogeek

This means one way or another the overlay is not picked up.

Under normal conditions, the line that picks them up is this one: https://github.com/blaggacao/frappix/blob/main/examples%2Ftemplates%2Ffrappe%2Fapps%2Fpkgs.nix#L31

Which, under normal conditions is picked up by https://github.com/blaggacao/frappix/blob/main/examples%2Ftemplates%2Ffrappe%2Fflake.nix#L16

blaggacao avatar May 16 '25 07:05 blaggacao

What I do then is:

inherit (inputs.cells.apps) pkgs;

You may feel adventurous and use divnix/hive to load your modules, but only as sugar for structure and consistency, if you want.

blaggacao avatar May 16 '25 07:05 blaggacao

Thank you for your response.

This means one way or another the overlay is not picked up.

Yes, I was guessing that too.

I'm basically going to import this repo into my flake, since it offers nixosModule for Frappe and ERPNext services. Which I believe it is defined here: https://github.com/blaggacao/frappix/blob/1f2553179c06d3151f179caeba2db36913550ac6/src/nixos.nix#L4 . Regarding to the file I can see that the pkgs is coming from my inputs not from the overlays. Plus, I don't think this repo export overlayed pkgs (correct me if I'm wrong). And my goal is to combine this module with my nixosConfiguration of one of my machine to run Frappe/ERPNext.

I tried to hack it using cell.pkgs manually. But I bumped into another problem which cfg.combinedAssets is an empty attrs.

I can check out divnix/hive and see what it offers.

kurogeek avatar May 26 '25 09:05 kurogeek

You could have a look at https://github.com/blaggacao/frappix/blob/main/src%2Foverlays%2Fdefault.nix for rhe structure of overlays and https://github.com/blaggacao/frappix/blob/main/examples%2Ftemplates%2Ffrappe%2Fapps%2Fpkgs.nix to gain an idea on how to load them into your own pkgs.

blaggacao avatar May 27 '25 08:05 blaggacao