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