From f06c243d432d39d00fdc104143b5bb58a3611342 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sun, 12 Jan 2025 15:29:50 -0800 Subject: [PATCH] refactor(home): Remove color options from marleyos.theme --- flake.nix | 4 + modules/home/appearance/base/default.nix | 30 +- modules/home/appearance/gtk/default.nix | 3 +- modules/home/appearance/qt/default.nix | 9 +- modules/home/options/theme/default.nix | 79 ---- modules/home/programs/amfora/default.nix | 21 +- modules/home/programs/bat/default.nix | 28 +- modules/home/programs/btop/default.nix | 10 +- modules/home/programs/cava/default.nix | 10 +- modules/home/programs/cheat/default.nix | 45 +- modules/home/programs/fish/default.nix | 26 +- modules/home/programs/fzf/default.nix | 29 +- modules/home/programs/starship/rose-pine.nix | 449 +++++++++---------- modules/home/programs/tmux/default.nix | 31 +- modules/home/programs/wezterm/default.nix | 8 +- modules/home/programs/zathura/default.nix | 10 +- modules/home/services/dunst/default.nix | 5 +- modules/home/services/waybar/default.nix | 5 +- modules/home/wayland/hyprland/default.nix | 20 +- modules/nixos/appearance/base/default.nix | 16 + modules/nixos/appearance/console/default.nix | 13 + systems/x86_64-linux/nyx/default.nix | 7 +- 22 files changed, 376 insertions(+), 482 deletions(-) create mode 100644 modules/nixos/appearance/base/default.nix create mode 100644 modules/nixos/appearance/console/default.nix diff --git a/flake.nix b/flake.nix index 1b104c4..2a57074 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,10 @@ marleyvim.overlays.default ]; + systems.modules.nixos = with inputs; [ + rose-pine.nixosModules.rose-pine + ]; + systems.modules.darwin = with inputs; [ lix.nixosModules.default ]; diff --git a/modules/home/appearance/base/default.nix b/modules/home/appearance/base/default.nix index 2ff879c..c0c739d 100644 --- a/modules/home/appearance/base/default.nix +++ b/modules/home/appearance/base/default.nix @@ -5,41 +5,22 @@ ... }: let inherit (lib) mkEnableOption mkIf; - inherit (lib.marleyos) enabled; cfg = config.marleyos.appearance.base; - inherit (config.marleyos.theme) colors; inherit (config.marleyos) isDesktop; in { options.marleyos.appearance.base.enable = mkEnableOption "base"; config = mkIf cfg.enable { - home.packages = with pkgs; [ - # TODO: package font with harfbuzz features. - maple-mono-NF - dm-sans - eb-garamond - whatsapp-emoji-font - ]; + rose-pine = { + enable = true; + flavor = "main"; + }; - rose-pine.pointerCursor = mkIf colors.isRosePine enabled; + rose-pine.pointerCursor.enable = mkIf config.rose-pine.enable true; marleyos = { theme = { - colors = { - default = "dark"; - - dark = { - base = "rose-pine"; - flavor = "main"; - }; - - light = { - base = "rose-pine"; - flavor = "dawn"; - }; - }; - icons = { package = pkgs.kora-icon-theme; name = "kora"; @@ -49,6 +30,7 @@ in { monospace = { package = pkgs.maple-mono-NF; name = "Maple Mono NF"; + # TODO: package font with harfbuzz features. ligatures = [ "cv02" "ss01" diff --git a/modules/home/appearance/gtk/default.nix b/modules/home/appearance/gtk/default.nix index c1d43da..9f40505 100644 --- a/modules/home/appearance/gtk/default.nix +++ b/modules/home/appearance/gtk/default.nix @@ -7,7 +7,6 @@ inherit (lib.marleyos) enabled; cfg = config.marleyos.appearance.gtk; - inherit (config.marleyos.theme) colors; in { options.marleyos.appearance.gtk.enable = mkEnableOption "gtk"; @@ -17,7 +16,7 @@ in { gtk = { enable = true; - rose-pine = mkIf colors.isRosePine enabled; + rose-pine = mkIf config.rose-pine.enable enabled; gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; }; diff --git a/modules/home/appearance/qt/default.nix b/modules/home/appearance/qt/default.nix index 702a301..47cd288 100644 --- a/modules/home/appearance/qt/default.nix +++ b/modules/home/appearance/qt/default.nix @@ -3,18 +3,15 @@ config, inputs, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf; cfg = config.marleyos.appearance.qt; - inherit (config.marleyos.theme) colors; -in -{ +in { options.marleyos.appearance.qt.enable = mkEnableOption "qt"; config = mkIf cfg.enable { - xdg.configFile = mkIf (colors.base == "rose-pine") { + xdg.configFile = mkIf config.rose-pine.enable { "qt5ct/colors/rose-pine.conf" = { source = "${inputs.rose-pine-qt5ct}/rose-pine.conf"; }; diff --git a/modules/home/options/theme/default.nix b/modules/home/options/theme/default.nix index 4b16e39..072f03a 100644 --- a/modules/home/options/theme/default.nix +++ b/modules/home/options/theme/default.nix @@ -9,48 +9,6 @@ cfg = config.marleyos.theme; - colorThemes = lib.types.enum [ - "rose-pine" - ]; - - colorThemeType = lib.types.submodule { - options = { - base = lib.mkOption { - type = colorThemes; - example = "rose-pine"; - description = lib.literalMD '' - The color theme to use. This should match the base of the enable - options provided by the input's module. For instance, the rose-pine - home-manager module provides the {option}`rose-pine.enable` base - option and the {option}`programs.gtk.rose-pine.enable` option. - ''; - }; - - flavor = lib.mkOption { - type = with lib.types; nullOr str; - default = null; - example = "moon"; - description = "The theme flavor to use, if applicable."; - }; - - accent = lib.mkOption { - type = with lib.types; nullOr str; - default = null; - example = "rose"; - description = "The theme accent to use, if applicable."; - }; - }; - }; - - mkColorThemeOpt = mode: flavor: (lib.mkOption { - type = with lib.types; either str colorThemeType; - default = { - base = "rose-pine"; - inherit flavor; - }; - description = "The color theme to use in ${mode} mode."; - }); - # https://github.com/nix-community/home-manager/blob/master/modules/misc/gtk.nix iconThemeType = lib.types.submodule { options = { @@ -100,31 +58,6 @@ }); in { options.marleyos.theme = { - colors = { - default = lib.mkOption { - type = with lib.types; str; - default = "dark"; - description = "Whether to prefer the light or dark theme."; - }; - - light = mkColorThemeOpt "light" "dawn"; - dark = mkColorThemeOpt "dark" "main"; - - base = lib.mkOption { - type = colorThemes; - }; - flavor = lib.mkOption { - type = with lib.types; nullOr str; - }; - accent = lib.mkOption { - type = with lib.types; nullOr str; - }; - - isRosePine = lib.mkOption { - type = with lib.types; bool; - }; - }; - icons = lib.mkOption { type = with lib.types; nullOr iconThemeType; default = null; @@ -166,18 +99,6 @@ in { }; config = lib.mkMerge [ - # colors - { - marleyos.theme.colors = rec { - inherit (cfg.colors."${cfg.colors.default}") base; - inherit (cfg.colors."${cfg.colors.default}") flavor; - inherit (cfg.colors."${cfg.colors.default}") accent; - - # HACK: Need to come up with a better solution - isRosePine = base == "rose-pine"; - }; - } - # icons (lib.mkIf ((cfg.icons != null) && (is-linux system)) { gtk = lib.mkDefault { diff --git a/modules/home/programs/amfora/default.nix b/modules/home/programs/amfora/default.nix index a850b6b..ce2d1ca 100644 --- a/modules/home/programs/amfora/default.nix +++ b/modules/home/programs/amfora/default.nix @@ -4,20 +4,20 @@ pkgs, inputs, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf; cfg = config.marleyos.programs.amfora; - inherit (config.marleyos.theme) colors; + theme = + if config.rose-pine.enable + then "rose-pine" + else ""; themeFiles = { rose-pine = "${inputs.rose-pine-amfora}/themes/rose-pine.toml"; }; - - themeFile = themeFiles."${colors.base}"; -in -{ + themeFile = themeFiles."${theme}"; +in { options.marleyos.programs.amfora.enable = mkEnableOption "amfora"; config = mkIf cfg.enable { @@ -25,12 +25,13 @@ in amfora ]; - xdg.configFile."amfora/theme.toml".source = "${themeFile}"; + xdg.configFile."amfora/theme.toml".source = themeFile; # https://github.com/makeworld-the-better-one/amfora/blob/master/default-config.toml # Amfora requires a number of options to run - omitting everything I didn't # care to customize resulted in go panic errors. - xdg.configFile."amfora/config.toml".text = # toml + xdg.configFile."amfora/config.toml".text = + # toml '' include = "./theme.toml" @@ -53,7 +54,7 @@ in underline = true # }}} - highlight_style = "${colors.base}" + highlight_style = "${theme}" # Defaults {{{ [auth] diff --git a/modules/home/programs/bat/default.nix b/modules/home/programs/bat/default.nix index 887641e..b5923c7 100644 --- a/modules/home/programs/bat/default.nix +++ b/modules/home/programs/bat/default.nix @@ -3,15 +3,11 @@ config, pkgs, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf; - inherit (lib.marleyos) enabled; cfg = config.marleyos.programs.bat; - inherit (config.marleyos.theme) colors; -in -{ +in { options.marleyos.programs.bat.enable = mkEnableOption "bat"; config = mkIf cfg.enable { @@ -23,8 +19,6 @@ in batman ]; - rose-pine = mkIf colors.isRosePine enabled; - config = { style = "auto"; }; @@ -38,13 +32,15 @@ in functions = { cat = { wraps = "bat"; - body = # fish + body = + # fish "bat $argv"; }; cath = { wraps = "bat"; - body = # fish + body = + # fish "bat --plain --language=help $argv"; }; }; @@ -54,25 +50,29 @@ in B = { position = "anywhere"; setCursor = true; - expansion = # fish + expansion = + # fish "% | bat"; }; "-h" = { position = "anywhere"; - expansion = # fish + expansion = + # fish "-h | cath"; }; "--help" = { position = "anywhere"; - expansion = # fish + expansion = + # fish "--help | cath"; }; help = { position = "anywhere"; - expansion = # fish + expansion = + # fish "help | cath"; }; }; diff --git a/modules/home/programs/btop/default.nix b/modules/home/programs/btop/default.nix index 8df016f..08e546b 100644 --- a/modules/home/programs/btop/default.nix +++ b/modules/home/programs/btop/default.nix @@ -2,23 +2,17 @@ lib, config, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf; - inherit (lib.marleyos) enabled; cfg = config.marleyos.programs.btop; - inherit (config.marleyos.theme) colors; -in -{ +in { options.marleyos.programs.btop.enable = mkEnableOption "btop"; config = mkIf cfg.enable { programs.btop = { enable = true; - rose-pine = mkIf colors.isRosePine enabled; - settings = { theme_background = false; truecolor = true; diff --git a/modules/home/programs/cava/default.nix b/modules/home/programs/cava/default.nix index d0fe8c7..9b5de43 100644 --- a/modules/home/programs/cava/default.nix +++ b/modules/home/programs/cava/default.nix @@ -2,15 +2,11 @@ lib, config, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf; - inherit (lib.marleyos) enabled; cfg = config.marleyos.programs.cava; - inherit (config.marleyos.theme) colors; -in -{ +in { options.marleyos.programs.cava.enable = mkEnableOption "cava"; config = mkIf cfg.enable { @@ -19,8 +15,6 @@ in # ported to nixpkgs/unstable enable = false; - rose-pine = mkIf colors.isRosePine enabled; - # TODO: disable this when mpd is not enabled? Can that be detected on non # NixOS systems? settings = { diff --git a/modules/home/programs/cheat/default.nix b/modules/home/programs/cheat/default.nix index d5096a6..5002ddc 100644 --- a/modules/home/programs/cheat/default.nix +++ b/modules/home/programs/cheat/default.nix @@ -3,16 +3,13 @@ config, pkgs, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf; cfg = config.marleyos.programs.cheat; - inherit (config.marleyos.theme) colors; - toYAML = (pkgs.formats.yaml { }).generate; -in -{ + toYAML = (pkgs.formats.yaml {}).generate; +in { options.marleyos.programs.cheat.enable = mkEnableOption "cheat"; config = mkIf cfg.enable { @@ -22,28 +19,26 @@ in xdg.configFile."cheat/conf.yml".source = toYAML "conf.yml" { colorize = true; - style = "${colors.base}"; + style = lib.mkIf config.rose-pine.enable "rose-pine"; formatter = "terminal256"; pager = "less -FRX"; - cheatpaths = - let - cheatDir = "${config.xdg.configHome}/cheat/cheatsheets"; - in - [ - { - name = "community"; - path = "${cheatDir}/community"; - tags = [ "community" ]; - readonly = true; - } - { - name = "personal"; - path = "${cheatDir}/personal"; - tags = [ "personal" ]; - readonly = false; - } - ]; + cheatpaths = let + cheatDir = "${config.xdg.configHome}/cheat/cheatsheets"; + in [ + { + name = "community"; + path = "${cheatDir}/community"; + tags = ["community"]; + readonly = true; + } + { + name = "personal"; + path = "${cheatDir}/personal"; + tags = ["personal"]; + readonly = false; + } + ]; }; }; } diff --git a/modules/home/programs/fish/default.nix b/modules/home/programs/fish/default.nix index b98cbc8..655c51f 100644 --- a/modules/home/programs/fish/default.nix +++ b/modules/home/programs/fish/default.nix @@ -4,21 +4,16 @@ pkgs, system, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf optionals; inherit (lib.snowfall.system) is-linux is-darwin; - inherit (lib.marleyos) enabled; cfg = config.marleyos.programs.fish; - inherit (config.marleyos.theme) colors; -in -{ +in { options.marleyos.programs.fish.enable = mkEnableOption "fish"; config = mkIf cfg.enable { - home.packages = - with pkgs; + home.packages = with pkgs; [ # general babelfish @@ -36,14 +31,12 @@ in pax ] # unrar-free is broken on darwin :( - ++ (optionals (is-linux system) [ unrar-free ]) - ++ (optionals (is-darwin system) [ unrar ]); + ++ (optionals (is-linux system) [unrar-free]) + ++ (optionals (is-darwin system) [unrar]); programs.fish = { enable = true; - rose-pine = mkIf colors.isRosePine enabled; - preferAbbrs = true; plugins = with pkgs.fishPlugins; [ @@ -65,7 +58,8 @@ in } ]; - shellInit = # fish + shellInit = + # fish '' set -g fish_key_bindings fish_vi_key_bindings ''; @@ -79,7 +73,8 @@ in }; functions = { - fish_greeting = # fish + fish_greeting = + # fish '' echo "" figlet -f Elite " marleyOS" | lolcat @@ -87,7 +82,8 @@ in extract = { argumentNames = "file"; - body = # fish + body = + # fish '' set --erase argv[1] diff --git a/modules/home/programs/fzf/default.nix b/modules/home/programs/fzf/default.nix index e1ede24..96f73f1 100644 --- a/modules/home/programs/fzf/default.nix +++ b/modules/home/programs/fzf/default.nix @@ -2,13 +2,10 @@ lib, config, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf; - inherit (lib.marleyos) enabled; cfg = config.marleyos.programs.fzf; - inherit (config.marleyos.theme) colors; has-ripgrep = config.programs.ripgrep.enable; has-fd = config.programs.fd.enable; @@ -17,16 +14,13 @@ let has-tmux = config.programs.tmux.enable; has-delta = config.programs.git.delta.enable; has-difft = config.programs.git.difftastic.enable; -in -{ +in { options.marleyos.programs.fzf.enable = mkEnableOption "fzf"; config = mkIf cfg.enable { programs.fzf = { enable = true; - rose-pine = mkIf colors.isRosePine enabled; - defaultOptions = [ "--margin=10%,5%" "--border=sharp" @@ -53,15 +47,14 @@ in }; home.sessionVariables = - if has-delta then - { - fzf_diff_highlighter = "delta --paging=never --features=arctic-fox"; - } - else if has-difft then - { - fzf_diff_highlighter = "difft --color=always"; - } - else - { }; + if has-delta + then { + fzf_diff_highlighter = "delta --paging=never --features=arctic-fox"; + } + else if has-difft + then { + fzf_diff_highlighter = "difft --color=always"; + } + else {}; }; } diff --git a/modules/home/programs/starship/rose-pine.nix b/modules/home/programs/starship/rose-pine.nix index 3b8f7c7..2809dd6 100644 --- a/modules/home/programs/starship/rose-pine.nix +++ b/modules/home/programs/starship/rose-pine.nix @@ -2,242 +2,237 @@ lib, config, ... -}: -let +}: let inherit (lib) mkIf mkDefault concatStrings; cfg = config.marleyos.programs.starship; - inherit (config.marleyos.theme) colors; -in -{ - config = mkIf (cfg.enable && colors.isRosePine) { - programs.starship.settings = - let - mkFormat = t: " [](fg:overlay)[${t}]($style)[](fg:overlay) "; - langFormat = mkFormat "$symbol$version"; - in - { - format = mkDefault (concatStrings [ - "$username" - "$directory" - "$nix_shell" - "$git_branch" - "$git_status" - "$fill" - "$c" - "$elixir" - "$elm" - "$golang" - "$haskell" - "$java" - "$julia" - "$nodejs" - "$nim" - "$rust" - "$scala" - "$python" - "$time" - "$line_break" - "$character" - ]); +in { + config = mkIf (cfg.enable && config.rose-pine.enable) { + programs.starship.settings = let + mkFormat = t: " [](fg:overlay)[${t}]($style)[](fg:overlay) "; + langFormat = mkFormat "$symbol$version"; + in { + format = mkDefault (concatStrings [ + "$username" + "$directory" + "$nix_shell" + "$git_branch" + "$git_status" + "$fill" + "$c" + "$elixir" + "$elm" + "$golang" + "$haskell" + "$java" + "$julia" + "$nodejs" + "$nim" + "$rust" + "$scala" + "$python" + "$time" + "$line_break" + "$character" + ]); - # TODO: Make the palette available from rose-pine-nix. - palettes.rose-pine = - if (colors.flavor == "moon") then - (mkDefault { - overlay = "#393552"; - love = "#eb6f92"; - gold = "#f6c177"; - rose = "#ea9a97"; - pine = "#3e8fb0"; - foam = "#9ccfd8"; - iris = "#c4a7e7"; - }) - else if (colors.flavor == "dawn") then - (mkDefault { - overlay = "#f2e9e1"; - love = "#b4637a"; - gold = "#ea9d34"; - rose = "#d7827e"; - pine = "#286983"; - foam = "#56949f"; - iris = "#907aa9"; - }) - else - (mkDefault { - overlay = "#26233a"; - love = "#eb6f92"; - gold = "#f6c177"; - rose = "#ebbcba"; - pine = "#31748f"; - foam = "#9ccfd8"; - iris = "#c4a7e7"; - }); + # TODO: Make the palette available from rose-pine-nix. + palettes.rose-pine = + if (config.rose-pine.flavor == "moon") + then + (mkDefault { + overlay = "#393552"; + love = "#eb6f92"; + gold = "#f6c177"; + rose = "#ea9a97"; + pine = "#3e8fb0"; + foam = "#9ccfd8"; + iris = "#c4a7e7"; + }) + else if (config.rose-pine.flavor == "dawn") + then + (mkDefault { + overlay = "#f2e9e1"; + love = "#b4637a"; + gold = "#ea9d34"; + rose = "#d7827e"; + pine = "#286983"; + foam = "#56949f"; + iris = "#907aa9"; + }) + else + (mkDefault { + overlay = "#26233a"; + love = "#eb6f92"; + gold = "#f6c177"; + rose = "#ebbcba"; + pine = "#31748f"; + foam = "#9ccfd8"; + iris = "#c4a7e7"; + }); - palette = "rose-pine"; + palette = "rose-pine"; - username = { - disabled = mkDefault false; - format = mkDefault (mkFormat " 󰧱 $user "); - show_always = mkDefault true; - style_root = mkDefault "bg:overlay fg:iris"; - style_user = mkDefault "bg:overlay fg:iris"; - }; + username = { + disabled = mkDefault false; + format = mkDefault (mkFormat " 󰧱 $user "); + show_always = mkDefault true; + style_root = mkDefault "bg:overlay fg:iris"; + style_user = mkDefault "bg:overlay fg:iris"; + }; - directory = { - format = mkDefault (mkFormat " $path "); - style = mkDefault "bg:overlay fg:pine"; - truncation_length = mkDefault 3; - truncation_symbol = mkDefault "…/"; + directory = { + format = mkDefault (mkFormat " $path "); + style = mkDefault "bg:overlay fg:pine"; + truncation_length = mkDefault 3; + truncation_symbol = mkDefault "…/"; - substitutions = { - Documents = mkDefault "󰈙"; - Downloads = mkDefault " "; - Music = mkDefault " "; - Pictures = mkDefault " "; - }; - }; - - git_branch = { - format = mkDefault (mkFormat " $symbol $branch "); - style = mkDefault "bg:overlay fg:foam"; - symbol = mkDefault ""; - }; - - git_status = { - disabled = mkDefault false; - style = mkDefault "bg:overlay fg:love"; - format = mkDefault (mkFormat " $all_status$ahead_behind"); - up_to_date = mkDefault "[ ✓ ](bg:overlay fg:iris)"; - untracked = mkDefault "[?\\($count\\)](bg:overlay fg:gold)"; - stashed = mkDefault "[\\$](bg:overlay fg:iris)"; - modified = mkDefault "[!\\($count\\)](bg:overlay fg:gold)"; - renamed = mkDefault "[»\\($count\\)](bg:overlay fg:iris)"; - deleted = mkDefault "[✘\\($count\\)](style)"; - staged = mkDefault "[++\\($count\\)](bg:overlay fg:gold)"; - ahead = mkDefault "[⇡\\(\${count}\\)](bg:overlay fg:foam)"; - diverged = mkDefault "⇕[\\[](bg:overlay fg:iris)[⇡\\(\${ahead_count}\\)](bg:overlay fg:foam)[⇣\\(\${behind_count}\\)](bg:overlay fg:rose)[\\]](bg:overlay fg:iris)"; - behind = mkDefault "[⇣\\(\${count}\\)](bg:overlay fg:rose)"; - }; - - fill = { - style = mkDefault "fg:overlay"; - symbol = mkDefault " "; - }; - - time = { - disabled = mkDefault false; - format = mkDefault (mkFormat " $time 󰴈 "); - style = mkDefault "bg:overlay fg:rose"; - time_format = mkDefault "%I:%M%P"; - use_12hr = mkDefault true; - }; - - character = - let - vim = ""; - mkChar = sym: col: " [${sym}](fg:${col}) [󰄾](fg:foam)"; - in - { - success_symbol = mkChar "" "iris"; - error_symbol = mkChar "󰋔" "love"; - vimcmd_symbol = mkChar vim "rose"; - vimcmd_replace_one_symbol = mkChar vim "foam"; - vimcmd_replace_symbol = mkChar vim "foam"; - vimcmd_visual_symbol = mkChar vim "iris"; - }; - - ### Languages ### - c = { - style = mkDefault "bg:overlay fg:pine"; - format = mkDefault langFormat; - disabled = mkDefault false; - symbol = mkDefault " "; - }; - - elixir = { - style = mkDefault "bg:overlay fg:pine"; - format = mkDefault langFormat; - disabled = mkDefault false; - symbol = mkDefault " "; - }; - - elm = { - style = mkDefault "bg:overlay fg:pine"; - format = mkDefault langFormat; - disabled = mkDefault false; - symbol = mkDefault " "; - }; - - haskell = { - style = mkDefault "bg:overlay fg:pine"; - format = mkDefault langFormat; - disabled = mkDefault false; - symbol = mkDefault " "; - }; - - java = { - style = mkDefault "bg:overlay fg:pine"; - format = mkDefault langFormat; - disabled = mkDefault false; - symbol = mkDefault " "; - }; - - julia = { - style = mkDefault "bg:overlay fg:pine"; - format = mkDefault langFormat; - disabled = mkDefault false; - symbol = mkDefault " "; - }; - - nodejs = { - style = mkDefault "bg:overlay fg:pine"; - format = mkDefault langFormat; - disabled = mkDefault false; - symbol = mkDefault "󰎙 "; - }; - - nim = { - style = mkDefault "bg:overlay fg:pine"; - format = mkDefault langFormat; - disabled = mkDefault false; - symbol = mkDefault "󰆥 "; - }; - - python = { - style = mkDefault "bg:overlay fg:pine"; - disabled = mkDefault false; - symbol = mkDefault " "; - }; - - rust = { - style = mkDefault "bg:overlay fg:pine"; - format = mkDefault langFormat; - disabled = mkDefault false; - symbol = mkDefault ""; - }; - - scala = { - style = "bg:overlay fg:pine"; - format = mkDefault langFormat; - disabled = false; - symbol = " "; - }; - - ### Tools ### - conda = { - style = mkDefault "bg:overlay fg:pine"; - format = mkDefault (mkFormat "$symbol$environment"); - disabled = mkDefault false; - symbol = mkDefault "🅒 "; - }; - - nix_shell = { - style = "bg:overlay fg:foam"; - format = mkDefault (mkFormat " $symbol $state( \($name\)) "); - disabled = mkDefault false; - symbol = mkDefault " "; + substitutions = { + Documents = mkDefault "󰈙"; + Downloads = mkDefault " "; + Music = mkDefault " "; + Pictures = mkDefault " "; }; }; + + git_branch = { + format = mkDefault (mkFormat " $symbol $branch "); + style = mkDefault "bg:overlay fg:foam"; + symbol = mkDefault ""; + }; + + git_status = { + disabled = mkDefault false; + style = mkDefault "bg:overlay fg:love"; + format = mkDefault (mkFormat " $all_status$ahead_behind"); + up_to_date = mkDefault "[ ✓ ](bg:overlay fg:iris)"; + untracked = mkDefault "[?\\($count\\)](bg:overlay fg:gold)"; + stashed = mkDefault "[\\$](bg:overlay fg:iris)"; + modified = mkDefault "[!\\($count\\)](bg:overlay fg:gold)"; + renamed = mkDefault "[»\\($count\\)](bg:overlay fg:iris)"; + deleted = mkDefault "[✘\\($count\\)](style)"; + staged = mkDefault "[++\\($count\\)](bg:overlay fg:gold)"; + ahead = mkDefault "[⇡\\(\${count}\\)](bg:overlay fg:foam)"; + diverged = mkDefault "⇕[\\[](bg:overlay fg:iris)[⇡\\(\${ahead_count}\\)](bg:overlay fg:foam)[⇣\\(\${behind_count}\\)](bg:overlay fg:rose)[\\]](bg:overlay fg:iris)"; + behind = mkDefault "[⇣\\(\${count}\\)](bg:overlay fg:rose)"; + }; + + fill = { + style = mkDefault "fg:overlay"; + symbol = mkDefault " "; + }; + + time = { + disabled = mkDefault false; + format = mkDefault (mkFormat " $time 󰴈 "); + style = mkDefault "bg:overlay fg:rose"; + time_format = mkDefault "%I:%M%P"; + use_12hr = mkDefault true; + }; + + character = let + vim = ""; + mkChar = sym: col: " [${sym}](fg:${col}) [󰄾](fg:foam)"; + in { + success_symbol = mkChar "" "iris"; + error_symbol = mkChar "󰋔" "love"; + vimcmd_symbol = mkChar vim "rose"; + vimcmd_replace_one_symbol = mkChar vim "foam"; + vimcmd_replace_symbol = mkChar vim "foam"; + vimcmd_visual_symbol = mkChar vim "iris"; + }; + + ### Languages ### + c = { + style = mkDefault "bg:overlay fg:pine"; + format = mkDefault langFormat; + disabled = mkDefault false; + symbol = mkDefault " "; + }; + + elixir = { + style = mkDefault "bg:overlay fg:pine"; + format = mkDefault langFormat; + disabled = mkDefault false; + symbol = mkDefault " "; + }; + + elm = { + style = mkDefault "bg:overlay fg:pine"; + format = mkDefault langFormat; + disabled = mkDefault false; + symbol = mkDefault " "; + }; + + haskell = { + style = mkDefault "bg:overlay fg:pine"; + format = mkDefault langFormat; + disabled = mkDefault false; + symbol = mkDefault " "; + }; + + java = { + style = mkDefault "bg:overlay fg:pine"; + format = mkDefault langFormat; + disabled = mkDefault false; + symbol = mkDefault " "; + }; + + julia = { + style = mkDefault "bg:overlay fg:pine"; + format = mkDefault langFormat; + disabled = mkDefault false; + symbol = mkDefault " "; + }; + + nodejs = { + style = mkDefault "bg:overlay fg:pine"; + format = mkDefault langFormat; + disabled = mkDefault false; + symbol = mkDefault "󰎙 "; + }; + + nim = { + style = mkDefault "bg:overlay fg:pine"; + format = mkDefault langFormat; + disabled = mkDefault false; + symbol = mkDefault "󰆥 "; + }; + + python = { + style = mkDefault "bg:overlay fg:pine"; + disabled = mkDefault false; + symbol = mkDefault " "; + }; + + rust = { + style = mkDefault "bg:overlay fg:pine"; + format = mkDefault langFormat; + disabled = mkDefault false; + symbol = mkDefault ""; + }; + + scala = { + style = "bg:overlay fg:pine"; + format = mkDefault langFormat; + disabled = false; + symbol = " "; + }; + + ### Tools ### + conda = { + style = mkDefault "bg:overlay fg:pine"; + format = mkDefault (mkFormat "$symbol$environment"); + disabled = mkDefault false; + symbol = mkDefault "🅒 "; + }; + + nix_shell = { + style = "bg:overlay fg:foam"; + format = mkDefault (mkFormat " $symbol $state( \($name\)) "); + disabled = mkDefault false; + symbol = mkDefault " "; + }; + }; }; } diff --git a/modules/home/programs/tmux/default.nix b/modules/home/programs/tmux/default.nix index db9d26a..8a86a14 100644 --- a/modules/home/programs/tmux/default.nix +++ b/modules/home/programs/tmux/default.nix @@ -3,23 +3,20 @@ config, pkgs, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf; cfg = config.marleyos.programs.tmux; - inherit (config.marleyos.theme) colors; -in -{ +in { options.marleyos.programs.tmux.enable = mkEnableOption "tmux"; config = mkIf cfg.enable { programs.tmux = { enable = true; - rose-pine = mkIf (colors.base == "rose-pine") { - enable = true; - extraConfig = # tmux + rose-pine = { + extraConfig = + # tmux '' set -g @rose_pine_host 'on' set -g @rose_pine_directory 'on' @@ -51,7 +48,8 @@ in { plugin = continuum; - extraConfig = # tmux + extraConfig = + # tmux '' set -g @continuum-restore 'on' ''; @@ -59,7 +57,8 @@ in { plugin = tilish; - extraConfig = # tmux + extraConfig = + # tmux '' # Don't enforce the layout. set -g @tilish-enforce 'none' @@ -77,7 +76,8 @@ in { plugin = jump; - extraConfig = # tmux + extraConfig = + # tmux '' set -g @jump-key 's' ''; @@ -85,7 +85,8 @@ in { plugin = fingers; - extraConfig = # tmux + extraConfig = + # tmux '' set -g @fingers-jump-key 'f' ''; @@ -93,7 +94,8 @@ in { plugin = tmux-floax; - extraConfig = # tmux + extraConfig = + # tmux '' set -g @floax-bind 'i' set -g @floax-text-color 'white' @@ -101,7 +103,8 @@ in } ]; - extraConfig = # tmux + extraConfig = + # tmux '' # Set repeat timeout so keys can be repeated without the prefix. set -g repeat-time 1000 diff --git a/modules/home/programs/wezterm/default.nix b/modules/home/programs/wezterm/default.nix index abbf743..5cc7709 100644 --- a/modules/home/programs/wezterm/default.nix +++ b/modules/home/programs/wezterm/default.nix @@ -8,10 +8,14 @@ inherit (lib.snowfall.system) is-darwin; cfg = config.marleyos.programs.wezterm; - inherit (config.marleyos.theme) colors; isGenericLinux = config.targets.genericLinux.enable; isNotNixOS = isGenericLinux || (is-darwin system); + + theme = + if config.rose-pine.enable + then "rose-pine" + else ""; in { options.marleyos.programs.wezterm.enable = lib.mkEnableOption "wezterm"; @@ -40,7 +44,7 @@ in { config.enable_tab_bar = false - config.color_scheme = "${colors.base}" + config.color_scheme = "${theme}" config.font = wezterm.font_with_fallback({ { diff --git a/modules/home/programs/zathura/default.nix b/modules/home/programs/zathura/default.nix index 2613e80..4b4c1ae 100644 --- a/modules/home/programs/zathura/default.nix +++ b/modules/home/programs/zathura/default.nix @@ -2,22 +2,16 @@ lib, config, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf; - inherit (lib.marleyos) enabled; cfg = config.marleyos.programs.zathura; - inherit (config.marleyos.theme) colors; -in -{ +in { options.marleyos.programs.zathura.enable = mkEnableOption "zathura"; config = mkIf cfg.enable { programs.zathura = { enable = true; - - rose-pine = mkIf colors.isRosePine enabled; }; }; } diff --git a/modules/home/services/dunst/default.nix b/modules/home/services/dunst/default.nix index 96c0c4f..d3333c0 100644 --- a/modules/home/services/dunst/default.nix +++ b/modules/home/services/dunst/default.nix @@ -6,9 +6,6 @@ inherit (lib.marleyos) disabled; cfg = config.marleyos.services.dunst; - inherit (config.marleyos.theme) colors; - - isRosePine = colors.base == "rose-pine"; in { options.marleyos.services.dunst.enable = lib.mkEnableOption "dunst"; @@ -23,7 +20,7 @@ in { settings = lib.mkMerge [ ### Rose Pine ### - (lib.mkIf isRosePine { + (lib.mkIf config.rose-pine.enable { global = { width = 400; offset = "20x60"; diff --git a/modules/home/services/waybar/default.nix b/modules/home/services/waybar/default.nix index f1b47a9..88d7cae 100644 --- a/modules/home/services/waybar/default.nix +++ b/modules/home/services/waybar/default.nix @@ -5,7 +5,6 @@ ... }: let cfg = config.marleyos.services.waybar; - inherit (config.marleyos.theme) colors; in { options.marleyos.services.waybar.enable = lib.mkEnableOption "waybar"; @@ -13,8 +12,6 @@ in { programs.waybar = { enable = true; - rose-pine.enable = lib.mkIf colors.isRosePine true; - # https://gitlab.com/Zaney/zaneyos/-/blob/main/config/waybar.nix settings = [ { @@ -201,7 +198,7 @@ in { transition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)"; in lib.concatStrings [ - (lib.optionalString colors.isRosePine + (lib.optionalString config.rose-pine.enable #css '' @define-color darkOne @base; diff --git a/modules/home/wayland/hyprland/default.nix b/modules/home/wayland/hyprland/default.nix index 8d13e3f..8f9062a 100644 --- a/modules/home/wayland/hyprland/default.nix +++ b/modules/home/wayland/hyprland/default.nix @@ -5,10 +5,7 @@ pkgs, ... }: let - inherit (lib.marleyos) enabled; - cfg = config.marleyos.wayland.hyprland; - inherit (config.marleyos.theme) colors; in { options.marleyos.wayland.hyprland = { enable = lib.mkEnableOption "hyprland"; @@ -45,9 +42,10 @@ in { home.pointerCursor.hyprcursor.enable = true; - home.packages = [ - inputs.rose-pine-hyprcursor.packages.${pkgs.system}.default - ]; + home.packages = + lib.optional + config.rose-pine.enable + inputs.rose-pine-hyprcursor.packages.${pkgs.system}.default; services.hyprpaper = { enable = true; @@ -64,8 +62,6 @@ in { systemd.enable = true; xwayland.enable = true; - rose-pine = lib.mkIf colors.isRosePine enabled; - settings = let numMonitors = lib.length (lib.attrNames (cfg.monitors or {})); workspaces = lib.range 1 10; @@ -135,7 +131,7 @@ in { "XCURSOR_SIZE,24" "HYPRCURSOR_SIZE,24" ] - ++ (lib.optional colors.isRosePine "HYPRCURSOR_THEME,rose-pine-hyprcursor"); + ++ (lib.optional config.rose-pine.enable "HYPRCURSOR_THEME,rose-pine-hyprcursor"); workspace = lib.mkIf (cfg ? monitors) @@ -143,8 +139,8 @@ in { (ws: "${toString ws}, monitor:${wsMons."${toString ws}"}") workspaces); - "$main" = lib.mkIf colors.isRosePine "$love"; - "$inactive" = lib.mkIf colors.isRosePine "$muted"; + "$main" = lib.mkIf config.rose-pine.enable "$love"; + "$inactive" = lib.mkIf config.rose-pine.enable "$muted"; general = { gaps_in = 5; @@ -153,7 +149,7 @@ in { "col.inactive_border" = "$inactive"; "col.active_border" = - lib.mkIf colors.isRosePine "$rose $pine $love $iris 90deg"; + lib.mkIf config.rose-pine.enable "$rose $pine $love $iris 90deg"; resize_on_border = false; diff --git a/modules/nixos/appearance/base/default.nix b/modules/nixos/appearance/base/default.nix new file mode 100644 index 0000000..f14c05d --- /dev/null +++ b/modules/nixos/appearance/base/default.nix @@ -0,0 +1,16 @@ +{ + lib, + config, + ... +}: let + cfg = config.marleyos.appearance.base; +in { + options.marleyos.appearance.base.enable = lib.mkEnableOption "base"; + + config = lib.mkIf cfg.enable { + rose-pine = { + enable = true; + flavor = "main"; + }; + }; +} diff --git a/modules/nixos/appearance/console/default.nix b/modules/nixos/appearance/console/default.nix new file mode 100644 index 0000000..cbdf30d --- /dev/null +++ b/modules/nixos/appearance/console/default.nix @@ -0,0 +1,13 @@ +{ + lib, + config, + ... +}: let + cfg = config.marleyos.appearance.console; +in { + options.marleyos.appearance.console.enable = lib.mkEnableOption "console"; + + config = lib.mkIf cfg.enable { + console.rose-pine.enable = lib.mkIf config.rose-pine.enable true; + }; +} diff --git a/systems/x86_64-linux/nyx/default.nix b/systems/x86_64-linux/nyx/default.nix index 0835194..f495fdd 100644 --- a/systems/x86_64-linux/nyx/default.nix +++ b/systems/x86_64-linux/nyx/default.nix @@ -10,11 +10,14 @@ in { marleyos = { hasNvidia = true; - mounts.babeshare = enabled; - wayland.hyprland = enabled; + appearance = { + base = enabled; + console = enabled; + }; + programs = { fish = enabled; };