refactor: condense some small modules into misc

This commit is contained in:
Youwen Wu 2024-12-23 02:14:20 -08:00
parent c9c3e3f6cb
commit ce89f8149e
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
3 changed files with 37 additions and 39 deletions

View file

@ -10,11 +10,10 @@
./fonts ./fonts
./gaming ./gaming
./greeter ./greeter
./hamachi
./networking ./networking
./spotifyd
./stylix ./stylix
./wine ./wine
./wsl ./wsl
./misc
]; ];
} }

View file

@ -1,31 +0,0 @@
{
pkgs,
lib,
config,
...
}:
let
cfg = config.liminalOS.system.fonts;
in
{
options.liminalOS.system.fonts = {
enable = lib.mkEnableOption "fonts";
};
config = lib.mkIf cfg.enable {
fonts = {
enableDefaultPackages = true;
packages =
with pkgs;
[
noto-fonts-cjk-sans
(google-fonts.override { fonts = [ "Lora" ]; })
]
++ (lib.optionals (!config.liminalOS.theming.enable) [
noto-fonts
noto-fonts-emoji
nerd-fonts.caskaydia-cove
]);
};
};
}

View file

@ -1,25 +1,55 @@
{ config, lib, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.liminalOS.system.printing; cfg = config.liminalOS.system.printing;
inherit (lib) mkIf;
in in
{ {
options.liminalOS.system.printing = { options.liminalOS.system = {
enable = lib.mkOption { printing.enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = config.liminalOS.enable; default = config.liminalOS.enable;
description = '' description = ''
Whether to set up default options for printing and printer discover on UNIX. Whether to set up default options for printing and printer discover on UNIX.
''; '';
}; };
fonts.enable = lib.mkEnableOption "fonts";
distrobox.enable = lib.mkEnableOption "distrobox and podman";
}; };
config = lib.mkIf cfg.enable { config = {
services.printing.enable = true; services.printing.enable = mkIf cfg.printing.enable true;
services.avahi = { services.avahi = mkIf cfg.printing.enable {
enable = true; enable = true;
nssmdns4 = true; nssmdns4 = true;
openFirewall = true; openFirewall = true;
}; };
fonts = mkIf cfg.fonts.enable {
enableDefaultPackages = true;
packages =
with pkgs;
[
noto-fonts-cjk-sans
(google-fonts.override { fonts = [ "Lora" ]; })
]
++ (lib.optionals (!config.liminalOS.theming.enable) [
noto-fonts
noto-fonts-emoji
nerd-fonts.caskaydia-cove
]);
};
virtualisation.podman = cfg.distrobox.enable {
enable = true;
dockerCompat = true;
};
environment.systemPackages = cfg.distrobox.enable [ pkgs.distrobox ];
}; };
} }