From cb6fcae89431f6bef7e6b9fd7758c2c2e0e5b31e Mon Sep 17 00:00:00 2001 From: mat ess Date: Fri, 3 Nov 2023 19:19:07 -0400 Subject: [PATCH] Clean up duplicate keys --- darwin/homebrew.nix | 8 ++- home/extras/helix/auto-theme.nix | 20 +++--- home/kitty.nix | 113 ++++++++++++++++--------------- home/starship-symbols.nix | 48 +++++++------ statix.toml | 1 - 5 files changed, 103 insertions(+), 87 deletions(-) delete mode 100644 statix.toml diff --git a/darwin/homebrew.nix b/darwin/homebrew.nix index ccd45b8..b708a40 100644 --- a/darwin/homebrew.nix +++ b/darwin/homebrew.nix @@ -18,9 +18,11 @@ homebrew = { enable = flake.inputs.homebrew-enabled.value; - onActivation.autoUpdate = true; - onActivation.upgrade = true; - onActivation.cleanup = "uninstall"; + onActivation = { + autoUpdate = true; + upgrade = true; + cleanup = "uninstall"; + }; global.brewfile = true; taps = [ "homebrew/cask-versions" "homebrew/services" ]; diff --git a/home/extras/helix/auto-theme.nix b/home/extras/helix/auto-theme.nix index 09cca9f..8c6326d 100644 --- a/home/extras/helix/auto-theme.nix +++ b/home/extras/helix/auto-theme.nix @@ -4,17 +4,19 @@ let tomlFormat = pkgs.formats.toml { }; in { options.programs.helix = { - autoTheme.enable = - lib.mkEnableOption "Automatically switch helix theme with night mode"; + autoTheme = { + enable = + lib.mkEnableOption "Automatically switch helix theme with night mode"; - autoTheme.light = lib.mkOption { - type = lib.types.str; - description = "Light mode theme"; - }; + light = lib.mkOption { + type = lib.types.str; + description = "Light mode theme"; + }; - autoTheme.dark = lib.mkOption { - type = lib.types.str; - description = "Dark mode theme"; + dark = lib.mkOption { + type = lib.types.str; + description = "Dark mode theme"; + }; }; }; diff --git a/home/kitty.nix b/home/kitty.nix index d3b1475..5aa0387 100644 --- a/home/kitty.nix +++ b/home/kitty.nix @@ -2,62 +2,69 @@ let font = "Rec Mono Duotone"; in { imports = [ ./extras/kitty/auto-theme.nix ./extras/kitty/nerd-font.nix ]; - programs.kitty.enable = true; - # using kitty from homebrew - programs.kitty.package = pkgs.emptyDirectory; - - programs.kitty.settings = { - font_family = font; - bold_font = "${font} Bold"; - italic_font = "${font} Italic"; - bold_italic_font = "${font} Bold Italic"; - font_size = "15.0"; - adjust_line_height = "120%"; - disable_ligatures = "cursor"; # disable ligatures when cursor is on them - - hide_window_decorations = "titlebar-only"; - window_padding_width = "10"; - - tab_bar_edge = "top"; - tab_bar_style = "powerline"; - tab_powerline_style = "angled"; - tab_title_template = "{index}: {title}"; - active_tab_font_style = "bold"; - inactive_tab_font_style = "normal"; - tab_activity_symbol = "💬"; - - # shell integration is manually enabled for fish - shell_integration = "disabled"; - } // lib.optionalAttrs pkgs.stdenv.isDarwin { macos_option_as_alt = "both"; }; - - programs.fish.interactiveShellInit = '' - # Manually enable shell integration - if set -q KITTY_INSTALLATION_DIR - set --global KITTY_SHELL_INTEGRATION enabled - source "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish" - set --prepend fish_complete_path "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_completions.d" - end - set-term-colors - ''; - programs.fish.shellAliases = { - s = "kitty +kitten ssh"; - e = "edit-in-kitty"; - }; - - programs.kitty.useSymbolsFromNerdFont = "CaskaydiaCove Nerd Font"; - programs.kitty.colors = { + programs.kitty = { enable = true; - dark-name = "rose-pine"; - light-name = "rose-pine-dawn"; + # using kitty from homebrew + package = pkgs.emptyDirectory; + + settings = { + font_family = font; + bold_font = "${font} Bold"; + italic_font = "${font} Italic"; + bold_italic_font = "${font} Bold Italic"; + font_size = "15.0"; + adjust_line_height = "120%"; + disable_ligatures = "cursor"; # disable ligatures when cursor is on them + + hide_window_decorations = "titlebar-only"; + window_padding_width = "10"; + + tab_bar_edge = "top"; + tab_bar_style = "powerline"; + tab_powerline_style = "angled"; + tab_title_template = "{index}: {title}"; + active_tab_font_style = "bold"; + inactive_tab_font_style = "normal"; + tab_activity_symbol = "💬"; + + # shell integration is manually enabled for fish + shell_integration = "disabled"; + } // lib.optionalAttrs pkgs.stdenv.isDarwin { + macos_option_as_alt = "both"; + }; + + useSymbolsFromNerdFont = "CaskaydiaCove Nerd Font"; + colors = { + enable = true; + dark-name = "rose-pine"; + light-name = "rose-pine-dawn"; + }; }; - programs.fish.functions.set-term-colors = { - body = '' - if test "$term_background" = light - term-light - else - term-dark + + programs.fish = { + interactiveShellInit = '' + # Manually enable shell integration + if set -q KITTY_INSTALLATION_DIR + set --global KITTY_SHELL_INTEGRATION enabled + source "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish" + set --prepend fish_complete_path "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_completions.d" end + set-term-colors ''; - onVariable = "term_background"; + shellAliases = { + s = "kitty +kitten ssh"; + e = "edit-in-kitty"; + }; + + functions.set-term-colors = { + body = '' + if test "$term_background" = light + term-light + else + term-dark + end + ''; + onVariable = "term_background"; + }; }; } diff --git a/home/starship-symbols.nix b/home/starship-symbols.nix index bf38f2d..48f7dc3 100644 --- a/home/starship-symbols.nix +++ b/home/starship-symbols.nix @@ -3,11 +3,13 @@ let inherit (lib) mkDefault; in { programs.starship.settings = { aws.symbol = mkDefault " "; - battery.full_symbol = mkDefault ""; - battery.charging_symbol = mkDefault ""; - battery.discharging_symbol = mkDefault ""; - battery.unknown_symbol = mkDefault ""; - battery.empty_symbol = mkDefault ""; + battery = { + full_symbol = mkDefault ""; + charging_symbol = mkDefault ""; + discharging_symbol = mkDefault ""; + unknown_symbol = mkDefault ""; + empty_symbol = mkDefault ""; + }; cmake.symbol = mkDefault "△ "; conda.symbol = mkDefault " "; crystal.symbol = mkDefault " "; @@ -21,17 +23,19 @@ in { gcloud.symbol = mkDefault " "; git_branch.symbol = mkDefault " "; git_commit.tag_symbol = mkDefault " "; - git_status.format = mkDefault "([$all_status$ahead_behind]($style) )"; - git_status.conflicted = mkDefault " "; - git_status.ahead = mkDefault " "; - git_status.behind = mkDefault " "; - git_status.diverged = mkDefault " "; - git_status.untracked = mkDefault " "; - git_status.stashed = mkDefault " "; - git_status.modified = mkDefault " "; - git_status.staged = mkDefault " "; - git_status.renamed = mkDefault " "; - git_status.deleted = mkDefault " "; + git_status = { + format = mkDefault "([$all_status$ahead_behind]($style) )"; + conflicted = mkDefault " "; + ahead = mkDefault " "; + behind = mkDefault " "; + diverged = mkDefault " "; + untracked = mkDefault " "; + stashed = mkDefault " "; + modified = mkDefault " "; + staged = mkDefault " "; + renamed = mkDefault " "; + deleted = mkDefault " "; + }; golang.symbol = mkDefault " "; helm.symbol = mkDefault "⎈ "; hg_branch.symbol = mkDefault " "; @@ -53,11 +57,13 @@ in { ruby.symbol = mkDefault " "; rust.symbol = mkDefault " "; shlvl.symbol = mkDefault " "; - status.symbol = mkDefault " "; - status.not_executable_symbol = mkDefault " "; - status.not_found_symbol = mkDefault " "; - status.sigint_symbol = mkDefault " "; - status.signal_symbol = mkDefault " "; + status = { + symbol = mkDefault " "; + not_executable_symbol = mkDefault " "; + not_found_symbol = mkDefault " "; + sigint_symbol = mkDefault " "; + signal_symbol = mkDefault " "; + }; swift.symbol = mkDefault " "; terraform.symbol = mkDefault "𝗧 "; vagrant.symbol = mkDefault "𝗩 "; diff --git a/statix.toml b/statix.toml deleted file mode 100644 index 3f02ae4..0000000 --- a/statix.toml +++ /dev/null @@ -1 +0,0 @@ -disabled = ["repeated_keys"]