citadel

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

commit 455c49e58fa393d214370e868756c441361c2f67
parent 0ce354bca4097072216fc2fb40ae5499f7479d13
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 17 Jul 2023 18:06:20 -0700

monad updates

Diffstat:
Mbin/fuzz-reader | 2+-
Mbin/nix-build-cache | 6++++--
Mdotfiles/.bashrc | 7++++++-
Mdotfiles/.gitconfig | 5+++++
Mdotfiles/.screenrc | 1+
Mdotfiles/.tmux.conf | 37++++++++++++++++++-------------------
Mdotfiles/commands | 1+
Mnix-config/environment/default.nix | 2+-
Mnix-config/environment/desktop/default.nix | 2+-
Mnix-config/machines/monad/bitcoin/default.nix | 48++++++++++++++++++++++++------------------------
Mnix-config/machines/monad/default.nix | 29+++++++++++++++++++----------
Mnix-config/machines/monad/networking/default.nix | 31++++++++++++++++++++++---------
12 files changed, 103 insertions(+), 68 deletions(-)

diff --git a/bin/fuzz-reader b/bin/fuzz-reader @@ -13,7 +13,7 @@ document=$(find "$BOOKS_DIR" \( -iname '*.txt' -o -iname '*.epub' -o -iname '*.p name="$(basename "$document")" noext="${name%.*}" -wname "$noext" +#wname "$noext" ext="$(extname "$document")" if [ "$ext" == ".txt" ] || [ "$ext" == ".md" ] || [ "$ext" == ".mediawiki" ]; then echo lessr "$document" diff --git a/bin/nix-build-cache b/bin/nix-build-cache @@ -5,6 +5,8 @@ printf "building cache of haskellPackages\n" >&2 nix-env -f $NIXPKGS -qaPA haskellPackages > /tmp/search2 & printf "building cache of perlPackages\n" >&2 nix-env -f $NIXPKGS -qaPA perlPackages > /tmp/search3 & +printf "building cache of linuxPackages\n" >&2 +nix-env -f $NIXPKGS -qaPA linuxPackages > /tmp/search4 & wait -cat /tmp/search{1,2,3} | sort > ~/.nixenv.cache -rm -f /tmp/search1 /tmp/search2 +cat /tmp/search{1,2,3,4} | sort > ~/.nixenv.cache +rm -f /tmp/search{1,2,3,4} diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc @@ -16,8 +16,13 @@ export NIX_PATH="dotfiles=$HOME/dotfiles:$NIX_PATH" #[ -z "$PS1" ] && return export HOST=$(hostname) +export IGNORE_WINDOW_CHECK=1 export LONG_RUNNING_COMMAND_TIMEOUT=3 -export PS1='$(printf "\x01\033[30;1m\x02%3.*s\x01\033[0m\x02 %s> \x01\033[33m\x02" $? $? $HOST)' +IN_NIX="" +if [ -n "$IN_NIX_SHELL" ]; then + IN_NIX="-nix" +fi +export PS1='$(printf "\x01\033[30;1m\x02%3.*s\x01\033[0m\x02 %s%s> \x01\033[33m\x02" $? $? $HOST $IN_NIX)' export PS0='\033[0m' #export PS1='$(printf "\x01\033[30;1m\x02%3.*s\x01\033[0m\x02> " $? $?)' diff --git a/dotfiles/.gitconfig b/dotfiles/.gitconfig @@ -99,3 +99,8 @@ helper = !gh auth git-credential [init] defaultBranch = master +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true diff --git a/dotfiles/.screenrc b/dotfiles/.screenrc @@ -15,3 +15,4 @@ hardstatus string '%{= 9b}[ %{B}%H %{b}][%= %{= 9w}%?%-Lw%?%{=b 9R}(%{W}%n*%f %t maptimeout 0 +truecolor on diff --git a/dotfiles/.tmux.conf b/dotfiles/.tmux.conf @@ -19,9 +19,9 @@ bind C-X swap-pane setw -g mode-keys vi # Make mouse useful in copy mode -setw -g mode-mouse on +#setw -g mode-mouse on setw -g escape-time 0 -setw -g mouse-resize-pane on +#setw -g mouse-resize-pane on # More straight forward key bindings for splitting unbind % @@ -57,8 +57,8 @@ setw -g window-status-current-format '#I:#W#F' setw -g automatic-rename off # Status Bar -set -g status-bg colour233 -set -g status-fg colour239 +set -g status-bg colour0 +set -g status-fg colour2 #set -g status-interval 1 #set -g status-left '#[fg=colour118]#H#[default]' #set -g status-right '#[fg=colour238]#(cut -d " " -f 1-4 /proc/loadavg)#[default] #[fg=colour242]%Y-%m-%d %H:%M:%S#[default]' @@ -71,14 +71,14 @@ set -g visual-activity off set -g visual-bell off # Highlighting the active window in status bar -setw -g window-status-current-bg colour233 -setw -g window-status-current-fg colour154 +#setw -g window-status-current-bg colour233 +#setw -g window-status-current-fg colour154 -set -g pane-border-bg black -set -g pane-border-fg colour238 +#set -g pane-border-bg black +#set -g pane-border-fg colour238 -set -g pane-active-border-bg black -set -g pane-active-border-fg colour112 +#set -g pane-active-border-bg black +#set -g pane-active-border-fg colour112 # Clock setw -g clock-mode-colour green @@ -87,12 +87,11 @@ setw -g clock-mode-style 24 # Title # powerline -set-option -g status on -set-option -g status-interval 2 -set-option -g status-utf8 on -set-option -g status-justify "centre" -set-option -g status-left-length 60 -set-option -g status-right-length 90 -set-option -g status-left "#(~/dev/tmux-powerline/status-left.sh)" -set-option -g status-right "#(~/dev/tmux-powerline/status-right.sh)" - +#set-option -g status on +#set-option -g status-interval 2 +#set-option -g status-utf8 on +#set-option -g status-justify "centre" +#set-option -g status-left-length 60 +#set-option -g status-right-length 90 +#set-option -g status-left "#(~/dev/tmux-powerline/status-left.sh)" +#set-option -g status-right "#(~/dev/tmux-powerline/status-right.sh)" diff --git a/dotfiles/commands b/dotfiles/commands @@ -54,6 +54,7 @@ nt notmuch threads fuzz-notmuch-threads of open file fuzz-open-file olf open last files fuzz-last-files open pc cat project file fuzz-cat-file +pr cd project root echo cd $(project-root) pf edit project file fuzz-edit-file ps edit project skeletons fuzz-edit-file --dir ~/dotfiles/skeletons rf recent files fuzz-recent-files 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.bpftrace linuxPackages.perf lsof - mailutils + #mailutils man-pages mdcat minisign diff --git a/nix-config/environment/desktop/default.nix b/nix-config/environment/desktop/default.nix @@ -118,7 +118,7 @@ in { VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json"; # radv }; - programs.steam.enable = false; + programs.steam.enable = true; environment.systemPackages = if extra.is-minimal then (with pkgs; [ #steam diff --git a/nix-config/machines/monad/bitcoin/default.nix b/nix-config/machines/monad/bitcoin/default.nix @@ -9,11 +9,11 @@ let nix-bitcoin = import (pkgs.fetchFromGitHub { owner = "fort-nix"; repo = "nix-bitcoin"; - rev = "v0.0.44"; - sha256 = "08qn597r3xnqg9s7bnkssf4xcxvm0lf6xmisr86nkp2gammazc42"; + rev = "v0.0.89"; + sha256 = "sha256-SMJW+QZt3iRuoezjE12sopBsdLHDihXe/RerLfRpqoI="; }) { inherit pkgs; }; - plugins = ["summary" "rebalance"]; + plugins = ["summary"]; mkPluginCfg = name: "plugin=${builtins.getAttr name (nix-bitcoin.clightning-plugins)}/${name}.py"; @@ -91,25 +91,25 @@ in }; }; - services.clightning.networks = { - mainnet = { - dataDir = "/home/jb55/.lightning-bitcoin"; - - config = '' - bitcoin-rpcuser=rpcuser - bitcoin-rpcpassword=rpcpass - bitcoin-rpcconnect=127.0.0.1 - bitcoin-rpcport=8332 - fee-per-satoshi=900 - bind-addr=0.0.0.0:9735 - announce-addr=24.84.152.187:9735 - network=bitcoin - alias=jb55.com - rgb=ff0000 - proxy=127.0.0.1:9050 - experimental-offers - ${lib.concatStringsSep "\n" (map mkPluginCfg plugins)} - ''; - }; - }; + #services.clightning.networks = { + # mainnet = { + # dataDir = "/home/jb55/.lightning-bitcoin"; + + # config = '' + # bitcoin-rpcuser=rpcuser + # bitcoin-rpcpassword=rpcpass + # bitcoin-rpcconnect=127.0.0.1 + # bitcoin-rpcport=8332 + # fee-per-satoshi=900 + # bind-addr=0.0.0.0:9735 + # announce-addr=24.84.152.187:9735 + # network=bitcoin + # alias=jb55.com + # rgb=ff0000 + # proxy=127.0.0.1:9050 + # experimental-offers + # ${lib.concatStringsSep "\n" (map mkPluginCfg plugins)} + # ''; + # }; + #}; } diff --git a/nix-config/machines/monad/default.nix b/nix-config/machines/monad/default.nix @@ -107,14 +107,9 @@ in services.dnsmasq.resolveLocalQueries = true; #services.dnsmasq.servers = ["127.0.0.1#43"]; # services.dnsmasq.servers = ["127.0.0.1#43" "1.1.1.1" "8.8.8.8"]; - services.dnsmasq.servers = ["8.8.8.8" "8.8.4.4" ]; - services.dnsmasq.extraConfig = '' - cache-size=10000 - addn-hosts=/var/hosts - conf-file=/var/dnsmasq-hosts - conf-file=/var/distracting-hosts - ''; - + services.dnsmasq.settings.server = ["8.8.8.8" "8.8.4.4" ]; + services.dnsmasq.settings.conf-file = "/var/dnsmasq-hosts"; + services.dnsmasq.settings.addn-hosts = "/var/hosts"; services.bitlbee.plugins = with pkgs; [ bitlbee-mastodon @@ -141,7 +136,7 @@ in }; systemd.user.services.bitcoin-contacts = { - enable = if extra.is-minimal then false else true; + enable = false; description = "Email bitcoin PR patches that have me as a git-contact"; wantedBy = [ "graphical-session.target" ]; @@ -322,6 +317,20 @@ in systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/www" ]; services.nginx.httpConfig = '' server { + listen 80 default_server; + listen ${extra.machine.ztip}:80 default_server; + listen 192.168.87.26 default_server; + + server_name monad.jb55.com; + + location / { + root /var/www/public; + autoindex on; + index index.html; + } + } + + server { listen 80; listen ${extra.machine.ztip}:80; listen 192.168.87.26; @@ -377,7 +386,7 @@ in serviceConfig.Type = "oneshot"; serviceConfig.ExecStart = util.writeBash "disable-c6-state" '' ${pkgs.kmod}/bin/modprobe msr - ${pkgs.python2}/bin/python ${zenstates}/zenstates.py --c6-disable --list + ${pkgs.python3}/bin/python ${zenstates}/zenstates.py --c6-disable --list ''; }; diff --git a/nix-config/machines/monad/networking/default.nix b/nix-config/machines/monad/networking/default.nix @@ -46,6 +46,8 @@ let "nixos-fw -s 10.100.0.0/24,192.168.87.1/24 -p tcp --dport 5442 -j nixos-fw-accept" "nixos-fw -s 10.100.0.0/24 -p tcp --dport 80 -j nixos-fw-accept" "nixos-fw -s 10.100.0.0/24 -p tcp --dport 3000 -j nixos-fw-accept" + "nixos-fw -s 10.100.0.0/24 -p tcp --dport 25565 -j nixos-fw-accept" + "nixos-fw -s 10.100.0.0/24 -p tcp --dport 25575 -j nixos-fw-accept" "nixos-fw -s 10.100.0.2/32 -p tcp --dport ${toString ports.lntun} -j nixos-fw-accept" "nixos-fw -s 10.100.0.0/24 -p tcp --dport ${toString ports.weechat} -j nixos-fw-accept" "nixos-fw -s 10.100.0.0/24,192.168.87.1/24 -p tcp --dport 8333 -j nixos-fw-accept" # bitcoin @@ -99,15 +101,15 @@ in { publicKey = "vIh3IQgP92OhHaC9XBiJVDLlrs3GVcR6hlXaapjTiA0="; # phone allowedIPs = [ "10.100.0.3/32" ]; } - { publicKey = "Dp8Df75X8Kh9gd33e+CWyyhOvT4mT0X9ToPwBUEBU1k="; # macos - allowedIPs = [ "10.100.0.4/32" ]; - } - { publicKey = "N4bIpjNL/IzV59y5KWHiR54n0rAKYcr3/BkVLzCmBBA="; # old-mac - allowedIPs = [ "10.100.0.5/32" ]; - } - { publicKey = "Ynuism5cSJYUrMF/gWZti8W+PztLufaB/3mQlXV6HyY="; # vanessa-phone - allowedIPs = [ "10.100.0.6/32" ]; - } + #{ publicKey = "Dp8Df75X8Kh9gd33e+CWyyhOvT4mT0X9ToPwBUEBU1k="; # macos + # allowedIPs = [ "10.100.0.4/32" ]; + #} + #{ publicKey = "N4bIpjNL/IzV59y5KWHiR54n0rAKYcr3/BkVLzCmBBA="; # old-mac + # allowedIPs = [ "10.100.0.5/32" ]; + #} + #{ publicKey = "Ynuism5cSJYUrMF/gWZti8W+PztLufaB/3mQlXV6HyY="; # vanessa-phone + # allowedIPs = [ "10.100.0.6/32" ]; + #} { publicKey = "BklL4dTL8WK3xnmM899Hr50/UlXaLYhJQWllj2p4ZEg="; # charon allowedIPs = [ "10.100.0.7/32" ]; endpoint = "45.79.91.128:51820"; @@ -115,6 +117,12 @@ in { publicKey = "oYTNuXPl5GQsz53cL55MO9MfI61DyZBrBDy9ZFBpDWU="; # cross (air) allowedIPs = [ "10.100.0.8/32" ]; } + { publicKey = "kBTRfnUGBwbTlyazK1J67VVpzNg/wLjgmSfI9+1J6S4="; # ipad-air + allowedIPs = [ "10.100.0.12/32" ]; + } + { publicKey = "fj35gCObJ+uP/8tDpYsAD+b2XuSpa82umL/8LscIHwQ="; # pixel6-android + allowedIPs = [ "10.100.0.9/32" ]; + } ]; }; @@ -184,6 +192,10 @@ in # any requests that come in that match any these names will use the proxy. server_name plex.jb55.com plez.jb55.com media.home plex.home; + location = / { + return 302 http://plex.jb55.com/web/index.html; + } + # this is where everything cool happens (you probably don't need to change anything here): location / { # if a request to / comes in, 301 redirect to the main plex page. @@ -270,6 +282,7 @@ in } ''; + systemd.services.transmission.enable = false; systemd.services.transmission.requires = [ "openvpn-pia.service" ]; systemd.services.transmission.after = [ "openvpn-pia.service" ]; systemd.services.transmission.serviceConfig.User = lib.mkForce "root";