diff options
author | tdback <tyler@tdback.net> | 2024-12-21 15:32:13 -0500 |
---|---|---|
committer | tdback <tyler@tdback.net> | 2024-12-21 15:32:13 -0500 |
commit | 0a5754541bb01e96021ca7ee74f1256a8ee68bc4 (patch) | |
tree | 2d0b8089e98239963a1e240cff676b1515fc8431 /users/tdback/modules |
initial commit to self-hosted git
Diffstat (limited to 'users/tdback/modules')
-rw-r--r-- | users/tdback/modules/alacritty/default.nix | 71 | ||||
-rw-r--r-- | users/tdback/modules/dunst/default.nix | 30 | ||||
-rw-r--r-- | users/tdback/modules/email/default.nix | 78 | ||||
-rw-r--r-- | users/tdback/modules/firefox/default.nix | 101 | ||||
-rw-r--r-- | users/tdback/modules/git/default.nix | 9 | ||||
-rw-r--r-- | users/tdback/modules/irc/default.nix | 30 | ||||
-rw-r--r-- | users/tdback/modules/mpd/default.nix | 34 | ||||
-rw-r--r-- | users/tdback/modules/ncmpcpp/default.nix | 65 | ||||
-rw-r--r-- | users/tdback/modules/neomutt/default.nix | 69 | ||||
-rw-r--r-- | users/tdback/modules/polybar/default.nix | 112 | ||||
-rw-r--r-- | users/tdback/modules/rofi/default.nix | 81 | ||||
-rw-r--r-- | users/tdback/modules/shell/default.nix | 59 | ||||
-rw-r--r-- | users/tdback/modules/tmux/default.nix | 52 | ||||
-rw-r--r-- | users/tdback/modules/x11/default.nix | 94 |
14 files changed, 885 insertions, 0 deletions
diff --git a/users/tdback/modules/alacritty/default.nix b/users/tdback/modules/alacritty/default.nix new file mode 100644 index 0000000..6955536 --- /dev/null +++ b/users/tdback/modules/alacritty/default.nix @@ -0,0 +1,71 @@ +{ pkgs, ... }: +{ + programs.alacritty = { + enable = true; + package = pkgs.alacritty; + settings = { + env.TERM = "xterm-256color"; + mouse.hide_when_typing = true; + scrolling.history = 10000; + + window = { + decorations = "None"; + opacity = 1.0; + title = "Alacritty"; + padding.x = 4; + }; + + cursor.style.blinking = "Never"; + + font = { + size = 14.0; + normal = { + family = "Iosevka Comfy Motion Fixed"; + style = "Regular"; + }; + italic = { + family = "Iosevka Comfy Motion Fixed"; + style = "Italic"; + }; + bold = { + family = "Iosevka Comfy Motion Fixed"; + style = "Bold"; + }; + bold_italic = { + family = "Iosevka Comfy Motion Fixed"; + style = "Bold Italic"; + }; + }; + + # Tomorrow Night Bright colorscheme. + colors = { + draw_bold_text_with_bright_colors = true; + + primary = { + background = "#000000"; + foreground = "#eaeaea"; + }; + normal = { + black = "#000000"; + red = "#d54e53"; + green = "#b9ca4a"; + yellow = "#e6c547"; + blue = "#7aa6da"; + magenta = "#c397d8"; + cyan = "#70c0ba"; + white = "#424242"; + }; + bright = { + black = "#666666"; + red = "#ff3334"; + green = "#9ec400"; + yellow = "#e7c547"; + blue = "#7aa6da"; + magenta = "#b77ee0"; + cyan = "#54ced6"; + white = "#2a2a2a"; + }; + }; + }; + }; +} diff --git a/users/tdback/modules/dunst/default.nix b/users/tdback/modules/dunst/default.nix new file mode 100644 index 0000000..132e32b --- /dev/null +++ b/users/tdback/modules/dunst/default.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: +{ + services.dunst = { + enable = true; + package = pkgs.dunst; + + settings = { + global = { + width = 300; + height = 300; + offset = "30x50"; + origin = "top-right"; + frame_color = "#2c363c"; + font = "Iosevka Comfy Motion Fixed 12"; + }; + + urgency_normal = { + background = "#37474f"; + foreground = "eceff1"; + timeout = 5; + }; + }; + + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + size = "16x16"; + }; + }; +} diff --git a/users/tdback/modules/email/default.nix b/users/tdback/modules/email/default.nix new file mode 100644 index 0000000..3321462 --- /dev/null +++ b/users/tdback/modules/email/default.nix @@ -0,0 +1,78 @@ +{ pkgs, ... }: +{ + accounts.email = { + maildirBasePath = "mail"; + + accounts.fastmail = { + primary = true; + address = "tyler@tdback.net"; + userName = "tyler@tdback.net"; + realName = "Tyler Dunneback"; + passwordCommand = "${pkgs.age}/bin/age -d -i ~/.ssh/mail ~/.mail.age"; + + folders = { + inbox = "Inbox"; + drafts = "Drafts"; + sent = "Sent"; + trash = "Trash"; + }; + + imap = { + host = "imap.fastmail.com"; + port = 993; + tls = { + enable = true; + certificatesFile = "/etc/ssl/certs/ca-certificates.crt"; + }; + }; + + smtp = { + host = "smtp.fastmail.com"; + port = 465; + tls = { + enable = true; + useStartTls = false; + certificatesFile = "/etc/ssl/certs/ca-certificates.crt"; + }; + }; + + mbsync = { + enable = true; + create = "both"; + expunge = "none"; + subFolders = "Verbatim"; + patterns = [ "*" ]; + }; + + msmtp = { + enable = true; + extraConfig = { + logfile = "~/.cache/msmtp/msmtp.log"; + }; + }; + + neomutt = { + enable = true; + sendMailCommand = "msmtp"; + mailboxType = "maildir"; + extraMailboxes = [ + "Drafts" + "Sent" + "Trash" + "Archive" + ]; + }; + }; + }; + + programs = { + mbsync.enable = true; + msmtp.enable = true; + }; + + services.mbsync = { + enable = true; + package = pkgs.isync; + frequency = "*:0/5"; + }; +} diff --git a/users/tdback/modules/firefox/default.nix b/users/tdback/modules/firefox/default.nix new file mode 100644 index 0000000..dde8742 --- /dev/null +++ b/users/tdback/modules/firefox/default.nix @@ -0,0 +1,101 @@ +{ config, pkgs, ... }: +let + lock-false = { + Value = false; + Status = "locked"; + }; + lock-true = { + Value = true; + Status = "locked"; + }; +in +{ + programs.firefox = { + enable = true; + package = pkgs.firefox; + + policies = { + # about:policies + DisableTelemetry = true; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisplayBookmarksToolbar = "newtab"; + DisplayMenuBar = "default-off"; + SearchBar = "unified"; + OfferToSaveLogins = false; + EnableTrackingProtection = { + Value= true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + + # about:config + Preferences = { + "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; + "extensions.pocket.enabled" = lock-false; + "extensions.screenshots.disabled" = lock-true; + "browser.topsites.contile.enabled" = lock-false; + "browser.formfill.enable" = lock-false; + "browser.search.suggest.enabled" = lock-false; + "browser.search.suggest.enabled.private" = lock-false; + "browser.urlbar.suggest.searches" = lock-false; + "browser.urlbar.showSearchSuggestionsFirst" = lock-false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; + "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; + "browser.newtabpage.activity-stream.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; + }; + + ExtensionSettings = { + # Block all extensions except those defined below. + "*".installation_mode = "blocked"; + + # uBlock Origin + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + + # Bitwarden + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; + installation_mode = "force_installed"; + }; + + # Dark Reader + "addon@darkreader.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi"; + installation_mode = "force_installed"; + }; + }; + }; + + profiles.${config.home.username}.search = { + force = true; + default = "searx"; + order = [ "searx" ]; + engines = { + "Amazon.com".metaData.hidden = true; + "Bing".metaData.hidden = true; + "eBay".metaData.hidden = true; + "Google".metaData.hidden = true; + "Wikipedia (en)".metaData.alias = "@w"; + "searx" = { + urls = [{ + template = "http://10.44.4.100:8888/?q={searchTerms}"; + }]; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@sx" ]; + }; + }; + }; + }; +} diff --git a/users/tdback/modules/git/default.nix b/users/tdback/modules/git/default.nix new file mode 100644 index 0000000..c608c6b --- /dev/null +++ b/users/tdback/modules/git/default.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + programs.git = { + enable = true; + userName = "tdback"; + userEmail = "tyler@tdback.net"; + extraConfig.init.defaultBranch = "main"; + }; +} diff --git a/users/tdback/modules/irc/default.nix b/users/tdback/modules/irc/default.nix new file mode 100644 index 0000000..bc96909 --- /dev/null +++ b/users/tdback/modules/irc/default.nix @@ -0,0 +1,30 @@ +{ ... }: +let + user = "tdback"; +in +{ + programs.irssi = { + enable = true; + + extraConfig = '' + settings = { core = { real_name = "${user}"; }; }; + ''; + + networks = { + liberachat = { + nick = "${user}"; + saslExternal = true; + server = { + address = "irc.libera.chat"; + port = 6697; + autoConnect = true; + ssl = { + enable = true; + verify = true; + certificateFile = "/home/${user}/.irssi/certs/libera.pem"; + }; + }; + }; + }; + }; +} diff --git a/users/tdback/modules/mpd/default.nix b/users/tdback/modules/mpd/default.nix new file mode 100644 index 0000000..d7338cb --- /dev/null +++ b/users/tdback/modules/mpd/default.nix @@ -0,0 +1,34 @@ +{ pkgs, ... }: +{ + services.mpd = { + enable = true; + package = pkgs.mpd; + + network = { + listenAddress = "127.0.0.1"; + port = 6600; + }; + + musicDirectory = "~/media/music"; + + extraConfig = '' + log_file "syslog" + max_output_buffer_size "16384" + + restore_paused "yes" + auto_update "yes" + + audio_output { + type "pulse" + name "pulseaudio" + } + + audio_output { + type "fifo" + name "Visualizer feed" + path "/tmp/mpd.fifo" + format "44100:16:2" + } + ''; + }; +} diff --git a/users/tdback/modules/ncmpcpp/default.nix b/users/tdback/modules/ncmpcpp/default.nix new file mode 100644 index 0000000..a201e88 --- /dev/null +++ b/users/tdback/modules/ncmpcpp/default.nix @@ -0,0 +1,65 @@ +{ pkgs, ... }: +{ + programs.ncmpcpp = { + enable = true; + package = pkgs.ncmpcpp.override { visualizerSupport = true; }; + mpdMusicDir = "~/Media/Music"; + settings = { + ncmpcpp_directory = "~/.config/ncmpcpp"; + lyrics_directory = "~/.local/share/lyrics"; + song_list_format = "{%a - }{%t}|{$8%f$9}$R{$3%l$9}"; + song_status_format = "{{%a{ \"%b\"{ (%y)}} - }{%t}}|{%f}"; + song_library_format = "{%n - }{%t}|{%f}"; + alternative_header_first_line_format = "$b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b"; + alternative_header_second_line_format = "{{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}"; + current_item_prefix = "$(yellow)$r"; + current_item_suffix = "$/r$(end)"; + current_item_inactive_column_prefix = "$(white)$r"; + current_item_inactive_column_suffix = "$/r$(end)"; + now_playing_prefix = "$b"; + now_playing_suffix = "$/b"; + browser_playlist_prefix = "$2playlist$9 "; + selected_item_prefix = "$6"; + selected_item_suffix = "$9"; + modified_item_prefix = "$3> $9"; + song_window_title_format = "{%a - }{%t}|{%f}"; + browser_sort_mode = "type"; + browser_sort_format = "{%a - }{%t}|{%f} {%l}"; + visualizer_data_source = "/tmp/mpd.fifo"; + visualizer_output_name = "Visualizer feed"; + visualizer_in_stereo = true; + visualizer_type = "spectrum"; + visualizer_look = "●▮"; + visualizer_color = "blue, cyan, green, yellow, magenta, red"; + visualizer_spectrum_smooth_look = true; + }; + + bindings = [ + { key = "j"; command = "scroll_down"; } + { key = "k"; command = "scroll_up"; } + { key = "h"; command = [ "previous_column" "jump_to_parent_directory" ]; } + { key = "l"; command = [ "next_column" "enter_directory" "run_action" "play_item" ]; } + { key = "u"; command = "page_up"; } + { key = "d"; command = "page_down"; } + { key = "ctrl-u"; command = "page_up"; } + { key = "ctrl-d"; command = "page_down"; } + { key = "g"; command = "move_home"; } + { key = "G"; command = "move_end"; } + { key = "n"; command = "next_found_item"; } + { key = "N"; command = "previous_found_item"; } + { key = "J"; command = "move_sort_order_down"; } + { key = "K"; command = "move_sort_order_up"; } + { key = "f"; command = [ "show_browser" "change_browse_mode" ]; } + { key = "s"; command = [ "reset_search_engine" "show_search_engine" ]; } + { key = "m"; command = "toggle_media_library_columns_mode"; } + { key = "x"; command = "delete_playlist_items"; } + { key = "U"; command = "update_database"; } + { key = "P"; command = "show_playlist"; } + { key = "t"; command = "show_tag_editor"; } + { key = "v"; command = "show_visualizer"; } + { key = "."; command = "show_lyrics"; } + { key = "+"; command = "show_clock"; } + { key = "="; command = "volume_up"; } + ]; + }; +} diff --git a/users/tdback/modules/neomutt/default.nix b/users/tdback/modules/neomutt/default.nix new file mode 100644 index 0000000..243aa6b --- /dev/null +++ b/users/tdback/modules/neomutt/default.nix @@ -0,0 +1,69 @@ +{ pkgs, ... }: +{ + programs.neomutt = { + enable = true; + package = pkgs.neomutt; + + vimKeys = true; + sort = "reverse-date"; + + checkStatsInterval = 60; + + sidebar = { + enable = true; + shortPath = true; + width = 20; + }; + + binds = [ + { + map = [ "index" "pager" ]; + key = "\\Cp"; + action = "sidebar-prev"; + } + { + map = [ "index" "pager" ]; + key = "\\Cn"; + action = "sidebar-next"; + } + { + map = [ "index" "pager" ]; + key = "\\Cy"; + action = "sidebar-open"; + } + ]; + + macros = [ + { + map = [ "index" "pager" ]; + key = "gi"; + action = "<change-folder>=Inbox<enter>"; + } + { + map = [ "index" "pager" ]; + key = "gs"; + action = "<change-folder>=Sent<enter>"; + } + { + map = [ "index" "pager" ]; + key = "gd"; + action = "<change-folder>=Drafts<enter>"; + } + { + map = [ "index" "pager" ]; + key = "gt"; + action = "<change-folder>=Trash<enter>"; + } + { + map = [ "index" "pager" ]; + key = "ga"; + action = "<change-folder>=Archive<enter>"; + } + { + map = [ "index" ]; + key = "S"; + action = "<shell-escape>${pkgs.isync}/bin/mbsync -a<enter>"; + } + ]; + }; +} diff --git a/users/tdback/modules/polybar/default.nix b/users/tdback/modules/polybar/default.nix new file mode 100644 index 0000000..833a260 --- /dev/null +++ b/users/tdback/modules/polybar/default.nix @@ -0,0 +1,112 @@ +{ lib, pkgs, ... }: +{ + services.polybar = { + enable = true; + package = pkgs.polybar.override { pulseSupport = true; }; + script = "polybar main &"; + settings = + let + colors = { + alert = "#505050"; + foreground = "#F1F1F1"; + background = "#050505"; + background-alt = "#373B41"; + }; + in + { + "bar/main" = { + bottom = true; + width = "100%"; + height = "16pt"; + line.size = "3pt"; + font = [ "Iosevka Comfy Motion Fixed:size=8" ]; + + foreground = "${colors.foreground}"; + background = "${colors.background}"; + + separator = "|"; + padding = { + left = 1; + right = 1; + }; + + module.margin = 1; + modules = { + left = "bspwm"; + center = "time"; + right = "volume cpu memory date"; + }; + + wm.restack = "bspwm"; + cursor.click = "pointer"; + }; + + "module/bspwm" = { + type = "internal/bspwm"; + pin.workspaces = true; + label = { + focused = { + text = "%index%"; + foreground = "${colors.foreground}"; + padding = 1; + }; + occupied = { + text = "%index%"; + foreground = "${colors.alert}"; + padding = 1; + }; + urgent = { + text = "%index%"; + foreground = "${colors.foreground}"; + background = "${colors.background-alt}"; + padding = 1; + }; + empty.text = ""; + }; + }; + + "module/cpu" = { + type = "internal/cpu"; + interval = 3; + label = "CPU %percentage%%"; + }; + + "module/memory" = { + type = "internal/memory"; + interval = 3; + label = "RAM %percentage_used%%"; + }; + + "module/volume" = { + type = "internal/pulseaudio"; + label = { + volume = "VOL %percentage%%"; + muted = "VOL 0%"; + }; + click.right = "${lib.getExe pkgs.pavucontrol}"; + }; + + "module/time" = { + type = "internal/date"; + interval = 1; + label = "%time%"; + time = "%H:%M"; + }; + + "module/date" = { + type = "internal/date"; + interval = 1; + label = "%date%"; + date = "%m.%d.%Y"; + }; + + "settings" = { + screenchange.reload = true; + pseudo.transparency = true; + }; + }; + }; + + # Make sure polybar starts only during graphical sessions. + systemd.user.services.polybar.Install.WantedBy = [ "graphical-session.target" ]; +} diff --git a/users/tdback/modules/rofi/default.nix b/users/tdback/modules/rofi/default.nix new file mode 100644 index 0000000..e3264df --- /dev/null +++ b/users/tdback/modules/rofi/default.nix @@ -0,0 +1,81 @@ +{ config, pkgs, ... }: +{ + programs.rofi = { + enable = true; + package = pkgs.rofi; + font = "Iosevka Comfy Motion Fixed 12"; + location = "center"; + extraConfig = { + modi = "window,run,drun"; + icon-theme = "Papirus"; + show-icons = true; + display-drun = ""; + display-window = ""; + drun-display-format = "{icon} {name}"; + }; + theme = + let + inherit (config.lib.formats.rasi) mkLiteral; + in + { + "*" = { + bg = mkLiteral "#050505"; + bg-alt = mkLiteral "#191919"; + fg = mkLiteral "#FFFFFF"; + fg-alt = mkLiteral"#787c99"; + background-color = mkLiteral "@bg"; + border = 0; + margin = 0; + padding = 0; + spacing = 0; + }; + + "window" = { + width = mkLiteral "40%"; + }; + + "element" = { + padding = 12; + text-color = mkLiteral "@fg-alt"; + }; + + "element selected" = { + text-color = mkLiteral "@fg"; + }; + + "element-text" = { + background-color = mkLiteral "inherit"; + text-color = mkLiteral "inherit"; + vertical-align = mkLiteral "0.5"; + }; + + "element-icon" = { + size = 38; + }; + + "entry" = { + background-color = mkLiteral "@bg-alt"; + text-color = mkLiteral "@fg"; + padding = 14; + placeholder = "Search..."; + }; + + "inputbar" = { + children = map mkLiteral [ "prompt" "entry" ]; + }; + + "listview" = { + columns = 2; + lines = 6; + background-color = mkLiteral "@bg"; + }; + + "prompt" = { + enabled = true; + background-color = mkLiteral "@bg-alt"; + text-color = mkLiteral "@fg"; + padding = mkLiteral "14 10 0 14"; + }; + }; + }; +} diff --git a/users/tdback/modules/shell/default.nix b/users/tdback/modules/shell/default.nix new file mode 100644 index 0000000..be63547 --- /dev/null +++ b/users/tdback/modules/shell/default.nix @@ -0,0 +1,59 @@ +{ pkgs, ... }: +{ + programs = { + zoxide = { + enable = true; + enableBashIntegration = true; + options = [ "--cmd cd" ]; + }; + + bash = { + enable = true; + historyFile = "~/.bash_history"; + historyControl = [ "ignoredups" "ignorespace" ]; + shellOptions = [ "histappend" ]; + initExtra = '' + PS1=" + \[\e[34m\]\u\[\e[33m\] at \[\e[34m\]\h\[\e[33m\] in \[\e[34m\]\w + \[\e[33m\]λ\[\e[0m\] " + + # Set sane options. + set -o noclobber + set -o vi + bind "\C-l":clear-screen + bind "\C-p":previous-history + bind "\C-n":next-history + ''; + + profileExtra = '' + # Add script directories to PATH. + PATH=$PATH:$HOME/scripts + PATH=$PATH:$HOME/.local/bin + + # Clean up duplicate entries in PATH while preserving directory order. + PATH="$(echo $PATH | tr ':' '\n' | awk '!a[$0]++' | tr '\n' ':' | sed 's/:$//')" + ''; + + sessionVariables = { + BROWSER = "firefox"; + EDITOR = "vi"; + KEYTIMEOUT = 1; + LC_ALL = "en_US.UTF-8"; + LESSHISTFILE = "-"; + MANPAGER = "less -R --use-color -Dd+r -Du+b"; + }; + + shellAliases = { + cp = "cp -i"; + mv = "mv -i"; + rm = "rm -I"; + ls = "ls --color=auto"; + cat = "bat -pp"; + grep = "grep --color=auto"; + diff = "diff --color=auto"; + song = "yt-dlp --continue --no-check-certificate --format=bestaudio -x --add-metadata --audio-format=flac"; + mkdir = "mkdir -p"; + }; + }; + }; +} diff --git a/users/tdback/modules/tmux/default.nix b/users/tdback/modules/tmux/default.nix new file mode 100644 index 0000000..8ac1c74 --- /dev/null +++ b/users/tdback/modules/tmux/default.nix @@ -0,0 +1,52 @@ +{ pkgs, ... }: +{ + programs.tmux = { + enable = true; + package = pkgs.tmux; + terminal = "tmux-256color"; + escapeTime = 0; + baseIndex = 0; + historyLimit = 10000; + mouse = true; + clock24 = true; + secureSocket = true; + aggressiveResize = true; + prefix = "C-t"; + extraConfig = '' + # Prevent detaching from tmux when closing a session. + set -g detach-on-destroy off + + # Kill the current session. + bind X kill-session + + # Splitting panes. + unbind v + unbind h + unbind % + unbind '"' + bind v split-window -h -c "#{pane_current_path}" # split vertically + bind h split-window -v -c "#{pane_current_path}" # split horizontally + + # Navigating panes. + bind ^ last-window + bind C-h select-pane -L + bind C-j select-pane -D + bind C-k select-pane -U + bind C-l select-pane -R + + # Copy mode movements. + set-window-option -g mode-keys vi + unbind -T copy-mode-vi Space; + unbind -T copy-mode-vi Enter; + bind -T copy-mode-vi v send-keys -X begin-selection + bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard" + + # Customizing status bar. + set -g status-position bottom + set -g status-style "bg=#050505 fg=#C5C8C6" + set -g status-right "" + setw -g window-status-current-format " #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F" + setw -g window-status-format " #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F" + ''; + }; +} diff --git a/users/tdback/modules/x11/default.nix b/users/tdback/modules/x11/default.nix new file mode 100644 index 0000000..41025a4 --- /dev/null +++ b/users/tdback/modules/x11/default.nix @@ -0,0 +1,94 @@ +{ pkgs, ... }: +{ + xsession.windowManager.bspwm = { + enable = true; + package = pkgs.bspwm; + settings = let color = "#3B4252"; in { + window_gap = 0; + top_padding = 0; + bottom_padding = 0; + right_padding = 0; + left_padding = 0; + top_monocle_padding = 0; + bottom_monocle_padding = 0; + right_monocle_padding = 0; + left_monocle_padding = 0; + split_ratio = 0.5; + borderless_monocle = true; + gapless_monocle = true; + normal_border_color = color; + active_border_color = color; + focused_border_color = color; + }; + + rules = { + "Zathura".state = "tiled"; + }; + + startupPrograms = [ + "${pkgs.xorg.setxkbmap}/bin/setxkbmap -layout us" + "${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr" + "${pkgs.xorg.xset}/bin/xset r rate 350 40" + "~/.fehbg" + ]; + + extraConfig = '' + ${pkgs.bspwm}/bin/bspc monitor -d 1 2 3 4 5 6 7 8 9 + ''; + }; + + services.sxhkd = { + enable = true; + package = pkgs.sxhkd; + keybindings = { + # Program hotkeys. + "alt + Tab" = "rofi -show window"; + "super + r" = "rofi -show drun"; + "super + x" = "alacritty"; + "super + b" = "firefox"; + "super + p" = "flameshot full -p $HOME/.local/screenshots"; + "super + shift + p" = "flameshot gui -p $HOME/.local/screenshots"; + "super + Escape" = "systemctl --user restart polybar"; + "super + alt + {q,r}" = "bspc {quit,wm -r}"; + + # Function hotkeys. + "XF86AudioPrev" = "mpc prev"; + "XF86AudioNext" = "mpc next"; + "XF86AudioPlay" = "mpc toggle"; + "XF86AudioLowerVolume" = "pamixer -d 5"; + "XF86AudioRaiseVolume" = "pamixer -i 5"; + "XF86AudioMute" = "pamixer -t"; + + # Manipulate window manager. + "super + q" = "bspc node -{c,k}"; + "super + f" = "bspc node focused.tiled -t fullscreen"; + "super + t" = "bspc node focused.fullscreen -t tiled"; + "super + shift + f" = "bspc node focused.tiled -t floating"; + "super + shift + t" = "bspc node focused.floating -t tiled"; + "super + {_,shift + }{h,j,k,l}" = "bspc node -{f,s} {west,south,north,east}"; + "super + {_,shift}c" = "bspc node -f {next,prev}.local.!hidden.window"; + "super + bracket{left,right}" = "bspc desktop -f {prev,next}.local"; + "super + {grave,Tab}" = "bspc {node,desktop} -f last"; + "super + {o,i}" = "bspc wm -h off; bspc node {older,newer} -f; bspc wm -h on"; + "super + {_,shift + }{1-9,0}" = "bspc {desktop -f, node -d} '^{1-9,10}'"; + "super + alt + {h,j,k,l}" = "bspc node -z {left -20 0, bottom 0 20, top 0 -20, right 20 0}"; + "super + alt + shift {h,j,k,l}" = "bspc node -z {right -20 0, top 0 20, bottom 0 -20, left 20 0}"; + "super + {Left,Down,Up,Right}" = "bspc node -v {-20 0,0 20,0 -20,20 0}"; + }; + }; + + # Generate X11 init scripts. + home.file = { + ".xinitrc".text = '' + [ -f ~/.xprofile ] && . ~/.xprofile + [ -f ~/.Xresources ] && xrdb -merge ~/.Xresources + exec bspwm + ''; + ".xprofile".text = '' + xrandr --output DP-0 --primary --mode 1920x1080 --rotate normal --rate 165 + ''; + ".Xresources".text = '' + Xcursor.size: 24 + ''; + }; +} |