building Nix...
building the system configuration...
building '/nix/store/vh6yjal2lyp9va5k5p5shv073jzsgay3-VMware-Workstation-Full-17.5.1-23298084.x86_64.bundle.drv'...
building '/nix/store/4slcz39jjfqb73rjqc2kbqqb9i6nppjy-gdbm-1.8.3.drv'...
building '/nix/store/gqwx8nkfw2m5xw92y6k3s4a3a2iqzrzn-vmware-unpack-env-usr-target.drv'...
Running phase: unpackPhase
unpacking source archive /nix/store/hh149gw57kdvafpqjfq3869x4zkkgdr7-gdbm-1.8.3.tar.gz
source root is gdbm-1.8.3
setting SOURCE_DATE_EPOCH to timestamp 1034719556 of file gdbm-1.8.3/gdbm.info
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./config.sub
Updating Autotools / GNU config script to a newer upstream version: ./config.guess
Running phase: configurePhase
fixing libtool script ./ltmain.sh
patching script interpreter paths in ./configure
./configure: interpreter directive changed from "#! /bin/sh" to "/nix/store/h3bhzvz9ipglcybbcvkxvm4vg9lwvqg4-bash-5.2p26/bin/sh"
configure flags: --disable-static --prefix=/nix/store/2gyp500pg8byyrbd9n4j6ijpbgb9ry4z-gdbm-1.8.3 --enable-libgdbm-compat
warning: collision between `/nix/store/nkdgysx90pln2l562l7lsk021hbxjdg8-glibc-2.39-31-bin/bin/ldconfig' and `/nix/store/d130xwm9365hfdzpz7x5kq9is9q6l4rm-ldconfig/bin/ldconfig'
warning: collision between `/nix/store/apab5i73dqa09wx0q27b6fbhd1r18ihl-glibc-2.39-31/lib/locale/locale-archive' and `/nix/store/j2h103h7b0xg7pc5ih3m1df0j3z71c6v-glibc-locales-2.39-31/lib/locale/locale-archive'
checking for gcc... gcc
created 1125 symlinks in user environment
building '/nix/store/jyymlbz15czjll8hac5qddil8afar8rf-vmware-unpack-env-fhs.drv'...
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
/nix/store/4hfpf6kn1fj2r1dxpn8dz7zqdnm3j12l-vmware-unpack-env-fhs /build
/nix/store/4hfpf6kn1fj2r1dxpn8dz7zqdnm3j12l-vmware-unpack-env-fhs/usr /nix/store/4hfpf6kn1fj2r1dxpn8dz7zqdnm3j12l-vmware-unpack-env-fhs /build
/nix/store/4hfpf6kn1fj2r1dxpn8dz7zqdnm3j12l-vmware-unpack-env-fhs /build
building '/nix/store/pl6gzr7sjfznn331rkp6iqs439nxav3s-vmware-unpack-env-bwrap.drv'...
trying https://download3.vmware.com/software/WKST-1751-LX/VMware-Workstation-Full-17.5.1-23298084.x86_64.bundle
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /nix/store/hq8765g3p1i7qbargnqli5mn0jpsdbfl-coreutils-9.5/bin/install -c
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for ld used by GCC... ld
checking if the linker (ld) is GNU ld... yes
checking for ld option to reload object files... -r
checking for BSD-compatible nm... nm
checking whether ln -s works... yes
checking how to recognise dependant libraries... (cached) pass_all
building '/nix/store/5l3rqri02lk0vlsshzxavdsd240zcm30-vmware-unpack-env.drv'...
checking command to parse nm output... ok
checking for egrep... grep -E
0 15 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (56) The requested URL returned error: 522
error: cannot download VMware-Workstation-Full-17.5.1-23298084.x86_64.bundle from any mirror
checking for ANSI C header files... yes
error: builder for '/nix/store/vh6yjal2lyp9va5k5p5shv073jzsgay3-VMware-Workstation-Full-17.5.1-23298084.x86_64.bundle.drv' failed with exit code 1
error:
… while calling the 'head' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/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/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: 1 dependencies of derivation '/nix/store/6zl9d3wlrw7s6p63l9agnangra8yfqdm-vmware-workstation-17.5.1.drv' failed to build
But I obtained a source file “VMware-Workstation-Full-17.5.0-22583795.x86_64.bundle”
from techspot
(I know the link says it is for windows, but there is a download also for linux)
Can I use this somehow?
You can override the src attribute of it using overrideAttrs. I read through the derivation for vmware-workstation and it looks like the unpackPhase refers to the src attribute, so the unpackPhase attribute would also need to be overridden. The following code got it past the unpack phase, but I didn’t let it build until the end:
(pkgs.vmware-workstation.overrideAttrs rec {
src = ./vmware.bundle;
unpackPhase = let
vmware-unpack-env = pkgs.buildFHSEnv rec {
name = "vmware-unpack-env";
targetPkgs = pkgs: [ pkgs.zlib ];
};
in ''
${vmware-unpack-env}/bin/vmware-unpack-env -c "sh ${src} --extract unpacked"
# If you need it, copy the enableMacOSGuests stuff here as well.
'';
})
For use with the vmware NixOS module, see my comment #9 in this thread.
If hash is specified, then a download is not performed if the Nix store already contains a file with the same hash and base name.
A cheesy way to get the desired file into the store is to run a static server on localhost (e.g. python -m http.server or whatever), then using nix-prefetch invoke the command:
$ nix-prefetch fetchurl --no-force-https --url http://localhost:8000/somefile.zip
The fetcher will be called as follows:
> fetchurl {
> sha256 = "sha256:0000000000000000000000000000000000000000000000000000";
> url = "http://localhost:8000/somefile.zip";
> }
sha256-4npR61/tABv4LYVvmulJy5cAvNN1rKc8UQFLjbgbpkw=
Then, since the file is copied to the Nix store (with the same basename and same hash), you wouldn’t need to fuss around with overriding the src attribute.
The result of overriding some attributes in a derivation is also a derivation, so it’s to be put into environment.systemPackages along with other packages. Example:
environment.systemPackages = [
(pkgs.vmware-workstation.overrideAttrs rec {
#...
})
# Other packages here
];
I found that there’s a vmware module in NixOS, and it’s advisable to use it instead of just adding it to environment.systemPackages, because the module handles things like kernel modules and networking as well. The relevant options are under virtualisation.vmware.host.*. To use the module with the overridden package:
Tried to install it with the vmware bundle locally, but I get this:
… while calling the 'head' builtin
at /nix/store/pnylamisx45d9dig55305gpq0xj2v7ki-source/lib/attrsets.nix:922:11:
921| || pred here (elemAt values 1) (head values) then
922| head values
| ^
923| else
… while evaluating the attribute 'value'
at /nix/store/pnylamisx45d9dig55305gpq0xj2v7ki-source/lib/modules.nix:807:9:
806| in warnDeprecation opt //
807| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
808| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: builder for '/nix/store/z1fccsqrkcyk1hf2yqpag86353l0p2bd-vmware-workstation-17.5.1.drv' failed with exit code 1;
last 10 log lines:
> Installing VMware Player Setup
> Installing VMware Network Editor
> Installing VMware Tools
> cp: cannot stat 'unpacked/vmware-tools-linux/linux.iso': No such file or directory
> cp: cannot stat 'unpacked/vmware-tools-linuxPreGlibc25/linuxPreGlibc25.iso': No such file or directory
> cp: cannot stat 'unpacked/vmware-tools-netware/netware.iso': No such file or directory
> cp: cannot stat 'unpacked/vmware-tools-solaris/solaris.iso': No such file or directory
> cp: cannot stat 'unpacked/vmware-tools-winPre2k/winPre2k.iso': No such file or directory
> cp: cannot stat 'unpacked/vmware-tools-winPreVista/winPreVista.iso': No such file or directory
> cp: cannot stat 'unpacked/vmware-tools-windows/windows.iso': No such file or directory
For full logs, run 'nix log /nix/store/z1fccsqrkcyk1hf2yqpag86353l0p2bd-vmware-workstation-17.5.1.drv'.
any idea why?
(using the expression @kotatsuyaki provided):