feat: add theme and fonts modules to home-manager

This commit is contained in:
Dmitriy Kholkin 2025-06-07 17:55:18 +03:00
parent 4a6249fb1c
commit 26d72ea190
Signed by: AtaraxiaDev
GPG Key ID: FD266B810DF48DF2
3 changed files with 177 additions and 0 deletions

View File

@ -64,6 +64,7 @@ in
};
serverRole = recursiveUpdate baseRole { };
desktopRole = recursiveUpdate baseRole {
ataraxia.defaults.fonts.enable = mkDefault true;
ataraxia.defaults.sound.enable = mkDefault true;
};
in

View File

@ -0,0 +1,38 @@
{
config,
lib,
...
}:
let
inherit (lib) mkEnableOption mkIf unique;
cfg = config.ataraxia.defaults.fonts;
inherit (config.theme) fonts;
in
{
options.ataraxia.defaults.fonts = {
enable = mkEnableOption "Setup default fonts";
};
config = mkIf cfg.enable {
home.packages = unique [
fonts.sans.package
fonts.serif.package
fonts.mono.package
fonts.emoji.package
fonts.icons.package
];
fonts = {
fontconfig = {
enable = true;
defaultFonts = {
emoji = [ fonts.emoji.family ];
monospace = [ fonts.mono.family ];
sansSerif = [ fonts.sans.family ];
serif = [ fonts.serif.family ];
};
};
};
};
}

View File

@ -0,0 +1,138 @@
{ lib, pkgs, ... }:
let
inherit (lib) mkOption;
inherit (lib.types)
attrsOf
int
package
str
submodule
;
fontSubmodule = {
options = {
family = mkOption {
type = str;
};
package = mkOption {
type = package;
};
};
};
in
{
options.theme = {
colors = mkOption {
type = attrsOf str;
default = { };
};
fonts = {
sans = mkOption {
type = submodule fontSubmodule;
default = { };
};
serif = mkOption {
type = submodule fontSubmodule;
default = { };
};
mono = mkOption {
type = submodule fontSubmodule;
default = { };
};
emoji = mkOption {
type = submodule fontSubmodule;
default = { };
};
icons = mkOption {
type = submodule fontSubmodule;
default = { };
};
size = mkOption {
type = submodule {
options =
let
sizeOpt = mkOption {
type = int;
};
in
{
big = sizeOpt;
normal = sizeOpt;
small = sizeOpt;
};
};
};
};
icons = mkOption {
type = (
submodule {
options = {
name = mkOption {
type = str;
};
package = mkOption {
type = package;
};
};
}
);
default = { };
};
};
config = {
theme = {
colors = {
color0 = "1e1e2e"; # base
color1 = "181825"; # mantle
color2 = "313244"; # surface0
color3 = "45475a"; # surface1
color4 = "585b70"; # surface2
color5 = "cdd6f4"; # text
color6 = "f5e0dc"; # rosewater
color7 = "b4befe"; # lavender
color8 = "f38ba8"; # red
color9 = "fab387"; # peach
color10 = "f9e2af"; # yellow
color11 = "a6e3a1"; # green
color12 = "94e2d5"; # teal
color13 = "89b4fa"; # blue
color14 = "cba6f7"; # mauve
color15 = "f2cdcd"; # flamingo
};
fonts = {
sans = {
family = "Atkinson Hyperlegible Next";
package = pkgs.atkinson-hyperlegible-next;
};
serif = {
family = "Atkinson Hyperlegible Next";
package = pkgs.atkinson-hyperlegible-next;
};
mono = {
# family = "Atkinson Hyperlegible Mono";
# package = pkgs.atkinson-hyperlegible-mono;
family = "VictorMono Nerd Font Mono";
package = pkgs.nerd-fonts.victor-mono;
};
emoji = {
family = "Noto Color Emoji";
package = pkgs.noto-fonts-color-emoji;
};
icons = {
# family = "Material Icons";
# package = pkgs.material-icons;
family = "Rose-Pine";
package = pkgs.rosepine-gtk-icons;
};
size.big = 14;
size.normal = 12;
size.small = 11;
};
icons = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
};
};
}