2024-11-15 21:11:42 -08:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
2024-11-21 20:28:46 -08:00
|
|
|
system,
|
2025-01-12 12:12:40 -08:00
|
|
|
pkgs,
|
2024-11-15 21:11:42 -08:00
|
|
|
...
|
2025-01-09 08:08:30 -08:00
|
|
|
}: let
|
2024-11-21 20:28:46 -08:00
|
|
|
inherit (lib.snowfall.system) is-linux;
|
|
|
|
|
2024-11-16 22:34:40 -08:00
|
|
|
cfg = config.marleyos.theme;
|
2024-11-15 21:11:42 -08:00
|
|
|
|
|
|
|
# https://github.com/nix-community/home-manager/blob/master/modules/misc/gtk.nix
|
2025-01-12 09:44:58 -08:00
|
|
|
iconThemeType = lib.types.submodule {
|
2024-11-15 21:11:42 -08:00
|
|
|
options = {
|
2025-01-12 09:44:58 -08:00
|
|
|
package = lib.mkOption {
|
|
|
|
type = with lib.types; nullOr package;
|
2024-11-15 21:11:42 -08:00
|
|
|
default = null;
|
2025-01-12 12:12:40 -08:00
|
|
|
example = pkgs.gnome.adwaita-icon-theme;
|
2024-11-15 21:11:42 -08:00
|
|
|
description = ''
|
|
|
|
Package providing the icon theme. This package will be installed to
|
|
|
|
your profile. If `null` then the theme is assumed to already be
|
|
|
|
available in your profile.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2025-01-12 09:44:58 -08:00
|
|
|
name = lib.mkOption {
|
|
|
|
type = with lib.types; str;
|
2024-11-15 21:11:42 -08:00
|
|
|
example = "Adwaita";
|
|
|
|
description = "The name of the icon theme within the package.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2025-01-12 12:12:40 -08:00
|
|
|
|
|
|
|
mkFontType = type: default: (lib.mkOption {
|
|
|
|
type = lib.types.submodule {
|
|
|
|
options = {
|
|
|
|
package = lib.mkOption {
|
|
|
|
type = with lib.types; package;
|
|
|
|
default = default.package;
|
|
|
|
description = "The package providing the ${type} font.";
|
|
|
|
};
|
|
|
|
|
|
|
|
name = lib.mkOption {
|
|
|
|
type = with lib.types; str;
|
|
|
|
default = default.name;
|
|
|
|
description = "The name of the ${type} font.";
|
|
|
|
};
|
|
|
|
|
|
|
|
ligatures = lib.mkOption {
|
|
|
|
type = with lib.types; listOf str;
|
|
|
|
default = default.ligatures;
|
|
|
|
description = "The ligature features to enable for programs that support it.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
inherit default;
|
|
|
|
description = "The ${type} font to use.";
|
|
|
|
});
|
2025-01-09 08:08:30 -08:00
|
|
|
in {
|
2024-11-16 22:34:40 -08:00
|
|
|
options.marleyos.theme = {
|
2025-01-12 09:44:58 -08:00
|
|
|
icons = lib.mkOption {
|
|
|
|
type = with lib.types; nullOr iconThemeType;
|
2024-11-15 21:11:42 -08:00
|
|
|
default = null;
|
|
|
|
description = "The icon theme to use.";
|
|
|
|
};
|
2025-01-12 12:12:40 -08:00
|
|
|
|
|
|
|
fonts = lib.mkOption {
|
|
|
|
type = with lib.types;
|
|
|
|
submodule {
|
|
|
|
options = {
|
|
|
|
monospace = mkFontType "monospace" {
|
|
|
|
package = pkgs.maple-mono-NF;
|
|
|
|
name = "Maple Mono NF";
|
|
|
|
ligatures = [];
|
|
|
|
};
|
|
|
|
|
|
|
|
sansSerif = mkFontType "sans-serif" {
|
|
|
|
package = pkgs.dm-sans;
|
|
|
|
name = "DeepMind Sans";
|
|
|
|
ligatures = [];
|
|
|
|
};
|
|
|
|
|
|
|
|
serif = mkFontType "serif" {
|
|
|
|
package = pkgs.eb-garamond;
|
|
|
|
name = "EB Garamond";
|
|
|
|
ligatures = [];
|
|
|
|
};
|
|
|
|
|
|
|
|
emoji = mkFontType "emoji" {
|
|
|
|
package = pkgs.whatsapp-emoji-font;
|
|
|
|
name = "Apple Color Emoji";
|
|
|
|
ligatures = [];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
default = {};
|
|
|
|
description = "Default font configuration.";
|
|
|
|
};
|
2024-11-15 21:11:42 -08:00
|
|
|
};
|
|
|
|
|
2025-01-12 09:44:58 -08:00
|
|
|
config = lib.mkMerge [
|
2024-11-16 19:12:51 -08:00
|
|
|
# icons
|
2025-01-12 09:44:58 -08:00
|
|
|
(lib.mkIf ((cfg.icons != null) && (is-linux system)) {
|
|
|
|
gtk = lib.mkDefault {
|
2024-11-16 19:12:51 -08:00
|
|
|
iconTheme = {
|
|
|
|
inherit (cfg.icons) name;
|
2025-01-12 09:44:58 -08:00
|
|
|
package = lib.mkIf (cfg.icons.package != null) cfg.icons.package;
|
2024-11-16 19:12:51 -08:00
|
|
|
};
|
2024-11-23 15:15:30 -08:00
|
|
|
};
|
2024-11-15 21:11:42 -08:00
|
|
|
|
2025-01-12 09:44:58 -08:00
|
|
|
services.dunst = lib.mkDefault {
|
2024-11-16 19:12:51 -08:00
|
|
|
iconTheme = {
|
|
|
|
inherit (cfg.icons) name;
|
2025-01-12 09:44:58 -08:00
|
|
|
package = lib.mkIf (cfg.icons.package != null) cfg.icons.package;
|
2024-11-16 19:12:51 -08:00
|
|
|
};
|
2024-11-23 15:15:30 -08:00
|
|
|
};
|
2024-11-16 19:12:51 -08:00
|
|
|
})
|
2025-01-12 12:12:40 -08:00
|
|
|
|
|
|
|
# fonts
|
|
|
|
{
|
|
|
|
home.packages = [
|
|
|
|
cfg.fonts.monospace.package
|
|
|
|
cfg.fonts.sansSerif.package
|
|
|
|
cfg.fonts.serif.package
|
|
|
|
cfg.fonts.emoji.package
|
|
|
|
];
|
|
|
|
|
|
|
|
fonts.fontconfig = lib.mkIf (is-linux system) {
|
|
|
|
enable = true;
|
|
|
|
defaultFonts = {
|
|
|
|
monospace = [cfg.fonts.monospace.name];
|
|
|
|
sansSerif = [cfg.fonts.sansSerif.name];
|
|
|
|
serif = [cfg.fonts.serif.name];
|
|
|
|
emoji = [cfg.fonts.emoji.name];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2024-11-16 19:12:51 -08:00
|
|
|
];
|
2024-11-15 21:11:42 -08:00
|
|
|
}
|