From ba9411fb9fb7f0fa222972458222030d2b5745e4 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sun, 4 Feb 2024 07:14:04 +0000 Subject: [PATCH] Split some expressions out of home/default.nix, clean up Move git, starship and btm expressions to own files Move account dir expressions up a level, remove accounts dir Clean up some unused expressions (like qutebrowser and firefox) --- home/accounts/default.nix | 1 - home/bottom/default.nix | 28 +++ home/default.nix | 214 +----------------- home/{accounts => email}/.davmail.properties | 0 .../{accounts/email.nix => email/default.nix} | 0 home/firefox/default.nix | 74 ------ home/git/default.nix | 29 +++ home/hyprland/default.nix | 3 +- .../pass.nix => password-store/default.nix} | 0 .../git-pass-mapping.ini | 0 home/qutebrowser/default.nix | 27 --- home/qutebrowser/qutemacs.py | 163 ------------- home/ssh/default.nix | 34 +++ home/starship/default.nix | 116 ++++++++++ 14 files changed, 220 insertions(+), 469 deletions(-) delete mode 100644 home/accounts/default.nix create mode 100644 home/bottom/default.nix rename home/{accounts => email}/.davmail.properties (100%) rename home/{accounts/email.nix => email/default.nix} (100%) delete mode 100644 home/firefox/default.nix create mode 100644 home/git/default.nix rename home/{accounts/pass.nix => password-store/default.nix} (100%) rename home/{accounts => password-store}/git-pass-mapping.ini (100%) delete mode 100644 home/qutebrowser/default.nix delete mode 100644 home/qutebrowser/qutemacs.py create mode 100644 home/ssh/default.nix create mode 100644 home/starship/default.nix diff --git a/home/accounts/default.nix b/home/accounts/default.nix deleted file mode 100644 index 1a00e88a..00000000 --- a/home/accounts/default.nix +++ /dev/null @@ -1 +0,0 @@ -{...}: {imports = [./pass.nix ./email.nix];} diff --git a/home/bottom/default.nix b/home/bottom/default.nix new file mode 100644 index 00000000..e4a63376 --- /dev/null +++ b/home/bottom/default.nix @@ -0,0 +1,28 @@ +{config, ...}: { + programs.bottom = { + enable = true; + settings.colors = with config.lib.stylix.colors.withHashtag; { + table_header_color = base06; + all_cpu_color = base06; + avg_cpu_color = "#eba0ac"; + cpu_core_colors = [base08 base09 base0A base0B "#74c7ec" base0E]; + ram_color = base0B; + swap_color = base09; + rx_color = base0B; + tx_color = base08; + widget_title_color = base0F; + border_color = base02; + highlighted_border_color = base07; + text_color = base04; + graph_color = "#a6adc8"; + cursor_color = "#f5c2e7"; + selected_text_color = base05; + selected_bg_color = base0E; + high_battery_color = base0B; + medium_battery_color = base0A; + low_battery_color = base08; + gpu_core_colors = ["#74c7ec" base0E base08 base09 base0A base0B]; + arc_color = "#89dceb"; + }; + }; +} diff --git a/home/default.nix b/home/default.nix index efb3022d..7ff68c81 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,46 +1,23 @@ -{ - config, - lib, - pkgs, - ... -}: { - imports = [./nushell/default.nix ./config/default.nix ./scripts/default.nix]; +{pkgs, ...}: { + imports = [ + ./git/default.nix + ./ssh/default.nix + ./nushell/default.nix + ./starship/default.nix + ./bottom/default.nix + ./config/default.nix + ./scripts/default.nix + ]; stylix.targets = { fzf.enable = true; zellij.enable = true; }; - programs = rec { + programs = { bash.enable = true; bat = { enable = true; config.theme = "Catppuccin-mocha"; }; - bottom = { - enable = true; - settings.colors = with config.lib.stylix.colors.withHashtag; { - table_header_color = base06; - all_cpu_color = base06; - avg_cpu_color = "#eba0ac"; - cpu_core_colors = [base08 base09 base0A base0B "#74c7ec" base0E]; - ram_color = base0B; - swap_color = base09; - rx_color = base0B; - tx_color = base08; - widget_title_color = base0F; - border_color = base02; - highlighted_border_color = base07; - text_color = base04; - graph_color = "#a6adc8"; - cursor_color = "#f5c2e7"; - selected_text_color = base05; - selected_bg_color = base0E; - high_battery_color = base0B; - medium_battery_color = base0A; - low_battery_color = base08; - gpu_core_colors = ["#74c7ec" base0E base08 base09 base0A base0B]; - arc_color = "#89dceb"; - }; - }; carapace = { enable = true; enableBashIntegration = true; @@ -73,175 +50,6 @@ changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d"; fileWidgetCommand = "${pkgs.fd}/bin/fd --type f"; }; - git = { - enable = true; - userName = "Evie Litherland-Smith"; - userEmail = lib.mkDefault "evie@xenia.me.uk"; - delta = { - enable = true; - options = { - line-numbers = true; - hyprlinks = true; - navigate = true; - side-by-side = true; - syntax-theme = bat.config.theme; - }; - }; - extraConfig = { - github.user = "elitherl"; - gitea.user = "xenia"; - pull.rebase = false; - init.defaultBranch = "main"; - merge.conflictstyle = "diff3"; - diff.colorMoved = "default"; - }; - }; - ssh = { - enable = true; - forwardAgent = true; - addKeysToAgent = "yes"; - compression = true; - serverAliveInterval = 15; - serverAliveCountMax = 3; - controlMaster = "auto"; - controlPersist = "10s"; - extraConfig = '' - SetEnv TERM=xterm-256color - ''; - matchBlocks = { - "git*".user = "git"; - "legion" = { - user = "xenia"; - hostname = "192.168.1.230"; - }; - "ionos" = { - user = "root"; - hostname = "77.68.67.133"; - }; - "freia" = { - user = "elitherl"; - hostname = "freia020.hpc.l"; - }; - "heimdall" = { - user = "elitherl"; - hostname = "heimdall003.jet.uk"; - }; - }; - }; - starship = { - enable = true; - enableBashIntegration = true; - enableNushellIntegration = true; - enableTransience = true; - settings = { - c = {symbol = " ";}; - command_timeout = 1000; - container = {symbol = " ";}; - add_newline = false; - character = { - success_symbol = "[!](bold green)"; - error_symbol = "[?](bold red)"; - }; - directory = { - truncation_length = 2; - fish_style_pwd_dir_length = 1; - read_only = "󰉐 "; - truncate_to_repo = false; - }; - line_break.disabled = false; - git_branch = { - symbol = " "; - only_attached = true; - ignore_branches = ["master" "main"]; - }; - git_commit = { - format = "[󰜘 $hash | $tag]($style) "; - tag_symbol = "󰓹 "; - tag_disabled = false; - }; - git_metrics.disabled = false; - git_status = { - stashed = "󰁯 "; - ahead = "󰁝 "; - behind = "󰁅 "; - up_to_date = ""; - diverged = "󰹹 "; - conflicted = "󰦎 "; - deleted = " "; - renamed = " "; - modified = " "; - staged = " "; - untracked = " "; - typechanged = " "; - }; - golang = {symbol = " ";}; - guix_shell = {symbol = " ";}; - haskell = {symbol = " ";}; - hostname = { - ssh_only = true; - ssh_symbol = "󰢹 "; - }; - java = {symbol = " ";}; - localip = {disabled = false;}; - lua = {symbol = " ";}; - memory_usage = { - disabled = false; - symbol = "󰍛 "; - }; - nix_shell.symbol = "󱄅 "; - os = { - disabled = false; - format = "on [$symbol]($style) "; - style = "bold blue"; - symbols = { - Alpine = " "; - Android = " "; - Arch = " "; - CentOS = " "; - Debian = " "; - EndeavourOS = " "; - Fedora = " "; - FreeBSD = " "; - Gentoo = " "; - Illumos = " "; - Linux = " "; - Macos = " "; - Manjaro = " "; - Mint = "󰣭 "; - NixOS = " "; - OpenBSD = " "; - openSUSE = " "; - Pop = " "; - Raspbian = " "; - Redhat = " "; - RedHatEnterprise = " "; - Solus = " "; - SUSE = " "; - Ubuntu = " "; - Unknown = " "; - Windows = " "; - }; - }; - package = {symbol = "󰏗 ";}; - python = { - symbol = "󰌠 "; - python_binary = "python3"; - }; - rust = {symbol = "󱘗 ";}; - shell = { - disabled = false; - format = "using [$indicator ]($style)"; - bash_indicator = "#"; - nu_indicator = "ν"; - unknown_indicator = "?"; - }; - status = {}; - sudo = { - disabled = false; - symbol = "󰪋 "; - }; - }; - }; zellij = { enable = true; settings.default_layout = "compact"; diff --git a/home/accounts/.davmail.properties b/home/email/.davmail.properties similarity index 100% rename from home/accounts/.davmail.properties rename to home/email/.davmail.properties diff --git a/home/accounts/email.nix b/home/email/default.nix similarity index 100% rename from home/accounts/email.nix rename to home/email/default.nix diff --git a/home/firefox/default.nix b/home/firefox/default.nix deleted file mode 100644 index 38987b21..00000000 --- a/home/firefox/default.nix +++ /dev/null @@ -1,74 +0,0 @@ -{pkgs, ...}: { - programs.firefox = { - enable = true; - package = null; # Use system Firefox - profiles.default = { - settings = { - "app.shield.optoutstudies.enabled" = false; - "browser.bookmarks.addedImportButton" = false; - "browser.bookmarks.showMobileBookmarks" = false; - "browser.toolbars.bookmarks.visibility" = "newtab"; - "browser.contentblocking.category" = "strict"; - "browser.search.region" = "GB"; - "browser.search.isUS" = false; - "browser.warnOnQuitShortcut" = false; - "distribution.searchplugins.defaultLocale" = "en-GB"; - "doh-rollout.home-region" = "GB"; - # Catppuccin Mocha (Lavender) theme - "extensions.activeThemeID" = "{8446b178-c865-4f5c-8ccc-1d7887811ae3}"; - "extensions.formautofill.creditCards.enabled" = false; - "general.useragent.locale" = "en-GB"; - "intl.accept_languages" = "en-gb,en"; - "intl.locale.requested" = "en-gb,en"; - "intl.regional_prefs.use_os_locales" = false; - "media.eme.enabled" = true; - "privacy.webrtc.legacyGlobalIndicator" = false; - "signon.management.page.breach-alerts.enabled" = false; - "signon.rememberSignons" = false; - "browser.newtabpage.pinned" = [ - { - title = "NixOS Wiki"; - url = "https://nixos.wiki"; - } - { - title = "Arch Wiki"; - url = "https://wiki.archlinux.org"; - } - { - title = "Hyprland Wiki"; - url = "https://wiki.hyprland.org"; - } - ]; - }; - search = { - default = "DuckDuckGo"; - force = true; - order = ["DuckDuckGo"]; - engines = { - "Wikipedia" = { - urls = [{template = "https://en.wikipedia.org/wiki/Special:Search?search={searchTerms}&go=Go&ns0=1";}]; - definedAliases = ["@w"]; - }; - "Arch Wiki" = { - urls = [{template = "https://wiki.archlinux.org/?search={searchTerms}";}]; - definedAliases = ["@aw"]; - }; - "NixOS Wiki" = { - urls = [{template = "https://nixos.wiki/index.php?search={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@nw"]; - }; - "MyNixOS" = { - urls = [{template = "https://mynixos.com/search?q={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@mn"]; - }; - "Atlas SearXNG" = { - urls = [{template = "https://search.atlas.engineer/searxng/search?q={searchTerms}";}]; - definedAliases = ["@a"]; - }; - }; - }; - }; - }; -} diff --git a/home/git/default.nix b/home/git/default.nix new file mode 100644 index 00000000..fed3fac1 --- /dev/null +++ b/home/git/default.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + ... +}: { + programs.git = { + enable = true; + userName = "Evie Litherland-Smith"; + userEmail = lib.mkDefault "evie@xenia.me.uk"; + delta = { + enable = true; + options = { + line-numbers = true; + hyprlinks = true; + navigate = true; + side-by-side = true; + syntax-theme = with config.programs; lib.mkIf bat.enable bat.config.theme; + }; + }; + extraConfig = { + github.user = "elitherl"; + gitea.user = "xenia"; + pull.rebase = false; + init.defaultBranch = "main"; + merge.conflictstyle = "diff3"; + diff.colorMoved = "default"; + }; + }; +} diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 3d55a882..e617f4ad 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -10,7 +10,8 @@ }; imports = [ ../default.nix - ../accounts/default.nix + ../email/default.nix + ../password-store/default.nix ../swaylock/default.nix ../waybar/default.nix ../rofi/default.nix diff --git a/home/accounts/pass.nix b/home/password-store/default.nix similarity index 100% rename from home/accounts/pass.nix rename to home/password-store/default.nix diff --git a/home/accounts/git-pass-mapping.ini b/home/password-store/git-pass-mapping.ini similarity index 100% rename from home/accounts/git-pass-mapping.ini rename to home/password-store/git-pass-mapping.ini diff --git a/home/qutebrowser/default.nix b/home/qutebrowser/default.nix deleted file mode 100644 index 955fb67c..00000000 --- a/home/qutebrowser/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: { - stylix.targets.qutebrowser.enable = true; - programs.qutebrowser = { - enable = true; - package = pkgs.qutebrowser-qt5; # Qt6 currently looks blurry with scaling on Wayland - loadAutoconfig = false; - enableDefaultBindings = true; # For now... - searchEngines = rec { - w = "https://en.wikipedia.org/wiki/Special:Search?search={}&go=Go&ns0=1"; - aw = "https://wiki.archlinux.org/?search={}"; - nw = "https://nixos.wiki/index.php?search={}"; - mn = "https://mynixos.com/search?q={}"; - ddg = "https://duckduckgo.com/?q={}"; - a = "https://search.atlas.engineer/searxng/search?q={}"; - DEFAULT = a; - }; - settings = { - tabs.tabs_are_windows = true; - fonts.web.size.default = lib.mkForce config.stylix.fonts.sizes.applications; # Temp fix until stylix is updated - }; - }; -} diff --git a/home/qutebrowser/qutemacs.py b/home/qutebrowser/qutemacs.py deleted file mode 100644 index 6810a21b..00000000 --- a/home/qutebrowser/qutemacs.py +++ /dev/null @@ -1,163 +0,0 @@ -# qutemacs - a simple, preconfigured Emacs binding set for qutebrowser -# -# The aim of this binding set is not to provide bindings for absolutely -# everything, but to provide a stable launching point for people to make their -# own bindings. -# -# Installation: -# -# 1. Copy this file or add this repo as a submodule to your dotfiles. -# 2. Add this line to your config.py, and point the path to this file: -# config.source('qutemacs/qutemacs.py') - - -config = config # type: ConfigAPI # noqa: F821 pylint: disable=E0602,C0103 -c = c # type: ConfigContainer # noqa: F821 pylint: disable=E0602,C0103 - -# c.input.insert_mode.auto_enter = False -# c.input.insert_mode.auto_leave = False -c.input.insert_mode.plugins = True -c.input.insert_mode.auto_load = True - -# Forward unbound keys -c.input.forward_unbound_keys = "all" - -ESC_BIND = "clear-keychain ;; search ;; fullscreen --leave" - -c.bindings.default["normal"] = {} -# Bindings -c.bindings.commands["normal"] = { - # Navigation - "": "scroll-page 0 0.9", - "": "scroll-page 0 -0.9", - "": "scroll-page 0 -0.9", - # '': 'scroll-page 0 0.9', - "": "scroll-to-perc 0", - # Commands - "": "set-cmd-text :", - "": "quit", - # searching - "": "set-cmd-text /", - "": "set-cmd-text ?", - # hinting - "": "hint all", - "": "hint all hover", - "": "hint all tab-bg", - "": "hint all tab-fg", - "": "hint all yank-primary", - "": "yank url", - "": "yank all download", - # history - "": "forward", - "": "back", - "": "forward", - "": "back", - "shift-h>": "history", - # bookmarks - "m": "bookmark-add", - "M": "open qute://bookmarks", - # tabs - "": "tab-next", - "": "tab-prev", - "": "tab-next", - "": "tab-move +", - "": "tab-prev", - "": "tab-move -", - "": "set-cmd-text -s :buffer", - "": "tab-close", - "

": "tab-pin", - "": "tab-mute", - "<0>": "tab-close", - "<1>": "tab-only", - "": "tab-focus 1", - "": "tab-focus 2", - "": "tab-focus 3", - "": "tab-focus 4", - "": "tab-focus 5", - "": "tab-focus 6", - "": "tab-focus 7", - "": "tab-focus 8", - "": "tab-focus -1", - # frames - "<5><0>": "close", - "<5><1>": "window-only", - "<5><2>": "set-cmd-text -s :open -w", - "<5><2>": "set-cmd-text -s :open -p", - # open links - "": "set-cmd-text -s :open", - "": "set-cmd-text -s :open -t", - # editing - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "insert-text {primary}", - # Numbers - # https://github.com/qutebrowser/qutebrowser/issues/4213 - "1": "fake-key 1", - "2": "fake-key 2", - "3": "fake-key 3", - "4": "fake-key 4", - "5": "fake-key 5", - "6": "fake-key 6", - "7": "fake-key 7", - "8": "fake-key 8", - "9": "fake-key 9", - "0": "fake-key 0", - # misc - "": "spawn --userscript ~/.bin/open_in_mpv.sh", - # Help - "": "open qute://bindings", - "": "set-cmd-text -s :help", - # escape hatch - "": ESC_BIND, -} - -c.bindings.commands["command"] = { - "": "search-next", - "": "search-prev", - "": "completion-item-focus prev", - "": "completion-item-focus next", - "": "command-history-prev", - "": "command-history-next", - # escape hatch - "": "leave-mode", -} - -c.bindings.commands["hint"] = { - # escape hatch - "": "leave-mode", -} - - -c.bindings.commands["caret"] = { - # escape hatch - "": "leave-mode", -} - -c.bindings.commands["insert"] = { - # editing - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "fake-key ", - "": "insert-text {primary}", - "": "leave-mode", -} diff --git a/home/ssh/default.nix b/home/ssh/default.nix new file mode 100644 index 00000000..b531dc62 --- /dev/null +++ b/home/ssh/default.nix @@ -0,0 +1,34 @@ +{...}: { + programs.ssh = { + enable = true; + forwardAgent = true; + addKeysToAgent = "yes"; + compression = true; + serverAliveInterval = 15; + serverAliveCountMax = 3; + controlMaster = "auto"; + controlPersist = "10s"; + extraConfig = '' + SetEnv TERM=xterm-256color + ''; + matchBlocks = { + "git*".user = "git"; + "legion" = { + user = "xenia"; + hostname = "192.168.1.230"; + }; + "ionos" = { + user = "root"; + hostname = "77.68.67.133"; + }; + "freia" = { + user = "elitherl"; + hostname = "freia020.hpc.l"; + }; + "heimdall" = { + user = "elitherl"; + hostname = "heimdall003.jet.uk"; + }; + }; + }; +} diff --git a/home/starship/default.nix b/home/starship/default.nix new file mode 100644 index 00000000..6f5c679f --- /dev/null +++ b/home/starship/default.nix @@ -0,0 +1,116 @@ +{...}: { + programs.starship = { + enable = true; + enableBashIntegration = true; + enableNushellIntegration = true; + enableTransience = true; + settings = { + c = {symbol = " ";}; + command_timeout = 1000; + container = {symbol = " ";}; + add_newline = false; + character = { + success_symbol = "[!](bold green)"; + error_symbol = "[?](bold red)"; + }; + directory = { + truncation_length = 2; + fish_style_pwd_dir_length = 1; + read_only = "󰉐 "; + truncate_to_repo = false; + }; + line_break.disabled = false; + git_branch = { + symbol = " "; + only_attached = true; + ignore_branches = ["master" "main"]; + }; + git_commit = { + format = "[󰜘 $hash | $tag]($style) "; + tag_symbol = "󰓹 "; + tag_disabled = false; + }; + git_metrics.disabled = false; + git_status = { + stashed = "󰁯 "; + ahead = "󰁝 "; + behind = "󰁅 "; + up_to_date = ""; + diverged = "󰹹 "; + conflicted = "󰦎 "; + deleted = " "; + renamed = " "; + modified = " "; + staged = " "; + untracked = " "; + typechanged = " "; + }; + golang = {symbol = " ";}; + guix_shell = {symbol = " ";}; + haskell = {symbol = " ";}; + hostname = { + ssh_only = true; + ssh_symbol = "󰢹 "; + }; + java = {symbol = " ";}; + localip = {disabled = false;}; + lua = {symbol = " ";}; + memory_usage = { + disabled = false; + symbol = "󰍛 "; + }; + nix_shell.symbol = "󱄅 "; + os = { + disabled = false; + format = "on [$symbol]($style) "; + style = "bold blue"; + symbols = { + Alpine = " "; + Android = " "; + Arch = " "; + CentOS = " "; + Debian = " "; + EndeavourOS = " "; + Fedora = " "; + FreeBSD = " "; + Gentoo = " "; + Illumos = " "; + Linux = " "; + Macos = " "; + Manjaro = " "; + Mint = "󰣭 "; + NixOS = " "; + OpenBSD = " "; + openSUSE = " "; + Pop = " "; + Raspbian = " "; + Redhat = " "; + RedHatEnterprise = " "; + Solus = " "; + SUSE = " "; + Ubuntu = " "; + Unknown = " "; + Windows = " "; + }; + }; + package = {symbol = "󰏗 ";}; + python = { + symbol = "󰌠 "; + python_binary = "python3"; + }; + rust = {symbol = "󱘗 ";}; + shell = { + disabled = false; + format = "using [$indicator ]($style)"; + bash_indicator = "#"; + nu_indicator = "ν"; + unknown_indicator = "?"; + }; + status = {}; + sudo = { + disabled = false; + symbol = "󰪋 "; + }; + }; + }; +}