2014-11-10 23:32:05 +00:00
|
|
|
{ config, lib, pkgs, pkgs_i686, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
prl-tools = config.boot.kernelPackages.prl-tools;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options = {
|
|
|
|
hardware.parallels = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf config.hardware.parallels.enable {
|
|
|
|
|
|
|
|
services.xserver = {
|
|
|
|
drivers = singleton
|
|
|
|
{ name = "prlvideo"; modules = [ prl-tools ]; libPath = [ prl-tools ]; };
|
|
|
|
|
|
|
|
screenSection = ''
|
|
|
|
Option "NoMTRR"
|
|
|
|
'';
|
|
|
|
|
|
|
|
config = ''
|
|
|
|
Section "InputClass"
|
|
|
|
Identifier "prlmouse"
|
|
|
|
MatchIsPointer "on"
|
|
|
|
MatchTag "prlmouse"
|
|
|
|
Driver "prlmouse"
|
|
|
|
EndSection
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware.opengl.package = prl-tools;
|
|
|
|
hardware.opengl.package32 = pkgs_i686.linuxPackages.prl-tools.override { libsOnly = true; kernel = null; };
|
|
|
|
|
|
|
|
services.udev.packages = [ prl-tools ];
|
|
|
|
|
|
|
|
environment.systemPackages = [ prl-tools ];
|
|
|
|
|
|
|
|
boot.extraModulePackages = [ prl-tools ];
|
|
|
|
|
|
|
|
boot.kernelModules = [ "prl_tg" "prl_eth" "prl_fs" "prl_fs_freeze" "acpi_memhotplug" ];
|
|
|
|
|
2016-12-14 22:49:14 +00:00
|
|
|
services.timesyncd.enable = false;
|
2014-11-10 23:32:05 +00:00
|
|
|
|
|
|
|
systemd.services.prltoolsd = {
|
|
|
|
description = "Parallels Tools' service";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${prl-tools}/bin/prltoolsd -f";
|
|
|
|
PIDFile = "/var/run/prltoolsd.pid";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.prlfsmountd = {
|
|
|
|
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 06:00:56 +00:00
|
|
|
bindsTo = [ "cups.service" ];
|
2014-11-10 23:32:05 +00:00
|
|
|
serviceConfig = {
|
|
|
|
Type = "forking";
|
|
|
|
ExecStart = "${prl-tools}/bin/prlshprint";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|