Install unstable virtualbox 7.0.14

I’ve been trying to get NIxos on a VM. My host uses 7.0.14. I found this PR and decided to try to install. Based on this discussion I added this to my config:

 let                                                                                        
    unstable = import <nixos-unstable> { config = { allowUntree = true; }; };                
  in                                                                                         
{                                                                                            
   nixpkgs.config = {                                                                        
     allowUntree = true;                                                                     
     packageOverrides = pkgs: {                                                              
       virtualbox = unstable.virtualbox;                                                     
#       virtualboxGuestAdditions = unstable.virtualBoxGuestAdditions;                        
     };                                                                                      
   };

However the build of GuestAdditions is using the wrong ISO image:

  /nix/store/v8wdgwqvlx168l3cx1rrbz48xjx5d9k5-VirtualBox-GuestAdditions-7.0.14-6.1.82.drv    
building '/nix/store/v8wdgwqvlx168l3cx1rrbz48xjx5d9k5-VirtualBox-GuestAdditions-7.0.14-6.1.82
.drv'...                                                                                     
Running phase: unpackPhase                                                                   
isoinfo: Warning: Joliet escape sequence uses illegal space at offset 3                      
Creating directory install                                                                   
Verifying archive integrity...  100%   MD5 checksums are OK. All good.                       
Uncompressing VirtualBox 7.0.12 Guest Additions for Linux  100%                              
LICENSE     
...
src/vboxguest-7.0.12/vboxsf/Makefile-header.gmk                                              
src/vboxguest-7.0.12/Makefile                                                                
Running phase: patchPhase                                                                    
substitute(): ERROR: file 'src/vboxguest-7.0.14/vboxvideo/vbox_ttm.c' does not exist         
/nix/store/10i1kjjq5szjn1gp6418x8bc1hswqc90-stdenv-linux/setup: line 131: pop_var_context: he
ad of shell_variables not a function context                                                 
error: builder for '/nix/store/v8wdgwqvlx168l3cx1rrbz48xjx5d9k5-VirtualBox-GuestAdditions-7.0
.14-6.1.82.drv' failed with exit code 1                                                                                              

This happens also when I build:
nix-build /nix/store/v8wdgwqvlx168l3cx1rrbz48xjx5d9k5-VirtualBox-GuestAdditio ns-7.0.14-6.1.82.drv.

What am I doing wrong? I’ve been trying to use thing like nix repl to inspect, but my grasp on this is a bit short (being new to Nix).

Did some more investigation and found something interesting. The ISO in my store is fetched from a tarball that has the old version of the image:

nix-build /nix/store/v8wdgwqvlx168l3cx1rrbz48xjx5d9k5-VirtualBox-GuestAdditions-7.0.14-6.1.82.drv
these 2 derivations will be built:
  /nix/store/3zs02fqsy9jylmv83m2i6cjdz3n4a1hk-VBoxGuestAdditions_7.0.14.iso.drv
  /nix/store/v8wdgwqvlx168l3cx1rrbz48xjx5d9k5-VirtualBox-GuestAdditions-7.0.14-6.1.82.drv
building '/nix/store/3zs02fqsy9jylmv83m2i6cjdz3n4a1hk-VBoxGuestAdditions_7.0.14.iso.drv'...

trying https://tarballs.nixos.org/sha256/b37f6aabe5a32e8b96ccca01f37fb49f4fd06674f1b29bc8fe0f423ead37b917
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 50.9M  100 50.9M    0     0   856k      0  0:01:00  0:01:00 --:--:--  943k
building '/nix/store/v8wdgwqvlx168l3cx1rrbz48xjx5d9k5-VirtualBox-GuestAdditions-7.0.14-6.1.82.drv'...
Running phase: unpackPhase
isoinfo: Warning: Joliet escape sequence uses illegal space at offset 3
Creating directory install
Verifying archive integrity...  100%   MD5 checksums are OK. All good.
Uncompressing VirtualBox 7.0.12 Guest Additions for Linux  100%

Here are the sha512 of the images I downloaded from oracle:

7f5db8f73bc2c89ad798fd2ec3543c460aa3fd3e44f02c04c334539172699af08c16312d96b6fdd5c561bc3d8133fc7a3662e51a86f82980d692f050286e0e7e  VBoxGuestAdditions_7.0.12.iso
5aa80b04c567d383793c560eb535babd1ebc4f472aaa51753867dbee00e1f5a3efeb5dd4c9eb1a48149ff0fa2e7598aa68792d3da9959709b619d234c2b57544  VBoxGuestAdditions_7.0.14.iso

And here is the one on my nix store:

sha512sum /nix/store/1l3g549kxm9is013qfj43kf9mdcf9idz-VBoxGuestAdditions_7.0.14.iso
7f5db8f73bc2c89ad798fd2ec3543c460aa3fd3e44f02c04c334539172699af08c16312d96b6fdd5c561bc3d8133fc7a3662e51a86f82980d692f050286e0e7e  /nix/store/1l3g549kxm9is013qfj43kf9mdcf9idz-VBoxGuestAdditions_7.0.14.iso

[Edit] Looking a bit more I found another iso with a different derivation hash, same version and correct sha512. What am I doing wrong?

[Edit 2] The correct version is a derivation for 6.6.22 but I’m running 6.1.82 and that one is using the wrong image.

I’ve now tried overlays and get the same result.

 nixpkgs.overlays = [
    (self: super: { 
      virtualbox= unstable.virtualbox;
      virtualboxExtpack = unstable.virtualboxExtpack;
      virtualboxGuestAdditions = unstable.virtualboxGuestAdditions;
    })
  ];

Look at the code between github and local and things like buildPhase and they don’t seem to match. I’ve tried other thing, kind of haphazardly and not success.

As far as I understand, the overlay is at least partially accepted, but the internal derivations are not being updated (like the iso image). Then module adds things to kernelPackages. I’m been trying to use nix repl and other tools to figure out where the thing fails.

How does one override these kernel packages and modules? Reviewed tons of issues, reddit post, and nothing.