Source system and user qvm.conf; add memory/cpus options; fix flake path
This commit is contained in:
parent
e28d1fa14f
commit
8d68e1daf9
4 changed files with 37 additions and 3 deletions
24
flake.nix
24
flake.nix
|
|
@ -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}"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue