mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-11-17 01:33:00 +00:00
41 lines
821 B
Nix
41 lines
821 B
Nix
|
params@{ config, lib, pkgs, ... }:
|
||
|
let
|
||
|
cfg = config.virtualisation.appvm;
|
||
|
appvm = import ../. params;
|
||
|
in with lib; {
|
||
|
|
||
|
options = {
|
||
|
virtualisation.appvm = {
|
||
|
enable = mkOption {
|
||
|
type = types.bool;
|
||
|
default = false;
|
||
|
description = ''
|
||
|
This enables AppVMs and related virtualisation settings.
|
||
|
'';
|
||
|
};
|
||
|
user = mkOption {
|
||
|
type = types.str;
|
||
|
description = ''
|
||
|
AppVM user login. Currenly only AppVMs are supported for a single user only.
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
|
||
|
};
|
||
|
|
||
|
config = mkIf cfg.enable {
|
||
|
virtualisation.libvirtd = {
|
||
|
enable = true;
|
||
|
qemuVerbatimConfig = ''
|
||
|
namespaces = []
|
||
|
user = "${cfg.user}"
|
||
|
group = "users"
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
users.users."${cfg.user}".packages = [ appvm ];
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|