From 2c5efdbec46ea4773a659261496a97cca54cbffc Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Fri, 19 Jan 2018 22:41:25 -0600 Subject: [PATCH 1/5] parallels: add `autoMountShares` option --- nixos/modules/virtualisation/parallels-guest.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/parallels-guest.nix b/nixos/modules/virtualisation/parallels-guest.nix index fc0409e9ec7..e3b28780ed6 100644 --- a/nixos/modules/virtualisation/parallels-guest.nix +++ b/nixos/modules/virtualisation/parallels-guest.nix @@ -22,6 +22,16 @@ in ''; }; + autoMountShares = mkOption { + type = types.bool; + default = true; + description = '' + Control prlfsmountd service. When this service is running, shares can not be manually + mounted through `mount -t prl_fs ...` as this service will remount and trample any set options. + Recommended to enable for simple file sharing, but extended share use such as for code should + disable this to manually mount shares. + ''; + }; }; }; @@ -67,7 +77,7 @@ in }; }; - systemd.services.prlfsmountd = { + systemd.services.prlfsmountd = mkIf config.hardware.parallels.autoMountShares { description = "Parallels Shared Folders Daemon"; wantedBy = [ "multi-user.target" ]; serviceConfig = rec { From ae7fae71ed4d2e4666a11b7ab60e50dffb71a282 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Thu, 1 Mar 2018 16:55:38 -0600 Subject: [PATCH 2/5] prl-tools: add libelf input fixes build on 18.03 --- pkgs/os-specific/linux/prl-tools/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix index b120062295a..593b810dae5 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -2,6 +2,7 @@ , gawk, utillinux, xorg, glib, dbus-glib, zlib , kernel ? null, libsOnly ? false , undmg, fetchurl +, libelf }: assert (!libsOnly) -> kernel != null; @@ -27,7 +28,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" "format" ]; # also maybe python2 to generate xorg.conf - nativeBuildInputs = [ p7zip undmg ] ++ lib.optionals (!libsOnly) [ makeWrapper ]; + nativeBuildInputs = [ p7zip undmg libelf ] ++ lib.optionals (!libsOnly) [ makeWrapper ]; inherit libsOnly; From 52747120c100c4a37c61725322e9216618b552cb Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Thu, 1 Mar 2018 17:06:43 -0600 Subject: [PATCH 3/5] parallels: add package config option allows overriding of package with newer versions --- nixos/modules/virtualisation/parallels-guest.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/nixos/modules/virtualisation/parallels-guest.nix b/nixos/modules/virtualisation/parallels-guest.nix index e3b28780ed6..36ca7f356d4 100644 --- a/nixos/modules/virtualisation/parallels-guest.nix +++ b/nixos/modules/virtualisation/parallels-guest.nix @@ -3,9 +3,7 @@ with lib; let - - prl-tools = config.boot.kernelPackages.prl-tools; - + prl-tools = config.hardware.parallels.package; in { @@ -32,6 +30,16 @@ in disable this to manually mount shares. ''; }; + + package = mkOption { + type = types.package; + default = config.boot.kernelPackages.prl-tools; + defaultText = "config.boot.kernelPackages.prl-tools"; + example = literalExample "config.boot.kernelPackages.prl-tools"; + description = '' + Defines which package to use for prl-tools. Override to change the version. + ''; + }; }; }; From 45fa79d43bdca35ac71c7dfba907cb031349bcaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 2 Mar 2018 09:18:57 +0000 Subject: [PATCH 4/5] prl-tools: use kernel.moduleBuildDependencies instead of libelf --- 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 593b810dae5..b2ebab447e1 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" "format" ]; # also maybe python2 to generate xorg.conf - nativeBuildInputs = [ p7zip undmg libelf ] ++ lib.optionals (!libsOnly) [ makeWrapper ]; + nativeBuildInputs = [ p7zip undmg ] ++ lib.optionals (!libsOnly) [ makeWrapper ] ++ kernel.moduleBuildDependencies; inherit libsOnly; From 552105d5026967d89d5f6165cb00db8187eb59d7 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Sat, 3 Mar 2018 10:36:17 -0600 Subject: [PATCH 5/5] prl-tools: assert linux kernel version < 4.15 --- pkgs/os-specific/linux/prl-tools/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix index b2ebab447e1..000d11af87d 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -6,6 +6,8 @@ }: assert (!libsOnly) -> kernel != null; +# Disable for kernels 4.15 and above due to compatibility issues +assert kernel != null -> stdenv.lib.versionOlder kernel.version "4.15"; let xorgFullVer = (builtins.parseDrvName xorg.xorgserver.name).version; xorgVer = lib.concatStringsSep "." (lib.take 2 (lib.splitString "." xorgFullVer));