From b78a6fa7c96895dfde29cf1c639bc64b3b5a63cc Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 30 May 2024 15:10:19 -0400 Subject: oops, lots of updates - got it working on beryl and my new framework laptop - refactored stuff in the process - added some catppuccin theme stuff --- lib/common.nix | 602 ++++++++++++++++++++++++++++---------------------------- lib/const.nix | 2 +- lib/linux.nix | 164 ++------------- lib/polybar.nix | 148 ++++++++++++++ lib/theme.nix | 24 +++ lib/urxvt.nix | 24 +++ lib/vimrc | 327 +++++++++++++++--------------- 7 files changed, 677 insertions(+), 614 deletions(-) create mode 100644 lib/polybar.nix create mode 100644 lib/theme.nix create mode 100644 lib/urxvt.nix (limited to 'lib') diff --git a/lib/common.nix b/lib/common.nix index 7ddff12..3b61b81 100644 --- a/lib/common.nix +++ b/lib/common.nix @@ -63,319 +63,326 @@ in { fonts.fontconfig.enable = true; - programs = { - home-manager = { - enable = true; + programs.home-manager.enable = true; + + programs.bat = { + enable = true; + config = { theme = "catppuccin"; }; + themes = { + catppuccin = builtins.readFile (pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "bat"; + rev = "d714cc1d358ea51bfc02550dabab693f70cccea0"; + hash = "sha256-Q5B4NDrfCIK3UAMs94vdXnR42k4AXCqZz6sRn8bzmf4="; + } + "/themes/Catppuccin Latte.tmTheme"); }; + }; - starship = { - # export PS1='$(printf "%3.*s" $? $?)ϟ ' - enable = true; - settings = { - format = lib.concatStrings [ - #"$username" - "$hostname" - "$directory" - "$git_branch" - "$git_state" - "$git_status" - "$cmd_duration" - "$line_break" - "$character" - ]; - directory.style = "blue"; - character = { - success_symbol = "[ϟ](white)"; - error_symbol = "[ϟ](red)"; - }; - git_branch = { - format = "[$branch]($style)"; - style = "bright-black"; - }; - git_status = { - format = - ''[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)''; - style = "cyan"; - conflicted = "​"; - untracked = "​"; - modified = "​"; - staged = "​"; - renamed = "​"; - deleted = "​"; - stashed = "≡"; - }; - git_state = { - format = "\([$state( $progress_current/$progress_total)]($style)\) "; - style = "bright-black"; - }; - - cmd_duration = { - format = "[$duration]($style) "; - style = "yellow"; - }; + programs.starship = { + # export PS1='$(printf "%3.*s" $? $?)ϟ ' + enable = true; + settings = { + format = lib.concatStrings [ + #"$username" + "$hostname" + "$directory" + "$git_branch" + "$git_state" + "$git_status" + "$cmd_duration" + "$line_break" + "$character" + ]; + directory.style = "blue"; + character = { + success_symbol = "[ϟ](white)"; + error_symbol = "[ϟ](red)"; }; - }; - - readline = { - enable = true; - variables = { - keyseq-timeout = 1200; - colored-stats = true; - colored-completion-prefix = true; - expand-tilde = true; + git_branch = { + format = "[$branch]($style)"; + style = "bright-black"; }; - bindings = { - # wrap a command in '$(...| fzf)' - "\\C-xf" = ''"\C-e | fzf)\C-a(\C-a$\C-b\C-a"''; - "\\e\\C-f" = "dump-functions"; # help - "\\e\\C-o" = "dabbrev-expand"; # expand - "\\e\\C-v" = "dump-variables"; # help - "\\em" = "beginning-of-line"; - # emacs-like history navigation - "\\en" = "next-history"; - "\\ep" = "previous-history"; - # groq-specific stuff - "\\er" = "redraw-current-line"; - "\\C-xt" = ''"$(_bake_targets)\e\C-e\er"''; + git_status = { + format = + ''[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)''; + style = "cyan"; + conflicted = "​"; + untracked = "​"; + modified = "​"; + staged = "​"; + renamed = "​"; + deleted = "​"; + stashed = "≡"; }; - extraConfig = '' - $if Guile - "\C-o": "()\C-b" - $endif - ''; - }; - - fzf = { - enable = true; - enableBashIntegration = true; - defaultCommand = "rg --files"; - changeDirWidgetCommand = "fd --type d"; # M-c - changeDirWidgetOptions = ["--preview 'tree -C {} | head -100'"]; - fileWidgetCommand = "fd --type f"; - fileWidgetOptions = ["--preview 'head -n100 {}'"]; - historyWidgetOptions = ["--sort" "--exact"]; - tmux.enableShellIntegration = true; - tmux.shellIntegrationOptions = [ "-p 70%" ]; - }; - - git = { - enable = true; - userName = "Ben Sima"; - userEmail = "ben@bsima.me"; - ignores = [ "*~" "*.swp" ]; - package = pkgs.gitAndTools.gitFull; - signing = { - key = gpgid; - # for some reason this fails... - #gpgPath = - # let - # script = pkgs.writeScriptBin "my-ots-git-gpg-wrapper" '' - # #!/usr/bin/env bash - # set -euxo pipefail - # ${pkgs.opentimestamps-client}/bin/ots-git-gpg-wrapper --gpg-program ${pkgs.gnupg}/bin/gpg $@ - # ''; - # in - # "${script}/bin/my-ots-git-gpg-wrapper"; + git_state = { + format = "\([$state( $progress_current/$progress_total)]($style)\) "; + style = "bright-black"; }; - aliases = { - authors = "shortlog -s -n"; - slog = "log --stat"; - glog = ''log --decorate --all --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative''; - logbr = "log -r origin/HEAD..HEAD"; - mylog = ''!git log --author=$USER --decorate --pretty=format:"%Cred%h%Creset %s%Creset%C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative''; - mrd = "!cat <(git shortlog origin/HEAD..HEAD) <(git diff --stat origin/HEAD...HEAD)"; - extend = "!git commit --fixup $1 && git rebase --autosquash $1~"; - mr = lib.concatStringsSep " " [ - "!git push" - "-o merge_request.create" - "-o merge_request.merge_when_pipeline_succeeds" - "-o merge_request.label=ReleaseUpdate::NotRequired" - "-o merge_request.assign=$USER" - # disable these two args bc gitlab just uses the commit message anyway - # ''-o merge_request.title="$(git log -n1 --format=%s)"'' - # ''-o merge_request.description="$(git log -n --format=%b)"'' - ]; - }; - extraConfig = { - commit.template = "${./git-commit-template}"; - commit.verbose = "true"; - fetch.showForcedUpdate = "false"; - init.defaultBranch = "main"; - log.date = "local"; - merge.tool = "fugitive"; - mergetool.fugitive.cmd = ''vim -f -c "Gvdiffsplit!" "$MERGED"''; - pull.rebase = "true"; - push.default = "current"; - remote.pushDefault = "origin"; - sendemail = { - #smtpuser = "ben@bsima.me"; - #smtpserverport = 587; - smtpserver = "${homedir}/bin/sendmail"; - chainreplyto = false; - composeencoding = "UTF-8"; - annotate = "yes"; - cccmd = "git-contacts"; - }; + + cmd_duration = { + format = "[$duration]($style) "; + style = "yellow"; }; }; + }; - jujutsu = { - enable = true; - enableBashIntegration = true; + programs.readline = { + enable = true; + variables = { + keyseq-timeout = 1200; + colored-stats = true; + colored-completion-prefix = true; + expand-tilde = true; }; - - tmux = { - enable = true; - aggressiveResize = false; - baseIndex = 0; - clock24 = true; - customPaneNavigationAndResize = false; - disableConfirmationPrompt = false; - escapeTime = 0; - historyLimit = 10000; - keyMode = "emacs"; - newSession = false; - resizeAmount = 5; - reverseSplit = false; - secureSocket = false; - sensibleOnTop = true; - #shell = "${pkgs.bash}/bin/bash"; - shortcut = "a"; - terminal = "xterm-256color"; - tmuxinator.enable = false; - tmuxp.enable = false; - - extraConfig = '' - # Automatically set window title - set-window-option -g automatic-rename on - set-option -g set-titles on - set -g xterm-keys on - setw -g mouse on - ## Panes - # Split panes - bind-key | split-window -h -c "#{pane_current_path}" - bind-key - split-window -v -c "#{pane_current_path}" - # Send/join panes - bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'" - bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'" - # Use Alt-vim keys without prefix key to switch panes - bind -n M-h select-pane -L - bind -n M-j select-pane -D - bind -n M-k select-pane -U - bind -n M-l select-pane -R - # Use Alt-vim capitalized keys without prefix key to resize panes - bind -n M-H resize-pane -L - bind -n M-J resize-pane -D - bind -n M-K resize-pane -U - bind -n M-L resize-pane -R - # Shift arrow to switch windows - bind -n S-Left previous-window - bind -n S-Right next-window - # Set current window pane to 80 columns - bind-key E resize-pane -x 80 - # cycle pane layout - bind-key N next-layout - bind-key P previous-layout - # Toggle synchronizing panes - bind-key y setw synchronize-panes - ## Text manipulation - # vim-like copy/paste - setw -g mode-keys vi - bind [ copy-mode - bind ] paste-buffer - # copy/paste with xclip - bind-key -Tcopy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i' - # select buffer to paste from - bind Space choose-buffer - # status line text - set -g status-left-length 30 - set -g status-left '#S | #(whoami)@#(hostname) | ' - set -g status-right '~%Y.%m.%d..%H.%M' - set -g renumber-windows on - # white-ish background with dark-grey text - set -g status-style bg=colour0,fg=colour13 - # highlight current window - set -g window-status-current-style fg=colour0,bg=colour13 - set -g window-status-format '#I) #W ' - set -g window-status-current-format '#I) #W ' - # special thing for groq's SFT thing - set -g update-environment "SFT_AUTH_SOCK SSH_AUTH_SOCK SSH_CONNECTION" - ''; - - plugins = with pkgs.tmuxPlugins; [ - extrakto - tmux-fzf - ]; + bindings = { + # wrap a command in '$(...| fzf)' + "\\C-xf" = ''"\C-e | fzf)\C-a(\C-a$\C-b\C-a"''; + "\\e\\C-f" = "dump-functions"; # help + "\\e\\C-o" = "dabbrev-expand"; # expand + "\\e\\C-v" = "dump-variables"; # help + "\\em" = "beginning-of-line"; + # emacs-like history navigation + "\\en" = "next-history"; + "\\ep" = "previous-history"; + # groq-specific stuff + "\\er" = "redraw-current-line"; + "\\C-xt" = ''"$(_bake_targets)\e\C-e\er"''; }; + extraConfig = '' + $if Guile + "\C-o": "()\C-b" + $endif + ''; + }; - urxvt = let font = name: size: "xft:${name}:size=${toString size}:ant"; in { - enable = true; - fonts = [ - (font "Fira Code" fontSize) - (font "FiraCodeNerdfont" fontSize) - "xft:Noto Emoji" - ]; - #keybindings = { - # # why don't any of these work? - # "Shift-Control-C" = "eval:selection_to_clipboard"; - # "Shift-Control-V" = "eval:paste_clipboard"; - # "Shift-Control-+" = "command:\033]710;${font 12}\007\033]711;${font 12}\007"; - # "Shift-Control--" = "command:\033]710;${font 8}\007\033]711;${font 8}\007"; - #}; - iso14755 = true; # unicode chars - #transparent = true; - #shading = 10; + programs.fzf = { + enable = true; + enableBashIntegration = true; + colors = { + # catppuccin-latte + # https://github.com/catppuccin/fzf + # TODO: use catppuccin/nix, and swtich based on xtheme + "bg+" = "#ccd0da"; + "bg" = "#eff1f5"; + "spinner" = "#dc8a78"; + "hl" = "#d20f39"; + "fg" = "#4c4f69"; + "header" = "#d20f39"; + "info" = "#8839ef"; + "pointer" = "#dc8a78 "; + "marker" = "#dc8a78"; + "fg+" = "#4c4f69"; + "prompt" = "#8839ef"; + "hl+" = "#d20f39"; }; + defaultCommand = "rg --files"; + changeDirWidgetCommand = "fd --type d"; # M-c + changeDirWidgetOptions = ["--preview 'tree -C {} | head -100'"]; + fileWidgetCommand = "fd --type f"; + fileWidgetOptions = ["--preview 'head -n100 {}'"]; + historyWidgetOptions = ["--sort" "--exact"]; + tmux.enableShellIntegration = true; + tmux.shellIntegrationOptions = [ "-p 70%" ]; + }; - direnv = { - enable = true; - enableBashIntegration = true; - nix-direnv.enable = true; + programs.git = { + enable = true; + userName = "Ben Sima"; + userEmail = "ben@bsima.me"; + ignores = [ "*~" "*.swp" ]; + package = pkgs.gitAndTools.gitFull; + signing = { + key = gpgid; + # for some reason this fails... + #gpgPath = + # let + # script = pkgs.writeScriptBin "my-ots-git-gpg-wrapper" '' + # #!/usr/bin/env bash + # set -euxo pipefail + # ${pkgs.opentimestamps-client}/bin/ots-git-gpg-wrapper --gpg-program ${pkgs.gnupg}/bin/gpg $@ + # ''; + # in + # "${script}/bin/my-ots-git-gpg-wrapper"; }; - - vim = { - enable = true; - #vimAlias = true; - #viAlias = true; - #vimdiffAlias = true; - plugins = with pkgs.vimPlugins; [ - base16-vim - editorconfig-vim - vim-sensible - vim-fugitive - vim-colors-solarized - vim-sexp-mappings-for-regular-people - # vim-ripgrep # not in nixpkgs :( - rainbow_parentheses - vim-plug # just in case - vim-addon-local-vimrc - fzf-vim - (pkgs.vimUtils.buildVimPlugin { - pname = "photon.vim"; - version = "2022.03.14"; - src = pkgs.fetchFromGitHub { - owner = "axvr"; - repo = "photon.vim"; - rev = "32b42c8a12bf9588259b76f3df6807960e0d7386"; - sha256 = "sha256-kM7WP03uE20yr0nCusB3ncHzgtEYxqNzoNoQGen9p+o="; - }; - meta.homepage = "https://github.com/axvr/photon.vim"; - }) - (pkgs.vimUtils.buildVimPlugin { - pname = "skull-vim"; - version = "2022.03.14"; - src = pkgs.fetchFromGitHub { - owner = "kadekillary"; - repo = "skull-vim"; - rev = "abb9d7120c63aad6f9acc26d31c948a93f352e94"; - sha256 = "sha256-tu5aDRjHZtXKoyQBbMEhzjGrRl4GZD121ybs7oNylvs="; - }; - meta.homepage = "https://github.com/kadekillary/skull-vim"; - }) + aliases = { + authors = "shortlog -s -n"; + slog = "log --stat"; + glog = ''log --decorate --all --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative''; + logbr = "log -r origin/HEAD..HEAD"; + mylog = ''!git log --author=$USER --decorate --pretty=format:"%Cred%h%Creset %s%Creset%C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative''; + mrd = "!cat <(git shortlog origin/HEAD..HEAD) <(git diff --stat origin/HEAD...HEAD)"; + extend = "!git commit --fixup $1 && git rebase --autosquash $1~"; + mr = lib.concatStringsSep " " [ + "!git push" + "-o merge_request.create" + "-o merge_request.merge_when_pipeline_succeeds" + "-o merge_request.label=ReleaseUpdate::NotRequired" + "-o merge_request.assign=$USER" + # disable these two args bc gitlab just uses the commit message anyway + # ''-o merge_request.title="$(git log -n1 --format=%s)"'' + # ''-o merge_request.description="$(git log -n --format=%b)"'' ]; - extraConfig = builtins.readFile ./vimrc; }; + extraConfig = { + commit.template = "${./git-commit-template}"; + commit.verbose = "true"; + fetch.showForcedUpdate = "false"; + init.defaultBranch = "main"; + log.date = "local"; + merge.tool = "fugitive"; + mergetool.fugitive.cmd = ''vim -f -c "Gvdiffsplit!" "$MERGED"''; + pull.rebase = "true"; + push.default = "current"; + remote.pushDefault = "origin"; + sendemail = { + #smtpuser = "ben@bsima.me"; + #smtpserverport = 587; + smtpserver = "${homedir}/bin/sendmail"; + chainreplyto = false; + composeencoding = "UTF-8"; + annotate = "yes"; + cccmd = "git-contacts"; + }; + }; + }; + programs.jujutsu = { + enable = true; + enableBashIntegration = true; + }; + + programs.tmux = { + enable = true; + aggressiveResize = false; + baseIndex = 0; + clock24 = true; + customPaneNavigationAndResize = false; + disableConfirmationPrompt = false; + escapeTime = 0; + historyLimit = 10000; + keyMode = "emacs"; + newSession = false; + resizeAmount = 5; + reverseSplit = false; + secureSocket = false; + sensibleOnTop = true; + #shell = "${pkgs.bash}/bin/bash"; + shortcut = "a"; + terminal = "xterm-256color"; + tmuxinator.enable = false; + tmuxp.enable = false; + extraConfig = '' + # Automatically set window title + set-window-option -g automatic-rename on + set-option -g set-titles on + set -g xterm-keys on + setw -g mouse on + ## Panes + # Split panes + bind-key | split-window -h -c "#{pane_current_path}" + bind-key - split-window -v -c "#{pane_current_path}" + # Send/join panes + bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'" + bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'" + # Use Alt-vim keys without prefix key to switch panes + bind -n M-h select-pane -L + bind -n M-j select-pane -D + bind -n M-k select-pane -U + bind -n M-l select-pane -R + # Use Alt-vim capitalized keys without prefix key to resize panes + bind -n M-H resize-pane -L + bind -n M-J resize-pane -D + bind -n M-K resize-pane -U + bind -n M-L resize-pane -R + # Shift arrow to switch windows + bind -n S-Left previous-window + bind -n S-Right next-window + # Set current window pane to 80 columns + bind-key E resize-pane -x 80 + # cycle pane layout + bind-key N next-layout + bind-key P previous-layout + # Toggle synchronizing panes + bind-key y setw synchronize-panes + ## Text manipulation + # vim-like copy/paste + setw -g mode-keys vi + bind [ copy-mode + bind ] paste-buffer + # copy/paste with xclip + bind-key -Tcopy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i' + # select buffer to paste from + bind Space choose-buffer + # status line text + set -g status-left-length 30 + set -g status-left '#S | #(whoami)@#(hostname) | ' + set -g status-right '~%Y.%m.%d..%H.%M' + set -g renumber-windows on + # white-ish background with dark-grey text + set -g status-style bg=colour0,fg=colour13 + # highlight current window + set -g window-status-current-style fg=colour0,bg=colour13 + set -g window-status-format '#I) #W ' + set -g window-status-current-format '#I) #W ' + # special thing for groq's SFT thing + set -g update-environment "SFT_AUTH_SOCK SSH_AUTH_SOCK SSH_CONNECTION" + ''; + plugins = with pkgs.tmuxPlugins; [ + extrakto + tmux-fzf + ]; + }; + + programs.direnv = { + enable = true; + enableBashIntegration = true; + nix-direnv.enable = true; + }; + + programs.vim = { + enable = true; + #vimAlias = true; + #viAlias = true; + #vimdiffAlias = true; + plugins = with pkgs.vimPlugins; [ + base16-vim + catppuccin-vim + editorconfig-vim + vim-sensible + vim-fugitive + vim-sexp-mappings-for-regular-people + # vim-ripgrep # not in nixpkgs :( + rainbow_parentheses + vim-plug # just in case + vim-addon-local-vimrc + fzf-vim + (pkgs.vimUtils.buildVimPlugin { + pname = "photon.vim"; + version = "2022.03.14"; + src = pkgs.fetchFromGitHub { + owner = "axvr"; + repo = "photon.vim"; + rev = "32b42c8a12bf9588259b76f3df6807960e0d7386"; + sha256 = "sha256-kM7WP03uE20yr0nCusB3ncHzgtEYxqNzoNoQGen9p+o="; + }; + meta.homepage = "https://github.com/axvr/photon.vim"; + }) + (pkgs.vimUtils.buildVimPlugin { + pname = "skull-vim"; + version = "2022.03.14"; + src = pkgs.fetchFromGitHub { + owner = "kadekillary"; + repo = "skull-vim"; + rev = "abb9d7120c63aad6f9acc26d31c948a93f352e94"; + sha256 = "sha256-tu5aDRjHZtXKoyQBbMEhzjGrRl4GZD121ybs7oNylvs="; + }; + meta.homepage = "https://github.com/kadekillary/skull-vim"; + }) + ]; + extraConfig = builtins.readFile ./vimrc; + }; + + programs = { info.enable = true; man.enable = true; @@ -509,12 +516,11 @@ in { bind '"\C- ": "$(p)\e\C-e\er"' ''; shellAliases = { - q = "que"; - qd = ''que pub/bsnotify - <<< "done"''; ".." = "__HM_SESS_VARS_SOURCED= ."; day = "date +%a"; ddate = "date +%Y.%m.%d"; dday = "date +%A"; + dr = "direnv reload"; e = "emacsclient -nw"; # emacs in a terminal f = "fossil"; g = "git"; @@ -529,6 +535,8 @@ in { gs = "git status -sb"; hs = "NIX_PATH=$HOME/.nix-defexpr/channels$\{NIX_PATH:+:\}$NIX_PATH home-manager switch"; ll = "ls -lah"; + q = "que"; + qd = ''que pub/bsnotify - <<< "done"''; rm = "rm -i"; s = '' INITIAL_QUERY="" && \ diff --git a/lib/const.nix b/lib/const.nix index ce1f11b..be27d9d 100644 --- a/lib/const.nix +++ b/lib/const.nix @@ -1,5 +1,5 @@ { - fontSize = 14; + fontSize = 12; homedir = builtins.getEnv "HOME"; gpgid = "66A6AD150399D970DCA4C4E6C8218B7D0BFDECCD"; } diff --git a/lib/linux.nix b/lib/linux.nix index e80b71f..ba0fbdf 100644 --- a/lib/linux.nix +++ b/lib/linux.nix @@ -2,24 +2,9 @@ let inherit (import ./const.nix) fontSize homedir gpgid; - base16-scheme = "atelier-sulphurpool"; - base16-scheme-filename = lib.strings.concatStrings (lib.strings.splitString "-" base16-scheme); - theme = lib.removeSuffix "\n" (builtins.readFile "${homedir}/.local/share/xtheme"); - xresourcesFile = "${pkgs.base16}/xresources/base16-${base16-scheme-filename}.${theme}.256.xresources"; - - # used in polybar and dunst - colors = { # derived from spacemacs - "dark" = { - highlight = "#5d4d7a"; - background = "#292b2e"; - foreground = "#b2b2b2"; - }; - "light" = { - highlight = "#67b11d"; - background = "#f6f1e1"; - foreground = "#655370"; - }; - }; + inherit (import ./theme.nix { inherit pkgs lib; }) + theme colors base16-scheme base16-scheme-filename + xresourcesFile; xmonadPackages = self: [ self.xmonad-contrib #self.taffybar # fails to build @@ -30,6 +15,10 @@ in { imports = [ ./common.nix + + # nix-channel --add https://github.com/catppuccin/nix/archive/main.tar.gz catppuccin + # + ]; home = { pointerCursor = { @@ -100,6 +89,10 @@ in zathura ]; }; + + #catppuccin.flavor = "latte"; + #catppuccin.enable = true; + fonts.fontconfig.enable = true; gtk.enable = false; # this fails because of some missing service file @@ -140,141 +133,6 @@ in postExec = "${pkgs.notmuch}/bin/notmuch new"; }; - polybar = { - # https://github.com/0x746866/dots/blob/master/polybar/config - enable = true; - config = { - "bar/top" = { - background = colors."${theme}".background; - font-0 = "FiraSans:size=${toString fontSize}"; - font-1 = "Font Awesome 5:pixelsize=11;1"; - font-2 = "MaterialIcons:size=10:antialias=false;2"; - foreground = colors."${theme}".foreground; - height = "30"; - module-margin = 1; - modules-center = "date"; - modules-left = ["ewmh" "volume-bar"]; - modules-right = [ "battery" "cpu" "mem" "temp" ]; - monitor = "\${env:MONITOR:HDMI-2}"; - monitor-fallback = "\${env:MONITOR:eDP-1}"; - radius = 0; - separator = "|"; - tray-background = colors."${theme}".background; - tray-detached = false; - tray-maxsize = 16; - tray-offset-x = 0; - tray-offset-y = 0; - tray-padding = 0; - tray-position = "right"; - tray-scale = 1; - width = "100%"; - }; - "module/ewmh" = { - type = "internal/xworkspaces"; - label-active-foreground = "#fff"; - }; - "module/date" = { - type = "internal/date"; - internal = 5; - date = "%Y.%m.%d"; - time = "%H.%M"; - label = "%date%..%time%"; - }; - "module/battery" = { - type = "internal/battery"; - battery = "BAT0"; - adapter = "AC"; - full-at = 99; - }; - "module/volume-bar" = { - type = "internal/alsa"; - master-soundcard = "hw:1"; - bar-volume-font = 2; - bar-volume-width = 9; - format-volume = ""; - label-volume = " .) "; - label-muted = " .) mute"; - label-volume-foreground = colors.${theme}.foreground; - format-muted-foreground = colors.${theme}.foreground; - bar-volume-foreground-0 = colors.${theme}.foreground; - bar-volume-foreground-1 = colors.${theme}.foreground; - bar-volume-foreground-2 = colors.${theme}.foreground; - bar-volume-foreground-3 = colors.${theme}.foreground; - bar-volume-foreground-4 = colors.${theme}.foreground; - bar-volume-foreground-5 = colors.${theme}.foreground; - bar-volume-foreground-6 = colors.${theme}.foreground; - bar-volume-gradient = true; - bar-volume-indicator = "•"; - bar-volume-fill = "•"; - bar-volume-empty = "·"; - bar-volume-empty-foreground = colors.${theme}.foreground; - }; - "module/ethernet" = { - type = "internal/network"; - interface = "enp1s0"; - label-connected = "eth up: %upspeed:9% down: %downspeed%"; - label-disconnected = "no eth"; - }; - "module/wifi" = { - type = "internal/network"; - interface = "wlan1"; - label-connected = "wifi up: %upspeed% down: %downspeed%"; - label-disconnected = "no wifi"; - }; - "module/cpu" = { - type = "internal/cpu"; - interval = 3; - format-padding = 1; - format = "