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
./gaming
./greeter
./hamachi
./networking
./spotifyd
./stylix
./wine
./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
cfg = config.liminalOS.system.printing;
inherit (lib) mkIf;
in
{
options.liminalOS.system.printing = {
enable = lib.mkOption {
options.liminalOS.system = {
printing.enable = lib.mkOption {
type = lib.types.bool;
default = config.liminalOS.enable;
description = ''
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 {
services.printing.enable = true;
config = {
services.printing.enable = mkIf cfg.printing.enable true;
services.avahi = {
services.avahi = mkIf cfg.printing.enable {
enable = true;
nssmdns4 = 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 ];
};
}