liminalOS/modules/linux/misc/default.nix

62 lines
1.4 KiB
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}:
2024-12-23 02:09:52 -08:00
let
cfg = config.liminalOS.system;
inherit (lib) mkIf;
2024-12-23 02:09:52 -08:00
in
{
options.liminalOS.system = {
printing.enable = lib.mkOption {
2024-12-23 02:09:52 -08:00
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.mkOption {
type = lib.types.bool;
default = config.liminalOS.enable;
description = ''
Whether to set up some nice default fonts, including a Nerd Font, Noto Fonts, and CJK.
'';
};
distrobox.enable = lib.mkEnableOption "distrobox and podman";
2024-12-23 02:09:52 -08:00
};
config = {
services.printing.enable = mkIf cfg.printing.enable true;
2024-12-23 02:09:52 -08:00
services.avahi = mkIf cfg.printing.enable {
2024-12-23 02:09:52 -08:00
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 = mkIf cfg.distrobox.enable {
enable = true;
dockerCompat = true;
};
environment.systemPackages = mkIf cfg.distrobox.enable [ pkgs.distrobox ];
2024-12-23 02:09:52 -08:00
};
}