finalize home configuration loading as nixos module, and more stuffs :3

This commit is contained in:
Jo 2025-04-24 03:01:52 +02:00
parent f89cbcc552
commit dc87b2c186
16 changed files with 192 additions and 87 deletions

View file

@ -1,44 +1,26 @@
{
lib,
config,
namespace,
puzzlelib,
self,
...
}: let
inherit (lib) mkIf mkMerge;
inherit (puzzlelib) mkOpt mkBool;
inherit (lib) mkIf;
inherit (self) namespace;
cfg = config.${namespace}.utils.vm;
in {
options.${namespace}.utils.vm = {
enable = mkBool true "Whether to enable custom vm presets";
preset = mkOpt lib.types.str "performance" "Specify the prefered vm settings preset: performance, balance or powersave";
enable = self.lib.mkBool true "Whether to enable custom vm presets";
preset = self.lib.mkOpt lib.types.str "performance" "Specify the prefered vm settings preset: performance, balance or powersave";
};
config = mkIf cfg.enable {
virtualisation.vmVariant = mkMerge [
(mkIf cfg.preset
== "performance" {
virtualisation = {
cores = 6;
memorySize = 4096;
graphics = true;
};
})
(mkIf cfg.preset
== "balance" {
virtualisation = {
cores = 4;
memorySize = 2048;
};
})
(mkIf cfg.preset
== "powersave" {
virtualisation = {
cores = 2;
memorySize = 1024;
};
})
];
virtualisation.vmVariant = {
virtualisation = {
cores = 6;
memorySize = 4096;
graphics = true;
};
};
};
}