Overlay or override? no one work for me

Hi,

Using nixos for some months now and like it. But one thing lack, good and up to date documentation :wink:

I’m trying to add a newer version for houdini as nixpkgs give 21.0.559 and sidefx has released newer version since (21.0.729). And newer version come fast with small bugfix or optimization. I can PR each new version but i think it can be faster to make an overlay or override for it.

I’ve tried with packages override but no documentation seem to offer up to date example that work.

Tried overlays and same problem.

I’m not seasoned programmer but 3d artist with some basic programming knowledge (python, C, learning haskell since two weeks).

Can anyone here give me full example of how to use most recent houdini version with nixos, please? It can be with other software but i need recent, working solution…

I like to learn by trial and error but this time, after hours of trying, nothing seem to work.

If someone can help me here, i’ll be I would be very grateful :slight_smile:

Thanks

Oof, whoever packaged houdini did not make things easy for you.

Untested because unfree software, but something like this should work:

{
  environment.systemPackages = [
    (pkgs.houdini.override {
      unwrapped = pkgs.houdini.unwrapped.overrideAttrs (finalAttrs: oldAttrs: {
        version = "21.0.729";
        src = pkgs.requireFile {
          name = "houdini-${finalAttrs.version}-linux_x86_64_gcc11.2.tar.gz"; # maybe?
          message = ''
            Anything you want. Usually this will contain instructions
            for how to download the unfree software package. When
            preparing a package for personal use, it'd just be a
            reminder to yourself.
          '';
          hash = ""; # you will have to fill this in after Nix complains about a hash mismatch
        };
        outputHash = ""; # same
      });
    })
  ];
}
1 Like
building the system configuration...
error:
       … while calling the 'derivationStrict' builtin
         at «nix-internal»/derivation-internal.nix:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'nixos-system-izia-26.11pre1008282.331800de5053'
         whose name attribute is located at /nix/store/db1a5l7i18a49g12cjj1scv91mdz7wqv-nixos/nixos/pkgs/stdenv/generic/make-derivation.nix:651:11

       … while evaluating attribute 'buildCommand' of derivation 'nixos-system-izia-26.11pre1008282.331800de5053'
         at /nix/store/db1a5l7i18a49g12cjj1scv91mdz7wqv-nixos/nixos/nixos/modules/system/activation/top-level.nix:63:7:
           62|       allowSubstitutes = false;
           63|       buildCommand = systemBuilder;
             |       ^
           64|

       … while evaluating the option `environment.etc.dbus-1.source':

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

       error: assertion '((message != null) || (url != null))' failed
       at /nix/store/db1a5l7i18a49g12cjj1scv91mdz7wqv-nixos/nixos/pkgs/build-support/trivial-builders/default.nix:918:7:
          917|       }@args:
          918|       assert (message != null) || (url != null);
             |       ^
          919|       assert (sha256 != null) || (sha1 != null) || (hash != null);
Command 'nix-build '<nixpkgs/nixos>' --attr config.system.build.toplevel --no-out-link' returned non-zero exit status 1.

Non working :wink:

Thanks for your help. This one seem difficult.

My oversight. Add message = "anything you want"; to the requireFile call.

Check the documentation for requireFile for the instructions on how to actually put that file in the store.

I don’t use overlay/ override for packages.
If i want to change packages (use packages) that aren’t in nixpkgs i add them like this:

  1. Create a folder in the same dir you have your config packages
  2. Copy the folder nixpkgs/pkgs/by-name/ho/houdini from nixpkgs in this folder.
  3. Change the files to your liking (if you are lucky you only need to change in runtime.nix the version and hash.) As it is unfree i can’t test it.
  4. Change in your configuration.nix pkgs.houdini to (pkgs.callPackage ./packages/houdini/package.nix { })

It could be that you need to use the impure flag (i think that you don’t need this if the folder is in the same folder as your configuration.nix file.)

building '/nix/store/2xb7r709m7vwf86ah2mi54589szim1i7-houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz.drv'...
structuredAttrs is enabled
created 184 symlinks in user environment
Unfortunately, we cannot download file houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz automatically.
Please go to https://www.sidefx.com/download/daily-builds/?production=true to download it yourself, and add it to the Nix store
using either
  nix-store --add-fixed sha256 houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz
or
  nix-prefetch-url --type sha256 file:///path/to/houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz
error: Cannot build '/nix/store/2xb7r709m7vwf86ah2mi54589szim1i7-houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/8mf0d1n2l62cb974g27kkzn1ri9n9fk5-houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz
error: Cannot build '/nix/store/2xasav4nqqk1n3s43w4rdd70vgnpybd0-houdini-runtime-21.0.729.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/d78rwi45rcyv342af5pfn5m3n6s2cvsn-houdini-runtime-21.0.729
error: Build failed due to failed dependency
error: Cannot build '/nix/store/xwiw5cxd8msrh0gqq290f94qxynz2yl2-houdini-21.0.729.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/88cvv5kyxaaww86b2x8l4qfb9i0327wi-houdini-21.0.729
error: Build failed due to failed dependency
error: Cannot build '/nix/store/4caxzk6lxix2dfjw6idp324zhdr4nhn8-system-path.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/b5wzp6jcj0n8j70vwmyqzpk8scksgv4c-system-path
error: Build failed due to failed dependency
error: Cannot build '/nix/store/145yn018jwrrx9hk5ipg5933wrmxjw70-X-Restart-Triggers-polkit.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/ar5fbawwvbf0dmy6f7fcrkah55jd2w1d-X-Restart-Triggers-polkit
error: Cannot build '/nix/store/xq9g74bzm9lpx5rxcpb45hmbvm7nqd3l-dbus-1.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/xiz0sl2mcqwpynq9g72ix919m2c88jrn-dbus-1
error: Cannot build '/nix/store/0m9br93992ciyqlavj1bfl7l63vaya2z-etc.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/rvpw8jfk528xbhnv8qycm8l3g0vrr88v-etc
error: Cannot build '/nix/store/vivc1npqs2bdl2yfn3kkd75dbrg5mn70-nixos-system-izia-26.11pre1008282.331800de5053.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/j6maizsa0fqylsj44ayh0xjsij77bqsi-nixos-system-izia-26.11pre1008282.331800de5053
error: Build failed due to failed dependency
Command 'nix-build '<nixpkgs/nixos>' --attr config.system.build.toplevel --no-out-link --show-trace' returned non-zero exit status 1.

This come with the two methods.

Almost if i add the file with nix-store or nix-prefetch-url:

 ls | grep "0.729"
08331b0g6ss1ycwrkish7r4r6g9hz1dg-houdini-21.0.729-init.drv
0hsd195an4vj52acp87dky290in9r5zz-houdini-21.0.729.drv
2xasav4nqqk1n3s43w4rdd70vgnpybd0-houdini-runtime-21.0.729.drv
2xb7r709m7vwf86ah2mi54589szim1i7-houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz.drv
34i4krnpqj9wms34jcfhi2ykiz7w5psp-houdini-21.0.729-init
3ncm76y0k7sxph70z3k77f1h7d9n6lh2-houdini-21.0.729-fhsenv-profile.drv
78h499sxd8wj3ffa19x0izj4cd23lxz1-houdini-21.0.729-fhsenv-profile
8mf0d1n2l62cb974g27kkzn1ri9n9fk5-houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz.lock
a3y45xpbwi5csy900gpbwk44y96qby7z-houdini-runtime-21.0.729.drv
a62imxp176g0pdw9ym9lwsk0n63n5d68-houdini-21.0.729-fhsenv-rootfs.drv
aqi8kzf40agxks5fkhs8iv8spa1jxh92-houdini-21.0.729-bwrap.drv
da36fzbnl3fymc1yf4xkl8ylwlwgzww9-houdini-21.0.729-bwrap
fdq1qrbxksspjkh7s9y77194pw6c8k52-onlineupdate-c003be8b9727672e7d30972983b375f4c200233f-2.tar.xz.drv
fprclb0c553hhy33s211k1sqda9jxiwr-houdini-runtime-21.0.729.drv
k1s682lp6m1bw42jbpghnxsi96y4zysd-houdini-21.0.729-fhsenv-rootfs
r70nvh6xhiggabsl4w964swyq97r0vsg-houdini-21.0.729.drv
vjab7pgja3pzjcdk31ajmawdggi1vxp0-houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz
xwiw5cxd8msrh0gqq290f94qxynz2yl2-houdini-21.0.729.drv

With the original package, i need to add houdini to my pkgs, run nixos-rebuild, add the tar.gz file with nix-store or nix-prefetch-url and launch nixos-rebuild for it to work.

With modified package, it can’t find it but it’s in the store…

I don’t know how to calculate outputhash as it seem ti be my problem now.

I’m assuming English is not your first language, so sorry if I am not understanding you or I say something unclear.

What does nix-store --query --deriver /nix/store/vjab7pgja3pzjcdk31ajmawdggi1vxp0-houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz return?

If it’s /nix/store/2xb7r709m7vwf86ah2mi54589szim1i7-houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz.drv, then you shouldn’t be getting Unfortunately, we cannot download file houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz automatically..

If you aren’t getting that error, please post the new error.

did you change the hash in the runtime.nix and how did you calculate it?

Here: Attempting to get requireFIle working to package proprietary software - #4 by polygon

they says that it gets calculated with: nix hash file ./houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz for the hash

The command return unknown-deriver.

The hash is calculated with: nix-hash --sri --type sha256 houdini-21.0.729-linux_x86_64_gcc11.2.tar.gz

But i don’t known how to calculate the outputhash as it’s different (as seen in runtime.nix of the houdini package).

ah I see. Have you tried vjab7pgja3pzjcdk31ajmawdggi1vxp0 in that case? Not sure if that will work, but that’s the hash of the file in /nix/store apparently

error: hash 'vjab7pgja3pzjcdk31ajmawdggi1vxp0' has wrong length for hash algorithm 'sha256'

If a solution is find, i’ll engrave it on my desk :wink:

I just create a package where i use the local tar.xz with requireFile i got it working with:

  1. i downloaded the tar.xz to the downloads folder
  2. i added the file to the nix-store with nix-store --add-fixed sha256 /home/lukas/Downloads/file.tar.xz
  3. I tried to build it but got the same error as you.
  4. I calculated the hash with nix hash file /home/lukas/Downloads/file.tar.xz
  5. I used this hash with the leading sha256-... in requireFile
  6. i was able to successfully build it.

I think your hash is wrong.

When i use nix-hash --sri --type sha256 /home/lukas/Downloads/file.tar.xz i get the wrong hash. I need to use nix hash file /home/lukas/Downloads/file.tar.xz to get the correct hash.

Thanks very much to all.