From c548add3186cca83267d33b0d99c034d723136ce Mon Sep 17 00:00:00 2001 From: kat witch Date: Tue, 9 Mar 2021 00:45:18 +0000 Subject: [PATCH] Music + GPG agent forwarding + all sorts. --- config/hosts/samhain/configuration.nix | 2 +- config/hosts/samhain/vm/default.nix | 9 +- config/profiles/common/nixos/nix.nix | 1 - config/profiles/gui/home/default.nix | 1 + config/profiles/gui/home/firefox/default.nix | 1 + config/profiles/gui/home/gpg.nix | 21 ++- config/profiles/gui/home/kitty.nix | 2 +- config/profiles/gui/home/music.nix | 35 ++++ config/profiles/kat/home/default.nix | 9 +- .../kat/home/neovim/coc-settings.json | 7 + config/profiles/kat/home/neovim/default.nix | 32 ++++ config/profiles/kat/home/neovim/vimrc.nix | 177 ++++++++++++++++++ config/profiles/kat/home/packages.nix | 6 +- config/profiles/kat/home/shell.nix | 4 - config/profiles/kat/home/tmux.nix | 4 + config/profiles/sway/home/grimshot.sh | 151 +++++++++++++++ config/profiles/sway/home/sway.nix | 17 +- config/profiles/sway/home/waybar/default.nix | 15 +- .../profiles/sway/home/waybar/waybar.css.nix | 4 +- lib/style.nix | 59 ++++-- modules/home/default.nix | 6 +- pkgs/default.nix | 2 +- pkgs/kat-weather/default.nix | 6 +- todo.org | 10 +- 24 files changed, 525 insertions(+), 56 deletions(-) create mode 100644 config/profiles/gui/home/music.nix create mode 100644 config/profiles/kat/home/neovim/coc-settings.json create mode 100644 config/profiles/kat/home/neovim/default.nix create mode 100644 config/profiles/kat/home/neovim/vimrc.nix create mode 100755 config/profiles/sway/home/grimshot.sh diff --git a/config/hosts/samhain/configuration.nix b/config/hosts/samhain/configuration.nix index 6bcbcdff..17cc3e58 100644 --- a/config/hosts/samhain/configuration.nix +++ b/config/hosts/samhain/configuration.nix @@ -2,7 +2,7 @@ { imports = [ - ./hardware.nix + ./hardware.nix ../../services/zfs.nix ../../services/nginx.nix ./thermal diff --git a/config/hosts/samhain/vm/default.nix b/config/hosts/samhain/vm/default.nix index d88083c9..73cbfcac 100644 --- a/config/hosts/samhain/vm/default.nix +++ b/config/hosts/samhain/vm/default.nix @@ -1,7 +1,7 @@ { config, pkgs, lib, sources, witch, ... }: { - # libvirtd is used for our virtual machine + # libvirtd is used for our virtual machine virtualisation.libvirtd = { enable = true; qemuOvmf = true; @@ -11,8 +11,9 @@ }; # required for guest reboots with the 580 - boot.extraModulePackages = - [ (pkgs.linuxPackagesFor config.boot.kernelPackages.kernel).vendor-reset ];# required groups for various intentions + boot.extraModulePackages = [ + (pkgs.linuxPackagesFor config.boot.kernelPackages.kernel).vendor-reset + ]; # required groups for various intentions users.users.kat.extraGroups = [ "libvirtd" "input" "qemu-libvirtd" ]; # video=efifb:off allows the 580 to be passed through regardless of being the boot display and allows the 560 to act as a console device @@ -82,4 +83,4 @@ Option "TearFree" "true" BusID "PCI:37:0:0" ''; -} \ No newline at end of file +} diff --git a/config/profiles/common/nixos/nix.nix b/config/profiles/common/nixos/nix.nix index 61cdbe0d..67bdcea3 100644 --- a/config/profiles/common/nixos/nix.nix +++ b/config/profiles/common/nixos/nix.nix @@ -16,7 +16,6 @@ binaryCaches = [ "https://arc.cachix.org" ]; binaryCachePublicKeys = [ "arc.cachix.org-1:DZmhclLkB6UO0rc0rBzNpwFbbaeLfyn+fYccuAy7YVY=" ]; - }; gc.automatic = lib.mkDefault true; gc.options = lib.mkDefault "--delete-older-than 1w"; trustedUsers = [ "root" "@wheel" ]; diff --git a/config/profiles/gui/home/default.nix b/config/profiles/gui/home/default.nix index d9ce4c03..53eeedc4 100644 --- a/config/profiles/gui/home/default.nix +++ b/config/profiles/gui/home/default.nix @@ -8,5 +8,6 @@ ./nextcloud.nix ./gpg.nix ./gtk.nix + ./music.nix ]; } diff --git a/config/profiles/gui/home/firefox/default.nix b/config/profiles/gui/home/firefox/default.nix index 9be24475..30db10ce 100644 --- a/config/profiles/gui/home/firefox/default.nix +++ b/config/profiles/gui/home/firefox/default.nix @@ -5,6 +5,7 @@ let "app.update.auto" = false; "identity.fxaccounts.account.device.name" = superConfig.networking.hostName; "signon.rememberSignons" = false; + "browser.download.lastDir" = "/home/kat/downloads"; "browser.urlbar.placeholderName" = "DuckDuckGo"; "toolkit.legacyUserProfileCustomizations.stylesheets" = true; "identity.sync.tokenserver.uri" = diff --git a/config/profiles/gui/home/gpg.nix b/config/profiles/gui/home/gpg.nix index 23c647f0..f500d4c8 100644 --- a/config/profiles/gui/home/gpg.nix +++ b/config/profiles/gui/home/gpg.nix @@ -2,9 +2,22 @@ { config = lib.mkIf config.deploy.profile.gui { - home.file.".gnupg/gpg-agent.conf".text = '' - enable-ssh-support - pinentry-program ${pkgs.pinentry.gtk2}/bin/pinentry - ''; + home.sessionVariables = { + SSH_AUTH_SOCK = + "\${SSH_AUTH_SOCK:-$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)}"; + }; + services.gpg-agent = { + enable = true; + enableExtraSocket = true; + enableSshSupport = false; + pinentryFlavor = "gtk2"; + extraConfig = lib.mkMerge [ + "auto-expand-secmem 0x30000" # otherwise "gpg: public key decryption failed: Cannot allocate memory" + "pinentry-timeout 30" + "allow-loopback-pinentry" + "enable-ssh-support" + "no-allow-external-cache" + ]; + }; }; } diff --git a/config/profiles/gui/home/kitty.nix b/config/profiles/gui/home/kitty.nix index af272955..4b06b929 100644 --- a/config/profiles/gui/home/kitty.nix +++ b/config/profiles/gui/home/kitty.nix @@ -8,7 +8,7 @@ settings = { font_size = witch.style.font.size; background = witch.style.base16.color0; - background_opacity = "0.7"; + background_opacity = "0.9"; foreground = witch.style.base16.color7; selection_background = witch.style.base16.color7; selection_foreground = witch.style.base16.color0; diff --git a/config/profiles/gui/home/music.nix b/config/profiles/gui/home/music.nix new file mode 100644 index 00000000..a9860feb --- /dev/null +++ b/config/profiles/gui/home/music.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, witch, ... }: + +{ + config = lib.mkIf config.deploy.profile.gui { + programs.ncmpcpp = { + enable = true; + mpdMusicDir = "/home/kat/music"; + }; + programs.beets = { + enable = true; + package = pkgs.unstable.beets; + settings = { + directory = "~/music"; + library = "~/.local/share/beets.db"; + plugins = lib.concatStringsSep " " [ + "mpdstats" + "mpdupdate" + "duplicates" + "chroma" + ]; + }; + }; + services.mpd = { + enable = true; + network.startWhenNeeded = true; + musicDirectory = "/home/kat/music"; + extraConfig = '' + audio_output { + type "pulse" + name "speaker" + } + ''; + }; + }; +} diff --git a/config/profiles/kat/home/default.nix b/config/profiles/kat/home/default.nix index 275a58cd..ebdfae8a 100644 --- a/config/profiles/kat/home/default.nix +++ b/config/profiles/kat/home/default.nix @@ -1,5 +1,12 @@ { ... }: { - imports = [ ./shell.nix ./git.nix ./tmux.nix ./ssh.nix ./emacs ./packages.nix ]; + imports = [ + ./shell.nix + ./neovim + ./git.nix + ./tmux.nix + ./ssh.nix + ./packages.nix + ]; # ./emacs bye emacs lol } diff --git a/config/profiles/kat/home/neovim/coc-settings.json b/config/profiles/kat/home/neovim/coc-settings.json new file mode 100644 index 00000000..342d8169 --- /dev/null +++ b/config/profiles/kat/home/neovim/coc-settings.json @@ -0,0 +1,7 @@ +{ + "python.formatting.provider": "black", + "python.jediEnabled": true, + "python.linting.flake8Enabled": true, + "python.linting.enabled": true, + "python.pythonPath": "nvim-python3" + } diff --git a/config/profiles/kat/home/neovim/default.nix b/config/profiles/kat/home/neovim/default.nix new file mode 100644 index 00000000..9513f9ff --- /dev/null +++ b/config/profiles/kat/home/neovim/default.nix @@ -0,0 +1,32 @@ +{ config, lib, pkgs, witch, ... }: + +{ + config = lib.mkIf config.deploy.profile.kat { + home.sessionVariables.EDITOR = "nvim"; + programs.neovim = { + enable = true; + withPython3 = true; + plugins = with pkgs.vimPlugins; [ + nerdtree + vim-nix + coc-nvim + coc-yank + coc-python + coc-json + coc-yaml + coc-git + vim-fugitive + { + plugin = vim-startify; + config = "let g:startify_change_to_vcs_root = 0"; + } + ]; + extraPackages = with pkgs; + [ (python3.withPackages (ps: with ps; [ black flake8])) ]; + extraPython3Packages = (ps: with ps; [ jedi pylint ]); + extraConfig = import ./vimrc.nix { inherit pkgs; }; + }; + xdg.configFile."nvim/coc-settings.json".text = + builtins.readFile ./coc-settings.json; + }; +} diff --git a/config/profiles/kat/home/neovim/vimrc.nix b/config/profiles/kat/home/neovim/vimrc.nix new file mode 100644 index 00000000..21ac1b35 --- /dev/null +++ b/config/profiles/kat/home/neovim/vimrc.nix @@ -0,0 +1,177 @@ +{ pkgs }: + +'' + " Set internal encoding of vim, not needed on neovim, since coc.nvim using some + " unicode characters in the file autoload/float.vim + set encoding=utf-8 + + " Enable mouse + set mouse=a + + " Open NERDTree at start + autocmd VimEnter * NERDTree | wincmd p + + let g:coc_node_path='${pkgs.nodejs}/bin/node' + + " TextEdit might fail if hidden is not set. + set hidden + + " Some servers have issues with backup files, see #649. + set nobackup + set nowritebackup + + " Give more space for displaying messages. + " set cmdheight=2 + + " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable + " delays and poor user experience. + set updatetime=300 + + " Don't pass messages to |ins-completion-menu|. + set shortmess+=c + + " Always show the signcolumn, otherwise it would shift the text each time + " diagnostics appear/become resolved. + if has("patch-8.1.1564") + " Recently vim can merge signcolumn and number column into one + set signcolumn=number + else + set signcolumn=yes + endif + + " Use tab for trigger completion with characters ahead and navigate. + " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by + " other plugin before putting this into your config. + inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() + inoremap pumvisible() ? "\" : "\" + + function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' + endfunction + + " Use to trigger completion. + if has('nvim') + inoremap coc#refresh() + else + inoremap coc#refresh() + endif + + " Make auto-select the first completion item and notify coc.nvim to + " format on enter, could be remapped by other vim plugin + inoremap pumvisible() ? coc#_select_confirm() + \: "\u\\=coc#on_enter()\" + + " Use `[g` and `]g` to navigate diagnostics + " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. + nmap [g (coc-diagnostic-prev) + nmap ]g (coc-diagnostic-next) + + " GoTo code navigation. + nmap gd (coc-definition) + nmap gy (coc-type-definition) + nmap gi (coc-implementation) + nmap gr (coc-references) + + " Use K to show documentation in preview window. + nnoremap K :call show_documentation() + + function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + elseif (coc#rpc#ready()) + call CocActionAsync('doHover') + else + execute '!' . &keywordprg . " " . expand('') + endif + endfunction + + " Highlight the symbol and its references when holding the cursor. + autocmd CursorHold * silent call CocActionAsync('highlight') + + " Symbol renaming. + nmap rn (coc-rename) + + " Formatting selected code. + xmap f (coc-format-selected) + nmap f (coc-format-selected) + + augroup mygroup + autocmd! + " Setup formatexpr specified filetype(s). + autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') + " Update signature help on jump placeholder. + autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') + augroup end + + " Applying codeAction to the selected region. + " Example: `aap` for current paragraph + xmap a (coc-codeaction-selected) + nmap a (coc-codeaction-selected) + + " Remap keys for applying codeAction to the current buffer. + nmap ac (coc-codeaction) + " Apply AutoFix to problem on the current line. + nmap qf (coc-fix-current) + + " Map function and class text objects + " NOTE: Requires 'textDocument.documentSymbol' support from the language server. + xmap if (coc-funcobj-i) + omap if (coc-funcobj-i) + xmap af (coc-funcobj-a) + omap af (coc-funcobj-a) + xmap ic (coc-classobj-i) + omap ic (coc-classobj-i) + xmap ac (coc-classobj-a) + omap ac (coc-classobj-a) + + " Remap and for scroll float windows/popups. + if has('nvim-0.4.0') || has('patch-8.2.0750') + nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" + nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" + inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" + inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" + vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" + vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" + endif + + " Use CTRL-S for selections ranges. + " Requires 'textDocument/selectionRange' support of language server. + nmap (coc-range-select) + xmap (coc-range-select) + + " Add `:Format` command to format current buffer. + command! -nargs=0 Format :call CocAction('format') + + " Add `:Fold` command to fold current buffer. + command! -nargs=? Fold :call CocAction('fold', ) + + " Add `:OR` command for organize imports of the current buffer. + command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') + + " Add (Neo)Vim's native statusline support. + " NOTE: Please see `:h coc-status` for integrations with external plugins that + " provide custom statusline: lightline.vim, vim-airline. + set statusline^=%{coc#status()}%{get(b:,'coc_current_function',''')} + + " Mappings for CoCList + " Show all diagnostics. + nnoremap a :CocList diagnostics + " Manage extensions. + nnoremap e :CocList extensions + " Show commands. + nnoremap c :CocList commands + " Find symbol of current document. + nnoremap o :CocList outline + " Search workspace symbols. + nnoremap s :CocList -I symbols + " Do default action for next item. + nnoremap j :CocNext + " Do default action for previous item. + nnoremap k :CocPrev + " Resume latest coc list. + nnoremap p :CocListResume +'' diff --git a/config/profiles/kat/home/packages.nix b/config/profiles/kat/home/packages.nix index ccd4dfcb..128cae6e 100644 --- a/config/profiles/kat/home/packages.nix +++ b/config/profiles/kat/home/packages.nix @@ -2,8 +2,6 @@ { config = lib.mkIf config.deploy.profile.kat { - home.packages = with pkgs; [ - kitty.terminfo - ]; + home.packages = with pkgs; [ kitty.terminfo ]; }; -} \ No newline at end of file +} diff --git a/config/profiles/kat/home/shell.nix b/config/profiles/kat/home/shell.nix index b24ae0e5..6b858331 100644 --- a/config/profiles/kat/home/shell.nix +++ b/config/profiles/kat/home/shell.nix @@ -5,10 +5,6 @@ programs.fish = { enable = true; interactiveShellInit = '' - ${if (config.deploy.profile.gui) then - "export SSH_AUTH_SOCK=(gpgconf --list-dirs agent-ssh-socket)" - else - ""} fish_vi_key_bindings set -g fish_greeting "" ''; diff --git a/config/profiles/kat/home/tmux.nix b/config/profiles/kat/home/tmux.nix index 319dd945..d8510022 100644 --- a/config/profiles/kat/home/tmux.nix +++ b/config/profiles/kat/home/tmux.nix @@ -5,6 +5,7 @@ programs.fish.shellAliases = { tne = "tmux new -s"; tat = "tmux attach -t"; + tren = "tmux new -AD -s"; }; programs.tmux = { enable = true; @@ -37,6 +38,9 @@ # messages set -g message-style 'fg=colour232 bg=colour16 bold' + + # mouse + set -g mouse on ''; }; }; diff --git a/config/profiles/sway/home/grimshot.sh b/config/profiles/sway/home/grimshot.sh new file mode 100755 index 00000000..2d9f5ee8 --- /dev/null +++ b/config/profiles/sway/home/grimshot.sh @@ -0,0 +1,151 @@ +#!/bin/sh + +## Grimshot: a helper for screenshots within sway +## Requirements: +## - `grim`: screenshot utility for wayland +## - `slurp`: to select an area +## - `swaymsg`: to read properties of current window +## - `wl-copy`: clipboard utility +## - `jq`: json utility to parse swaymsg output +## - `notify-send`: to show notifications +## Those are needed to be installed, if unsure, run `grimshot check` +## +## See `man 1 grimshot` or `grimshot usage` for further details. + +getTargetDirectory() { + echo "/home/kat/media/Screenshots" +} + +if [ "$1" = "--notify" ]; then + NOTIFY=yes + shift 1 +else + NOTIFY=no +fi + +ACTION=${1:-usage} +SUBJECT=${2:-screen} +FILE=${3:-$(getTargetDirectory)/$(date -Ins).png} + +if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "check" ]; then + echo "Usage:" + echo " grimshot [--notify] (copy|save) [active|screen|output|area|window] [FILE]" + echo " grimshot check" + echo " grimshot usage" + echo "" + echo "Commands:" + echo " copy: Copy the screenshot data into the clipboard." + echo " save: Save the screenshot to a regular file." + echo " check: Verify if required tools are installed and exit." + echo " usage: Show this message and exit." + echo "" + echo "Targets:" + echo " active: Currently active window." + echo " screen: All visible outputs." + echo " output: Currently active output." + echo " area: Manually select a region." + echo " window: Manually select a window." + exit +fi + +notify() { + notify-send -t 3000 -a grimshot "$@" +} +notifyOk() { + [ "$NOTIFY" = "no" ] && return + + TITLE=${2:-"Screenshot"} + MESSAGE=${1:-"OK"} + notify "$TITLE" "$MESSAGE" +} +notifyError() { + if [ $NOTIFY = "yes" ]; then + TITLE=${2:-"Screenshot"} + MESSAGE=${1:-"Error taking screenshot with grim"} + notify -u critical "$TITLE" "$MESSAGE" + else + echo $1 + fi +} + +die() { + MSG=${1:-Bye} + notifyError "Error: $MSG" + exit 2 +} + +check() { + COMMAND=$1 + if command -v "$COMMAND" > /dev/null 2>&1; then + RESULT="OK" + else + RESULT="NOT FOUND" + fi + echo " $COMMAND: $RESULT" +} + +takeScreenshot() { + FILE=$1 + GEOM=$2 + OUTPUT=$3 + if [ ! -z "$OUTPUT" ]; then + grim -o "$OUTPUT" "$FILE" || die "Unable to invoke grim" + elif [ -z "$GEOM" ]; then + grim "$FILE" || die "Unable to invoke grim" + else + grim -g "$GEOM" "$FILE" || die "Unable to invoke grim" + fi +} + +if [ "$ACTION" = "check" ] ; then + echo "Checking if required tools are installed. If something is missing, install it to your system and make it available in PATH..." + check grim + check slurp + check swaymsg + check wl-copy + check jq + check notify-send + exit +elif [ "$SUBJECT" = "area" ] ; then + GEOM=$(slurp -d) + # Check if user exited slurp without selecting the area + if [ -z "$GEOM" ]; then + exit + fi + WHAT="Area" +elif [ "$SUBJECT" = "active" ] ; then + FOCUSED=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)') + GEOM=$(echo "$FOCUSED" | jq -r '.rect | "\(.x),\(.y) \(.width)x\(.height)"') + APP_ID=$(echo "$FOCUSED" | jq -r '.app_id') + WHAT="$APP_ID window" +elif [ "$SUBJECT" = "screen" ] ; then + GEOM="" + WHAT="Screen" +elif [ "$SUBJECT" = "output" ] ; then + GEOM="" + OUTPUT=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused)' | jq -r '.name') + WHAT="$OUTPUT" +elif [ "$SUBJECT" = "window" ] ; then + GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) + # Check if user exited slurp without selecting the area + if [ -z "$GEOM" ]; then + exit + fi + WHAT="Window" +else + die "Unknown subject to take a screen shot from" "$SUBJECT" +fi + +if [ "$ACTION" = "copy" ] ; then + takeScreenshot - "$GEOM" "$OUTPUT" | wl-copy --type image/png || die "Clipboard error" + notifyOk "$WHAT copied to buffer" +else + if takeScreenshot "$FILE" "$GEOM" "$OUTPUT"; then + TITLE="Screenshot of $SUBJECT" + MESSAGE=$(basename "$FILE") + notifyOk "$MESSAGE" "$TITLE" + echo $FILE + else + notifyError "Error taking screenshot with grim" + fi +fi diff --git a/config/profiles/sway/home/sway.nix b/config/profiles/sway/home/sway.nix index c300567b..37265b77 100644 --- a/config/profiles/sway/home/sway.nix +++ b/config/profiles/sway/home/sway.nix @@ -8,7 +8,7 @@ XDG_SESSION_TYPE = "wayland"; }; - home.packages = with pkgs; [ grim slurp ]; + home.packages = with pkgs; [ grim slurp wl-clipboard jq ]; wayland.windowManager.sway = { enable = true; @@ -138,6 +138,13 @@ "${cfg.modifier}+d" = "exec ${cfg.menu}"; "${cfg.modifier}+x" = "exec ${lockCommand}"; + "${cfg.modifier}+Print" = + "exec ${./grimshot.sh} --notify save screen"; + "${cfg.modifier}+Shift+Print" = + "exec ${./grimshot.sh} --notify save area"; + "${cfg.modifier}+Mod1+Print" = + "exec ${./grimshot.sh} --notify save window"; + "${cfg.modifier}+i" = "move workspace to output left"; "${cfg.modifier}+o" = "move workspace to output left"; "${cfg.modifier}+b" = "splith"; @@ -172,15 +179,15 @@ colors = { focused = { border = witch.style.base16.color8; - background = witch.style.base16.color4; + background = witch.style.base16.color13; text = witch.style.base16.color0; indicator = witch.style.base16.color2; childBorder = witch.style.base16.color8; }; focusedInactive = { border = witch.style.base16.color0; - background = witch.style.base16.color11; - text = witch.style.base16.color12; + background = witch.style.base16.color10; + text = witch.style.base16.color13; indicator = witch.style.base16.color2; childBorder = witch.style.base16.color8; }; @@ -192,7 +199,7 @@ childBorder = witch.style.base16.color8; }; urgent = { - border = witch.style.base16.color8; + border = witch.style.base16.color0; background = witch.style.base16.color9; text = witch.style.base16.color0; indicator = witch.style.base16.color1; diff --git a/config/profiles/sway/home/waybar/default.nix b/config/profiles/sway/home/waybar/default.nix index 6a70176d..a3916422 100644 --- a/config/profiles/sway/home/waybar/default.nix +++ b/config/profiles/sway/home/waybar/default.nix @@ -10,15 +10,18 @@ }; settings = [{ modules-left = [ "sway/workspaces" "sway/mode" "sway/window" ]; - modules-center = [ "clock" "custom/weather" ]; + modules-center = [ ]; # "clock" "custom/weather" modules-right = [ "pulseaudio" - "network" "cpu" "memory" "temperature" "backlight" "battery" + #"mpd" + "network" + "custom/weather" + "clock" "tray" ]; @@ -33,9 +36,15 @@ format = "{}"; interval = 3600; on-click = "xdg-open 'https://google.com/search?q=weather'"; - exec = "${pkgs.kat-weather}/bin/kat-weather ${witch.secrets.profiles.sway.city} ${witch.secrets.profiles.sway.api_key}"; + exec = + "${pkgs.kat-weather}/bin/kat-weather ${witch.secrets.profiles.sway.city} ${witch.secrets.profiles.sway.api_key}"; }; cpu = { format = " {usage}%"; }; + #mpd = { + # format = " {album} - {artist} - {title}"; + # format-stopped = "ﱙ"; + # format-paused = " Paused"; + #}; memory = { format = " {percentage}%"; }; temperature = { format = "﨎 {temperatureC}°C"; }; backlight = { diff --git a/config/profiles/sway/home/waybar/waybar.css.nix b/config/profiles/sway/home/waybar/waybar.css.nix index 1dee1a49..4819dd91 100644 --- a/config/profiles/sway/home/waybar/waybar.css.nix +++ b/config/profiles/sway/home/waybar/waybar.css.nix @@ -30,8 +30,8 @@ #workspaces { padding: 0px 4px 0px 4px } #workspaces button { - color: ${style.base16.color7}; - background: ${hextorgba style.base16.color11}; + color: ${style.base16.color13}; + background: ${hextorgba style.base16.color10}; font-size: 16px; margin: 0px 4px 0px 4px; border-bottom: 2px solid transparent; diff --git a/lib/style.nix b/lib/style.nix index aedaa37b..3e7acac2 100644 --- a/lib/style.nix +++ b/lib/style.nix @@ -1,22 +1,22 @@ rec { base16 = { - color0 = "#2e3440"; - color1 = "#bf616a"; - color2 = "#a3be8c"; - color3 = "#ebcb8b"; - color4 = "#81a1c1"; - color5 = "#b48ead"; - color6 = "#88c0d0"; - color7 = "#e5e9f0"; + color0 = "#181818"; + color1 = "#ab4642"; + color2 = "#a1b56c"; + color3 = "#f7ca88"; + color4 = "#7cafc2"; + color5 = "#ba8baf"; + color6 = "#86c1b9"; + color7 = "#d8d8d8"; - color8 = "#4c566a"; - color9 = "#d08770"; - color10 = "#3b4252"; - color11 = "#434c5e"; - color12 = "#d8dee9"; - color13 = "#eceff4"; - color14 = "#5e81ac"; - color15 = "#8fbcbb"; + color8 = "#585858"; + color9 = "#dc9656"; + color10 = "#282828"; + color11 = "#383838"; + color12 = "#b8b8b8"; + color13 = "#e8e8e8"; + color14 = "#a16946"; + color15 = "#f8f8f8"; color16 = "#fd971f"; color17 = "#cc6633"; @@ -24,6 +24,33 @@ rec { color19 = "#49483e"; color20 = "#a59f85"; color21 = "#f5f4f1"; + + ## Nord + + # color0 = "#2e3440"; + # color1 = "#bf616a"; + # color2 = "#a3be8c"; + # color3 = "#ebcb8b"; + # color4 = "#81a1c1"; + # color5 = "#b48ead"; + # color6 = "#88c0d0"; + # color7 = "#e5e9f0"; + + # color8 = "#4c566a"; + # color9 = "#d08770"; + # color10 = "#3b4252"; + # color11 = "#434c5e"; + # color12 = "#d8dee9"; + # color13 = "#eceff4"; + # color14 = "#5e81ac"; + # color15 = "#8fbcbb"; + + # color16 = "#fd971f"; + # color17 = "#cc6633"; + # color18 = "#383830"; + # color19 = "#49483e"; + # color20 = "#a59f85"; + # color21 = "#f5f4f1"; }; font = { diff --git a/modules/home/default.nix b/modules/home/default.nix index acc7c018..eae475c3 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,8 +1,8 @@ { sources, ... }: { - imports = [ - (sources.tf-nix + "/modules/home/secrets.nix") - (sources.arc-nixexprs + "/modules/home/weechat.nix") + imports = [ + (sources.tf-nix + "/modules/home/secrets.nix") + (sources.arc-nixexprs + "/modules/home/weechat.nix") ]; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 49cfa025..46eb18a2 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -7,7 +7,7 @@ let dino = super.callPackage "${sources.qyliss-nixlib}/overlays/patches/dino" { inherit (super) dino; }; - + discord = unstable.discord.override { nss = self.nss_latest; }; arc = import sources.arc-nixexprs { pkgs = super; }; diff --git a/pkgs/kat-weather/default.nix b/pkgs/kat-weather/default.nix index 26a1ded2..e409c70c 100644 --- a/pkgs/kat-weather/default.nix +++ b/pkgs/kat-weather/default.nix @@ -3,9 +3,7 @@ stdenv.mkDerivation { name = "kat-weather"; buildInputs = [ - (python36.withPackages (pythonPackages: with pythonPackages; [ - requests - ])) + (python36.withPackages (pythonPackages: with pythonPackages; [ requests ])) ]; unpackPhase = "true"; installPhase = '' @@ -13,4 +11,4 @@ stdenv.mkDerivation { cp ${./weather.py} $out/bin/kat-weather chmod +x $out/bin/kat-weather ''; -} \ No newline at end of file +} diff --git a/todo.org b/todo.org index ad89d12c..0f393cf7 100644 --- a/todo.org +++ b/todo.org @@ -40,10 +40,16 @@ Too many excess unneccessary parameters. ** TODO Syncplay server Need to do SSL properly. Also set up salt + room passwords. -** TODO Unfuckulate the weechat config -Move to arc's weechat module. + +* Refactor + +** TODO Move to arc's weechat module. https://github.com/arcnmx/nixexprs/blob/f3f24ef4226a8ff3531d9a3e005c4993ed0d7ba2/modules/home/weechat.nix +** TODO Refactor secrets usage into private host configs. + +** TODO Move ZNC config into etc, out of store. + * Research ** TODO Investigate nix-darwin