From e21eb7887c66dd690dff6010ede111ec30be98eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 22 Apr 2020 17:42:45 +0200 Subject: [PATCH] feat: big upgrade to 20.03 use emojis for i3status-rust remove overlays configure mail via home-manager adapt to 20.03 config options automatically symlink cloud directories into home --- .versions/home-manager.json | 6 +- .versions/krops.json | 6 +- .versions/nixpkgs-unstable.json | 6 +- .versions/nixpkgs.json | 6 +- configs/alacritty.nix | 7 +- configs/bluetooth.nix | 4 +- configs/cloud.nix | 7 + configs/default.nix | 209 +----------------- configs/fonts.nix | 16 +- configs/i3.nix | 33 ++- configs/keyboard.nix | 2 +- configs/mail.nix | 70 ++++-- configs/newsboat.nix | 89 ++++---- configs/packages/default.nix | 18 +- configs/theming.nix | 11 +- configs/tmux.nix | 2 +- dot/i3status-rust.nix | 33 ++- dot/init.vim | 2 + lib/default.nix | 7 + niveum-update | 4 +- overlays/overlays.nix | 6 - overlays/scripts.nix | 3 - overlays/toml.nix | 6 - packages/scripts/default.nix | 21 -- systems/catullus/configuration.nix | 8 +- .../telegram-bots/literature-quote.nix | 3 +- systems/homeros/configuration.nix | 2 +- 27 files changed, 212 insertions(+), 375 deletions(-) create mode 100644 lib/default.nix delete mode 100644 overlays/overlays.nix delete mode 100644 overlays/scripts.nix delete mode 100644 overlays/toml.nix diff --git a/.versions/home-manager.json b/.versions/home-manager.json index ccf0fa0..99310d4 100644 --- a/.versions/home-manager.json +++ b/.versions/home-manager.json @@ -1,7 +1,7 @@ { "url": "https://github.com/rycee/home-manager.git", - "rev": "0d1ca254d0f213a118459c5be8ae465018132f74", - "date": "2020-02-16T18:10:00+01:00", - "sha256": "0sw8lw825gg04h6js42bvackgydi5m0xsjvnb5gxlqv45qw8rxjq", + "rev": "3461ceebc01169f99362ab5cc62d26224e7886d9", + "date": "2020-04-18T11:24:11+02:00", + "sha256": "0242ibqrr8wn8wipl41dmchmr76lh6zrv046hp374wx4dpkdl7r1", "fetchSubmodules": false } diff --git a/.versions/krops.json b/.versions/krops.json index 9e7c6ad..da8291c 100644 --- a/.versions/krops.json +++ b/.versions/krops.json @@ -1,7 +1,7 @@ { "url": "https://cgit.krebsco.de/krops", - "rev": "89a83135e7ac5e1452c04f5581c00ff293bd01f5", - "date": "2019-06-29T13:39:10+02:00", - "sha256": "0fxm471rpkijijhvbfgpw6y1k5qdrww2v351v2lyswkvrrqgmidk", + "rev": "55aa2c77ce8183f3d2b24f54efa33ab6a42e1e02", + "date": "2020-04-19T01:06:20+02:00", + "sha256": "00rvx9h596ync8wgic6xc9srzajzm28wlp9q7mv4z0jsb27l5bj8", "fetchSubmodules": false } diff --git a/.versions/nixpkgs-unstable.json b/.versions/nixpkgs-unstable.json index 0cd80f9..e6382a0 100644 --- a/.versions/nixpkgs-unstable.json +++ b/.versions/nixpkgs-unstable.json @@ -1,7 +1,7 @@ { "url": "https://github.com/NixOS/nixpkgs-channels.git", - "rev": "b61999e4ad60c351b4da63ae3ff43aae3c0bbdfb", - "date": "2020-04-16T08:43:36-04:00", - "sha256": "0cggpdks4qscyirqwfprgdl91mlhjlw24wkg0riapk5f2g2llbpq", + "rev": "22a3bf9fb9edad917fb6cd1066d58b5e426ee975", + "date": "2020-04-21T08:56:52+02:00", + "sha256": "089hqg2r2ar5piw9q5z3iv0qbmfjc4rl5wkx9z16aqnlras72zsa", "fetchSubmodules": false } diff --git a/.versions/nixpkgs.json b/.versions/nixpkgs.json index f1a8f8c..c0ba745 100644 --- a/.versions/nixpkgs.json +++ b/.versions/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/NixOS/nixpkgs-channels.git", - "rev": "b67bc34d4e3de1e89b8bb7cd6e375ba44f1ae8ca", - "date": "2020-04-15T22:11:06+01:00", - "sha256": "1q9a64bl5afflgpa2iaw1q7z7s08c8xq9w6lndlnc5c3siajrp8v", + "rev": "1e90c46c2d98f9391df79954a74d14f263cad729", + "date": "2020-04-20T23:47:17-04:00", + "sha256": "1xs0lgh3q1hbrj0lbpy3czw41cv6vxx9kdf2npwc58z8xq3sdqmh", "fetchSubmodules": false } diff --git a/configs/alacritty.nix b/configs/alacritty.nix index 2384eed..04898a5 100644 --- a/configs/alacritty.nix +++ b/configs/alacritty.nix @@ -2,10 +2,9 @@ { environment.variables.TERMINAL = "alacritty"; - environment.systemPackages = [ - pkgs.unstable.alacritty - pkgs.st - pkgs.unstable.alacritty.terminfo + environment.systemPackages = with pkgs; [ + alacritty + alacritty.terminfo ]; home-manager.users.me.xdg.configFile."alacritty/alacritty.yml".text = diff --git a/configs/bluetooth.nix b/configs/bluetooth.nix index 243ded5..a7a11ee 100644 --- a/configs/bluetooth.nix +++ b/configs/bluetooth.nix @@ -2,9 +2,7 @@ { hardware.bluetooth = { enable = true; - extraConfig = lib.generators.toINI {} { - General.Enable = lib.concatStringsSep "," ["Source" "Sink" "Media" "Socket"]; - }; + config.General.Enable = lib.concatStringsSep "," ["Source" "Sink" "Media" "Socket"]; }; environment.systemPackages = [ pkgs.blueman ]; diff --git a/configs/cloud.nix b/configs/cloud.nix index b6a0ba9..38b653b 100644 --- a/configs/cloud.nix +++ b/configs/cloud.nix @@ -15,6 +15,13 @@ }; }; + system.activationScripts.home-symlinks = '' + ln -sfn ${config.users.users.me.home}/cloud/syncthing/common/daybook ${config.users.users.me.home}/daybook + ln -sfn ${config.users.users.me.home}/cloud/syncthing/common/memo ${config.users.users.me.home}/memo + ln -sfn ${config.users.users.me.home}/cloud/Dropbox/notes ${config.users.users.me.home}/notes + ln -sfn ${config.users.users.me.home}/cloud/Seafile/Uni ${config.users.users.me.home}/uni + ''; + services.syncthing = rec { enable = true; user = "kfm"; diff --git a/configs/default.nix b/configs/default.nix index 6df4942..73bc3e7 100644 --- a/configs/default.nix +++ b/configs/default.nix @@ -13,7 +13,6 @@ in ./chromium.nix ./cloud.nix ./compton.nix - ./default.nix ./direnv.nix ./distrobump.nix ./docker.nix @@ -29,7 +28,7 @@ in ./kdeconnect.nix ./keybase.nix ./keyboard.nix - # ./mail.nix + ./mail.nix ./mpv.nix ./nano.nix ./neovim.nix @@ -48,13 +47,11 @@ in ./theming.nix ./tmux.nix ./todo-txt.nix - ./traadfri.nix + # ./traadfri.nix ./unclutter.nix - # ./urxvt.nix ./version.nix ./vscode.nix ./xautolock.nix - # ./xresources.nix ./zsh.nix { niveum.user = { @@ -74,10 +71,7 @@ in }; } { - nix.nixPath = [ - "/var/src" - "nixpkgs-overlays=${toString ../overlays}" - ]; + nix.nixPath = [ "/var/src" ]; } { services.dbus.packages = [ pkgs.gnome3.dconf ]; @@ -102,24 +96,17 @@ in nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { inherit pkgs; }; + writeDashBin = pkgs.writers.writeDashBin; + writeDash = pkgs.writers.writeDash; + gfs-fonts = pkgs.callPackage { + scardanelli = config.networking.hostName == "scardanelli"; + }; + iolanguage = pkgs.callPackage {}; + ix = pkgs.callPackage {}; }; }; overlays = [ - # (import ) - (import ) - (import ) - (import ) - (self: super: { - writeDashBin = super.writers.writeDashBin; - writeDash = super.writers.writeDash; - - ix = super.callPackage {}; - - iolanguage = super.callPackage {}; - gfs-fonts = super.callPackage { - scardanelli = config.networking.hostName == "scardanelli"; - }; - }) + # (import ) ]; }; } @@ -277,7 +264,6 @@ in indicators = [ "~spacer" "~host" "~spacer" "~session" "~power" ]; }; }; - desktopManager.default = "none"; }; } { @@ -305,178 +291,5 @@ in ''; }; } - { - environment.systemPackages = [ pkgs.neomutt ]; - home-manager.users.me.xdg.configFile."neomutt/neomuttrc".text = '' - set mailcap_path = ${pkgs.writeText "mailcap" '' - text/plain; $EDITOR %s ; - text/html; ${pkgs.lynx} -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput; - image/*; ${pkgs.sxiv}/bin/sxiv %s ; - video/*; ${pkgs.utillinux}/bin/setsid ${pkgs.mpv}/bin/mpv --quiet %s &; copiousoutput - application/*; ${pkgs.xdg_utils}/bin/xdg-open %s ; - ''} - - set sort = reverse-threads - set sleep_time = 0 # Pause 0 seconds for informational messages - set markers = no # Disables the `+` displayed at line wraps - set mark_old = no # Unread mail stay unread until read - set mime_forward = yes # attachments are forwarded with mail - set wait_key = no # mutt won't ask "press key to continue" - set fast_reply # skip to compose when replying - set fcc_attach # save attachments with the body - set forward_format = "Fwd: %s" # format of subject when forwarding - set forward_quote # include message in forwards - set reverse_name # reply as whomever it was to - set include = no # dont include message in replies - set mail_check=60 # to avoid lags using IMAP with some email providers (yahoo for example) - auto_view text/html # automatically show html (mailcap uses w3m) - alternative_order text/plain text/enriched text/html - - source ${pkgs.neomutt}/share/doc/neomutt/vim-keys/vim-keys.rc - source ${pkgs.writeText "vim-keys.rc" '' - bind index j next-entry - bind index k previous-entry - bind attach view-mailcap - bind attach l view-mailcap - bind editor noop - bind index G last-entry - 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 index tag-entry - bind index,pager H view-raw-message - 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 S sync-mailbox - 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 - - set sidebar_visible = yes - set sidebar_width = 20 - set sidebar_short_path = yes - set sidebar_next_new_wrap = yes - set mail_check_stats - set sidebar_format = '%B%?F? [%F]?%* %?N?%N/? %?S?%S?' - 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 - ''} - - source ${pkgs.writeText "colours.rc" '' - # Default index colors: - # color index yellow default '.*' - color index_author red default '.*' - color index_number blue default - color index_subject cyan default '.*' - - # New mail is boldened - color index brightyellow black "~N" - color index_author brightred black "~N" - color index_subject brightcyan black "~N" - - # Tagged mail is highlighted - color index brightyellow blue "~T" - color index_author brightred blue "~T" - color index_subject brightcyan blue "~T" - - # Other colors and aesthetic settings: - mono bold bold - mono underline underline - mono indicator reverse - mono error bold - color normal default default - color indicator brightblack white - 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 - - # Regex highlighting: - color header blue default ".*" - color header brightmagenta default "^(From)" - color header brightcyan default "^(Subject)" - color header brightwhite default "^(CC|BCC)" - 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<>\"]" - ''} - - set index_format="%2C %Z %?X?A& ? %D %-15.15F %s (%-4.4c)" - set smtp_authenticators = 'gssapi:login' - - source ${ - let emailUser = "kieran.meinhardt"; - in pkgs.writeText "gmail.rc" '' - set from="${emailUser}@gmail.com" - set realname="${config.niveum.user.name}" - - set imap_login="${emailUser}@gmail.com" - set imap_pass="`${pkgs.pass}/bin/pass mail/${emailUser}@gmail.com`" - - set smtp_url="smtps://${emailUser}@gmail.com@smtp.gmail.com:465/" - set smtp_pass="$imap_pass" - - set folder=imaps://${emailUser}@imap.gmail.com/ - set spoolfile="+INBOX" - set record="+[Gmail]/Gesendet" - set postponed="+[Gmail]/Entwรผrfe" - set mbox="+[Gmail]/Archiv" - - mailboxes =INBOX, =[Gmail]/Gesendet, =[Gmail]/Entwรผrfe, =[Gmail]/Archiv - ''} - ''; - } ]; } diff --git a/configs/fonts.nix b/configs/fonts.nix index 313e53e..53a537e 100644 --- a/configs/fonts.nix +++ b/configs/fonts.nix @@ -27,17 +27,11 @@ twemoji-color-font joypixels ]; - fontconfig = { - defaultFonts = { - monospace = [ "JetBrains Mono" ]; - serif = [ "IBM Plex Serif" ]; - sansSerif = [ "IBM Plex Sans" ]; - emoji = [ "JoyPixels" ]; - }; - ultimate = { - enable = true; - substitutions = "combi"; - }; + fontconfig.defaultFonts = { + monospace = [ "JetBrains Mono" ]; + serif = [ "IBM Plex Serif" ]; + sansSerif = [ "IBM Plex Sans" ]; + emoji = [ "JoyPixels" ]; }; }; } diff --git a/configs/i3.nix b/configs/i3.nix index 646a571..cd998bd 100644 --- a/configs/i3.nix +++ b/configs/i3.nix @@ -1,14 +1,39 @@ { config, pkgs, lib, ... }: let + myLib = import { inherit pkgs; }; + inherit (myLib) writeTOML; + new-workspace = pkgs.unstable.writers.writeDash "new-workspace" '' i3-msg workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1)) ''; move-to-new-workspace = pkgs.unstable.writers.writeDash "new-workspace" '' i3-msg move container to workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1)) ''; + + # https://github.com/LukeSmithxyz/voidrice/blob/9fe6802122f6e0392c7fe20eefd30437771d7f8e/.local/bin/dmenuunicode + emoji-menu = + let emoji-file = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/LukeSmithxyz/voidrice/master/.local/share/larbs/emoji"; + sha256 = "09m2rgb9d5jpiy8q4jz3dw36gkpb4ng2pl7xi7ppsrzzzdvq85qk"; + }; + in with pkgs; writers.writeDashBin "emoji-menu" '' + PATH=${lib.makeBinPath [ coreutils dmenu gnused libnotify xclip xdotool ]} + chosen=$(cut -d ';' -f1 ${emoji-file} | dmenu -i -l 10 | sed "s/ .*//") + + [ "$chosen" != "" ] || exit + + echo "$chosen" | tr -d '\n' | xclip -selection clipboard + + if [ -n "$1" ]; then + xdotool key Shift+Insert + else + notify-send "'$chosen' copied to clipboard." & + fi + ''; + in with config.niveum; { services.xserver = { - windowManager.default = "i3"; + displayManager.defaultSession = "none+i3"; windowManager.i3 = { enable = true; package = pkgs.i3-gaps; @@ -90,7 +115,7 @@ in with config.niveum; { }; }; statusCommand = "${pkgs.unstable.i3status-rust}/bin/i3status-rs ${ - pkgs.writeTOML (import { + writeTOML (import { wifi-interface = networkInterfaces.wireless; batteryBlock = batteryBlocks.default; inherit (config.niveum) colours; @@ -130,7 +155,7 @@ in with config.niveum; { "${modifier}+w" = "layout tabbed"; "${modifier}+Return" = "exec i3-sensible-terminal"; - "${modifier}+Shift+y" = "exec ${pkgs.qutebrowser}/bin/qutebrowser"; + # "${modifier}+Shift+y" = "exec ${pkgs.qutebrowser}/bin/qutebrowser"; "${modifier}+t" = "exec ${applications.fileManager}"; "${modifier}+y" = "exec x-www-browser"; @@ -145,7 +170,7 @@ in with config.niveum; { find . -maxdepth 1 -type f | dmenu -i -l 20 | xargs i3-sensible-terminal -e "$EDITOR" ''}"; "${modifier}+p" = "exec --no-startup-id ${pkgs.pass}/bin/passmenu -l 5"; - "${modifier}+u" = "exec ${pkgs.scripts.emoji-menu}/bin/emoji-menu"; + "${modifier}+u" = "exec ${emoji-menu}/bin/emoji-menu"; "XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -d 5"; "XF86AudioMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t"; diff --git a/configs/keyboard.nix b/configs/keyboard.nix index 7e5b3b9..a34f422 100644 --- a/configs/keyboard.nix +++ b/configs/keyboard.nix @@ -9,5 +9,5 @@ in { libinput.enable = true; }; - i18n.consoleKeyMap = "de"; + console.keyMap = "de"; } diff --git a/configs/mail.nix b/configs/mail.nix index 8b7ed42..20fa4ba 100644 --- a/configs/mail.nix +++ b/configs/mail.nix @@ -7,27 +7,46 @@ in home-manager.users.me = { accounts.email.maildirBasePath = "${config.users.users.me.home}/mail"; - accounts.email.accounts.hu-berlin = { - primary = true; - address = "meinhark@hu-berlin.de"; - realName = config.niveum.user.name; - userName = "meinhark"; - passwordCommand = pass "shared/eduroam/password"; - smtp = { - host = "mailhost.cms.hu-berlin.de"; - port = 25; - tls.enable = true; + accounts.email.accounts = { + kieran-gmail = { + primary = true; + flavor = "gmail.com"; + address = "kieran.meinhardt@gmail.com"; + realName = config.niveum.user.name; + userName = "kieran.meinhardt"; + passwordCommand = pass "mail/kieran.meinhardt@gmail.com"; + neomutt.enable = true; + mbsync = { + enable = true; + create = "both"; + }; + msmtp.enable = true; }; - imap = { - host = "mailbox.cms.hu-berlin.de"; - port = 993; - tls.enable = true; - }; - neomutt.enable = true; + hu-berlin = { + primary = false; + address = "meinhark@hu-berlin.de"; + realName = config.niveum.user.name; + userName = "meinhark"; + passwordCommand = pass "shared/eduroam/password"; + smtp = { + host = "mailhost.cms.hu-berlin.de"; + port = 25; + tls.enable = true; + }; + imap = { + host = "mailbox.cms.hu-berlin.de"; + port = 993; + tls.enable = true; + }; + neomutt.enable = true; + mbsync = { + enable = true; + create = "both"; + }; + msmtp.enable = true; - # notmuch.enable = true; - # msmtp.enable = true; - # mbsync.enable = true; + # notmuch.enable = true; + }; }; programs.neomutt = { @@ -37,16 +56,16 @@ in vimKeys = true; checkStatsInterval = 60; settings = { - date_format = "%Y-%m-%d %H:%M"; + date_format = "\"%Y-%m-%d %H:%M\""; mime_forward = "yes"; # forward attachments with mail fast_reply = "yes"; # skip to compose when forwarding - forward_format = "Fwd: %s"; # format of subject when forwarding + forward_format = "\"Fwd: %s\""; # format of subject when forwarding forward_quote = "yes"; # include message in forwards reverse_name = "yes"; # reply as whomever it was to include = "no"; # dont include message in replies - mailcap_path = pkgs.writeText "mailcap" '' + mailcap_path = toString (pkgs.writeText "mailcap" '' text/html; ${pkgs.elinks}/bin/elinks -dump; copiousoutput; - ''; + ''); }; # binds = [ {map = null; key = null; action = null; }]; extraConfig = '' @@ -123,9 +142,12 @@ in 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<>\"]" ''; }; + + programs.msmtp.enable = true; + programs.mbsync.enable = true; + /* programs.notmuch.enable = true; - programs.msmtp.enable = true; home.file = { ".muttrc".text = '' diff --git a/configs/newsboat.nix b/configs/newsboat.nix index 56cc41b..f55710a 100644 --- a/configs/newsboat.nix +++ b/configs/newsboat.nix @@ -1,54 +1,49 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: let newsboat-home = "${config.users.users.me.home}/cloud/syncthing/common/newsboat"; - linkhandler-bin = "${pkgs.scripts.linkhandler}/bin/linkhandler"; + scripts = import { inherit pkgs lib; }; + linkhandler-bin = "${scripts.linkhandler}/bin/linkhandler"; + + newsboat-config = pkgs.writeText "config" '' + auto-reload yes + + external-url-viewer "${pkgs.urlscan}/bin/urlscan -dc -r '${linkhandler-bin} {}'" + browser ${linkhandler-bin} + + bind-key j down + bind-key k up + bind-key j next articlelist + bind-key k prev articlelist + bind-key J next-feed articlelist + bind-key K prev-feed articlelist + bind-key G end + bind-key g home + bind-key d pagedown + bind-key u pageup + bind-key l open + bind-key h quit + bind-key a toggle-article-read + bind-key n next-unread + bind-key N prev-unread + bind-key D pb-download + bind-key U show-urls + bind-key x pb-delete + + save-path ${newsboat-home}/saved/ + + color listnormal cyan default + color listfocus black yellow standout bold + color listnormal_unread blue default + color listfocus_unread yellow default bold + color info red black bold + ''; in { - environment = { - variables.NEWSBOAT_HOME = newsboat-home; - shellAliases.newsboat = "${pkgs.newsboat}/bin/newsboat -u \"$NEWSBOAT_HOME/urls\""; + nixpkgs.config.packageOverrides = pkgs: { + newsboat = pkgs.writers.writeDashBin "newsboat" '' + ${pkgs.newsboat}/bin/newsboat -C ${newsboat-config} -c ${newsboat-home}/cache.db -u ${newsboat-home}/urls "$@" + ''; }; - home-manager.users.me = { - programs.newsboat = { - enable = true; - extraConfig = '' - auto-reload yes - - external-url-viewer "${pkgs.urlscan}/bin/urlscan -dc -r '${linkhandler-bin} {}'" - - bind-key j down - bind-key k up - bind-key j next articlelist - bind-key k prev articlelist - bind-key J next-feed articlelist - bind-key K prev-feed articlelist - bind-key G end - bind-key g home - bind-key d pagedown - bind-key u pageup - bind-key l open - bind-key h quit - bind-key a toggle-article-read - bind-key n next-unread - bind-key N prev-unread - bind-key D pb-download - bind-key U show-urls - bind-key x pb-delete - - save-path ${newsboat-home}/saved/ - - color listnormal cyan default - color listfocus black yellow standout bold - color listnormal_unread blue default - color listfocus_unread yellow default bold - color info red black bold - - browser ${linkhandler-bin} - macro , open-in-browser - macro v set browser "${pkgs.utillinux}/bin/setsid ${pkgs.utillinux}/bin/setsid ${pkgs.mpv}/bin/mpv"; open-in-browser ; set browser ${linkhandler-bin} - macro w set browser "${pkgs.w3m}/bin/w3m"; open-in-browser ; set browser ${linkhandler-bin} - ''; - }; - }; + environment.systemPackages = [ pkgs.newsboat ]; } diff --git a/configs/packages/default.nix b/configs/packages/default.nix index 5855930..256a362 100644 --- a/configs/packages/default.nix +++ b/configs/packages/default.nix @@ -1,4 +1,7 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: +let + scripts = import { inherit pkgs lib; }; +in { imports = [ ./krebs.nix @@ -8,10 +11,10 @@ { environment.systemPackages = let - nightly = pkgs.rustChannelOf { - date = "2019-12-27"; - channel = "nightly"; - }; + # nightly = pkgs.rustChannelOf { + # date = "2019-12-27"; + # channel = "nightly"; + # }; in with pkgs; [ htmlTidy nodePackages.csslint @@ -25,7 +28,7 @@ tokei # count lines of code gnumake binutils # for strip, ld, ... - nightly.rust + # nightly.rust shellcheck ]; } @@ -36,7 +39,7 @@ aria2 firefox # tor-browser-bundle-bin - qutebrowser + # qutebrowser tdesktop w3m wget @@ -113,7 +116,6 @@ scripts.notetags scripts.mansplain scripts.vg - scripts.emoji-menu scripts.fkill scripts.wttr # kmein.slide diff --git a/configs/theming.nix b/configs/theming.nix index a1346c1..04bc5d8 100644 --- a/configs/theming.nix +++ b/configs/theming.nix @@ -1,6 +1,7 @@ { lib, config, ... }: -with config.niveum; { - i18n.consoleColors = map (c: lib.strings.removePrefix "#" c) colourPalette; +let inherit (config.niveum) theme colourPalette; +in { + console.colors = map (c: lib.strings.removePrefix "#" c) colourPalette; environment.systemPackages = [ theme.gtk.package @@ -10,12 +11,10 @@ with config.niveum; { services.xserver.displayManager.lightdm.greeters.gtk = { theme = { - name = theme.gtk.name; - package = theme.gtk.package; + inherit (theme.gtk) name package; }; iconTheme = { - name = theme.icon.name; - package = theme.icon.package; + inherit (theme.icon) name package; }; }; diff --git a/configs/tmux.nix b/configs/tmux.nix index 7096864..06649f2 100644 --- a/configs/tmux.nix +++ b/configs/tmux.nix @@ -10,7 +10,7 @@ keyMode = "vi"; clock24 = true; terminal = "screen-256color"; - extraTmuxConf = '' + extraConfig = '' set -g status-interval 2 set -g status-left-length 32 set -g status-right-length 150 diff --git a/dot/i3status-rust.nix b/dot/i3status-rust.nix index 3ee896b..110b936 100644 --- a/dot/i3status-rust.nix +++ b/dot/i3status-rust.nix @@ -19,24 +19,34 @@ }; icons = { name = "none"; - /* overrides = { - time = "๐Ÿ“…"; - music = "๐ŸŽต"; + time = "๐Ÿ“… "; + music = "๐ŸŽต "; music_play = "โ–ถ"; music_pause = "๏Œ"; music_next = "โญ"; music_prev = "โฎ"; - cogs = "๐ŸŽ›"; - memory_mem = "๐Ÿ“ˆ"; - memory_swap = "๐Ÿ“‰"; - cpu = "๐Ÿšฆ"; + cpu = "๐Ÿ–ฅ "; + memory_mem = "๐Ÿง  "; + cogs = "๐Ÿšฆ "; bat = "๐Ÿ”‹"; bat_full = "โšก"; bat_charging = "๐Ÿ”Œ"; bat_discharging = "๐Ÿ”‹"; + bat_quarter = "๐Ÿ”‹"; + bat_three_quarters = "๐Ÿ”‹"; + net_up = "๐ŸŒ "; + net_down = "โŽ "; + net_wireless = "๐Ÿ“ถ "; + net_wired = "๐ŸŒ "; + net_vpn = "๐Ÿ›ก "; + toggle_off = "โŒ "; + toggle_on = "โœ… "; + volume_full = "๐Ÿ”Š "; + volume_half = "๐Ÿ”‰ "; + volume_muted = "โ›”"; + volume_empty = "๐Ÿ”ˆ "; }; - */ }; block = [ { @@ -55,17 +65,17 @@ | ${pkgs.gnugrep}/bin/grep Germany \ | ${pkgs.gnused}/bin/sed 's/\s*//g' \ | ${pkgs.ansifilter}/bin/ansifilter \ - | ${pkgs.gawk}/bin/awk -F'โ”‚' '{print "CORONA " $3 " โ€ " $5}' + | ${pkgs.gawk}/bin/awk -F'โ”‚' '{print "๐Ÿค’ " $3 " ๐Ÿ’€ " $5}' ''; } { block = "custom"; interval = 2 * 60; command = pkgs.writers.writeDash "rss" '' - ${pkgs.newsboat}/bin/newsboat -u "$NEWSBOAT_HOME/urls" -x print-unread | ${pkgs.gawk}/bin/awk '{ print "RSS " $1 }' + ${pkgs.newsboat}/bin/newsboat -x print-unread | ${pkgs.gawk}/bin/awk '{ print "๐Ÿ“ฐ " $1 }' ''; on_click = pkgs.writers.writeDash "updateNewsboat" '' - ${pkgs.newsboat}/bin/newsboat -u "$NEWSBOAT_HOME/urls" -x reload && ${pkgs.libnotify}/bin/notify-send newsboat "Feeds updated." + ${pkgs.newsboat}/bin/newsboat -x reload && ${pkgs.libnotify}/bin/notify-send newsboat "Feeds updated." ''; } { @@ -87,6 +97,7 @@ } { block = "disk_space"; + alias = "๐Ÿ’ฝ"; } { block = "memory"; diff --git a/dot/init.vim b/dot/init.vim index 063c776..5f0ad75 100644 --- a/dot/init.vim +++ b/dot/init.vim @@ -133,6 +133,8 @@ if has("autocmd") " autocmd bufwritepre * :call StripTrailingWhitespaces() autocmd bufwinenter * if &fdm == 'indent' | setlocal foldmethod=manual | endif + autocmd bufwrite *.elm set nofoldenable + autocmd VimEnter * UpdateRemotePlugins endif diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 0000000..7941883 --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + writeTOML = object: pkgs.runCommand "generated.toml" {} '' + echo '${builtins.toJSON object}' | ${pkgs.remarshal}/bin/json2toml > $out + ''; + toTOML = object: builtins.readFile (pkgs.writeTOML object); +} diff --git a/niveum-update b/niveum-update index 97ee80b..3686ced 100755 --- a/niveum-update +++ b/niveum-update @@ -1,5 +1,5 @@ #!/bin/sh -NIXOS_VERSION=19.09 +NIXOS_VERSION=20.03 fetch() { rev=$1 @@ -26,7 +26,7 @@ home_manager() { } krops() { - fetch "refs/tags/v1.15.0" .versions/krops.json "https://cgit.krebsco.de/krops" + fetch "refs/tags/v1.21.0" .versions/krops.json "https://cgit.krebsco.de/krops" } stockholm() { diff --git a/overlays/overlays.nix b/overlays/overlays.nix deleted file mode 100644 index ac6acf2..0000000 --- a/overlays/overlays.nix +++ /dev/null @@ -1,6 +0,0 @@ -self: super: -with super.lib; -let - eval = import ; - paths = (eval {modules = [(import )];}).config.nixpkgs.overlays; -in foldl' (flip extends) (_: super) paths self diff --git a/overlays/scripts.nix b/overlays/scripts.nix deleted file mode 100644 index fcb79de..0000000 --- a/overlays/scripts.nix +++ /dev/null @@ -1,3 +0,0 @@ -(self: super: { - scripts = import { pkgs = super; lib = super.lib; }; -}) diff --git a/overlays/toml.nix b/overlays/toml.nix deleted file mode 100644 index e921930..0000000 --- a/overlays/toml.nix +++ /dev/null @@ -1,6 +0,0 @@ -(self: super: { - writeTOML = object: super.runCommand "generated.toml" {} '' - echo '${builtins.toJSON object}' | ${super.remarshal}/bin/json2toml > $out - ''; - toTOML = object: builtins.readFile (self.writeTOML object); -}) diff --git a/packages/scripts/default.nix b/packages/scripts/default.nix index 3483a86..cc877e9 100644 --- a/packages/scripts/default.nix +++ b/packages/scripts/default.nix @@ -12,27 +12,6 @@ let }; in { - # https://github.com/LukeSmithxyz/voidrice/blob/9fe6802122f6e0392c7fe20eefd30437771d7f8e/.local/bin/dmenuunicode - emoji-menu = - let emoji-file = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/LukeSmithxyz/voidrice/master/.local/share/larbs/emoji"; - sha256 = "09m2rgb9d5jpiy8q4jz3dw36gkpb4ng2pl7xi7ppsrzzzdvq85qk"; - }; - in with pkgs; writers.writeDashBin "emoji-menu" '' - PATH=${lib.makeBinPath [ coreutils dmenu gnused libnotify xclip xdotool ]} - chosen=$(cut -d ';' -f1 ${emoji-file} | dmenu -i -l 10 | sed "s/ .*//") - - [ "$chosen" != "" ] || exit - - echo "$chosen" | tr -d '\n' | xclip -selection clipboard - - if [ -n "$1" ]; then - xdotool key Shift+Insert - else - notify-send "'$chosen' copied to clipboard." & - fi - ''; - instaget = wrapScript { packages = [ pkgs.jq pkgs.curl pkgs.gnugrep ]; script = ./instaget.sh; diff --git a/systems/catullus/configuration.nix b/systems/catullus/configuration.nix index 808282c..d548a79 100644 --- a/systems/catullus/configuration.nix +++ b/systems/catullus/configuration.nix @@ -1,5 +1,6 @@ { config, pkgs, lib, ... }: let + inherit (import { inherit pkgs; }) writeTOML; sshKey = { homeros = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDn13Y6CznabMvKJPIrr/dj1TX4boe8F98yc3FDElJeprQo2RXlDzjg/po9/lHTHaoC5yQUjlRg/AnI4vizYkn2sqJebAeSPahmpS+l0eFnjZgsqds2cCFqSPB6Qc5YEkGRhN4aq/ABz0jdFJLBYOYGxuuXowYxyNrqrItxDR7tF7upG+kVjYiDoP/qFm8C7zv6Zy8aoehNbzf8HlIJd0ITbMr/vUftNsQ8C84QmbZljReHmchPgE8GUfVLTlCORkhndbvNX3jXo+75y7JOIZZ6193FZHM4seg/VSDWYLJtpnhttD1w6qmiLrlimqbJB9ihoXq2eDmQ+4zo6hxQ6pFH6P0xQClJ0hxVWn6hEM3rkMwoMfbq4v54gKJsYxcGdnwjAX6d9DQv/QVjmVZffKWsGGoC7uz7bdmc0akVKi+GLSPOx8sJwXqvyvFStfqLaweVcuikUqQ72JLK7pZyliA7na6KuQ1PE3LTpfSr0lbBJ73xtS2rU1nF/Oe5zwA4LX5s/QeDVmS86D8acUrSCO62pBB3Yv8go0KR4mEvfxLiUWV6gR2uTeIPXvo4ouYFZqyABAGybjUATlGCXJaeHd/y/VWkpIB8ocqNESlRMCEe4TrYjw91AEmYBL6kWIeop3dyhovm3dTB3fQvC97kbL16wuXBrOcN4lEc+56ShhmvdQ== kieran.meinhardt@gmail.com"; scardanelli = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC19H0FhSNWcfBRPKzbTVSMJikIWZl0CoM8zCm+/3fdMgoaLRpeZWe/AfDK6b4qOjk/sez/J0JUFCGr+JbMwjsduoazsuQowu9L9DLP9Q5UkJje4BD7MHznaeu9/XfVng/MvyaEWArA/VUJeKQesHe76tR511/+n3+bdzlIh8Zw/3wfFxmg1OTNA99/vLkXrQzHDTuV/yj1pxykL4xFtN0OIssW1IKncJeKtkO/OHGT55ypz52Daj6bNKqvxiTuzeEhv5M+5ppyIPcRf1uj/7IaPKttCgZAntEqBTIR9MbyXFeAZVayzaFnLl2okeam5XreeZbj+Y1h2ZjxiIuWoab3MLndSekVfLtfa63gtcWIf8CIvZO2wJoH8v73y0U78JsfWVaTM09ZCfFlHHA/bWqZ6laAjW+mWLO/c77DcYkB3IBzaMVNfc6mfTcGFIC+biWeYpKgA0zC6rByUPbmbIoMueP9zqJwqUaM90Nwd6559inBB107/BK3Ktb3b+37mMCstetIPB9e4EFpGMjhmnL/G81jS53ACWLXJYzt7mKU/fEsiW93MtaB+Le46OEC18y/4G8F7p/nnH7i0kO74ukxbnc4PlpiM7iWT6ra2Cyy+nzEgdXCNXywIxr05TbCQDwX6/NY8k7Hokgdfyz+1Pq3sX0yCcWRPaoB26YF12KYFQ== kieran.meinhardt@gmail.com"; @@ -88,7 +89,7 @@ in { - + # { @@ -97,14 +98,11 @@ in { writeDash = pkgs.writers.writeDash; writeDashBin = pkgs.writers.writeDashBin; }; - overlays = [ - (import ) - ]; }; services.matterbridge = { enable = true; - configPath = toString (pkgs.writeTOML (import { + configPath = toString (writeTOML (import { token = lib.strings.fileContents ; })); }; diff --git a/systems/catullus/telegram-bots/literature-quote.nix b/systems/catullus/telegram-bots/literature-quote.nix index 41dd62c..6c60bac 100644 --- a/systems/catullus/telegram-bots/literature-quote.nix +++ b/systems/catullus/telegram-bots/literature-quote.nix @@ -1,6 +1,7 @@ { pkgs, lib, ... }: let - literature-quote = pkgs.callPackage {}; + scripts = import { inherit pkgs lib; }; + inherit (scripts) literature-quote; in { niveum.telegramBots.quotebot = { diff --git a/systems/homeros/configuration.nix b/systems/homeros/configuration.nix index 8bb3f07..7577a1f 100644 --- a/systems/homeros/configuration.nix +++ b/systems/homeros/configuration.nix @@ -8,7 +8,7 @@ services.xserver.xrandrHeads = [ { output = "HDMI1"; primary = true; } "LVDS1" ]; - environment.systemPackages = [ pkgs.unstable.zeroad pkgs.minecraft ]; + environment.systemPackages = [ pkgs.zeroad pkgs.minecraft ]; niveum = { batteryBlocks.default = "BAT1";