citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit c63c272c080ba3f330b7d6aa65e73abca8561774
parent fadc74649e2d79ea143f6bce557e213a0da6ae41
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 29 Dec 2020 10:34:47 -0800

Merge remote-tracking branch 'monad/master' into master

Diffstat:
Mbin/btc-txs-raw | 2+-
Mbin/nannypay | 4++--
Mbin/steamoji-code | 1+
Mdotfiles/.bash_aliases | 1+
Mdotfiles/.config/mimi/mime.conf | 4++--
Mdotfiles/.config/nvim/init.vim | 3+++
Mdotfiles/.spacemacs | 67++-----------------------------------------------------------------
Mdotfiles/commands | 1+
Mjb55pkgs/default.nix | 4++--
Mnix-config/machines/monad/config/default.nix | 2+-
Mnix-config/machines/monad/hardware/default.nix | 31-------------------------------
Mnix-config/machines/monad/networking/default.nix | 9+++++----
Mnix-config/misc/imap-notifier/default.nix | 8+++++---
13 files changed, 26 insertions(+), 111 deletions(-)

diff --git a/bin/btc-txs-raw b/bin/btc-txs-raw @@ -7,5 +7,5 @@ do bcli -rpcwallet="$wallet" "$@" listtransactions '*' 2000 \ | jq -rc '.[] | {label: .label, address: .address, category: .category, amount: .amount, blocktime: .blocktime}' done) \ - | jq -src 'sort_by(.time) | .[] | [.label,.address,.category,.amount,(.blocktime | strftime("%F %R"))] | @tsv' + | jq -src 'sort_by(.blocktime) | .[] | [.label,.address,.category,.amount,.blocktime] | @tsv' diff --git a/bin/nannypay b/bin/nannypay @@ -12,11 +12,11 @@ if [ "$NANNY" == "lisbeth" ]; then fi if [ "$NANNY" == "maribel" ]; then - pay=18 + pay=20 fi if [ "$NANNY" == "diana" ]; then - pay=17 + pay=20 fi if [ "$NANNY" == "laura" ]; then diff --git a/bin/steamoji-code b/bin/steamoji-code @@ -1,4 +1,5 @@ #!/usr/bin/env bash +date -u +'Now: %a, %d %b %Y %R:%S +0000' notmuch show from:verification@steamoji.com and date:today | grep -e '^Your verification' -e ^Date | head -n2 diff --git a/dotfiles/.bash_aliases b/dotfiles/.bash_aliases @@ -62,6 +62,7 @@ function run_fuzzer() { eval "$(fuzz-run-command "$@")" } +alias t="todo.sh" alias e="edit -n" alias g=git alias f=run_fuzzer diff --git a/dotfiles/.config/mimi/mime.conf b/dotfiles/.config/mimi/mime.conf @@ -3,9 +3,9 @@ text/: edit application/pdf: zathura text/html: browser html: browser -video/: vlc +video/: mpv image/: feh -audio/: vlc +audio/: mpv svg: feh --conversion-timeout 2 lightning: urxvtc -e /home/jb55/bin/lightning-handler application/x-tar: urxvtc -e una diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim @@ -16,3 +16,6 @@ syntax on set clipboard+=unnamedplus +let mapleader = "\\" +let maplocalleader = "\\" +nmap <Leader>xda ma:%s/\s\+$//g<CR>`a diff --git a/dotfiles/.spacemacs b/dotfiles/.spacemacs @@ -4,85 +4,22 @@ ;; It must be stored in your home directory. (setq jb55/base-layers - '((haskell :variables - haskell-enable-ghc-mod-support nil - haskell-enable-hindent-style "chris-done") - - (c-c++ :variables - c-c++-enable-clang-support t - c-c++-backend 'rtags - ) - + '( (auto-completion :variables auto-completion-enable-help-tooltip t) - csharp - confluence - react - csv - debug - elm - emacs-lisp - emoji - finance - fsharp - git - github - go - gtags - html - react - ;idris - ivy - javascript - latex - lua - markdown - nixos notmuch (org :variables org-want-todo-bindings t org-enable-trello-support t) - purescript - python - racket - rust - shell-scripts ;sml spacemacs-layouts - sql syntax-checking - twitter - typescript - yaml - (org :variables org-want-todo-bindings t) )) (setq jb55/additional-packages - '( company-irony - base16-theme - bison-mode - envrc + '( envrc editor-config - emojify - forge - github-review - glsl-mode - ;gnu-apl-mode - graphviz-dot-mode - helm-pages - ;jade-mode - markdown-mode - mastodon - meson-mode - olivetti - org-brain - org-kanban - org-clock-csv - protobuf-mode - ;shen-mode - w3m - weechat (notmuch :location (recipe :fetcher github diff --git a/dotfiles/commands b/dotfiles/commands @@ -6,6 +6,7 @@ eFc edit fuzz command fuzz-edit-command sFc show fuzz command fuzz-show-fuzz-command of open file fuzz-open-file ec edit commands fuzz-edit-scripts +em edit mimi echo edit ~/.config/mimi/mime.conf sc show command fuzz-show-script sh show history fuzz-show-hist Nc new command echo make-script diff --git a/jb55pkgs/default.nix b/jb55pkgs/default.nix @@ -50,8 +50,8 @@ in rec { datefmt = fetch { repo = "datefmt"; - rev = "0.1.1"; - sha256 = "1xjfr1lbkiy277firlb8zkg1pmj7pmiijhxx1z4bg41970dr446x"; + rev = "67a176de6db75fddecd0239dd6afe2659b1b1b46"; + sha256 = "08as7m9fnsidryx9bm6bwp1hq43g59icv97x58zfrgpk68y8v785"; }; btcs = fetch { diff --git a/nix-config/machines/monad/config/default.nix b/nix-config/machines/monad/config/default.nix @@ -1,6 +1,6 @@ pkgs: rec { hostId = "d7ee0243"; # needed for zfs - ztip = "172.24.172.111"; + ztip = "10.100.0.1"; nix-serve = { port = 10845; bindAddress = ztip; diff --git a/nix-config/machines/monad/hardware/default.nix b/nix-config/machines/monad/hardware/default.nix @@ -1,14 +1,5 @@ { config, lib, pkgs, ... }: { - # fileSystems."/" = - # { device = "/dev/disk/by-uuid/62518649-0872-49e2-a269-34975e314c6a"; - # fsType = "ext4"; - # }; - - # fileSystems."/" = - # { device = "/dev/nvme0n1p1"; - # fsType = "zfs"; - #nixos-generate-config --root /mnt }; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" "amdgpu" "vfio-pci" ]; boot.initrd.preDeviceCommands = '' @@ -39,28 +30,6 @@ fsType = "zfs"; }; - #fileSystems."/vr" = - # { device = "/dev/disk/by-uuid/E234A89834A87169"; - # fsType = "ntfs"; - # }; - - #fileSystems."/sand" = - # { device = "/dev/disk/by-uuid/2ee709b8-7e83-470f-91bc-d0b0ba59b945"; - # fsType = "ext4"; - # }; - - # fileSystems."/home/jb55/shares/will-vm/projects" = - # { device = "//192.168.86.199/Users/jb55/projects"; - # fsType = "cifs"; - # options = ["username=jb55" "password=notsecurepw" "gid=100" "uid=1000"]; - # }; - - #fileSystems."/home/jb55/.local/share/Steam/steamapps" = - # { device = "/sand/data/SteamAppsLinux"; - # fsType = "none"; - # options = ["bind"]; - # }; - # swapDevices = # [ { device = "/dev/disk/by-uuid/d4e4ae51-9179-439d-925b-8df42dd1bfc5"; } # ]; diff --git a/nix-config/machines/monad/networking/default.nix b/nix-config/machines/monad/networking/default.nix @@ -4,7 +4,7 @@ let chromecastIP = "192.168.86.190"; iptables = "iptables -A nixos-fw"; ipr = "${pkgs.iproute}/bin/ip"; - hasVPN = builtins.hasAttr "services" config.services.openvpn && config.services.openvpn.services.pia != null; + hasVPN = true; writeBash = extra.util.writeBash; transmission-dir = "/zbig/torrents"; download-dir = "${transmission-dir}/Downloads"; @@ -35,23 +35,24 @@ let dns = 53; http = 80; wireguard = 51820; + weechat = 9000; inherit (extra.private) notify-port; }; firewallRules = [ "nixos-fw -s 10.100.0.1/24,192.168.86.1/24 -p tcp --dport 8080 -j nixos-fw-accept" # dev "nixos-fw -s 10.100.0.1/24 -p tcp --dport 80 -j nixos-fw-accept" + "nixos-fw -s 10.100.0.1/24 -p tcp --dport 3000 -j nixos-fw-accept" + "nixos-fw -s 10.100.0.1/24 -p tcp --dport ${toString ports.weechat} -j nixos-fw-accept" + "nixos-fw -s 10.100.0.1/24,192.168.86.1/24 -p tcp --dport 8333 -j nixos-fw-accept" # bitcoin "nixos-fw -s 192.168.122.218 -p udp --dport 137 -j nixos-fw-accept" "nixos-fw -s 192.168.122.218 -p udp --dport 138 -j nixos-fw-accept" "nixos-fw -s 192.168.122.218 -p tcp --dport 139 -j nixos-fw-accept" "nixos-fw -s 192.168.122.218 -p tcp --dport 445 -j nixos-fw-accept" - ] - ++ lib.optional hasVPN [ "OUTPUT -t mangle -m cgroup --cgroup 11 -j MARK --set-mark 11" "POSTROUTING -t nat -m cgroup --cgroup 11 -o tun0 -j MASQUERADE" ]; - addRule = rule: "iptables -A ${rule}"; rmRule = rule: "iptables -D ${rule} || true"; extraCommands = lib.concatStringsSep "\n" (map addRule firewallRules); diff --git a/nix-config/misc/imap-notifier/default.nix b/nix-config/misc/imap-notifier/default.nix @@ -74,14 +74,16 @@ with extra; { set -e export HOME=/home/jb55 export DATABASEDIR=$HOME/mail/personal + EVAR=/home/jb55/var/notify + LAST_COUNT=$EVAR/last-email-count notify() { local c=$(notmuch --config /home/jb55/.notmuch-config-personal count 'tag:inbox and not tag:filed and not tag:noise') local lc=$c - if [ -f /tmp/last-email-count ]; then - lc=$(</tmp/last-email-count) + if [ -f $LAST_COUNT ]; then + lc=$(<$LAST_COUNT) fi - echo "$c" > /tmp/last-email-count + echo "$c" > $LAST_COUNT if [ -f ~/var/notify/home ] && [ $c -ne $lc ]; then ${pkgs.libnotify}/bin/notify-send -i email-new "You Got Mail (inbox $c)" fi