From 7db704a59c0176d586c44b1013a8731e5439b693 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Mon, 7 Oct 2024 14:50:10 -0500 Subject: [PATCH 1/9] add mlg to trusted on netbox --- boxes/netbox/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/boxes/netbox/default.nix b/boxes/netbox/default.nix index 0363bf9..b32bdc6 100644 --- a/boxes/netbox/default.nix +++ b/boxes/netbox/default.nix @@ -59,6 +59,7 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbhM3wj0oqjR3pUaZgpfX4Xo4dlzvBTbQ48zHyg7Pwx usr" # x230t "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILBGh1FHPneg7PCDkhMs2BCJPTIRVJkRTKpOj1w02ydD usr" # copernicus "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGrpVDLQszFKoYbvYKRyVTTpehxR0BVU47SXkz39l2wK usr" # mainsail + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB2xUbQw9+RCPVw7qCFm4NNCP/MpS2BIArcwMv0KdKOI usr" # mlg "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHZw5bg0TrvSkW/XQa4c+2iLbIKOxfMGbjy5Nb3HSfBv usr" # phone ]; isNormalUser = true; From 22ce9198e8cf4016f79eb50a3fa93cb5b40c89a6 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Mon, 7 Oct 2024 15:15:19 -0500 Subject: [PATCH 2/9] inc flake.lock --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 5fd904d..a08a255 100644 --- a/flake.lock +++ b/flake.lock @@ -41,11 +41,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1726632193, - "narHash": "sha256-oDT1HGKLn3HhzgmYwhSf31Rkpa7K2IBuhMsHGtLfAng=", + "lastModified": 1728307881, + "narHash": "sha256-stJXHgN3twyjLnQQQECa1LgdTyz6JuUHgEf8pjHz/rQ=", "owner": "rycee", "repo": "nur-expressions", - "rev": "b487b142b50bb70d4d1a86625e9de4eff645b4d1", + "rev": "60121cd3a79a4490206e172cbf00160dbc22f503", "type": "gitlab" }, "original": { @@ -93,11 +93,11 @@ ] }, "locked": { - "lastModified": 1726592409, - "narHash": "sha256-2Y6CDvD/BD43WLS77PHu6dUHbdUfFhuzkY8oJAecD/U=", + "lastModified": 1726989464, + "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", "owner": "nix-community", "repo": "home-manager", - "rev": "2ab00f89dd3ecf8012f5090e6d7ca1a7ea30f594", + "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", "type": "github" }, "original": { @@ -199,11 +199,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1726447378, - "narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", + "lastModified": 1728193676, + "narHash": "sha256-PbDWAIjKJdlVg+qQRhzdSor04bAPApDqIv2DofTyynk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", + "rev": "ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6", "type": "github" }, "original": { From b1ab4677ab8013243df6b870ff4f909757cc7c00 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Mon, 7 Oct 2024 22:00:39 -0500 Subject: [PATCH 3/9] enable port 8000 on mlg for testing of web services --- boxes/mlg/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boxes/mlg/default.nix b/boxes/mlg/default.nix index 53a6388..5b93f90 100644 --- a/boxes/mlg/default.nix +++ b/boxes/mlg/default.nix @@ -81,7 +81,7 @@ hostName = "mlg"; firewall = { enable = true; - allowedTCPPorts = [ 6000 ]; + allowedTCPPorts = [ 6000 8000 ]; allowedTCPPortRanges = [ { from = 1714; to = 1764; } # KDE Connect ]; From 4064d774ade63813cc30294288d7ccea8a98491a Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Tue, 8 Oct 2024 17:17:45 -0500 Subject: [PATCH 4/9] add git-annext to mlg --- boxes/mlg/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/boxes/mlg/default.nix b/boxes/mlg/default.nix index 5b93f90..30bcda6 100644 --- a/boxes/mlg/default.nix +++ b/boxes/mlg/default.nix @@ -35,6 +35,7 @@ libreoffice texliveMedium ledger + git-annex ]; services.hardware.bolt.enable = true; # thunderbolt support From 928c65dfc4b64e1e7740d898db2490e0a2e86ddf Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Tue, 8 Oct 2024 18:54:14 -0500 Subject: [PATCH 5/9] add establish-annex-link --- builds/utils/establish-annex-link | 116 ++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100755 builds/utils/establish-annex-link diff --git a/builds/utils/establish-annex-link b/builds/utils/establish-annex-link new file mode 100755 index 0000000..ec89f78 --- /dev/null +++ b/builds/utils/establish-annex-link @@ -0,0 +1,116 @@ +#!/bin/bash + +printf "This tool is for establishing sshfs links to transfer git-annex repo contents.\n" + +printf "server or client?\n" +printf 'EITHER OF `s` or `c`\n' + +read -p "?> " + +case "$REPLY" in + s) + printf "[] ensure that port 22 is unfiltered\n" + sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT + + printf "[] starting sshd\n" + sudo systemctl start sshd + + WIRELESS_INTERFACE=$( + nmcli --get-values GENERAL.DEVICE,GENERAL.TYPE device show | + sed '/^wifi/!{h;d;};x' | + head -n1) + + IP_OF_INTERFACE=$( + ip address show dev $WIRELESS_INTERFACE | + grep 'inet ' | + awk -F' ' '{print $2}' | + awk -F'/' '{print $1}') + + printf "[] instruct client to connect to %s\n" "$IP_OF_INTERFACE" + + printf "[] waiting to stop sshd\n" + + read + + sudo systemctl stop sshd + + printf "[] sshd stopped, but port 22 still open\n" + ;; + c) + printf "What IP to connect to?\n" + printf "ENSURE THAT the IP is accessable on the current VLAN\n" + + printf 'ONE OF `ipv4 address`' + + read -p "?> " ADDRESS + + INFORMED_GUESS=$(ssh usr@$ADDRESS hostname) + if [ -z "$INFORMED_GUESS" ]; then + printf "What hostname?\n" + + mkdir -p ~/annex-remotes + ls ~/annex-remotes + + read -p "?> " REMOTE_HOST + else + REMOTE_HOST=$INFORMED_GUESS + printf "[] using hostname %s\n" "$INFORMED_GUESS" + fi + + printf "[] mounting fs via sshfs\n" + + mkdir -p ~/annex-remotes/$REMOTE_HOST + fusermount3 -qu ~/annex-remotes/$REMOTE_HOST + sshfs usr@$ADDRESS:/home/usr/annex ~/annex-remotes/$REMOTE_HOST + + printf "[] mounted fs\n" + + # check if the fuse mount worked + df_output=$(df -h | grep -c '/home/usr/annex') + if [ "$df_output" -eq 0 ]; then + printf "It seems the sshfs mount didn't work. Exiting.\n" + exit 1 + fi + + # check if we need to make a copy of the annex on the new device + if [ ! -d ~/annex-remotes/$REMOTE_HOST/.git ]; then + printf "Should I do that with the current computer's git-annex store?\n\n" + + printf '`y`) initialize with the local store\n' + printf '`n`) no, just mount the sshfs\n' + + read -p '?> ' + + case $REPLY in + y) + cd ~/annex-remotes/$REMOTE_HOST + printf "[] cloning the local git-annex store\n" + git clone -v ~/annex + + shopt -s dotglob # include dotfiles and dotdirs in wildcard + mv ./annex/* . # move everything up a dir + + if find "annex" -maxdepth 1 -type f -o -type d -empty; then # if annex is empty... + printf "[] removing spurious ./annex directory\n" + rm -r ./annex # ...remove it + fi + + git annex init "$REMOTE_HOST" + cd ~/annex + git remote add $REMOTE_HOST ~/annex-remotes/$REMOTE_HOST + ;; + esac # it's okay that the `n` and `*` cases fall-through + fi + + printf "[] waiting to stop sshfs\n" + + read + + fusermount3 -u ~/annex-remotes/$REMOTE_HOST + + printf "[] unmounted sshfs\n" + ;; + *) + printf "unknown\n" + ;; +esac From 40731b37400f938f899b6e2eaa7fe9d9f24a0ea9 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Tue, 8 Oct 2024 22:28:42 -0500 Subject: [PATCH 6/9] move the winget-list to the out-of-tree directory --- winget-list => boxes/aristotle/out-of-tree/winget-list | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename winget-list => boxes/aristotle/out-of-tree/winget-list (100%) diff --git a/winget-list b/boxes/aristotle/out-of-tree/winget-list similarity index 100% rename from winget-list rename to boxes/aristotle/out-of-tree/winget-list From c569ba00d775ea5c06f1cb9ef48f29dfbaa1a517 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Tue, 8 Oct 2024 22:31:19 -0500 Subject: [PATCH 7/9] move termux stuff to out-of-tree directory --- Makefile => boxes/phone/out-of-tree/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename Makefile => boxes/phone/out-of-tree/Makefile (67%) diff --git a/Makefile b/boxes/phone/out-of-tree/Makefile similarity index 67% rename from Makefile rename to boxes/phone/out-of-tree/Makefile index 47cee80..2acae8c 100644 --- a/Makefile +++ b/boxes/phone/out-of-tree/Makefile @@ -1,10 +1,10 @@ termux: termux-pkgs termux-dots utils-sh st st: - cd builds/st/ && CC=clang make && cp st ~/.local/bin/st + cd ../../../builds/st/ && CC=clang make && cp st ~/.local/bin/st utils-sh: - cp builds/utils/sh/* ~/.local/bin + cp ../../../builds/utils/* ~/.local/bin termux-pkgs: pkg install \ @@ -33,7 +33,7 @@ termux-pkgs: x11-repo termux-dots: - ln -sf $(CURDIR)/.config ~/.config - ln -sf $(CURDIR)/home/ssh/config ~/.ssh/config + ln -sf $(CURDIR)/../../../.config ~/.config + ln -sf $(CURDIR)/../../../home/ssh/config ~/.ssh/config ln -sf ~/.config/bash/bashrc ~/.bashrc ln -sf ~/.config/bash/profile ~/.bash_profile From 542d05f0df6d4a572e03225f53f088f103ce96f2 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Wed, 9 Oct 2024 04:26:18 -0500 Subject: [PATCH 8/9] add nix.gc to netbox configuration --- boxes/netbox/default.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/boxes/netbox/default.nix b/boxes/netbox/default.nix index b32bdc6..d5de83f 100644 --- a/boxes/netbox/default.nix +++ b/boxes/netbox/default.nix @@ -18,13 +18,18 @@ ./franklincce.nix ]; - # nix optimization - nix.optimise = { - automatic = true; - dates = [ "03:45" ]; + nix = { + optimise = { + automatic = true; + dates = [ "02:30" ]; + }; + gc = { + automatic = true; + dates = "03:15"; + options = "-d"; + }; }; - time.timeZone = "America/Chicago"; i18n.defaultLocale = "en_US.UTF-8"; From 4c16d744a45693f61e6d15d5335a4b1d534c66ce Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Tue, 15 Oct 2024 11:31:33 -0500 Subject: [PATCH 9/9] make the phone xorg experience better --- .config/sxhkd/phone | 18 +++++++++++++ .config/sxhkd/phonemouse | 43 ++++++++++++++++++++++++++++++++ boxes/phone/out-of-tree/Makefile | 3 ++- builds/st/config.h | 5 ++++ builds/utils/disp | 6 +++++ 5 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .config/sxhkd/phone create mode 100644 .config/sxhkd/phonemouse diff --git a/.config/sxhkd/phone b/.config/sxhkd/phone new file mode 100644 index 0000000..ee14aa4 --- /dev/null +++ b/.config/sxhkd/phone @@ -0,0 +1,18 @@ +# essentially the same thing as sxhkdrc, but super is replaced with ctrl + b and all shortcuts are chorded +ctrl + b; c + st + +ctrl + b; q + bspc node -c + +ctrl + b; {_,shift + } {1-9,0} + bspc {desktop -f,node -d} '{1-9,10}' + +ctrl + b; {_,ctrl +,shift + }{h,j,k,l} + bspc node -{f,p,s} {west,south,north,east} + +ctrl + b; d + tmenu_run + +ctrl + b; m + mode phonemouse diff --git a/.config/sxhkd/phonemouse b/.config/sxhkd/phonemouse new file mode 100644 index 0000000..3215f79 --- /dev/null +++ b/.config/sxhkd/phonemouse @@ -0,0 +1,43 @@ +# exit mouse mode +w + mode phone + +# move left +{ctrl +,shift +,_} h + xdotool mousemove_relative -- {-5,-50,-20} 0 + +# move down +{ctrl +,shift +,_} j + xdotool mousemove_relative -- 0 {5,50,20} + +# move up +{ctrl +,shift +,_} k + xdotool mousemove_relative -- 0 {-5,-50,-20} + +# move right +{ctrl +,shift +,_} l + xdotool mousemove_relative -- {5,50,20} 0 + +# left, middle, right click +{ctrl +,_} {a,s,d} + xdotool {mousedown,click} {1,2,3} + +# let go of clicked button +q + xdotool mouseup 1; xdotool mouseup 2; xdotool mouseup 3 + +# move the mouse to the top of the window +g ; g + mousehelper top + +# ditto for bottom +G + mousehelper bottom + +# ditto for left +0 + mousehelper left + +# ditto for right +dollar + mousehelper right diff --git a/boxes/phone/out-of-tree/Makefile b/boxes/phone/out-of-tree/Makefile index 2acae8c..ad3cecf 100644 --- a/boxes/phone/out-of-tree/Makefile +++ b/boxes/phone/out-of-tree/Makefile @@ -1,7 +1,7 @@ termux: termux-pkgs termux-dots utils-sh st st: - cd ../../../builds/st/ && CC=clang make && cp st ~/.local/bin/st + cd ../../../builds/st/ && CFLAGS="-DIS_PHONE" CC=clang make && cp st ~/.local/bin/st utils-sh: cp ../../../builds/utils/* ~/.local/bin @@ -9,6 +9,7 @@ utils-sh: termux-pkgs: pkg install \ neovim \ + xdotool \ git \ tig \ tigervnc \ diff --git a/builds/st/config.h b/builds/st/config.h index b1f9552..6721eb9 100644 --- a/builds/st/config.h +++ b/builds/st/config.h @@ -3,7 +3,12 @@ /* * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ +#ifdef IS_PHONE +static char *font = "Monospace:pixelsize=34:antialias=true:autohint=true"; +#else static char *font = "Fantasque Sans Mono:pixelsize=14:antialias=true:autohint=true"; +#endif + static int borderpx = 2; /* diff --git a/builds/utils/disp b/builds/utils/disp index f89e066..5954f38 100755 --- a/builds/utils/disp +++ b/builds/utils/disp @@ -186,6 +186,12 @@ case "$(hostname)" in dunst & disown phone pair & disown ;; + "localhost") # phone in termux + pkill sxhkd + sxhkd -c ~/.config/sxhkd/phone & disown + + xrandr --output VNC-0 --mode 1920x1080 + bspc monitor VNC-0 -d 1 2 3 4 5 6 7 8 9 esac # initial post-wm setup