2018-11-03 06:55:57 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2014-11-11 00:32:05 +01:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
2018-03-02 00:06:43 +01:00
|
|
|
prl-tools = config.hardware.parallels.package;
|
2014-11-11 00:32:05 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options = {
|
|
|
|
hardware.parallels = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
2015-09-15 08:01:02 +02:00
|
|
|
This enables Parallels Tools for Linux guests, along with provided
|
2014-11-11 00:32:05 +01:00
|
|
|
video, mouse and other hardware drivers.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2018-01-20 05:41:25 +01:00
|
|
|
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.
|
|
|
|
'';
|
|
|
|
};
|
2018-03-02 00:06:43 +01:00
|
|
|
|
|
|
|
package = mkOption {
|
2020-04-28 19:13:21 +02:00
|
|
|
type = types.nullOr types.package;
|
2018-03-02 00:06:43 +01:00
|
|
|
default = config.boot.kernelPackages.prl-tools;
|
2021-10-03 18:06:03 +02:00
|
|
|
defaultText = literalExpression "config.boot.kernelPackages.prl-tools";
|
2018-03-02 00:06:43 +01:00
|
|
|
description = ''
|
|
|
|
Defines which package to use for prl-tools. Override to change the version.
|
|
|
|
'';
|
|
|
|
};
|
2014-11-11 00:32:05 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf config.hardware.parallels.enable {
|
|
|
|
services.xserver = {
|
|
|
|
drivers = singleton
|
2019-05-24 01:21:57 +02:00
|
|
|
{ name = "prlvideo"; modules = [ prl-tools ]; };
|
2014-11-11 00:32:05 +01:00
|
|
|
|
|
|
|
screenSection = ''
|
|
|
|
Option "NoMTRR"
|
|
|
|
'';
|
|
|
|
|
|
|
|
config = ''
|
|
|
|
Section "InputClass"
|
|
|
|
Identifier "prlmouse"
|
|
|
|
MatchIsPointer "on"
|
|
|
|
MatchTag "prlmouse"
|
|
|
|
Driver "prlmouse"
|
|
|
|
EndSection
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware.opengl.package = prl-tools;
|
2018-11-03 06:55:57 +01:00
|
|
|
hardware.opengl.package32 = pkgs.pkgsi686Linux.linuxPackages.prl-tools.override { libsOnly = true; kernel = null; };
|
2019-05-24 01:21:57 +02:00
|
|
|
hardware.opengl.setLdLibraryPath = true;
|
2014-11-11 00:32:05 +01:00
|
|
|
|
|
|
|
services.udev.packages = [ prl-tools ];
|
|
|
|
|
|
|
|
environment.systemPackages = [ prl-tools ];
|
|
|
|
|
|
|
|
boot.extraModulePackages = [ prl-tools ];
|
|
|
|
|
2017-07-20 00:41:21 +02:00
|
|
|
boot.kernelModules = [ "prl_tg" "prl_eth" "prl_fs" "prl_fs_freeze" ];
|
2014-11-11 00:32:05 +01:00
|
|
|
|
2016-12-14 23:49:14 +01:00
|
|
|
services.timesyncd.enable = false;
|
2014-11-11 00:32:05 +01:00
|
|
|
|
|
|
|
systemd.services.prltoolsd = {
|
|
|
|
description = "Parallels Tools' service";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${prl-tools}/bin/prltoolsd -f";
|
|
|
|
PIDFile = "/var/run/prltoolsd.pid";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-01-20 05:41:25 +01:00
|
|
|
systemd.services.prlfsmountd = mkIf config.hardware.parallels.autoMountShares {
|
2014-11-11 00:32:05 +01:00
|
|
|
description = "Parallels Shared Folders Daemon";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = rec {
|
|
|
|
ExecStart = "${prl-tools}/sbin/prlfsmountd ${PIDFile}";
|
|
|
|
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /media";
|
|
|
|
ExecStopPost = "${prl-tools}/sbin/prlfsmountd -u";
|
|
|
|
PIDFile = "/run/prlfsmountd.pid";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.prlshprint = {
|
|
|
|
description = "Parallels Shared Printer Tool";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
2015-03-12 07:00:56 +01:00
|
|
|
bindsTo = [ "cups.service" ];
|
2014-11-11 00:32:05 +01:00
|
|
|
serviceConfig = {
|
|
|
|
Type = "forking";
|
|
|
|
ExecStart = "${prl-tools}/bin/prlshprint";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2017-07-19 21:36:24 +02:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2014-11-11 00:32:05 +01:00
|
|
|
};
|
|
|
|
}
|