From 1aef116e41a17a248309ba966230648c1292ed3c Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Tue, 18 Jul 2017 18:24:39 -0500 Subject: [PATCH 1/9] prl-tools: ignore patchelf errors --- pkgs/os-specific/linux/prl-tools/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix index 9ca48ccaf05..49da2760b38 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -124,7 +124,7 @@ stdenv.mkDerivation rec { patchelf \ --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ --set-rpath "$out/lib:$libPath" \ - $i + $i || true done mkdir -p $out/bin From e58b67ab2b07386d406631c1d04d22038704deef Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Wed, 19 Jul 2017 16:16:49 -0500 Subject: [PATCH 2/9] prl-tools: Update platforms and url --- pkgs/os-specific/linux/prl-tools/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix index 49da2760b38..b13a28e92f0 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -189,8 +189,8 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "Parallels Tools for Linux guests"; - homepage = http://parallels.com; - platforms = platforms.linux; + homepage = https://parallels.com; + platforms = [ "i686-linux" "x86_64-linux" ]; license = licenses.unfree; # I was making this package blindly and requesting testing from the real user, # so I can't even test it by myself and won't provide future updates. From 0b845abd22e0cb8d8b5ab66f2a763a2b2b9c4ee8 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Wed, 19 Jul 2017 17:00:05 -0500 Subject: [PATCH 3/9] prl-tools: 10.0.2.27712 -> 12.2.1-41615; src: download parallels dmg --- pkgs/os-specific/linux/prl-tools/default.nix | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix index b13a28e92f0..0118d39fe41 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -32,19 +32,15 @@ let xorgFullVer = (builtins.parseDrvName xorg.xorgserver.name).version; ]; in stdenv.mkDerivation rec { - version = "10.0.2.27712"; + version = "${prl_major}.2.1-41615"; + prl_major = "12"; name = "prl-tools-${version}"; - src = requireFile rec { - name = "prl-tools-lin.iso"; - sha256 = "07960jvyv7gihjlg922znjm6db6l6bd23x9mg6ympwibzf2mylmx"; - message = '' - Please, place Parallels Tools for Linux image into Nix store - using either - nix-store --add-fixed sha256 ${name} - or - nix-prefetch-url file://path/to/${name} - ''; + # We download the full distribution to extract prl-tools-lin.iso from + # => ${dmg}/Parallels\ Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso + src = fetchurl { + url = "https://download.parallels.com/desktop/v${prl_major}/${version}/ParallelsDesktop-${version}.dmg"; + sha256 = "1jwzwif69qlhmfky9kigjaxpxfj0lyrl1iyrpqy4iwqvajdgbbym"; }; hardeningDisable = [ "pic" ]; From 019cbdaa6a4ac751abd443e5425e07bf00048629 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Wed, 19 Jul 2017 17:01:30 -0500 Subject: [PATCH 4/9] prl-tools: unpackPhase: extract prl-tools-lin.iso from dmg; add undmg, fetchurl inputs; update sourceRoot --- pkgs/os-specific/linux/prl-tools/default.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix index 0118d39fe41..0f9d835d004 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -1,6 +1,7 @@ { stdenv, lib, requireFile, makeWrapper, substituteAll, p7zip , gawk, utillinux, xorg, glib, dbus_glib, zlib , kernel ? null, libsOnly ? false +, undmg, fetchurl }: assert (!libsOnly) -> kernel != null; @@ -46,17 +47,19 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; # also maybe python2 to generate xorg.conf - nativeBuildInputs = [ p7zip ] ++ lib.optionals (!libsOnly) [ makeWrapper ]; + nativeBuildInputs = [ p7zip undmg ] ++ lib.optionals (!libsOnly) [ makeWrapper ]; inherit libsOnly; unpackPhase = '' - 7z x $src - export sourceRoot=. + undmg < "${src}" + + export sourceRoot=prl-tools-build + 7z x "Parallels Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso" -o$sourceRoot if test -z "$libsOnly"; then - ( cd kmods; tar -xaf prl_mod.tar.gz ) + ( cd $sourceRoot/kmods; tar -xaf prl_mod.tar.gz ) fi - ( cd tools; tar -xaf prltools${if x64 then ".x64" else ""}.tar.gz ) + ( cd $sourceRoot/tools; tar -xaf prltools${if x64 then ".x64" else ""}.tar.gz ) ''; kernelVersion = if libsOnly then "" else (builtins.parseDrvName kernel.name).version; From 029b44db9d61e88e30b6faaa8b545b7c19d50646 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Wed, 19 Jul 2017 17:02:43 -0500 Subject: [PATCH 5/9] prl-tools: hardeningDisable: +"format" --- pkgs/os-specific/linux/prl-tools/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix index 0f9d835d004..548725ae4e3 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { sha256 = "1jwzwif69qlhmfky9kigjaxpxfj0lyrl1iyrpqy4iwqvajdgbbym"; }; - hardeningDisable = [ "pic" ]; + hardeningDisable = [ "pic" "format" ]; # also maybe python2 to generate xorg.conf nativeBuildInputs = [ p7zip undmg ] ++ lib.optionals (!libsOnly) [ makeWrapper ]; From 26d6eab6550dc6bf1581aa0d11f05203f6181f24 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Wed, 19 Jul 2017 17:41:21 -0500 Subject: [PATCH 6/9] prl-tools: remove unnecessary kernel modules --- nixos/modules/virtualisation/parallels-guest.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/parallels-guest.nix b/nixos/modules/virtualisation/parallels-guest.nix index bd85973ee56..f27ee46f489 100644 --- a/nixos/modules/virtualisation/parallels-guest.nix +++ b/nixos/modules/virtualisation/parallels-guest.nix @@ -55,7 +55,7 @@ in boot.extraModulePackages = [ prl-tools ]; - boot.kernelModules = [ "prl_tg" "prl_eth" "prl_fs" "prl_fs_freeze" "acpi_memhotplug" ]; + boot.kernelModules = [ "prl_tg" "prl_eth" "prl_fs" "prl_fs_freeze" ]; services.timesyncd.enable = false; From 6ead149ff91220706c0a347468925a2a288ca829 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Wed, 19 Jul 2017 17:40:52 -0500 Subject: [PATCH 7/9] prl-tools: remove user services using .desktop files --- pkgs/os-specific/linux/prl-tools/default.nix | 30 -------------------- 1 file changed, 30 deletions(-) diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix index 548725ae4e3..9fe331e6cb1 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -11,26 +11,6 @@ let xorgFullVer = (builtins.parseDrvName xorg.xorgserver.name).version; x64 = if stdenv.system == "x86_64-linux" then true else if stdenv.system == "i686-linux" then false else abort "Parallels Tools for Linux only support {x86-64,i686}-linux targets"; - # We autostart user services by ourselves, because prlcc uses hardcoded paths. - autostart = [ { exec = "prlcc"; - description = "Parallels Control Center"; - } - { exec = "prldhd"; - description = "Parallels Control Center"; # not a mistake - } - { exec = "prl_wmouse_d"; - description = "Parallels Walking Mouse Daemon"; - } - { exec = "prlcp"; - description = "Parallels CopyPaste Tool"; - } - { exec = "prlsga"; - description = "Parallels Shared Guest Applications Tool"; - } - { exec = "prlshprof"; - description = "Parallels Shared Profile Tool"; - } - ]; in stdenv.mkDerivation rec { version = "${prl_major}.2.1-41615"; @@ -87,11 +67,6 @@ stdenv.mkDerivation rec { stdenv.lib.makeLibraryPath ([ stdenv.cc.cc libXrandr libXext libX11 libXcomposite libXinerama ] ++ lib.optionals (!libsOnly) [ libXi glib dbus_glib zlib ]); - desktops = map (x: substituteAll ({ - src = ./autostart.desktop; - name = x.exec + ".desktop"; - version = version; - } // x)) autostart; installPhase = '' if test -z "$libsOnly"; then @@ -144,11 +119,6 @@ stdenv.mkDerivation rec { sed 's,/bin/bash,${stdenv.shell},g' $i > $out/lib/udev/rules.d/$i done - mkdir -p $out/share/autostart - for i in $desktops; do - cat $i | sed "s,^Exec=,Exec=$out/bin/," > $out/share/autostart/$(basename $i) - done - ( cd xorg.${xorgVer} # Install the X modules. From 0f047e612bbdee78fae3ea85a6f0eb46428737e3 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Wed, 19 Jul 2017 14:36:24 -0500 Subject: [PATCH 8/9] prl-tools: Add all user services using systemd.user --- .../virtualisation/parallels-guest.nix | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/nixos/modules/virtualisation/parallels-guest.nix b/nixos/modules/virtualisation/parallels-guest.nix index f27ee46f489..604ba2e76ef 100644 --- a/nixos/modules/virtualisation/parallels-guest.nix +++ b/nixos/modules/virtualisation/parallels-guest.nix @@ -89,5 +89,58 @@ in }; }; + systemd.services.prlcc = { + description = "Parallels Control Center"; + wantedBy = [ "graphical.target" ]; + serviceConfig = { + ExecStart = "${prl-tools}/bin/prlcc"; + }; + }; + + systemd.user.services = { + prlcc = { + description = "Parallels Control Center"; + wantedBy = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${prl-tools}/bin/prlcc"; + }; + }; + prldnd = { + description = "Parallels Control Center"; + wantedBy = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${prl-tools}/bin/prldnd"; + }; + }; + prl_wmouse_d = { + description = "Parallels Walking Mouse Daemon"; + wantedBy = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${prl-tools}/bin/prl_wmouse_d"; + }; + }; + prlcp = { + description = "Parallels CopyPaste Tool"; + wantedBy = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${prl-tools}/bin/prlcp"; + }; + }; + prlsga = { + description = "Parallels Shared Guest Applications Tool"; + wantedBy = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${prl-tools}/bin/prlsga"; + }; + }; + prlshprof = { + description = "Parallels Shared Profile Tool"; + wantedBy = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${prl-tools}/bin/prlshprof"; + }; + }; + }; + }; } From 2ce30c5b5303e7a4a991bc852669d13d31823c82 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Sat, 7 Oct 2017 10:43:26 -0500 Subject: [PATCH 9/9] remove prlcc from global systemd services --- nixos/modules/virtualisation/parallels-guest.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/nixos/modules/virtualisation/parallels-guest.nix b/nixos/modules/virtualisation/parallels-guest.nix index 604ba2e76ef..fc0409e9ec7 100644 --- a/nixos/modules/virtualisation/parallels-guest.nix +++ b/nixos/modules/virtualisation/parallels-guest.nix @@ -27,7 +27,6 @@ in }; config = mkIf config.hardware.parallels.enable { - services.xserver = { drivers = singleton { name = "prlvideo"; modules = [ prl-tools ]; libPath = [ prl-tools ]; }; @@ -89,14 +88,6 @@ in }; }; - systemd.services.prlcc = { - description = "Parallels Control Center"; - wantedBy = [ "graphical.target" ]; - serviceConfig = { - ExecStart = "${prl-tools}/bin/prlcc"; - }; - }; - systemd.user.services = { prlcc = { description = "Parallels Control Center";