diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-06-26 11:45:42 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-06-26 18:12:06 +0000 |
commit | 97a16f52d718073531ddc3bb3aa038110793ae06 (patch) | |
tree | b1bba8552e33b5699190f0d235eaa0881d3d78ea | |
parent | 943fd5ea4b17b9d7d2be3b2ff9316858fde61270 (diff) | |
download | nixpkgs-97a16f52d718073531ddc3bb3aa038110793ae06.tar nixpkgs-97a16f52d718073531ddc3bb3aa038110793ae06.tar.gz nixpkgs-97a16f52d718073531ddc3bb3aa038110793ae06.tar.bz2 nixpkgs-97a16f52d718073531ddc3bb3aa038110793ae06.tar.lz nixpkgs-97a16f52d718073531ddc3bb3aa038110793ae06.tar.xz nixpkgs-97a16f52d718073531ddc3bb3aa038110793ae06.tar.zst nixpkgs-97a16f52d718073531ddc3bb3aa038110793ae06.zip |
linuxPackages.virtualboxGuestAdditions: properly mark platforms
This saves a lot of defensive checking inside the expression.
-rw-r--r-- | pkgs/applications/virtualization/virtualbox/guest-additions/default.nix | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix index 0168b46f47e..538ebfa78cf 100644 --- a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix +++ b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix @@ -45,26 +45,15 @@ in stdenv.mkDerivation rec { patchFlags = [ "-p1" "-d" "src/vboxguest-${version}" ]; unpackPhase = '' - ${if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then '' - isoinfo -J -i $src -x /VBoxLinuxAdditions.run > ./VBoxLinuxAdditions.run - chmod 755 ./VBoxLinuxAdditions.run - # An overflow leads the is-there-enough-space check to fail when there's too much space available, so fake how much space there is - sed -i 's/\$leftspace/16383/' VBoxLinuxAdditions.run - ./VBoxLinuxAdditions.run --noexec --keep - '' - else throw ("Architecture: "+stdenv.hostPlatform.system+" not supported for VirtualBox guest additions") - } + isoinfo -J -i $src -x /VBoxLinuxAdditions.run > ./VBoxLinuxAdditions.run + chmod 755 ./VBoxLinuxAdditions.run + # An overflow leads the is-there-enough-space check to fail when there's too much space available, so fake how much space there is + sed -i 's/\$leftspace/16383/' VBoxLinuxAdditions.run + ./VBoxLinuxAdditions.run --noexec --keep # Unpack files cd install - ${if stdenv.hostPlatform.system == "i686-linux" then '' - tar xfvj VBoxGuestAdditions-x86.tar.bz2 - '' - else if stdenv.hostPlatform.system == "x86_64-linux" then '' - tar xfvj VBoxGuestAdditions-amd64.tar.bz2 - '' - else throw ("Architecture: "+stdenv.hostPlatform.system+" not supported for VirtualBox guest additions") - } + tar xfvj VBoxGuestAdditions-${if stdenv.hostPlatform.is32bit then "x86" else "amd64"}.tar.bz2 ''; buildPhase = '' @@ -158,7 +147,7 @@ in stdenv.mkDerivation rec { sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; license = "GPL"; maintainers = [ lib.maintainers.sander ]; - platforms = lib.platforms.linux; + platforms = [ "i686-linux" "x86_64-linux" ]; broken = kernel.kernelAtLeast (if stdenv.hostPlatform.is32bit then "5.10" else "5.17"); }; } |