This repository has no description
Something went wrong. Try again.
3.4 kB · 146 lines
Nix
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147{ config, pkgs, lib, ...}:let tomlFormat = pkgs.formats.toml { }; palette = let cfg = config.catppuccin; p = builtins.mapAttrs ( n: v: lib.strings.removePrefix "#" v.hex ) (lib.importJSON "${cfg.sources.palette}/palette.json").${cfg.flavor}.colors; in p // { accent = p.${cfg.accent}; };
surferTheme = with palette; { foreground = text; alt_text_color = surface0; # negated foreground border_color = surface0; selected_elements_colors = { background = surface1; foreground = text; }; canvas_colors = { background = crust; alt_background = base; foreground = text; }; primary_ui_color = { background = mantle; foreground = text; }; secondary_ui_color = { background = crust; foreground = text; }; accent_info = { background = blue; foreground = text; }; accent_warn = { background = surface0; foreground = text; }; accent_error = { background = red; foreground = text; }; clock_highlight_line = { color = overlay0; width = 2; }; clock_highlight_cycle = base; clock_rising_marker = false; variable_default = green; variable_undef = red; variable_highimp = yellow; variable_dontcare = blue; variable_weak = overlay1; variable_parameter = text; transaction_default = green; waveform_opacity = 0.2; wide_opacity = 0.0; cursor = { color = accent; width = 2; }; gesture = { color = yellow; width = 2; }; measure = { color = overlay1; width = 2; }; linewidth = 2; vector_transition_width = 6; alt_frequency = 3; viewport_separator = { color = text; width = 4; }; drag_threshold = 1.0; drag_hint_color = subtext1; drag_hint_width = 2.0; highlight_background = surface1;
colors = { Green = green; Red = red; Yellow = yellow; Blue = blue; Pink = mauve; Orange = peach; Gray = overlay1; Violet = lavender; };
ticks = { style = { color = base; width = 2; }; density = 1; };
relation_arrow = { style = { color = red; width = 1.3; }; head_angle = 25; head_length = 8; }; };in{ options = { programs.surfer = { enable = lib.mkEnableOption "Enable surfer waveform viewer"; # https://gitlab.com/surfer-project/surfer/-/blob/main/default_config.toml settings = lib.mkOption { type = lib.types.nullOr tomlFormat.type; default = null; }; }; catppuccin.surfer.enable = lib.mkOption { type = lib.types.bool; default = config.catppuccin.enable; }; }; config = lib.mkIf config.programs.surfer.enable { home.packages = [ pkgs.surfer ]; xdg.configFile."surfer/config.toml".source = lib.mkIf (config.programs.surfer.settings != null) ( tomlFormat.generate "config.toml" config.programs.surfer.settings ); programs.surfer.settings = lib.mkIf config.catppuccin.surfer.enable { theme = lib.mkDefault "catppuccin"; }; xdg.configFile."surfer/themes/catppuccin.toml".source = lib.mkIf config.catppuccin.surfer.enable ( tomlFormat.generate "catppuccin.toml" surferTheme ); };}