2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
prl-tools = config.hardware.parallels.package;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options = {
|
|
|
|
hardware.parallels = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc ''
|
2020-04-24 23:36:52 +00:00
|
|
|
This enables Parallels Tools for Linux guests, along with provided
|
|
|
|
video, mouse and other hardware drivers.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
package = mkOption {
|
2020-09-25 04:45:31 +00:00
|
|
|
type = types.nullOr types.package;
|
2020-04-24 23:36:52 +00:00
|
|
|
default = config.boot.kernelPackages.prl-tools;
|
2022-07-18 16:21:45 +00:00
|
|
|
defaultText = "config.boot.kernelPackages.prl-tools";
|
|
|
|
example = literalExpression "config.boot.kernelPackages.prl-tools";
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc ''
|
2020-04-24 23:36:52 +00:00
|
|
|
Defines which package to use for prl-tools. Override to change the version.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf config.hardware.parallels.enable {
|
|
|
|
|
|
|
|
services.udev.packages = [ prl-tools ];
|
|
|
|
|
|
|
|
environment.systemPackages = [ prl-tools ];
|
|
|
|
|
|
|
|
boot.extraModulePackages = [ prl-tools ];
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
boot.kernelModules = [ "prl_fs" "prl_fs_freeze" "prl_tg" ]
|
|
|
|
++ optional (pkgs.stdenv.hostPlatform.system == "aarch64-linux") "prl_notifier";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
services.timesyncd.enable = false;
|
|
|
|
|
|
|
|
systemd.services.prltoolsd = {
|
2022-07-18 16:21:45 +00:00
|
|
|
description = "Parallels Tools Service";
|
2020-04-24 23:36:52 +00:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
2022-07-18 16:21:45 +00:00
|
|
|
path = [ prl-tools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${prl-tools}/bin/prltoolsd -f";
|
|
|
|
PIDFile = "/var/run/prltoolsd.pid";
|
2022-07-18 16:21:45 +00:00
|
|
|
WorkingDirectory = "${prl-tools}/bin";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.prlfsmountd = mkIf config.hardware.parallels.autoMountShares {
|
2022-07-18 16:21:45 +00:00
|
|
|
description = "Parallels Guest File System Sharing Tool";
|
2020-04-24 23:36:52 +00:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
2022-07-18 16:21:45 +00:00
|
|
|
path = [ prl-tools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
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";
|
2022-07-18 16:21:45 +00:00
|
|
|
WorkingDirectory = "${prl-tools}/bin";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.prlshprint = {
|
2022-07-18 16:21:45 +00:00
|
|
|
description = "Parallels Printing Tool";
|
2020-04-24 23:36:52 +00:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
bindsTo = [ "cups.service" ];
|
2022-07-18 16:21:45 +00:00
|
|
|
path = [ prl-tools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
serviceConfig = {
|
|
|
|
Type = "forking";
|
|
|
|
ExecStart = "${prl-tools}/bin/prlshprint";
|
2022-07-18 16:21:45 +00:00
|
|
|
WorkingDirectory = "${prl-tools}/bin";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.services = {
|
|
|
|
prlcc = {
|
|
|
|
description = "Parallels Control Center";
|
|
|
|
wantedBy = [ "graphical-session.target" ];
|
2022-07-18 16:21:45 +00:00
|
|
|
path = [ prl-tools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${prl-tools}/bin/prlcc";
|
2022-07-18 16:21:45 +00:00
|
|
|
WorkingDirectory = "${prl-tools}/bin";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
prldnd = {
|
2022-07-18 16:21:45 +00:00
|
|
|
description = "Parallels Drag And Drop Tool";
|
2020-04-24 23:36:52 +00:00
|
|
|
wantedBy = [ "graphical-session.target" ];
|
2022-07-18 16:21:45 +00:00
|
|
|
path = [ prl-tools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${prl-tools}/bin/prldnd";
|
2022-07-18 16:21:45 +00:00
|
|
|
WorkingDirectory = "${prl-tools}/bin";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
prlcp = {
|
2022-07-18 16:21:45 +00:00
|
|
|
description = "Parallels Copy Paste Tool";
|
2020-04-24 23:36:52 +00:00
|
|
|
wantedBy = [ "graphical-session.target" ];
|
2022-07-18 16:21:45 +00:00
|
|
|
path = [ prl-tools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${prl-tools}/bin/prlcp";
|
2022-07-18 16:21:45 +00:00
|
|
|
Restart = "always";
|
|
|
|
WorkingDirectory = "${prl-tools}/bin";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
prlsga = {
|
|
|
|
description = "Parallels Shared Guest Applications Tool";
|
|
|
|
wantedBy = [ "graphical-session.target" ];
|
2022-07-18 16:21:45 +00:00
|
|
|
path = [ prl-tools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${prl-tools}/bin/prlsga";
|
2022-07-18 16:21:45 +00:00
|
|
|
WorkingDirectory = "${prl-tools}/bin";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
prlshprof = {
|
|
|
|
description = "Parallels Shared Profile Tool";
|
|
|
|
wantedBy = [ "graphical-session.target" ];
|
2022-07-18 16:21:45 +00:00
|
|
|
path = [ prl-tools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${prl-tools}/bin/prlshprof";
|
2022-07-18 16:21:45 +00:00
|
|
|
WorkingDirectory = "${prl-tools}/bin";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|