Merge pull request #34070 from lukeadams/prl-improve

Improve parallels-tools

authored by Jörg Thalheim and committed by GitHub 5d0d140f 6e316ed6

+26 -5
+22 -4
nixos/modules/virtualisation/parallels-guest.nix
··· 3 3 with lib; 4 4 5 5 let 6 - 7 - prl-tools = config.boot.kernelPackages.prl-tools; 8 - 6 + prl-tools = config.hardware.parallels.package; 9 7 in 10 8 11 9 { ··· 22 20 ''; 23 21 }; 24 22 23 + autoMountShares = mkOption { 24 + type = types.bool; 25 + default = true; 26 + description = '' 27 + Control prlfsmountd service. When this service is running, shares can not be manually 28 + mounted through `mount -t prl_fs ...` as this service will remount and trample any set options. 29 + Recommended to enable for simple file sharing, but extended share use such as for code should 30 + disable this to manually mount shares. 31 + ''; 32 + }; 33 + 34 + package = mkOption { 35 + type = types.package; 36 + default = config.boot.kernelPackages.prl-tools; 37 + defaultText = "config.boot.kernelPackages.prl-tools"; 38 + example = literalExample "config.boot.kernelPackages.prl-tools"; 39 + description = '' 40 + Defines which package to use for prl-tools. Override to change the version. 41 + ''; 42 + }; 25 43 }; 26 44 27 45 }; ··· 67 85 }; 68 86 }; 69 87 70 - systemd.services.prlfsmountd = { 88 + systemd.services.prlfsmountd = mkIf config.hardware.parallels.autoMountShares { 71 89 description = "Parallels Shared Folders Daemon"; 72 90 wantedBy = [ "multi-user.target" ]; 73 91 serviceConfig = rec {
+4 -1
pkgs/os-specific/linux/prl-tools/default.nix
··· 2 2 , gawk, utillinux, xorg, glib, dbus-glib, zlib 3 3 , kernel ? null, libsOnly ? false 4 4 , undmg, fetchurl 5 + , libelf 5 6 }: 6 7 7 8 assert (!libsOnly) -> kernel != null; 9 + # Disable for kernels 4.15 and above due to compatibility issues 10 + assert kernel != null -> stdenv.lib.versionOlder kernel.version "4.15"; 8 11 9 12 let xorgFullVer = (builtins.parseDrvName xorg.xorgserver.name).version; 10 13 xorgVer = lib.concatStringsSep "." (lib.take 2 (lib.splitString "." xorgFullVer)); ··· 27 30 hardeningDisable = [ "pic" "format" ]; 28 31 29 32 # also maybe python2 to generate xorg.conf 30 - nativeBuildInputs = [ p7zip undmg ] ++ lib.optionals (!libsOnly) [ makeWrapper ]; 33 + nativeBuildInputs = [ p7zip undmg ] ++ lib.optionals (!libsOnly) [ makeWrapper ] ++ kernel.moduleBuildDependencies; 31 34 32 35 inherit libsOnly; 33 36