mirror of
https://github.com/Jokiller230/puzzlevision.git
synced 2025-09-09 20:30:05 +00:00
✨ (modules/flake) improve library loading and implement system class module mappings
This commit is contained in:
parent
7d16e19c8b
commit
f139b88c0b
9 changed files with 144 additions and 73 deletions
43
modules/nixos/utils/vm/default.nix
Normal file
43
modules/nixos/utils/vm/default.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
namespace,
|
||||
puzzlelib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkIf mkMerge;
|
||||
inherit (puzzlelib) mkOpt mkBool;
|
||||
|
||||
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";
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue