Source system and user qvm.conf; add memory/cpus options; fix flake path

This commit is contained in:
Joshua Bell 2026-01-26 10:21:23 -06:00
parent e28d1fa14f
commit 8d68e1daf9
4 changed files with 37 additions and 3 deletions

View file

@ -15,12 +15,36 @@
{
nixosModules.default =
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.qvm;
in
{
options.programs.qvm = {
memory = lib.mkOption {
type = lib.types.str;
default = "8G";
description = "Amount of memory to allocate to the VM (e.g., '8G', '16G')";
};
cpus = lib.mkOption {
type = lib.types.int;
default = 4;
description = "Number of CPU cores to allocate to the VM";
};
};
config = {
environment.systemPackages = [ self.packages.${pkgs.system}.qvm ];
environment.etc."xdg/qvm/qvm.conf".text = ''
QVM_MEMORY="${cfg.memory}"
QVM_CPUS="${toString cfg.cpus}"
'';
};
};
}