From 674c2fcb15a26a90088a140fffede34372811ca6 Mon Sep 17 00:00:00 2001 From: Anish L Date: Wed, 5 Jan 2022 00:27:58 +1000 Subject: [PATCH] fix polybar, neomutt (sorta), and probably some lazygit stuff probs? --- flake.nix | 2 +- profiles/wireguard/default.nix | 4 +- users/profiles/desktop/Xresources | 32 +-- users/profiles/desktop/ayu-Xresources | 2 +- users/profiles/desktop/default.nix | 164 +++++++----- users/profiles/email/default.nix | 364 +++++++++++++------------- users/profiles/git/default.nix | 2 + 7 files changed, 310 insertions(+), 260 deletions(-) diff --git a/flake.nix b/flake.nix index a7f17d9b..02a40c2b 100644 --- a/flake.nix +++ b/flake.nix @@ -120,7 +120,7 @@ base = [ core users.root nvim users.anish ]; # TODO make anish non gui sealight = [ base ]; # matrix rsshub backup wireguard website mossnet = [ base ]; # shaarli wallabag nextcloud taskwarrior headphones - graphical = [ base users.profiles.firefox users.profiles.desktop bluetooth music sync ]; + graphical = [ base users.profiles.firefox users.profiles.desktop bluetooth music sync wireguard ]; curve = [ graphical ]; }; }; diff --git a/profiles/wireguard/default.nix b/profiles/wireguard/default.nix index 7ce91362..ec72a9c8 100644 --- a/profiles/wireguard/default.nix +++ b/profiles/wireguard/default.nix @@ -12,14 +12,14 @@ ips = [ "10.0.69.2/24" ]; listenPort = 60990; # to match firewall allowedUDPPorts (without this wg uses random port numbers) - privateKeyFile = "/run/secrets/curve-wg"; + privateKeyFile = "/run/agenix/curve-wg"; peers = [ # For a client configuration, one peer entry for the server will suffice. { publicKey = "c1J4p63rD3IlszugMZiki7UBV3YmDdqa3DU4UejXzAI="; allowedIPs = [ "10.0.69.0/24" ]; # Set this to the server IP and port. - endpoint = "sealight.xyz:60990"; # ToDo: route to endpoint not automatically configured https://wiki.archlinux.org/index.php/WireGuard#Loop_routing https://discourse.nixos.org/t/solved-minimal-firewall-setup-for-wireguard-client/7577 + endpoint = "149.28.163.78:60990"; # ToDo: route to endpoint not automatically configured https://wiki.archlinux.org/index.php/WireGuard#Loop_routing https://discourse.nixos.org/t/solved-minimal-firewall-setup-for-wireguard-client/7577 # Send keepalives every 25 seconds. Important to keep NAT tables alive. persistentKeepalive = 25; diff --git a/users/profiles/desktop/Xresources b/users/profiles/desktop/Xresources index c0c48f61..ed68792a 100644 --- a/users/profiles/desktop/Xresources +++ b/users/profiles/desktop/Xresources @@ -1,20 +1,20 @@ !! Colors -#define blk #1E2029 -#define bblk #282a36 -#define red #ffb86c -#define bred #de935f -#define grn #50fa7b -#define bgrn #0189cc -#define ylw #f0c674 -#define bylw #f9a03f -#define blu #61bfff -#define bblu #8be9fd -#define mag #bd93f9 -#define bmag #ff79c6 -#define cyn #8be9fd -#define bcyn #0189cc -#define wht #f8f8f2 -#define bwht #e2e2dc +#define blk #1F2430 +#define bblk #F28779 +#define red #A6CC70 +#define bred #FFCC66 +#define grn #5CCFE6 +#define bgrn #F29E74 +#define ylw #77A8D9 +#define bylw #5C6773 +#define blu #707A8C +#define bblu #F27983 +#define mag #BAE67E +#define bmag #FFD580 +#define cyn #73D0FF +#define bcyn #FFA759 +#define wht #95E6CB +#define bwht #CBCCC6 #define bg blk #define fg wht diff --git a/users/profiles/desktop/ayu-Xresources b/users/profiles/desktop/ayu-Xresources index 8e72bc61..34e38a60 100644 --- a/users/profiles/desktop/ayu-Xresources +++ b/users/profiles/desktop/ayu-Xresources @@ -2,7 +2,7 @@ ! Generated with : ! XRDB2Xreources.py ! -*.foreground: #e6e1cf +*.foreground: #1F2430 *.background: #0f1419 *.cursorColor: #f29718 ! diff --git a/users/profiles/desktop/default.nix b/users/profiles/desktop/default.nix index 672e4a65..c2830d57 100644 --- a/users/profiles/desktop/default.nix +++ b/users/profiles/desktop/default.nix @@ -1,5 +1,12 @@ { pkgs, config, lib, ... }: - +let + dracula-gtk = pkgs.fetchFromGitHub { + owner = "dracula"; + repo = "gtk"; + rev = "502f212d83bc67e8f0499574546b99ec6c8e16f9"; + sha256 = "1wx9nzq7cqyvpaq4j60bs8g7gh4jk8qg4016yi4c331l4iw1ymsa"; + }; +in { # TODO modularize #imports = [ ./xdg.nix ]; @@ -18,6 +25,11 @@ home-manager.users.anish.xdg.enable = true; # This doesn't seem to do anything so we have below home-manager.users.anish.xdg.configHome = "/home/anish/.config"; # TODO bad hard coded + home-manager.users.anish.xdg.configFile = { + "Kvantum/Dracula/Dracula.kvconfig".source = "${dracula-gtk}/kde/kvantum/Dracula-purple-solid/Dracula-purple-solid.kvconfig"; + "Kvantum/Dracula/Dracula.svg".source = "${dracula-gtk}/kde/kvantum/Dracula-purple-solid/Dracula-purple-solid.svg"; + "Kvantum/kvantum.kvconfig".text = "[General]\ntheme=Dracula"; + }; environment.sessionVariables = rec { XDG_CACHE_HOME = "\${HOME}/.cache"; XDG_CONFIG_HOME = "\${HOME}/.config"; @@ -36,7 +48,8 @@ environment.systemPackages = with pkgs; [ # TODO move somewhere meaningful - tdesktop # TODO get rid of this once bridged on sealight + signal-desktop # bridge to sealight? + scrot ripcord feh mupdf @@ -75,37 +88,54 @@ defaultSession = "none+bspwm"; sessionCommands = '' ${pkgs.xorg.xrdb}/bin/xrdb -merge <\"]" + mono bold bold + mono underline underline + mono indicator reverse + mono error bold + color normal default default + color indicator brightyellow default # currently selected message. default makes bar clear, disabled arrow to save space. + color sidebar_highlight red default + color sidebar_divider brightblack black + color sidebar_flagged red black + color sidebar_new green black + color normal brightyellow default + color error red default + color tilde black default + color message cyan default + color markers red white + color attachment white default + color search brightmagenta default + color status brightyellow black + color hdrdefault brightgreen default + color quoted green default + color quoted1 blue default + color quoted2 cyan default + color quoted3 yellow default + color quoted4 red default + color quoted5 brightred default + color signature brightgreen default + color bold black default + color underline black default + color normal default default - ## Default index colors: - #color index yellow default '.*' - #color index_author red default '.*' - #color index_number blue default - #color index_subject cyan default '.*' + color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses + color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL + color body green default "\`[^\`]*\`" # Green text between ` and ` + color body brightblue default "^# \.*" # Headings as bold blue + color body brightcyan default "^## \.*" # Subheadings as bold cyan + color body brightgreen default "^### \.*" # Subsubheadings as bold green + color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow + color body brightcyan default "[;:][-o][)/(|]" # emoticons + color body brightcyan default "[;:][)(|]" # emoticons + color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? + color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? + color body red default "(BAD signature)" + color body cyan default "(Good signature)" + color body brightblack default "^gpg: Good signature .*" + color body brightyellow default "^gpg: " + color body brightyellow red "^gpg: BAD signature from.*" + mono body bold "^gpg: Good signature" + mono body bold "^gpg: BAD signature from.*" + color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" - ## For new mail: - #color index brightyellow black "~N" - #color index_author brightred black "~N" - #color index_subject brightcyan black "~N" + # Default index colors: + color index yellow default '.*' + color index_author red default '.*' + color index_number blue default + color index_subject cyan default '.*' - #color progress black cyan + # For new mail: + color index brightyellow black "~N" + color index_author brightred black "~N" + color index_subject brightcyan black "~N" - #### Mappings Settings - # - ## General rebindings - #bind attach view-mailcap - #bind attach l view-mailcap - #bind editor noop - #bind pager c imap-fetch-mail - #bind index G last-entry - #bind index g noop - #bind index gg first-entry - #bind pager,attach h exit - #bind pager j next-line - #bind pager k previous-line - #bind pager l view-attachments - #bind index D delete-message - #bind index U undelete-message - #bind index L limit - #bind index h noop - #bind index l display-message - #bind browser h goto-parent - #bind browser l select-entry - #bind pager,browser gg top-page - #bind pager,browser G bottom-page - #bind index,pager,browser d half-down - #bind index,pager,browser u half-up - #bind index,pager R group-reply - #bind index \031 previous-undeleted # Mouse wheel - #bind index \005 next-undeleted # Mouse wheel - #bind pager \031 previous-line # Mouse wheel - #bind pager \005 next-line # Mouse wheel - #bind editor complete-query + color progress black cyan + + ### Mappings Settings + + # General rebindings + bind attach view-mailcap + bind attach l view-mailcap + bind editor noop + bind pager c imap-fetch-mail + bind index G last-entry + bind index g noop + bind index gg first-entry + bind pager,attach h exit + bind pager j next-line + bind pager k previous-line + bind pager l view-attachments + bind index D delete-message + bind index U undelete-message + bind index L limit + bind index h noop + bind index l display-message + bind browser h goto-parent + bind browser l select-entry + bind pager,browser gg top-page + bind pager,browser G bottom-page + bind index,pager,browser d half-down + bind index,pager,browser u half-up + bind index,pager R group-reply + bind index \031 previous-undeleted # Mouse wheel + bind index \005 next-undeleted # Mouse wheel + bind pager \031 previous-line # Mouse wheel + bind pager \005 next-line # Mouse wheel + bind editor complete-query - ## sidebar mappings - #bind index,pager \Ck sidebar-prev - #bind index,pager \Cj sidebar-next - #bind index,pager \Co sidebar-open - #bind index,pager \Cp sidebar-prev-new - #bind index,pager \Cn sidebar-next-new - #bind index,pager B sidebar-toggle-visible + # sidebar mappings + bind index,pager \Ck sidebar-prev + bind index,pager \Cj sidebar-next + bind index,pager \Co sidebar-open + bind index,pager \Cp sidebar-prev-new + bind index,pager \Cn sidebar-next-new + bind index,pager B sidebar-toggle-visible - ## global index and pager shortcuts - #bind index,pager @ compose-to-sender - #bind index,pager D purge-message - #bind index sync-mailbox - #bind index collapse-thread + # global index and pager shortcuts + bind index,pager @ compose-to-sender + bind index,pager D purge-message + bind index sync-mailbox + bind index collapse-thread - ## Email completion bindings - #bind editor complete-query - #bind editor ^T complete + # Email completion bindings + bind editor complete-query + bind editor ^T complete - ## Press A to add contact to Khard address book - #macro index,pager A \ - #"khard add-email" \ - #"add the sender email address to khard" + # Press A to add contact to Khard address book + macro index,pager A \ + "khard add-email" \ + "add the sender email address to khard" ''; }; services.imapnotify.enable = true; @@ -273,7 +279,7 @@ ''; showSignature = "append"; }; - passwordCommand = "cat /run/secrets/fastmail"; + passwordCommand = "cat /run/agenix/fastmail"; smtp = { host = "fastmail.com"; }; diff --git a/users/profiles/git/default.nix b/users/profiles/git/default.nix index e34a94d9..c99255da 100644 --- a/users/profiles/git/default.nix +++ b/users/profiles/git/default.nix @@ -5,6 +5,8 @@ "git/attributes".source = ./attributes; }; + programs.lazygit.enable = true; + programs.git = { enable = true;