Files
nixos-blueprint/modules/nixos/system/stylix/default.nix
unexplrd 1ae179eb85 hosts/dunamis/configuration.nix: rose-pine-moon
modules/nixos/system/stylix/default.nix: change serif to inter

Signed-off-by: unexplrd <unexplrd@linerds.us>
2025-06-28 17:35:18 +03:00

366 lines
9.3 KiB
Nix

{
config,
inputs,
lib,
pkgs,
...
}: let
inherit (builtins) fetchurl;
inherit (lib) mkEnableOption mkOption mkIf;
inherit (lib) optionalAttrs;
inherit (lib.types) bool str;
cfg = config.module.stylix;
interPackage = pkgs.inter-nerdfont;
iosevkaPackage = pkgs.nerd-fonts.iosevka;
iosevkaTermPackage = pkgs.nerd-fonts.iosevka-term;
mesloLgPackage = pkgs.nerd-fonts.meslo-lg;
# jetBrainsMonoPackage = pkgs.nerd-fonts.jetbrains-mono;
geistMonoPackage = pkgs.nerd-fonts.geist-mono;
geistPackage = pkgs.geist-font;
wallpapers = {
abstract = {
squares = fetchurl {
url = "https://w.wallhaven.cc/full/p9/wallhaven-p91dym.jpg";
name = "wallhaven-p91dym.jpg";
sha256 = "wnsAhh0Soxm+lxahh+Xc/+CAw/abWgPIkeoOlzNGaDo=";
};
};
fern-outline = fetchurl {
url = "https://w.wallhaven.cc/full/p9/wallhaven-p9m7ve.png";
name = "wallhaven-p9m7ve.png";
sha256 = "0r7dl4fjwv2p5q5ggr4sjsl2h5m0s98k9qhiwkvmwi010lyffkx7";
};
mountains-pink = fetchurl {
url = "https://w.wallhaven.cc/full/yq/wallhaven-yq7gox.jpg";
name = "wallhaven-yq7gox.jpg";
sha256 = "09s31spp9mq71fgkl1w80nzdc1458p1gjfyi3y6fy14wj2dza0pj";
};
mountains-black = fetchurl {
url = "https://w.wallhaven.cc/full/9d/wallhaven-9djzww.jpg";
name = "wallhaven-9djzww.jpg";
sha256 = "1p2si922i9qs09h8c74lrvx0f284g0xvm7lh85gk1x7lqhn611zm";
};
cyber-dawn = fetchurl {
url = "https://w.wallhaven.cc/full/ym/wallhaven-ymo2y7.png";
name = "wallhaven-ymo2y7.png";
sha256 = "1b3j0hxxy8m25scq42lxsxc99xvr15pha1j4wplgz761asrvxly3";
};
nixos-rainbow = fetchurl {
url = "https://w.wallhaven.cc/full/p9/wallhaven-p9pd23.png";
name = "wallhaven-p9pd23.png";
sha256 = "7CMuETntiVUCKhUIdJzX+sf3F47GvuX2a61o4xbEzww=";
};
mountains-sepia = fetchurl {
url = "https://w.wallhaven.cc/full/k8/wallhaven-k89k81.jpg";
name = "wallhaven-k89k81.jpg";
sha256 = "C0lvJ0ff0mCC3i9mmeHZsj/n6Ehkp3jaslVr7VDUB3k=";
};
jcurry-cloud = fetchurl {
url = "https://w.wallhaven.cc/full/7j/wallhaven-7j6wpy.jpg";
name = "wallhaven-je8rwq.jpg";
sha256 = "xsuCYc0mCDkrJZ+BUmEEclAfF17g1n39JHeubtZHP78=";
};
vapor-moon = fetchurl {
url = "https://w.wallhaven.cc/full/lm/wallhaven-lm6d2r.png";
name = "wallhaven-lm6d2r.png";
sha256 = "V07kj2zwFHDwzIN8QE8IFrJMXxDOBoK9C11sQGgTjyQ=";
};
};
themes = {
rose-pine-dawn = {
polarity = "light";
scheme = "${pkgs.base16-schemes}/share/themes/rose-pine-dawn.yaml";
wallpaper = wallpapers.cyber-dawn;
serif = {
package = iosevkaPackage;
name = "Iosevka Nerd Font Propo";
};
monospace = {
package = iosevkaTermPackage;
name = "IosevkaTerm Nerd Font Mono";
};
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 24;
};
};
rose-pine-moon = {
polarity = "dark";
scheme = "${pkgs.base16-schemes}/share/themes/rose-pine-moon.yaml";
wallpaper = wallpapers.cyber-dawn;
serif = {
package = interPackage;
name = "Inter Nerd Font";
};
monospace = {
package = iosevkaTermPackage;
name = "IosevkaTerm Nerd Font Mono";
};
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
};
gruvbox-dark-pale = {
polarity = "dark";
scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-pale.yaml";
wallpaper = wallpapers.mountains-sepia;
serif = {
package = geistPackage;
name = "Geist";
};
monospace = {
package = geistMonoPackage;
name = "GeistMono Nerd Font";
};
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
};
nord = {
polarity = "dark";
scheme = "${pkgs.base16-schemes}/share/themes/nord.yaml";
wallpaper = fetchurl {
url = "https://w.wallhaven.cc/full/l8/wallhaven-l8l9gq.png";
name = "wallhaven-l8l9gq.png";
sha256 = "0ypr44sg0fn55m1b52dgr1nnscpi2p6rfkjsm7vvrdqw7bafbx2z";
};
serif = {
package = iosevkaPackage;
name = "Iosevka Nerd Font Propo";
};
monospace = {
package = iosevkaTermPackage;
name = "IosevkaTerm Nerd Font Mono";
};
cursor = {
package = pkgs.nordzy-cursor-theme;
name = "Nordzy-cursors";
size = 32;
};
};
nord-light = {
polarity = "light";
scheme = "${pkgs.base16-schemes}/share/themes/nord-light.yaml";
wallpaper = fetchurl {
url = "https://w.wallhaven.cc/full/l8/wallhaven-l8l9gq.png";
name = "wallhaven-l8l9gq.png";
sha256 = "0ypr44sg0fn55m1b52dgr1nnscpi2p6rfkjsm7vvrdqw7bafbx2z";
};
serif = {
package = iosevkaPackage;
name = "Iosevka Nerd Font Propo";
};
monospace = {
package = iosevkaTermPackage;
name = "IosevkaTerm Nerd Font Mono";
};
cursor = {
package = pkgs.nordzy-cursor-theme;
name = "Nordzy-cursors-white";
size = 32;
};
};
helios = {
polarity = "dark";
scheme = "${pkgs.base16-schemes}/share/themes/helios.yaml";
wallpaper = fetchurl {
url = "https://w.wallhaven.cc/full/lq/wallhaven-lqorw2.png";
name = "wallhaven-lqorw2.png";
sha256 = "sha256:1rjchjq4pc2jyq8dvpa17mmscv9qcm0h0zv468lsf8s51anpid6p";
};
serif = {
package = interPackage;
name = "Inter Nerd Font";
};
monospace = {
package = iosevkaTermPackage;
name = "IosevkaTerm Nerd Font Mono";
};
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
};
sulphurpool = {
polarity = "dark";
scheme = "${pkgs.base16-schemes}/share/themes/atelier-sulphurpool.yaml";
wallpaper = fetchurl {
url = "https://w.wallhaven.cc/full/rd/wallhaven-rd5q3m.jpg";
name = "wallhaven-rd5q3m.jpg";
sha256 = "sha256:1sa2739vwwv1xafzjvxlg3kvq26xmcxg6hrwq29q40j617r63sy6";
};
serif = {
package = interPackage;
name = "Inter Nerd Font";
};
monospace = {
package = iosevkaTermPackage;
name = "IosevkaTerm Nerd Font Mono";
};
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
};
himalaya = {
# lightly pink like himalayan salt
polarity = "light";
scheme = "${pkgs.base16-schemes}/share/themes/atelier-plateau-light.yaml";
wallpaper = wallpapers.mountains-pink;
serif = {
package = interPackage;
name = "Inter Nerd Font";
};
monospace = {
package = mesloLgPackage;
name = "MesloLGM Nerd Font Mono";
};
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 24;
};
};
vesper = {
polarity = "dark";
scheme = "${pkgs.base16-schemes}/share/themes/vesper.yaml";
wallpaper = wallpapers.abstract.squares;
serif = {
package = geistPackage;
name = "Geist";
};
monospace = {
package = geistMonoPackage;
name = "GeistMono Nerd Font";
};
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
};
github = {
polarity = "light";
scheme = "${pkgs.base16-schemes}/share/themes/github.yaml";
wallpaper = wallpapers.abstract.squares;
serif = {
package = geistPackage;
name = "Geist Light";
};
monospace = {
package = geistMonoPackage;
name = "GeistMono Nerd Font";
};
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 24;
};
};
};
in {
imports = with inputs; [
stylix.nixosModules.stylix
];
options = {
module.stylix = {
enable = mkEnableOption "enable stylix";
useCursor = mkOption {
type = bool;
default = true;
description = "enable cursor settings";
};
theme = mkOption {
type = str;
default = "nord";
};
};
};
config = mkIf cfg.enable {
stylix =
{
enable = true;
image = themes.${cfg.theme}.wallpaper;
autoEnable = true;
polarity = themes.${cfg.theme}.polarity;
base16Scheme = themes.${cfg.theme}.scheme;
opacity = {
applications = 1.0;
terminal = 1.0;
popups = 1.0;
desktop = 1.0;
};
fonts = {
sizes = {
applications = 13;
terminal = 13;
popups = 14;
desktop = 13;
};
serif = {
inherit (themes.${cfg.theme}.serif) package name;
};
sansSerif = config.stylix.fonts.serif;
monospace = {
inherit (themes.${cfg.theme}.monospace) package name;
};
emoji = config.stylix.fonts.serif;
};
}
// optionalAttrs cfg.useCursor {
cursor = {
inherit (themes.${cfg.theme}.cursor) package name size;
};
};
};
}