mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-11-27 10:31:31 +00:00
nixos configuration module
This commit is contained in:
parent
77eada72c3
commit
5376e7a56f
40
nixos/default.nix
Normal file
40
nixos/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
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 ];
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in a new issue