pdtpartners / nix-snapshotter

Brings native understanding of Nix packages to containerd
MIT License
532 stars 15 forks source link

update modules to nixos 24.05 and k3s 1.30 #141

Closed yu-re-ka closed 4 weeks ago

bglgwyng commented 1 month ago

I encountered this error message.

error:
       … while calling the 'head' builtin

         at /nix/store/0jr2kk95c34c0b6yxi75q4fqgb43kqkm-source/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/store/0jr2kk95c34c0b6yxi75q4fqgb43kqkm-source/lib/modules.nix:821:9:

          820|     in warnDeprecation opt //
          821|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          822|         inherit (res.defsFinal') highestPrio;

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

       error: attribute '"sha256-Mj9Q3TgqZoJluG4/nyuw2WHnB3OJ+/mlV7duzWt1B1A="' missing

       at /nix/store/3wy0ggfkfzma1hadbfy9b3jgn6272csz-source/modules/flake/overlays.nix:12:24:

           11|         buildGoModule = args: super.buildGoModule (args // super.lib.optionalAttrs (args.pname != "k3s-cni-plugins" && args.pname != "k3s-containerd") {
           12|           vendorHash = {
             |                        ^
           13|             "sha256-XtTahFaWnuHzKDI/U4d/j4C4gRxH163MCGEEM4hu/WM=" = "sha256-XuMP+ffwTdXKL9q9+ZJUQc5ghGEcdY9UdefjCD19OUE=";

Here is my flake.lock

yu-re-ka commented 1 month ago

you can just add "sha256-Mj9Q3TgqZoJluG4/nyuw2WHnB3OJ+/mlV7duzWt1B1A=" = lib.fakeHash to the list, then see what it gives you as "expected" and enter that instead of lib.fakeHash

elpdt852 commented 4 weeks ago

Awesome, you even updated the nix-snapshotter patch to k3s. Thanks @yu-re-ka !

bglgwyng commented 4 weeks ago

@yu-re-ka Thanks! your solution worked!

"sha256-Mj9Q3TgqZoJluG4/nyuw2WHnB3OJ+/mlV7duzWt1B1A=" = "sha256-9i0vY+CqrLDKYBZPooccX7OtFhS3//mpKTLntvPYDJo=";

I don't know well about vendorHash attribute in buildGoModule, but isn't it worth making PR to add this code? If then, I'll do it.

yu-re-ka commented 4 weeks ago

@bglgwyng yes it makes sense to make a PR. Please specify the exact version of nixpkgs you are using in the PR, so that others can check the hash.