From 6590279a6825a3276326078833657ea440182d51 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 25 Dec 2024 23:37:17 -0800 Subject: [PATCH] feat: configure wallpaper, polarity, colorscheme options --- modules/linux/stylix/default.nix | 36 ++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/modules/linux/stylix/default.nix b/modules/linux/stylix/default.nix index aa8d32a..ec93226 100644 --- a/modules/linux/stylix/default.nix +++ b/modules/linux/stylix/default.nix @@ -1,5 +1,4 @@ { - inputs, pkgs, config, lib, @@ -24,16 +23,41 @@ in Whether to enable plymouth and sane defaults. ''; }; + wallpaper = lib.mkOption { + type = lib.types.path; + default = "../../../hm/modules/common/shellenv/fastfetch/nixos-logo.png"; + description = '' + Path to wallpaper to set as background and generate system colorscehme from. + ''; + }; + polarity = lib.mkOption { + type = lib.types.nullOr ( + lib.types.enum [ + "light" + "dark" + ] + ); + default = null; + description = '' + Whether to force colorscheme to be generated as light or dark theme. Set to null to automatically determine. + ''; + }; + base16Scheme = lib.mkOption { + type = lib.types.nullOr lib.types.path; + default = null; + description = '' + Base 16 colorscheme from base16-schemes to override wallpaper generated colorscheme with. Set to null to use wallpaper generated scheme. + Example: ''${pkgs.base16-schemes}/share/themes/rose-pine.yaml + ''; + }; }; config = lib.mkIf cfg.enable { stylix = { enable = true; - image = "${inputs.wallpapers}/aesthetic/afterglow_city_skyline_at_night.png"; - # image = "${inputs.wallpapers}/aesthetic/red_deadly_sun.jpg"; - # image = "${inputs.wallpapers}/aesthetic/afterglow_sand_dunes.jpg"; - base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine.yaml"; - polarity = "dark"; + image = lib.mkIf (cfg.wallpaper != null) cfg.wallpaper; + base16Scheme = lib.mkIf (cfg.base16Scheme != null) cfg.base16Scheme; + polarity = lib.mkIf (cfg.polarity != null) cfg.polarity; fonts = { serif = {