citadel

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

commit 903135225ebab7c54177b21ba001f253d37d3335
parent 9d51450dfc5bb1ccb8b93c56d9b14e7ff2b470ea
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 17 Nov 2023 06:35:34 -0800

Merge remote-tracking branch 'origin/master'

Diffstat:
Mbin/btc-balance | 10++++++++--
Mdotfiles/.config/neomutt/neomuttrc | 14+++++++-------
Mdotfiles/.config/nvim/init.vim | 3++-
Mdotfiles/.config/qutebrowser/autoconfig.yml | 4++--
Mdotfiles/.gitconfig | 2+-
Mnix-config/environment/desktop/default.nix | 1+
Mnix-config/machines/charon/networking/default.nix | 3++-
Mnix-config/machines/monad/default.nix | 37++++++++++++++++++++-----------------
Mnix-config/machines/monad/hardware/default.nix | 24++++++++++++------------
Mnix-config/machines/monad/networking/default.nix | 20+++++++++++---------
Mnix-config/machines/quiver/default.nix | 2+-
Mnix-config/nixpkgs/config.nix | 2+-
Mnix-config/services/default.nix | 4++--
13 files changed, 70 insertions(+), 56 deletions(-)

diff --git a/bin/btc-balance b/bin/btc-balance @@ -1,14 +1,20 @@ #!/usr/bin/env bash #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 +set -e + for wallet in personal vanessa multisig bare clightning do echo -n "$wallet " bcli -rpcwallet="$wallet" getbalance done -echo -n "cln-availout " -lcli summary | grep avail_out | cut -d= -f2 | cut -d" " -f1 | xargs printf '%s to btc\n' | bcalc -n +summary=$(lcli summary) +if [ -n "$summary" ] +then + echo -n "cln-availout " + <<<"$summary" grep avail_out | cut -d= -f2 | cut -d" " -f1 | xargs printf '%s to btc\n' | bcalc -n +fi #if [ -n "$1" ]; then # FIAT=$(printf '%s sats to fiat\n' "$SATS" | bcalc --price "$1") diff --git a/dotfiles/.config/neomutt/neomuttrc b/dotfiles/.config/neomutt/neomuttrc @@ -34,12 +34,12 @@ virtual-mailboxes \ "damus-prs" "notmuch://?query=query:damusp" \ "damus-issues" "notmuch://?query=query:damusi" -macro index,pager a "<modify-labels>-unread -inbox<enter> -macro index,pager i "<modify-labels>+inbox<enter> +macro index,pager a "<modify-labels-then-hide>-unread -inbox<enter>" +macro index,pager i "<modify-labels>+inbox<enter>" macro index,pager A "<create-alias>" "Create alias" -macro index,pager F "<modify-labels>+filed" "File message" +macro index,pager F "<modify-labels-then-hide>+filed" "File message" macro index,pager + "<modify-labels>+" -macro index,pager S "<modify-labels>+spam -unread -inbox<enter> +macro index,pager S "<modify-labels-then-hide>+spam -unread -inbox<enter>" macro index c "<change-vfolder>?" "Change to vfolder overview" macro index \\\\ "<vfolder-from-query>" "Search mailbox" macro pager p "|delta --paging always<enter>" @@ -68,9 +68,9 @@ color quoted9 blue default # Quoting Ebene 10 color header brightcyan default '^Subject:' #collapse threads -folder-hook . "push \eV" -set collapse_unread=yes -set uncollapse_jump=yes +#folder-hook . "push \eV" +#set collapse_unread=yes +#set uncollapse_jump=yes #set display_filter=~/bin/mutt-local-date source ~/.mail_aliases diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim @@ -13,7 +13,8 @@ set hidden set rnu nu set wrap -hi ColorColumn ctermbg=8 +hi ColorColumn ctermbg=254 +hi StatusLine ctermbg=254 map Y y$ diff --git a/dotfiles/.config/qutebrowser/autoconfig.yml b/dotfiles/.config/qutebrowser/autoconfig.yml @@ -1,10 +1,10 @@ # If a config.py file exists, this file is ignored unless it's explicitly loaded # via config.load_autoconfig(). For more information, see: -# https://github.com/qutebrowser/qutebrowser/blob/master/doc/help/configuring.asciidoc#loading-autoconfigyml +# https://github.com/qutebrowser/qutebrowser/blob/main/doc/help/configuring.asciidoc#loading-autoconfigyml # DO NOT edit this file by hand, qutebrowser will overwrite it. # Instead, create a config.py - see :help for details. config_version: 2 settings: colors.webpage.darkmode.enabled: - global: false + global: true diff --git a/dotfiles/.gitconfig b/dotfiles/.gitconfig @@ -83,7 +83,7 @@ chp = cherry-pick sw = switch fixes = !git --no-pager show -s --pretty=fixes - pushall = !git remote | parallel -L1 -I R git push R master + pushall = !git remote | parallel -L1 -I R git push R master [rebase] autosquash = true [pretty] diff --git a/nix-config/environment/desktop/default.nix b/nix-config/environment/desktop/default.nix @@ -119,6 +119,7 @@ in { }; programs.steam.enable = true; + programs.gamemode.enable = true; environment.systemPackages = if extra.is-minimal then (with pkgs; [ #steam diff --git a/nix-config/machines/charon/networking/default.nix b/nix-config/machines/charon/networking/default.nix @@ -6,12 +6,13 @@ let ports = { git = 9418; gemini = 1965; + starbound = 21025; }; in { services.openssh.gatewayPorts = "yes"; - networking.firewall.allowedTCPPorts = with ports; [ 22 443 80 70 12566 12788 5222 5269 3415 git gemini ]; + networking.firewall.allowedTCPPorts = with ports; [ 22 443 80 70 12566 12788 5222 5269 3415 git gemini starbound ]; networking.domain = "jb55.com"; networking.search = [ "jb55.com" ]; diff --git a/nix-config/machines/monad/default.nix b/nix-config/machines/monad/default.nix @@ -33,12 +33,14 @@ 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.zfs.enableUnstable = true; + boot.zfs.removeLinuxDRM = true; + boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; services.ofono.enable = false; services.ofono.plugins = with pkgs; [ ofono-phonesim ]; @@ -110,6 +112,7 @@ in 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.dnsmasq.settings.dns-forward-max = 1024; services.bitlbee.plugins = with pkgs; [ bitlbee-mastodon @@ -219,20 +222,20 @@ in ''; }; - virtualisation.libvirtd.enable = false; - virtualisation.libvirtd.qemuOvmf = false; - virtualisation.libvirtd.qemuVerbatimConfig = '' - user = "jb55" - group = "kvm" - cgroup_device_acl = [ - "/dev/input/by-id/usb-Topre_Corporation_Realforce-event-kbd", - "/dev/input/by-id/usb-Razer_Razer_DeathAdder_2013-event-mouse", - "/dev/null", "/dev/full", "/dev/zero", - "/dev/random", "/dev/urandom", - "/dev/ptmx", "/dev/kvm", "/dev/kqemu", - "/dev/rtc","/dev/hpet", "/dev/sev" - ] - ''; + #virtualisation.libvirtd.enable = false; + #virtualisation.libvirtd.qemuOvmf = false; + #virtualisation.libvirtd.qemuVerbatimConfig = '' + # user = "jb55" + # group = "kvm" + # cgroup_device_acl = [ + # "/dev/input/by-id/usb-Topre_Corporation_Realforce-event-kbd", + # "/dev/input/by-id/usb-Razer_Razer_DeathAdder_2013-event-mouse", + # "/dev/null", "/dev/full", "/dev/zero", + # "/dev/random", "/dev/urandom", + # "/dev/ptmx", "/dev/kvm", "/dev/kqemu", + # "/dev/rtc","/dev/hpet", "/dev/sev" + # ] + #''; systemd.user.services.btc-ban-aws = { enable = if extra.is-minimal then false else true; @@ -251,7 +254,7 @@ in environment.systemPackages = [ pkgs.virt-manager ]; - services.minecraft-server.enable = true; + services.minecraft-server.enable = false; services.minecraft-server.eula = true; services.minecraft-server.openFirewall = true; services.minecraft-server.declarative = true; diff --git a/nix-config/machines/monad/hardware/default.nix b/nix-config/machines/monad/hardware/default.nix @@ -2,13 +2,13 @@ { boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" "amdgpu" "vfio-pci" ]; - boot.initrd.preDeviceCommands = '' - DEVS="0000:27:00.0 0000:27:00.1" - for DEV in $DEVS; do - echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override - done - modprobe -i vfio-pci - ''; + #boot.initrd.preDeviceCommands = '' + # DEVS="0000:27:00.0 0000:27:00.1" + # for DEV in $DEVS; do + # echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override + # done + # modprobe -i vfio-pci + #''; boot.kernelParams = [ "amdgpu.gpu_recovery=1" ]; boot.kernelModules = [ "kvm-amd" "kvm-intel" ]; @@ -25,16 +25,16 @@ fsType = "zfs"; }; - #fileSystems."/chonk" = - # { device = "chonk"; - # fsType = "zfs"; - # }; - fileSystems."/zbig" = { device = "zbig"; fsType = "zfs"; }; + #fileSystems."/chonk" = + # { device = "chonk"; + # fsType = "zfs"; + # }; + # 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 @@ -31,34 +31,36 @@ let ports = { lightning = 9735; lightningt = 9736; - lightning_websocket = 8756; + lightning_websocket = 8324; lntun = 7878; dns = 53; http = 80; wireguard = 51820; weechat = 9000; nncp = 5442; + starbound = 21025; inherit (extra.private) notify-port; }; - firewallRules = [ - "nixos-fw -s 10.100.0.0/24,192.168.87.1/24 -p tcp --dport 8080 -j nixos-fw-accept" # dev - "nixos-fw -s 10.100.0.0/24,192.168.87.1/24 -p tcp --dport 5442 -j nixos-fw-accept" + firewallRules = (with ports; [ + "nixos-fw -s 10.100.0.0/24,192.168.86.1/24 -p tcp --dport 8080 -j nixos-fw-accept" # dev + "nixos-fw -s 10.100.0.0/24,192.168.86.1/24 -p tcp --dport 5442 -j nixos-fw-accept" + "nixos-fw -s 10.100.0.0/24,192.168.86.1/24 -p tcp --dport ${toString starbound} -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 - "nixos-fw -s 10.100.0.0/24,192.168.87.1/24 -p tcp --dport 8332 -j nixos-fw-accept" # bitcoin-rpc + "nixos-fw -s 10.100.0.2/32 -p tcp --dport ${toString lntun} -j nixos-fw-accept" + "nixos-fw -s 10.100.0.0/24 -p tcp --dport ${toString weechat} -j nixos-fw-accept" + "nixos-fw -s 10.100.0.0/24,192.168.86.1/24 -p tcp --dport 8333 -j nixos-fw-accept" # bitcoin + "nixos-fw -s 10.100.0.0/24,192.168.86.1/24 -p tcp --dport 8332 -j nixos-fw-accept" # bitcoin-rpc "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" "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"; diff --git a/nix-config/machines/quiver/default.nix b/nix-config/machines/quiver/default.nix @@ -11,7 +11,7 @@ extra: environment.systemPackages = with pkgs; [ acpi xorg.xbacklight sshuttle ]; - virtualisation.docker.enable = true; + virtualisation.docker.enable = false; virtualisation.virtualbox.host.enable = false; users.extraGroups.vboxusers.members = [ "jb55" ]; diff --git a/nix-config/nixpkgs/config.nix b/nix-config/nixpkgs/config.nix @@ -15,7 +15,7 @@ in { allowBroken = false; checkMeta = true; zathura.useMupdf = true; - + android_sdk.accept_license = true; packageOverrides = super: rec { qemu = super.qemu.override { diff --git a/nix-config/services/default.nix b/nix-config/services/default.nix @@ -11,8 +11,8 @@ extra: #services.redis.enable = true; services.openssh.enable = true; - services.openssh.passwordAuthentication = false; - services.openssh.permitRootLogin = "no"; + services.openssh.settings.PasswordAuthentication = false; + services.openssh.settings.PermitRootLogin = "no"; services.atd.enable = true;