refactor: massively overhaul home manager module system

This commit is contained in:
Youwen Wu 2024-12-25 19:47:59 -08:00
parent b2270408fc
commit a506d2aed4
Signed by: youwen
GPG key ID: 865658ED1FE61EC3
64 changed files with 5201 additions and 64 deletions

View file

@ -20,6 +20,7 @@ in
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
};
}

View file

@ -9,7 +9,13 @@ let
in
{
options.liminalOS.desktop = {
enable = lib.mkEnableOption "liminalOS desktop environment with Hyprland and other utilities";
enable = lib.mkOption {
type = lib.types.bool;
default = config.liminalOS.enable;
description = ''
Whether to enable the liminalOS desktop environment.
'';
};
hyprland.enable = lib.mkOption {
type = lib.types.bool;
default = cfg.enable;

View file

@ -27,6 +27,7 @@ in
};
config = lib.mkIf cfg.enable {
xdg.portal.enable = true;
services.flatpak = {
enable = true;

View file

@ -55,9 +55,21 @@ in
default = pkgs.neovim;
description = "Default text editor that will be installed and set as $EDITOR. Set to null to disable setting and installing default text editor.";
};
formFactor = lib.mkOption {
type = lib.types.nullOr (
lib.types.enum [
"laptop"
"desktop"
]
);
default = null;
description = ''
Form factor of the machine. Adjusts some UI settings.
'';
};
};
config = {
config = lib.mkIf cfg.enable {
services.printing.enable = mkIf cfg.system.printing.enable true;
services.avahi = mkIf cfg.system.printing.enable {
@ -113,5 +125,14 @@ in
LC_TIME = "en_US.UTF-8";
};
};
assertions = [
{
assertion = cfg.formFactor != null;
message = ''
You must set `liminalOS.formFactor` to either "laptop" or "desktop"!
'';
}
];
};
}

View file

@ -19,7 +19,13 @@ let
in
{
options.liminalOS.system.networking = {
enable = lib.mkEnableOption "networking";
enable = lib.mkOption {
type = lib.types.bool;
default = config.liminalOS.enable;
description = ''
Whether to enable networking features.
'';
};
firewallPresets = {
grimDawn = lib.mkEnableOption "firewall ports for Grim Dawn";
vite = lib.mkEnableOption "firewall ports for Vite";

View file

@ -10,7 +10,13 @@ let
in
{
options.liminalOS.theming = {
enable = lib.mkEnableOption "theming";
enable = lib.mkOption {
type = lib.types.bool;
default = config.liminalOS.enable;
description = ''
Whether to uniformly theme the entire system using Stylix.
'';
};
plymouth.enable = lib.mkOption {
type = lib.types.bool;
default = cfg.enable;