This repository has no description
Something went wrong. Try again.
4.3 kB · 135 lines
Nix
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136{ config, pkgs, lib, ...}:let toGtkwaveRc = with lib.generators; toKeyValue { mkKeyValue = mkKeyValueDefault { } " "; };in{ options = { programs.gtkwave = { enable = lib.mkEnableOption "Enable gtkwave"; settings = lib.mkOption { type = lib.types.nullOr (lib.types.attrsOf lib.types.str); default = null; }; }; catppuccin.gtkwave.enable = lib.mkOption { type = lib.types.bool; default = config.catppuccin.enable; }; }; config = lib.mkIf config.programs.gtkwave.enable { home = { packages = [ pkgs.gtkwave ]; file = lib.mkIf (config.programs.gtkwave.settings != null) { ".gtkwaverc".text = toGtkwaveRc config.programs.gtkwave.settings; }; }; programs.gtkwave.settings = lib.mkIf config.catppuccin.gtkwave.enable ( let palette = lib.mapAttrs (n: v: lib.strings.removePrefix "#" v.hex) (lib.importJSON "${config.catppuccin.sources.palette}/palette.json") .${config.catppuccin.flavor}.colors; in with palette // { accent = palette.${config.catppuccin.accent}; }; let traceRegular = green; traceVector = green; traceDontCare = yellow; traceTriState = teal; traceUndefined = red; in { # background color color_back = base; # text color for timebar's background color_timeb = mantle; # text color for timebar color_time = text;
# color value for "normal" GTK state in signal window color_normal = green; # brick red color for comments color_brkred = red; # color value for "dark blue" in signal window color_dkblue = accent; # color for shadowed traces color_ltblue = sky;
# color value for trace groupings color_gmstrd = maroon;
# grid color (use Alt+G to show/hide grid). This is also the color used for high-light_wavewindow when enabled. color_grid = mantle;
# grid color for secondary pattern search color_grid2 = flamingo;
# middle mouse button marker color color_baseline = text; # color of the named markers color_mark = peach; # color of the unnamed (primary) marker color_umark = mauve;
# color value for "white" in signal window color_white = base; # color value for "black" in signal window color_black = text; # color value for "light gray" in signal window color_ltgray = base; # color value for "medium gray" in signal window color_mdgray = mantle; # color value for "dark gray" in signal window color_dkgray = crust;
# text color for vector values color_value = text; # vector color (horizontal) color_vbox = traceVector; # vector color (verticals/transitions) color_vtrans = traceVector;
# trace color when 0 color_0 = traceRegular; # trace color when 1 color_1 = traceRegular; # trace color (inside of box) when 1 color_1fill = traceRegular; # trace color when transitioning color_trans = traceRegular;
# trace color when don't care ("-") color_dash = traceDontCare; # trace color (inside of box) when don't care ("-") color_dashfill = traceDontCare;
# trace color when weak ("W") color_w = traceTriState; # trace color when high ("H") color_high = traceTriState; # trace color when low ("L") color_low = traceTriState; # trace color when floating ("Z") color_mid = traceTriState; # trace color (inside of box) when weak ("W") color_wfill = traceTriState; # trace color (inside of box) when high ("H") color_highfill = traceTriState;
# trace color when undefined ("X") (collision for VHDL) color_x = traceUndefined; # trace color (inside of box) when undefined ("X") (collision for VHDL) color_xfill = traceUndefined; # trace color when undefined ("U") color_u = traceUndefined; # trace color (inside of box) when undefined ("U") color_ufill = traceUndefined; } ); };}