citadel

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

commit 2e2f041748f7fd1216b715f1e513804dc4d67cf9
parent b5d8ff4d7277e110796cbb1b73f79dfc72f28254
Author: William Casarin <jb55@jb55.com>
Date:   Wed, 20 Apr 2022 17:17:42 -0700

Merge remote-tracking branch 'origin/master'

Diffstat:
Mbin/btc-balance | 1+
Mbin/btc-txs | 4+---
Mbin/git-logbr | 4+---
Mbin/git-review | 13++++++++++++-
Mbin/lcli | 1+
Mbin/plainweb | 2+-
Mdotfiles/.gitconfig | 4++--
Mdotfiles/.todo/config | 2+-
Ddotfiles/skeletons/nix-rust/default.nix | 6------
Mnix-config/environment/default.nix | 2+-
Mnix-config/environment/desktop/default.nix | 6+++---
Mnix-config/fonts/default.nix | 2+-
Mnix-config/machines/archer/config/default.nix | 2+-
Mnix-config/machines/monad/bitcoin/default.nix | 8++++++--
Mnix-config/machines/monad/default.nix | 4++--
Mnix-config/machines/monad/networking/default.nix | 9+++++++--
Mnix-config/nixpkgs/dotfiles.nix | 2+-
17 files changed, 42 insertions(+), 30 deletions(-)

diff --git a/bin/btc-balance b/bin/btc-balance @@ -2,6 +2,7 @@ #btc coins | awk '{print $3}' | xargs printf '%.8f * 100000000\n' | bc -l | xargs printf '%.0f\n' | paste -sd+ | bc -l | xargs printf '%s sats to btc\n' | bcalc -n bcli -rpcwallet=personal getbalance +bcli -rpcwallet=vanessa getbalance #if [ -n "$1" ]; then # FIAT=$(printf '%s sats to fiat\n' "$SATS" | bcalc --price "$1") diff --git a/bin/btc-txs b/bin/btc-txs @@ -1,6 +1,4 @@ #!/usr/bin/env bash set -eou pipefail btc-txs-raw | - datefmt --after $(date +%s -d 2009-01-01) --before $(date +%s -d 2030-01-01) '%F' | - ct | - less -S +G + datefmt --after $(date +%s -d 2009-01-01) --before $(date +%s -d 2030-01-01) '%F' diff --git a/bin/git-logbr b/bin/git-logbr @@ -1,4 +1,2 @@ #!/usr/bin/env sh -branch="$1" -shift -exec git log --reverse "$@" origin/master.."$branch" +exec git log --reverse "$@" origin/master.. diff --git a/bin/git-review b/bin/git-review @@ -12,10 +12,21 @@ usage() { exit 1 } +start_review() { + diffs "$DIR"/*.patch +} + if [ -z "$2" ]; then usage fi +if [ -d "$DIR" ]; then + read -p "Found $DIR, review this? (y/n): " res + if [ "$res" == "" ] || [ "$res" == "y" ]; then + start_review + exit 0 + fi +fi git fetch origin $BASE git fetch "$REMOTE" "$BRANCH" @@ -30,4 +41,4 @@ printf "$DIR\n" read -p "Press enter to review." -diffs "$DIR"/*.patch +start_review diff --git a/bin/lcli b/bin/lcli @@ -1,6 +1,7 @@ #!/usr/bin/env sh if [ "$HOST" != "monad" ]; then ssh monad lightning-cli "$@" + exit 0 fi lightning-cli "$@" diff --git a/bin/plainweb b/bin/plainweb @@ -12,7 +12,7 @@ OUT=${2:-$HURL} if [ ! -f "$HURL" ]; then #w3m -header "$USER_AGENT" -dump "$1" > "$HURL" - w3m -dump "$1" > "$HURL" + w3m -dump "$1" | par -w$(tput cols) > "$HURL" fi lessr "$HURL" diff --git a/dotfiles/.gitconfig b/dotfiles/.gitconfig @@ -8,7 +8,7 @@ [core] excludesfile = /Users/jb55/.gitignore_global editor = edit - pager = delta --hunk-style=plain --file-style=box --paging=always + pager = delta --max-line-length=4096 --file-style=box --paging=always [sendemail] smtpServer=/home/jb55/bin/sendmail [url "git@github.com:"] @@ -64,7 +64,7 @@ prs-merged = log --merges --date=local --author-date-order --glob='pull/origin/*' puff = pull --ff-only rc = rebase --continue - rv = remote -v + rv = !"git remote -v | grep fetch | sort | ct" refl = reflog --date=relative r = rebase serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git diff --git a/dotfiles/.todo/config b/dotfiles/.todo/config @@ -1,5 +1,5 @@ export TODO_DIR="${TODO_DIR:-"$HOME/docs/todo"}" -export TODO_FILE="$TODO_DIR/todo.txt" +export TODO_FILE="${TODO_FILE:-TODO_DIR/todo.txt}" export DONE_FILE="$TODO_DIR/done.txt" export REPORT_FILE="$TODO_DIR/report.txt" diff --git a/dotfiles/skeletons/nix-rust/default.nix b/dotfiles/skeletons/nix-rust/default.nix @@ -1,6 +0,0 @@ -{ pkgs ? import <nixpkgs> {} }: -with pkgs; -stdenv.mkDerivation { - name = "project"; - nativeBuildInputs = [ cargo rustc rustfmt ]; -} diff --git a/nix-config/environment/default.nix b/nix-config/environment/default.nix @@ -69,7 +69,7 @@ let jb55pkgs = import <jb55pkgs> { inherit pkgs; }; linuxPackages.perf lsof mailutils - manpages + man-pages mdcat minisign neovim diff --git a/nix-config/environment/desktop/default.nix b/nix-config/environment/desktop/default.nix @@ -84,9 +84,9 @@ let gtk2rc = pkgs.writeText "gtk2rc" '' xbindkeys xclip xdotool - xlibs.xev - xlibs.xmodmap - xlibs.xset + xorg.xev + xorg.xmodmap + xorg.xset zathura zoom-us diff --git a/nix-config/fonts/default.nix b/nix-config/fonts/default.nix @@ -95,7 +95,7 @@ in ibm-plex noto-fonts noto-fonts-emoji - opensans-ttf + open-sans raleway profont terminus_font diff --git a/nix-config/machines/archer/config/default.nix b/nix-config/machines/archer/config/default.nix @@ -1,5 +1,5 @@ pkgs: { sessionCommands = '' - ${pkgs.xlibs.xset}/bin/xset m 0 0 + ${pkgs.xorg.xset}/bin/xset m 0 0 ''; } diff --git a/nix-config/machines/monad/bitcoin/default.nix b/nix-config/machines/monad/bitcoin/default.nix @@ -49,11 +49,15 @@ in services.nginx.httpConfig = '' server { - listen ${extra.machine.ztip}:80; + listen 80; + listen 10.100.0.1:80; + listen 192.168.87.26:80; + server_name wallet.jb55.com; location / { - proxy_pass http://${extra.machine.ztip}:${toString spark-port}; + proxy_pass http://127.0.0.1:9962; + proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; proxy_buffering off; diff --git a/nix-config/machines/monad/default.nix b/nix-config/machines/monad/default.nix @@ -33,12 +33,12 @@ in #(import ../../misc/dnsmasq-adblock.nix) (import ../../misc/msmtp extra) (import ./networking extra) - (import ../../misc/imap-notifier extra) + #(import ../../misc/imap-notifier extra) ] ++ (if !extra.is-minimal then [ (import ./bitcoin extra) ] else []); #hardware.steam-hardware.enable = true; - boot.kernelPackages = pkgs.linuxPackages_latest; + #boot.kernelPackages = pkgs.linuxPackages_latest; services.ofono.enable = false; services.ofono.plugins = with pkgs; [ ofono-phonesim ]; diff --git a/nix-config/machines/monad/networking/default.nix b/nix-config/machines/monad/networking/default.nix @@ -31,6 +31,7 @@ let ports = { lightning = 9735; lightningt = 9736; + lightning_websocket = 8756; lntun = 7878; dns = 53; http = 80; @@ -66,7 +67,7 @@ in networking.hostId = extra.machine.hostId; #networking.firewall.trustedInterfaces = ["wg0"]; - networking.firewall.allowedTCPPorts = with ports; [ lightning lightningt http ]; + networking.firewall.allowedTCPPorts = with ports; [ lightning lightning_websocket http ]; networking.firewall.allowedUDPPorts = with ports; [ dns wireguard ]; networking.nat.enable = true; @@ -107,10 +108,13 @@ in { publicKey = "Ynuism5cSJYUrMF/gWZti8W+PztLufaB/3mQlXV6HyY="; # vanessa-phone allowedIPs = [ "10.100.0.6/32" ]; } - { publicKey = "BklL4dTL8WK3xnmM899Hr50/UlXaLYhJQWllj2p4ZEg="; # charon + { publicKey = "BklL4dTL8WK3xnmM899Hr50/UlXaLYhJQWllj2p4ZEg="; # charon allowedIPs = [ "10.100.0.7/32" ]; endpoint = "45.79.91.128:51820"; } + { publicKey = "oYTNuXPl5GQsz53cL55MO9MfI61DyZBrBDy9ZFBpDWU="; # cross (air) + allowedIPs = [ "10.100.0.8/32" ]; + } ]; }; @@ -422,4 +426,5 @@ in networking.firewall.checkReversePath = false; networking.firewall.logReversePathDrops = true; + networking.firewall.logRefusedConnections = false; } diff --git a/nix-config/nixpkgs/dotfiles.nix b/nix-config/nixpkgs/dotfiles.nix @@ -17,7 +17,7 @@ let sessionCommands = '' #!${pkgs.bash}/bin/bash ${pkgs.feh}/bin/feh --bg-fill ${bgimg} - ${pkgs.xlibs.xsetroot}/bin/xsetroot -cursor_name left_ptr + ${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr ${pkgs.autocutsel}/bin/autocutsel -fork -selection CLIPBOARD ${pkgs.autocutsel}/bin/autocutsel -fork -selection PRIMARY