astro / nix-openwrt-imagebuilder

Build OpenWRT images in Nix derivations
MIT License
129 stars 16 forks source link

Unable to include some packages in build #25

Closed adamcstephens closed 1 year ago

adamcstephens commented 1 year ago

For example, I was trying to add luci but I receive an error:

warning: Git tree '/home/adam/projects/stop' is dirty
error: attribute 'luci' missing

       at /nix/store/v62n706ywrq2z8d60xm1n9l3ia2vfskw-source/files.nix:180:20:

          179|             with_new_dep = current_deps // { ${new_dep} = true; };
          180|             deps = packages.${new_dep}.depends;
             |                    ^
          181|           in
       Did you mean one of uci, auc, libuci, lua or luac?
⚠︎ Exited with 1 errors reported by nix at 22:05:51 after 7s

It looks like maybe luci is in a separate package list. Is that why this is failing?

astro commented 1 year ago

luci should be in the default package set of OpenWRT, no?

Could you perhaps share a minimal example that reproduces the problem? A lot of luci modules are in a separate package set that may or may not be included. :smile:

adamcstephens commented 1 year ago

Using the flake example in the README, with the following diff, will recreate the issue.

diff --git a/flake.nix b/flake.nix
index a8dcd75..30e5323 100644
--- a/flake.nix
+++ b/flake.nix
@@ -17,7 +17,7 @@
         // {
           # add package to include in the image, ie. packages that you don't
           # want to install manually later
-          packages = ["tcpdump"];
+          packages = ["luci" "tcpdump"];

           disabledServices = ["dnsmasq"];
astro commented 1 year ago

Ah right. I left out the luci packages feed because downloading the hashes takes quite a while already.

Now that there is demand, I am adding it.

adamcstephens commented 1 year ago

Thanks for the quick addition. Speaking of downloading the hashes, is it possible to just download the hashes for the relevant targets, rather than all of them? That would reduce the impact of adding the luci feeds.

astro commented 1 year ago

You can pass a customized feedsSha256 to builder.nix.