🚧 Initial work on generating homeConfigurations output + syntax changes

This commit is contained in:
Jo 2025-03-25 23:46:13 +01:00
parent f139b88c0b
commit f89cbcc552
12 changed files with 131 additions and 106 deletions

View file

@ -3,13 +3,11 @@
config,
namespace,
...
}:
let
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.desktop.gnome;
in
{
options.${namespace}.desktop.gnome = { enable = mkEnableOption "Enable the gnome desktop environment ${namespace}"; };
in {
options.${namespace}.desktop.gnome = {enable = mkEnableOption "Enable the gnome desktop environment ${namespace}";};
config = mkIf cfg.enable {
services.xserver.enable = true;

View file

@ -4,14 +4,12 @@
namespace,
puzzlelib,
...
}:
let
}: let
inherit (lib) mkIf mkMerge;
inherit (puzzlelib) mkOpt mkBool;
cfg = config.${namespace}.utils.vm;
in
{
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";
@ -19,25 +17,28 @@ in
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;
};
})
(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;
};
})
];
};
}