Merge branch 'master' into staging
Conflicts (simple): pkgs/development/lisp-modules/clwrapper/setup-hook.sh
This commit is contained in:
75
nixos/modules/virtualisation/lxc.nix
Normal file
75
nixos/modules/virtualisation/lxc.nix
Normal file
@@ -0,0 +1,75 @@
|
||||
# LXC Configuration
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.virtualisation.lxc;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
###### interface
|
||||
|
||||
options.virtualisation.lxc = {
|
||||
enable =
|
||||
mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description =
|
||||
''
|
||||
This enables Linux Containers (LXC), which provides tools
|
||||
for creating and managing system or application containers
|
||||
on Linux.
|
||||
'';
|
||||
};
|
||||
|
||||
systemConfig =
|
||||
mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description =
|
||||
''
|
||||
This is the system-wide LXC config. See lxc.system.conf(5).
|
||||
'';
|
||||
};
|
||||
|
||||
defaultConfig =
|
||||
mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description =
|
||||
''
|
||||
Default config (default.conf) for new containers, i.e. for
|
||||
network config. See lxc.container.conf(5).
|
||||
'';
|
||||
};
|
||||
|
||||
usernetConfig =
|
||||
mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description =
|
||||
''
|
||||
This is the config file for managing unprivileged user network
|
||||
administration access in LXC. See lxc-user-net(5).
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.lxc ];
|
||||
|
||||
environment.etc."lxc/lxc.conf".text = cfg.systemConfig;
|
||||
environment.etc."lxc/lxc-usernet".text = cfg.usernetConfig;
|
||||
environment.etc."lxc/default.conf".text = cfg.defaultConfig;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
93
nixos/modules/virtualisation/parallels-guest.nix
Normal file
93
nixos/modules/virtualisation/parallels-guest.nix
Normal file
@@ -0,0 +1,93 @@
|
||||
{ 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 = ''
|
||||
This enables Parallel Tools for Linux guests, along with provided
|
||||
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" ];
|
||||
|
||||
services.ntp.enable = false;
|
||||
|
||||
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" ];
|
||||
bindsTo = [ "cupsd.service" ];
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
ExecStart = "${prl-tools}/bin/prlshprint";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user