02cf88bb76
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
49 lines
895 B
Nix
49 lines
895 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.virtualisation.appvm;
|
|
|
|
in {
|
|
|
|
options = {
|
|
virtualisation.appvm = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = lib.mdDoc ''
|
|
This enables AppVMs and related virtualisation settings.
|
|
'';
|
|
};
|
|
user = mkOption {
|
|
type = types.str;
|
|
description = lib.mdDoc ''
|
|
AppVM user login. Currenly only AppVMs are supported for a single user only.
|
|
'';
|
|
};
|
|
};
|
|
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
virtualisation.libvirtd = {
|
|
enable = true;
|
|
qemu.verbatimConfig = ''
|
|
namespaces = []
|
|
user = "${cfg.user}"
|
|
group = "users"
|
|
remember_owner = 0
|
|
'';
|
|
};
|
|
|
|
users.users."${cfg.user}" = {
|
|
packages = [ pkgs.appvm ];
|
|
extraGroups = [ "libvirtd" ];
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|