From e7bcf1fbc117abbdc536349578e20935ad1c53bd Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Fri, 24 Oct 2025 01:50:27 -0400 Subject: [PATCH 01/24] generation 535 25.11.20250714.62e0f05 --- hosts/meta.nix | 10 ++++++++++ secrets/ip-cmu.age | 5 +++++ secrets/ip-master-k3s.age | Bin 0 -> 227 bytes secrets/secrets.nix | 2 ++ 4 files changed, 17 insertions(+) create mode 100644 secrets/ip-cmu.age create mode 100644 secrets/ip-master-k3s.age diff --git a/hosts/meta.nix b/hosts/meta.nix index 7577bb6..0ea6a12 100644 --- a/hosts/meta.nix +++ b/hosts/meta.nix @@ -35,6 +35,16 @@ owner = "synchronous"; mode = "0400"; }; + ip-master-k3s = { + file = ../secrets/ip-master-k3s.age; + owner = "synchronous"; + mode = "0400"; + }; + ip-cmu = { + file = ../secrets/ip-cmu.age; + owner = "synchronous"; + mode = "0400"; + }; }; secretsDir = "/home/synchronous/.agenix/agenix"; secretsMountPoint = "/home/synchronous/.agenix/agenix.d"; diff --git a/secrets/ip-cmu.age b/secrets/ip-cmu.age new file mode 100644 index 0000000..6b2a0fc --- /dev/null +++ b/secrets/ip-cmu.age @@ -0,0 +1,5 @@ +age-encryption.org/v1 +-> ssh-ed25519 1qNjsw iIlHsfHTOuuIYQREkl1jdSuHm03aLZFqDmhj2Ngx234 +BgmH1kx6pxDIBpyn2qpM6vTtAcJLxKqcIMn/LT7jLsw +--- ySOiv2BxTZC2/SIcq4cUJPlSYecE15wyf8w0/LJmptM +#þï½P~dá×I:ó&6 0bG28y™Ñ*.a1hœŸÃIŸA³7Jüw!°à \ No newline at end of file diff --git a/secrets/ip-master-k3s.age b/secrets/ip-master-k3s.age new file mode 100644 index 0000000000000000000000000000000000000000..73cd9cbf8f33d2c29610cf41a59e7d3cc86cb4bf GIT binary patch literal 227 zcmV<90382eXJsvAZewzJaCB*JZZ2y|6b9W$a zGigpsOLa3#PI^Q%Gg@?2NMcJdd3j`1X;e^7Ic8NwS$TFXNNie3P(^8GQgUTca%4zkSWOBoEiE8-Ib>C0Q$#gRT1a_H zW;AG6cY1SaXjfWEXl5@nN?2JoOJq%JYHxWpICl#AG=dPb?2KFb9H|4Ueq>a3cd#We dLY}d`P2}{s=ENP_01C{ugB+)H4I}_g6l2~&P^bU^ literal 0 HcmV?d00001 diff --git a/secrets/secrets.nix b/secrets/secrets.nix index d4c6ae4..56c0439 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -6,4 +6,6 @@ in { "tailscale-rq.age".publicKeys = [key]; "ssh-pub.age".publicKeys = [key]; "kube.age".publicKeys = [key]; + "ip-master-k3s.age".publicKeys = [key]; + "ip-cmu.age".publicKeys = [key]; } From e544178a170ab2bf947552e06600ea7607e1753e Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Fri, 24 Oct 2025 02:06:30 -0400 Subject: [PATCH 02/24] generation 536 25.11.20250714.62e0f05 --- home/scripts/brainrot-transfer.sh | 75 +++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 home/scripts/brainrot-transfer.sh diff --git a/home/scripts/brainrot-transfer.sh b/home/scripts/brainrot-transfer.sh new file mode 100644 index 0000000..38fa4a9 --- /dev/null +++ b/home/scripts/brainrot-transfer.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +# --- CONFIGURATION --- +ip=$(cat /home/synchronous/.agenix/agenix/ip-master-k3s) +SSH_TARGET="synchronous@$ip" +NAMESPACE="ingress-nginx" +POD_LABEL="app=pvc-explorer" +TARGET_DIR="/data" +# --------------------- + +# 1. Check for an argument +LOCAL_PATH="$1" +if [ -z "$LOCAL_PATH" ]; then + echo "Usage: $0 " + exit 1 +fi + +if [ ! -e "$LOCAL_PATH" ]; then + echo "Error: Local path not found: $LOCAL_PATH" + exit 1 +fi + +# Define a unique name for the temporary archive +TEMP_ARCHIVE="kube_cp_temp_$(date +%s).tar.gz" + +# --- PART 1: Create local archive --- +echo "[Local] Creating temporary archive: $TEMP_ARCHIVE" +tar czf "$TEMP_ARCHIVE" "$LOCAL_PATH" +if [ $? -ne 0 ]; then + echo "Error: Failed to create local archive." + rm -f "$TEMP_ARCHIVE" # Clean up on failure + exit 1 +fi + +# --- PART 2: Copy archive to remote machine --- +echo "[Local] Copying archive to $SSH_TARGET:~/ " +scp "$TEMP_ARCHIVE" "$SSH_TARGET:~/$TEMP_ARCHIVE" +if [ $? -ne 0 ]; then + echo "Error: Failed to scp archive to remote machine." + rm -f "$TEMP_ARCHIVE" # Clean up local + exit 1 +fi + +# --- PART 3: Execute remote commands --- +echo "[Local] Connecting via SSH to import archive... You will be prompted for your SUDO password." + +# Define the set of commands to run on the remote machine +REMOTE_CMD=$(cat <&2 + rm -f ~/"$TEMP_ARCHIVE" # Clean up remote archive + exit 1 +fi + +echo "[Remote] Found pod: \$POD_NAME" +echo "[Remote] Streaming archive from ~/$TEMP_ARCHIVE into pod..." +cat ~/"$TEMP_ARCHIVE" | sudo kubectl exec -i \$POD_NAME -n "$NAMESPACE" -- tar xzf - -C "$TARGET_DIR" + +echo "[Remote] Cleaning up remote archive..." +rm ~/"$TEMP_ARCHIVE" +echo "[Remote] Transfer complete." +EOF +) + +# Run the remote commands +ssh -tt "$SSH_TARGET" "$REMOTE_CMD" + +# --- PART 4: Local cleanup --- +echo "[Local] Cleaning up local archive: $TEMP_ARCHIVE" +rm "$TEMP_ARCHIVE" + +echo "[Local] All done." From eb066c5712329e8f47169b510f9cfa34c52c8b2c Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Fri, 24 Oct 2025 02:08:52 -0400 Subject: [PATCH 03/24] generation 537 25.11.20250714.62e0f05 --- home/scripts/brainrot-transfer.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/home/scripts/brainrot-transfer.sh b/home/scripts/brainrot-transfer.sh index 38fa4a9..36bf570 100644 --- a/home/scripts/brainrot-transfer.sh +++ b/home/scripts/brainrot-transfer.sh @@ -1,5 +1,3 @@ -#!/bin/bash - # --- CONFIGURATION --- ip=$(cat /home/synchronous/.agenix/agenix/ip-master-k3s) SSH_TARGET="synchronous@$ip" From fb98f0e01a17d6169e583718be6fb6b13762b89e Mon Sep 17 00:00:00 2001 From: JakeGinesin Date: Fri, 31 Oct 2025 18:53:07 -0400 Subject: [PATCH 04/24] add store --- flake.nix | 2 +- hosts/store/configuration.nix | 37 +++++++++++++++++++++++++ hosts/store/hardware-configuration.nix | 36 ++++++++++++++++++++++++ secrets/tailscale-rq.age | Bin 275 -> 275 bytes 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 hosts/store/configuration.nix create mode 100644 hosts/store/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index d5d4fd3..2372f80 100644 --- a/flake.nix +++ b/flake.nix @@ -36,7 +36,7 @@ system = "x86_64-linux"; # hostnames - hosts = ["thonkpad" "rq" "yoga" "server1" "server2" "server3"]; + hosts = ["thonkpad" "rq" "yoga" "server1" "server2" "server3" "store"]; baseModule = {lib, ...}: { imports = [ diff --git a/hosts/store/configuration.nix b/hosts/store/configuration.nix new file mode 100644 index 0000000..d1226da --- /dev/null +++ b/hosts/store/configuration.nix @@ -0,0 +1,37 @@ +{ + config, + pkgs, + lib, + ... +}: { + imports = [ + ./hardware-configuration.nix + ../../system/system-server.nix + ../meta.nix + ../../extras/ssh.nix + ../../extras/k3s-node.nix + ]; + + config = { + networking.hostName = "store"; # Define your hostname. + res = "1920x1080"; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "backup"; + users.synchronous.imports = [../../home/home.nix]; + }; + + # Bootloader. + #boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.useOSProber = true; + boot.loader.grub.version = 2; + # services.logind.lidSwitchExternalPower = "ignore"; + + boot.loader.systemd-boot.enable = false; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub.enable = true; + }; +} diff --git a/hosts/store/hardware-configuration.nix b/hosts/store/hardware-configuration.nix new file mode 100644 index 0000000..a829d33 --- /dev/null +++ b/hosts/store/hardware-configuration.nix @@ -0,0 +1,36 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/bb36a123-4dc9-4583-8571-1aa180efb00b"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/78565ab8-d7b8-476d-a6e7-46ceda4ee761"; } + { device = "/dev/disk/by-uuid/c735b357-c35c-4249-bb0b-23321fe50c3d"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.eno2.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/secrets/tailscale-rq.age b/secrets/tailscale-rq.age index b97303cfa62c4bf4ceea5146ef02cb07e1e99faa..3d1f46499c2f051ff5cf71320dab2ddc0a92c8a1 100644 GIT binary patch delta 239 zcmVMaYFBqFQEEz9OHoZmLRU|ENO@#KZ*fsbI0`K- zEg)!5RZ@6FLN{0|T2C}lM{`d{FhomadM{~uPE|2lO>0+3HfV8lZfHhjQc()V&{vGr zJ4+P?pS)Gvuz>Kq%_1R)b;-gcQq#J=2t4X;g2hutOMxEzF;}-$K>!^V7{7wC?C+v< pukX%K@XQf_SzExwDCJTn!N%P9G{DI3JOR{M2Xd#+YAq1mEb<8mU%&tW delta 239 zcmVmXLwaXzOGPAUFbXndLq>CVW=M8RdT&Q}HduIJFKTIV)>HPBB7yXgG9HSqd#J zEg)k;VL>=oQ#N*PYiV_1ZFy5vMKd-;aac8BPg+KBc4#YEY-n0&IW}1^cr*&vGmOp? zpgE9ny&lYT_J5>0N3B0-!5xUDC1wtqN+RE6Ta^F+ From fc352f3d2914b2341a13e58d5c5034064a0f4744 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Wed, 12 Nov 2025 20:33:01 -0500 Subject: [PATCH 05/24] generation 541 25.11.20250714.62e0f05 --- home/home.nix | 2 ++ home/scripts/macflip.sh | 2 +- hosts/store/hardware-configuration.nix | 38 ++++++++++++++------------ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/home/home.nix b/home/home.nix index f98417a..fb88e5d 100644 --- a/home/home.nix +++ b/home/home.nix @@ -120,6 +120,8 @@ in { yq semgrep tectonic + electrum + feather # texlive.combined.scheme-full # security diff --git a/home/scripts/macflip.sh b/home/scripts/macflip.sh index 79ab8f2..911ed6d 100644 --- a/home/scripts/macflip.sh +++ b/home/scripts/macflip.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash newmac=$1 -suod ip link set wlan0 down +sudo ip link set wlan0 down sudo macchanger wlan0 --mac "$1" sudo ip link set wlan0 up diff --git a/hosts/store/hardware-configuration.nix b/hosts/store/hardware-configuration.nix index a829d33..495d0fb 100644 --- a/hosts/store/hardware-configuration.nix +++ b/hosts/store/hardware-configuration.nix @@ -1,27 +1,31 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["uhci_hcd" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/bb36a123-4dc9-4583-8571-1aa180efb00b"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/bb36a123-4dc9-4583-8571-1aa180efb00b"; + fsType = "ext4"; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/78565ab8-d7b8-476d-a6e7-46ceda4ee761"; } - { device = "/dev/disk/by-uuid/c735b357-c35c-4249-bb0b-23321fe50c3d"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/78565ab8-d7b8-476d-a6e7-46ceda4ee761";} + {device = "/dev/disk/by-uuid/c735b357-c35c-4249-bb0b-23321fe50c3d";} + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's From f99b4d536838290500976796051c6e4ad547d2c0 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Wed, 12 Nov 2025 20:47:56 -0500 Subject: [PATCH 06/24] generation 542 25.11.20250714.62e0f05 --- home/home.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/home.nix b/home/home.nix index fb88e5d..2d228aa 100644 --- a/home/home.nix +++ b/home/home.nix @@ -122,6 +122,7 @@ in { tectonic electrum feather + gnupg # texlive.combined.scheme-full # security From dbeedcb647d864f0aefb73fa3a88444763703867 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Wed, 12 Nov 2025 21:01:49 -0500 Subject: [PATCH 07/24] generation 543 25.11.20250714.62e0f05 --- system/system.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/system.nix b/system/system.nix index 2baf50f..f3058c5 100644 --- a/system/system.nix +++ b/system/system.nix @@ -48,6 +48,11 @@ services.printing.enable = true; hardware.bluetooth.enable = true; programs.dconf.enable = true; + services.pcscd.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; xdg.mime.defaultApplications = { "application/pdf" = "firefox.desktop"; From 8d298829b43bb62b423439230c65f93d19a341f5 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Wed, 12 Nov 2025 22:10:19 -0500 Subject: [PATCH 08/24] generation 544 25.11.20250714.62e0f05 --- home/home.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/home.nix b/home/home.nix index 2d228aa..cdb37dd 100644 --- a/home/home.nix +++ b/home/home.nix @@ -53,7 +53,7 @@ in { home.sessionVariables = { EDITOR = "nvim"; - SHELL = "zsh"; + SHELL = "/etc/profiles/per-user/synchronous/bin/zsh"; # just zsh no longer works? HOME = "/home/synchronous"; # XDG_CACHE_HOME = "$HOME/.cache"; DBUS_SESSION_BUS_ADDRESS = "unix:path=$XDG_RUNTIME_DIR/bus"; From 35f493aa9c5f7a68833e04a65480c9afe1367244 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Tue, 18 Nov 2025 02:07:36 -0500 Subject: [PATCH 09/24] generation 545 25.11.20250714.62e0f05 --- home/scripts/security/wpcap.sh | 2 -- secrets/zsh_remote.age | Bin 1151 -> 1768 bytes 2 files changed, 2 deletions(-) diff --git a/home/scripts/security/wpcap.sh b/home/scripts/security/wpcap.sh index 71247ba..0c2c291 100644 --- a/home/scripts/security/wpcap.sh +++ b/home/scripts/security/wpcap.sh @@ -1,5 +1,3 @@ -#!/bin/bash - if [[ $EUID -ne 0 ]]; then echo "This script must be run as root." exit 1 diff --git a/secrets/zsh_remote.age b/secrets/zsh_remote.age index 222be25ea73711631ab1974f20e88ed325bdc19f..2af809ee757b4df4cc72333e0010bca26bca1950 100644 GIT binary patch delta 1744 zcmV;>1~2*l2tR4+qIX9_JX zEg&^@QD}2@Q$}b>S2HtAQfhToOjJ!$FlkRiF)>tXZEP@jczm)9at(fy`CDEoPRzzN>dCNd6nl30(XzxyTSc%{AX%o9SJ^9q`FH zPTC5^OU$ZTPk(vGWfB}eI&e)5&5OkL{--pwQe3f@oc!CsSA@>mV8KU*klz$lsuA9g zT$!HMFfA03n(}y^{O0aHssMjdy}L9rfU+-wZP)UIJbq+g%h$ z?1c-@3Bqf*WU<)sGyd}w+G}O!E~{VAX>>+Jz54R_g@4a|l&=plw|knxQQTZB7_}H+ zbXFnQ8+XLtNew21+b+|n8$;jOZd0<7Tu9!Lb99D#l<*twf<>mWM(Z(7YevsOBjF2r`~teD2*1uXad9cQKe2Qc~K@^SZs+Y}Pove(po%5rqO5PV=j zcGT9)!gLMOqw=@Lch!Nv*`1so*5c3*!<>$1xW4Wdxs-}s* z0#vQaBC{6fvb}vzl9wNqBp1gz1@;EEYFZ`JoGfO=EI~_j8GZhL2_l`KpofiH;=W;s z9^1u9Jl!CqJ@0uZ*RC)98;s}zzV(i#KtANZX0*=+K=!#7# znx#Srx_}5*+KZjkur!dzwe7osvLAb|IDazs`m_H4p)>fP!<&;SV#C1PeK#NBTVDa& zsS_0hs^b*_>)`_UgT8Fb&v=iICizJo*>cCSXUYk;^wyq#>ke*|fP(a3pnAi{vf*8M zp>4;YlNyKDdJLd3tB2}PA;i*_yFneF1ky~GNtHmixX+5xEZqv2R&Wwzw~webQGfe* z_wosNNSjoT(Cun+G zxI}H^x2_6HaQ$T%E5MEHldLz|nmqQ0a=O zSvskp{27?h`&h=BRXwq=i12wJn{Wf+#xM##*x}mur-}|T3_DnwjoBV@aMY`^*UMyf z`oIanqxG=F!n+9Claxd#4%HtIZpI&gzbA6zd)363E`P4ryQE7`7MWWQ z@;K7VH)w|SiMuo7r@J?0IdL_vFpf0I>Hv?c^RTYSux1;yX)xhJK2P-w-3l#>D{NeB z3FyLvrCgb}$0KB9C+AP!I03T;&!DD)ZpmFAxFRFDdrUhd@BWoRBWct m2L`Cx#H?b+#;FNa^0Mk0HebFB57%l+7c3!eaLFgNFk(F{(q`=d delta 1122 zcmV-o1fBcn4gUy`EPpFEbY*6FNp56LP;Yu!H8f30RcKL9c5hiobZ%l$NKwNfwttT|bh}DJ(v{M$;P-phYCo22u2V_>{Fqo69m&asw!HNW}!~>S3L)&SwwBPep!8we6e*XDyb8>sn zLJ58Qn70VtX)0N#GKrZly^!YVA;kUv6B2?dx&$Prcz?fuyQf`M!vtFsO~PmNUY3Sw z8E3^c2S<4-AyIO&*NM0#N`TILCCg>)opIcODwcoHey*|?33Y(oz^xXSLmy6Bu84qjvZH~QQpmQ_@oxC9{7!xBot0KeRHTpv+qJ9=q z&V7fG(0`FS9I8$T7hWh+jT!2FTKTtE2Qopt;DKO<=4I&Bm|D}fl4HlwFV<~CURIq# zj4QIX!>^`mjuel=oH)K%EtAtA&`EL_R05U8Jze#*W|Bj>Tn;z=8~n{kp7A*#sFq=3dRqtWXn$fkCwYTn}D);;o=x3!e={Y%G@&UE&R2VCitMyQ8eL`oVMQX5A zC0j*$V>PfEQ0R8dK*0LaI4w3%;66Ny Date: Wed, 3 Dec 2025 22:50:31 -0500 Subject: [PATCH 10/24] generation 546 25.11.20250714.62e0f05 --- home/programs/sxhkd/sxhkdrc | 3 + home/scripts/daily.sh | 59 +++++++++++++++++++ home/scripts/idk.sh | 25 ++++++++ home/scripts/journal/nf.sh | 8 +++ .../security/{sg.sh => semgrep-auto.sh} | 0 5 files changed, 95 insertions(+) create mode 100644 home/scripts/daily.sh create mode 100644 home/scripts/idk.sh rename home/scripts/security/{sg.sh => semgrep-auto.sh} (100%) diff --git a/home/programs/sxhkd/sxhkdrc b/home/programs/sxhkd/sxhkdrc index 8c1a5d9..deae6d7 100644 --- a/home/programs/sxhkd/sxhkdrc +++ b/home/programs/sxhkd/sxhkdrc @@ -186,6 +186,9 @@ super + bracket{left,right} super + {o} sh nf daily +super + {i} + sh nf idk + # open my notes without goyo and with nvimteee super + {shift} + {o} sh nf daily diff --git a/home/scripts/daily.sh b/home/scripts/daily.sh new file mode 100644 index 0000000..288d341 --- /dev/null +++ b/home/scripts/daily.sh @@ -0,0 +1,59 @@ +# get today's date +curr=$(date +%y-%m-%d) +curr_bigyear=$(date +%Y-%m-%d) +# echo "$curr" +curr_pretty=$(date "+%A, %B %d %G") +curr_onenumber=$(date +%Y%m%d) +echo "Today: $curr_pretty" + +# get written journal lines +journal_len=$(wc /home/synchronous/journal/daily.md | awk '{print $1}') +journal_date_area=$(rg 25-12-03 /home/synchronous/journal/daily.md -n -o | sed 's/:/ /' | awk '{print $1}') +journal="" +if [[ $journal_date_area == "" ]]; then + journal="No writing in the journal yet today.." +else + jd_diff=$(echo "$journal_len - $journal_date_area" | bc) + journal="You've written $jd_diff journal line(s)" +fi + +# get todos for today +todo_len=$(awk '!NF { print NR; exit }' /home/synchronous/journal/todo.md) +todo_len_1=$(echo "$todo_len" - 1 | bc) +todo_len_2=$(echo "$todo_len" - 2 | bc) +todos=$(head /home/synchronous/journal/todo.md -n "$todo_len_1" | tail -n "$todo_len_2") + +# choose idk based on psuedorandom seeded with date +idk_len=$(wc -l /home/synchronous/journal/rest/idk.md | awk '{print $1'}) +idk_date=$(date +%Y%m%d) +idk_pseudo=$(python3 -c "import math; import random; random.seed($idk_date); print( math.floor(random.random() * 10000) % $idk_len)") +idk=$(sed -n '7 p' /home/synchronous/journal/rest/idk.md | cut -c3-) + +# check if there exists a .daily in home for this day +daily_date=$(stat -c "%y" /home/synchronous/.daily | awk '{print $1}') +if [[ $daily_date != $curr_bigyear ]]; then + rm /home/synchronous/.daily + touch /home/synchronous/.daily + + # set idk + echo "- idk: $idk" >> /home/synchronous/.daily +else + idk_prev=$(rg idk /home/synchronous/.daily | cut -c8-) # take existing idk + if [[ $idk_prev != $idk ]]; then + idk="$idk_prev [done!]" + fi +fi + +echo + +# echo $idk + +echo "Lore for today:" +echo "- idk: $idk" +echo "- $journal" + +echo + +# TODOS SETUP +echo "Todos for today ($todo_len_2 items):" +echo "$todos" diff --git a/home/scripts/idk.sh b/home/scripts/idk.sh new file mode 100644 index 0000000..640dc16 --- /dev/null +++ b/home/scripts/idk.sh @@ -0,0 +1,25 @@ +add_idk() { + if [[ "$1" == "" ]]; then + echo "Empty entry" + exit 0 + fi + fq=$(rg "$1" /home/synchronous/journal/rest/idk.md 2> /dev/null) + if [[ "$fq" != "" ]]; then + echo "Entry already present" + exit 0 + fi + echo "- $1" >> /home/synchronous/journal/rest/idk.md + echo "Added entry: '$1'" + idk_len=$(wc -l /home/synchronous/journal/rest/idk.md | awk '{print $1}') + echo "You do not know $idk_len things!" +} + +run_command() { + case $1 in + "add") add_idk "$2" ;; + "del") remove_idk "$2" ;; + *) + esac +} + +run_command "$1" "$2" diff --git a/home/scripts/journal/nf.sh b/home/scripts/journal/nf.sh index 924b9da..f4477b0 100644 --- a/home/scripts/journal/nf.sh +++ b/home/scripts/journal/nf.sh @@ -44,6 +44,13 @@ open_daily() { -c "lua vim.g.goyo_if = 1" &! } +open_idk() { + alacritty -t "idk.md" -e nvim "$main/rest/idk.md" \ + -c "Goyo | set wrap | set path+=$main_dir" \ + -c "execute 'normal G'" \ + -c "lua vim.g.goyo_if = 1" &! +} + open_todo() { alacritty -t "todo.md" -e nvim "$main/todo.md" \ -c "execute 'lua vim.g.goyo_if = 1' | set wrap | Goyo | set path+=$main_dir" &! @@ -157,6 +164,7 @@ run_command() { "search") search ;; "daily") open_daily ;; "todo") open_todo ;; + "idk") open_idk ;; "find") notes_find ;; "tags") search_by_tags ;; "title") search_by_title ;; diff --git a/home/scripts/security/sg.sh b/home/scripts/security/semgrep-auto.sh similarity index 100% rename from home/scripts/security/sg.sh rename to home/scripts/security/semgrep-auto.sh From 8aa3987c1b91600cf87649366f5a377bfbc5e4da Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Wed, 10 Dec 2025 16:37:24 -0500 Subject: [PATCH 11/24] generation 547 25.11.20250714.62e0f05 --- home/programs/sxhkd/sxhkdrc | 5 ++++- home/programs/zsh/zshrc | 9 +++++++++ home/scripts/journal/nf.sh | 9 +++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/home/programs/sxhkd/sxhkdrc b/home/programs/sxhkd/sxhkdrc index deae6d7..6536ae3 100644 --- a/home/programs/sxhkd/sxhkdrc +++ b/home/programs/sxhkd/sxhkdrc @@ -186,7 +186,10 @@ super + bracket{left,right} super + {o} sh nf daily -super + {i} +super + {;} + sh nf idk + +super + {m} sh nf idk # open my notes without goyo and with nvimteee diff --git a/home/programs/zsh/zshrc b/home/programs/zsh/zshrc index 9018a4b..8e3fc37 100644 --- a/home/programs/zsh/zshrc +++ b/home/programs/zsh/zshrc @@ -220,11 +220,20 @@ alias dnsblock-add="nvim /home/synchronous/nix-cfg/system/networking/blockers.sh alias focus-wifi="nvim /home/synchronous/nix-cfg/system/networking/blockers.sh" alias verus-dir="cd /home/synchronous/code/verus" alias cure="cd /home/synchronous/code/cure53" +alias scripts="cd /home/synchronous/nix-cfg/home/scripts" +alias bookmarks="vim -c '80' /home/synchronous/nix-cfg/home/programs/firefox/default.nix" stack() { find . -type f -exec echo -e "\n--- {} ---\n" \; -exec cat {} \; } +stack-fast() { + rg -l . | while read -r file; do + echo -e "\n--- $file ---\n" + cat "$file" + done +} + stack-b() { ( while IFS= read -r -d '' file; do diff --git a/home/scripts/journal/nf.sh b/home/scripts/journal/nf.sh index f4477b0..a806c31 100644 --- a/home/scripts/journal/nf.sh +++ b/home/scripts/journal/nf.sh @@ -159,6 +159,14 @@ search_by_title() { fi } +open_misc() { + tf=$(mktemp --suffix=.md) + # sh -c keeps window open for nvim, then deletes file immediately on exit + alacritty -t "scratch" -e sh -c "nvim '$tf' \ + -c 'execute \"lua vim.g.goyo_if = 1\" | Goyo | set wrap | autocmd BufEnter * let b:coc_suggest_disable=1'; \ + rm '$tf'" &! +} + run_command() { case $1 in "search") search ;; @@ -168,6 +176,7 @@ run_command() { "find") notes_find ;; "tags") search_by_tags ;; "title") search_by_title ;; + "misc") open_misc ;; *) esac } From 4eae53c82a83f068ebca1a1c81ce2849b1ead347 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Wed, 10 Dec 2025 16:44:35 -0500 Subject: [PATCH 12/24] generation 548 25.11.20250714.62e0f05 --- home/programs/sxhkd/sxhkdrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home/programs/sxhkd/sxhkdrc b/home/programs/sxhkd/sxhkdrc index 6536ae3..8b22592 100644 --- a/home/programs/sxhkd/sxhkdrc +++ b/home/programs/sxhkd/sxhkdrc @@ -186,11 +186,11 @@ super + bracket{left,right} super + {o} sh nf daily -super + {;} +super + semicolon sh nf idk super + {m} - sh nf idk + sh nf misc # open my notes without goyo and with nvimteee super + {shift} + {o} From cb059e5f587ce2ca5056775c7ff6a70deecad800 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Wed, 17 Dec 2025 18:02:19 -0500 Subject: [PATCH 13/24] generation 549 25.11.20250714.62e0f05 --- home/programs/firefox/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/home/programs/firefox/default.nix b/home/programs/firefox/default.nix index cd99a87..f708454 100644 --- a/home/programs/firefox/default.nix +++ b/home/programs/firefox/default.nix @@ -210,6 +210,10 @@ in { name = "verus github"; url = "https://github.com/verus-lang/verus"; } + { + name = "secure foundations"; + url = "https://github.com/secure-foundations"; + } ]; } { From 9670a56ed9677ca3f37e2799bdb5ff3479d35f77 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Thu, 18 Dec 2025 03:13:21 -0500 Subject: [PATCH 14/24] generation 550 25.11.20250714.62e0f05 --- home/programs/nvim/plugins/smear.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/home/programs/nvim/plugins/smear.lua b/home/programs/nvim/plugins/smear.lua index 655f39b..b8d6bc1 100644 --- a/home/programs/nvim/plugins/smear.lua +++ b/home/programs/nvim/plugins/smear.lua @@ -2,6 +2,7 @@ require('smear_cursor').setup({ scroll_buffer_space = false, smear_between_buffers = false, smear_between_neighbor_lines = false, + scroll_buffer_space = true, stiffness = 0.5, trailing_stiffness = 0.5, matrix_pixel_threshold = 0.5, From 11607d24a4816299460751840b9bc2c20d2aabca Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Thu, 18 Dec 2025 03:21:30 -0500 Subject: [PATCH 15/24] generation 551 25.11.20250714.62e0f05 --- home/programs/nvim/default.nix | 4 ++++ home/programs/nvim/plugins/markdown-preview-nvim.lua | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 home/programs/nvim/plugins/markdown-preview-nvim.lua diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index 405c611..39ae2e6 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -86,6 +86,10 @@ # plugin = vim-airline; # config = toLuaFile ./plugins/airline.lua; # } + { + plugin = markdown-preview-nvim; + config = toLuaFile ./plugins/markdown-preview-nvim.lua; + } { plugin = barbar-nvim; config = toLuaFile ./plugins/barbar.lua; diff --git a/home/programs/nvim/plugins/markdown-preview-nvim.lua b/home/programs/nvim/plugins/markdown-preview-nvim.lua new file mode 100644 index 0000000..a742414 --- /dev/null +++ b/home/programs/nvim/plugins/markdown-preview-nvim.lua @@ -0,0 +1,4 @@ +-- browser +vim.g.mkdp_browser = "firefox" +-- keybindings +vim.keymap.set("n", "m", "MarkdownPreview") From 2aab3f2174d29fbcd506ae72768511952bcacf72 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Thu, 18 Dec 2025 03:31:28 -0500 Subject: [PATCH 16/24] generation 552 25.11.20250714.62e0f05 --- home/programs/nvim/default.nix | 1 + home/programs/nvim/init.lua | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index 39ae2e6..cff0689 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -41,6 +41,7 @@ vim-airline-themes plenary-nvim nvim-web-devicons + texpresso-vim { plugin = smear-cursor-nvim; config = toLuaFile ./plugins/smear.lua; diff --git a/home/programs/nvim/init.lua b/home/programs/nvim/init.lua index 653d883..59a2fdc 100644 --- a/home/programs/nvim/init.lua +++ b/home/programs/nvim/init.lua @@ -165,6 +165,29 @@ vim.api.nvim_create_autocmd("FileType", { command = "setlocal wrap" }) +vim.api.nvim_create_autocmd("FileType", { + desc = "texpresso compile", + group = "vimrc", + pattern = "tex", + callback = function(args) + -- start server on first BufWrite + vim.api.nvim_create_autocmd("BufWritePost", { + group = vim.api.nvim_create_augroup( + string.format("latex", args.buf), + { clear = true } + ), + buffer = args.buf, + callback = function() + if not vim.b.latex_started then + vim.cmd "TeXpresso %" + vim.b.latex_started = true + end + -- vim.cmd "VimtexView" + end, + }) + end, +}) + -- idk why i need to define it here bro -- local builtin = require('telescope.builtin') -- vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) From 2958e665fd9b8f2f1aa0ee139c5431dcf81435fb Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Thu, 18 Dec 2025 03:37:48 -0500 Subject: [PATCH 17/24] generation 553 25.11.20250714.62e0f05 --- home/programs/nvim/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home/programs/nvim/init.lua b/home/programs/nvim/init.lua index 59a2fdc..b4e9134 100644 --- a/home/programs/nvim/init.lua +++ b/home/programs/nvim/init.lua @@ -165,6 +165,8 @@ vim.api.nvim_create_autocmd("FileType", { command = "setlocal wrap" }) +vim.api.nvim_create_augroup("vimrc", { clear = true }) + vim.api.nvim_create_autocmd("FileType", { desc = "texpresso compile", group = "vimrc", From 0f9d539d119a8e630df489ed5f2747725c8e9307 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Thu, 18 Dec 2025 03:57:24 -0500 Subject: [PATCH 18/24] generation 554 25.11.20250714.62e0f05 --- home/home.nix | 1 + home/programs/nvim/plugins/vimtex.lua | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/home/home.nix b/home/home.nix index cdb37dd..03fc112 100644 --- a/home/home.nix +++ b/home/home.nix @@ -123,6 +123,7 @@ in { electrum feather gnupg + texpresso # texlive.combined.scheme-full # security diff --git a/home/programs/nvim/plugins/vimtex.lua b/home/programs/nvim/plugins/vimtex.lua index ef5811b..c608d72 100644 --- a/home/programs/nvim/plugins/vimtex.lua +++ b/home/programs/nvim/plugins/vimtex.lua @@ -7,11 +7,10 @@ vim.g.vimtex_view_method = 'zathura' vim.g.vimtex_view_general_viewer = 'zathura' vim.g.vimtex_view_general_options = '--unique file:@pdf#src:@line@tex' - -- Set the TeX flavor and quickfix mode. vim.g.tex_flavor = 'latex' -vim.g.vimtex_quickfix_mode = 0 -vim.g.vimtex_quickfix_enabled = 0 +-- vim.g.vimtex_quickfix_mode = 0 +-- vim.g.vimtex_quickfix_enabled = 0 -- Compiler backend. -- vim.g.vimtex_compiler_method = 'latexmk' From a357ea695d65689ef5f67d40f420311c8bbbec8c Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Thu, 18 Dec 2025 04:09:00 -0500 Subject: [PATCH 19/24] generation 555 25.11.20250714.62e0f05 --- home/programs/nvim/init.lua | 44 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/home/programs/nvim/init.lua b/home/programs/nvim/init.lua index b4e9134..27fb8e6 100644 --- a/home/programs/nvim/init.lua +++ b/home/programs/nvim/init.lua @@ -167,28 +167,28 @@ vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_augroup("vimrc", { clear = true }) -vim.api.nvim_create_autocmd("FileType", { - desc = "texpresso compile", - group = "vimrc", - pattern = "tex", - callback = function(args) - -- start server on first BufWrite - vim.api.nvim_create_autocmd("BufWritePost", { - group = vim.api.nvim_create_augroup( - string.format("latex", args.buf), - { clear = true } - ), - buffer = args.buf, - callback = function() - if not vim.b.latex_started then - vim.cmd "TeXpresso %" - vim.b.latex_started = true - end - -- vim.cmd "VimtexView" - end, - }) - end, -}) +-- vim.api.nvim_create_autocmd("FileType", { + -- desc = "texpresso compile", + -- group = "vimrc", + -- pattern = "tex", + -- callback = function(args) + -- -- start server on first BufWrite + -- vim.api.nvim_create_autocmd("BufWritePost", { + -- group = vim.api.nvim_create_augroup( + -- string.format("latex", args.buf), + -- { clear = true } + -- ), + -- buffer = args.buf, + -- callback = function() + -- if not vim.b.latex_started then + -- vim.cmd "TeXpresso %" + -- vim.b.latex_started = true + -- end + -- -- vim.cmd "VimtexView" + -- end, + -- }) + -- end, +-- }) -- idk why i need to define it here bro -- local builtin = require('telescope.builtin') From 29cc4418eedf9702f0a2fd26990e372a88e5271c Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Thu, 18 Dec 2025 04:28:33 -0500 Subject: [PATCH 20/24] generation 556 25.11.20250714.62e0f05 --- home/programs/nvim/plugins/smear.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home/programs/nvim/plugins/smear.lua b/home/programs/nvim/plugins/smear.lua index b8d6bc1..953fdb8 100644 --- a/home/programs/nvim/plugins/smear.lua +++ b/home/programs/nvim/plugins/smear.lua @@ -2,10 +2,10 @@ require('smear_cursor').setup({ scroll_buffer_space = false, smear_between_buffers = false, smear_between_neighbor_lines = false, - scroll_buffer_space = true, + scroll_buffer_space = false, stiffness = 0.5, trailing_stiffness = 0.5, matrix_pixel_threshold = 0.5, - damping = 0.95, + damping = 1, -- how "bouncy" the cursor is smear_insert_mode = false, }) From 2b9e4e94c0508f05781ac308c0396381590ab482 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Thu, 18 Dec 2025 04:36:15 -0500 Subject: [PATCH 21/24] generation 557 25.11.20250714.62e0f05 --- home/programs/nvim/plugins/smear.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/programs/nvim/plugins/smear.lua b/home/programs/nvim/plugins/smear.lua index 953fdb8..59a3d59 100644 --- a/home/programs/nvim/plugins/smear.lua +++ b/home/programs/nvim/plugins/smear.lua @@ -6,6 +6,6 @@ require('smear_cursor').setup({ stiffness = 0.5, trailing_stiffness = 0.5, matrix_pixel_threshold = 0.5, - damping = 1, -- how "bouncy" the cursor is + damping = 0.9999, -- how "bouncy" the cursor is. 1 makes the cursor freeze in the top left lmao smear_insert_mode = false, }) From 3c1dee3c197a56570c0dcbe779b3eb7e67bcc1f3 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Thu, 18 Dec 2025 04:42:39 -0500 Subject: [PATCH 22/24] generation 559 25.11.20250714.62e0f05 --- home/programs/nvim/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index cff0689..01c22c9 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -42,10 +42,10 @@ plenary-nvim nvim-web-devicons texpresso-vim - { - plugin = smear-cursor-nvim; - config = toLuaFile ./plugins/smear.lua; - } + # { + # plugin = smear-cursor-nvim; + # config = toLuaFile ./plugins/smear.lua; + # } # { # plugin = neovide; # config = toLuaFile ./plugins/neovide.lua; From a49755c10f7ae56d2d8db2c435b60b0ff7a1333c Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Thu, 18 Dec 2025 05:24:31 -0500 Subject: [PATCH 23/24] generation 560 25.11.20250714.62e0f05 --- home/programs/nvim/plugins/vimtex.lua | 8 ++++---- home/programs/nvim/snippets/tex.lua | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/home/programs/nvim/plugins/vimtex.lua b/home/programs/nvim/plugins/vimtex.lua index c608d72..465c2ba 100644 --- a/home/programs/nvim/plugins/vimtex.lua +++ b/home/programs/nvim/plugins/vimtex.lua @@ -47,7 +47,7 @@ vim.g.maplocalleader = ',' -- vim.g.Tex_IgnoreLevel = 8 -- Delete extra compilation files when a TeX buffer is deleted. -vim.api.nvim_create_autocmd("BufDelete", { - pattern = "*.tex", - command = "silent! !latexmk -c > /dev/null 2>&1 %:p", -}) +-- vim.api.nvim_create_autocmd("BufDelete", { + -- pattern = "*.tex", + -- command = "silent! !latexmk -c > /dev/null 2>&1 %:p", +-- }) diff --git a/home/programs/nvim/snippets/tex.lua b/home/programs/nvim/snippets/tex.lua index 4e5dff6..924606f 100644 --- a/home/programs/nvim/snippets/tex.lua +++ b/home/programs/nvim/snippets/tex.lua @@ -171,6 +171,27 @@ ls.add_snippets("tex", { })) }) +ls.add_snippets("tex", { + s("beamer", fmta([[ +\documentclass{beamer} +\usetheme{metropolis} % Use metropolis theme +\title{<>} +\date{\today} +\author{Jacob Ginesin} +\institute{<>} +\begin{document} + \maketitle + \section{First Section} + \begin{frame}{First Frame} + Hello, world! + \end{frame} +\end{document} + + ]], {i(1), i(0)}, { + indent_string = "" + })) +}) + -- ---- From 2282e2ddfa179548a7fe7c730171c77ab54e4db5 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Thu, 18 Dec 2025 17:13:10 -0500 Subject: [PATCH 24/24] generation 561 25.11.20250714.62e0f05 --- home/home.nix | 1 + home/programs/nvim/snippets/tex.lua | 141 ++++++++++++++++++++++++++++ home/scripts/tex/safe-tex.sh | 31 ++++++ 3 files changed, 173 insertions(+) create mode 100644 home/scripts/tex/safe-tex.sh diff --git a/home/home.nix b/home/home.nix index 03fc112..72f12a5 100644 --- a/home/home.nix +++ b/home/home.nix @@ -124,6 +124,7 @@ in { feather gnupg texpresso + python313Packages.pygments # texlive.combined.scheme-full # security diff --git a/home/programs/nvim/snippets/tex.lua b/home/programs/nvim/snippets/tex.lua index 924606f..81531b6 100644 --- a/home/programs/nvim/snippets/tex.lua +++ b/home/programs/nvim/snippets/tex.lua @@ -171,6 +171,103 @@ ls.add_snippets("tex", { })) }) +ls.add_snippets("tex", { + s("template-report", fmta([[ +\documentclass[10pt]{article} +\usepackage{graphicx} % Required for inserting images +\usepackage[margin=1in]{geometry} +\usepackage[dvipsnames]{xcolor} +\usepackage{url} +\usepackage{amssymb} +\usepackage{amsmath} +\usepackage{amsthm} +\usepackage{fullpage} +\usepackage{listings} +\usepackage[utf8]{inputenc} +\usepackage{parskip} +\usepackage{hyperref} +\usepackage{bookmark} +\usepackage[linguistics]{forest} +\usepackage{tikz} +\usepackage{float} + +\usepackage[minted,skins]{tcolorbox} % 'skins' needed for shadows + +% Define a new command \rustshadowfile that replaces \rustfile +\newtcbinputlisting{\rustshadowfile}[2][]{% + listing engine=minted, + minted language=rust, + minted options={linenos, numbersep=5pt, fontsize=\footnotesize, baselinestretch=1.05}, + listing file={#2}, % The file to read + enhanced, % Enable skins for shadows + drop shadow, % Add the shadow + colback=white, % Background color + colframe=black!70, % Border color + boxrule=0.5pt, % Border width + arc=2pt, % Rounded corners (optional) + listing only, % Display code only (no title bar inside box) + #1 % Pass extra options like labels +} + +\newtcblisting{rustcode}[1][]{ + listing engine=minted, + minted language=rust, + minted options={linenos, numbersep=5pt, fontsize=\footnotesize, baselinestretch=1.05}, + enhanced, + drop shadow, % Adds the shadow + colback=white, % Background color + colframe=black!70,% Border color + boxrule=0.5pt, % Border width + arc=2pt, % Rounded corners + listing only, % Hides the internal tcolorbox title bar + #1 % Allows passing extra options +} + +% \usepackage{enumitem} +% \usepackage{euler} +% \usepackage{libertine} + +\usepackage{import} +\usepackage{pdfpages} +\usepackage{transparent} + +\newtheoremstyle{definitionstyle} +{} +{} +{\normalfont} +{} +{\bfseries} +{:} +{0.5em} +{} + +\theoremstyle{definitionstyle} +\newtheorem{definition}{Definition}[section] + +\newtheorem{all}{Theorem}[section] +\newtheorem{corollary}[all]{Corollary} +\newtheorem{lemma}[all]{Lemma} +\newtheorem{exercise}[all]{Exercise} +\newtheorem{proposition}[all]{Proposition} +\newtheorem{example}[all]{Example} +\newtheorem{theorem}{Theorem} + +\newcommand{\namedcomment}[3]{{\sf \scriptsize \color{#2} #1: #3}} +\newcommand{\jake}[1]{\namedcomment{jake}{red}{#1}} +\title{<>} +\author{Jake Ginesin \and <>} +\date{December 5th, 1999} + +\begin{document} +\maketitle + +\end{document} + ]], {i(1), i(0)}, { + indent_string = "" + })) +}) + + ls.add_snippets("tex", { s("beamer", fmta([[ \documentclass{beamer} @@ -192,6 +289,37 @@ ls.add_snippets("tex", { })) }) +ls.add_snippets("tex", { + s("beamer", fmta([[ +\documentclass{beamer} +\usetheme{metropolis} % Use metropolis theme +\title{<>} +\date{\today} +\author{Jacob Ginesin} +\institute{<>} +\begin{document} + \maketitle + \section{First Section} + \begin{frame}{First Frame} + Hello, world! + \end{frame} +\end{document} + + ]], {i(1), i(0)}, { + indent_string = "" + })) +}) + +ls.add_snippets("tex", { + s("bib", fmta([[ +\bibliographystyle{plain} +\bibliography{<>} + ]], {i(0)}, { + indent_string = "" + })) +}) + + -- ---- @@ -482,6 +610,19 @@ ls.add_snippets("tex", { {condition = in_mathzone} ), + s({trig = "rustcode"}, + fmta( + [[ + \begin{listing}[H] + \begin{rustcode} + <> + \end{rustcode} + \end{listing} + ]], + { i(1) } + ) + ), + s({ trig = "notin", snippetType="autosnippet", diff --git a/home/scripts/tex/safe-tex.sh b/home/scripts/tex/safe-tex.sh new file mode 100644 index 0000000..076fa4a --- /dev/null +++ b/home/scripts/tex/safe-tex.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# designed to compile tex with isolation, in the case something like minted is used +set -euo pipefail + +if [[ $# -lt 1 ]]; then + echo "Usage: $0 [tectonic args...]" + exit 1 +fi + +TEXFILE="$1" +shift + +mkdir -p ~/.cache/Tectonic + +nix-shell -p bubblewrap tectonic cacert python313Packages.pygments which --run " + bwrap --ro-bind /nix /nix \ + --bind \$(pwd) /workspace \ + --bind ~/.cache/Tectonic ~/.cache/Tectonic \ + --chdir /workspace \ + --dev /dev \ + --proc /proc \ + --tmpfs /tmp \ + --symlink \$(which bash) /bin/sh \ + --ro-bind /etc/resolv.conf /etc/resolv.conf \ + --ro-bind /etc/hosts /etc/hosts \ + --ro-bind /etc/nsswitch.conf /etc/nsswitch.conf \ + --setenv SSL_CERT_FILE \"\$SSL_CERT_FILE\" \ + --setenv TMPDIR /tmp \ + --setenv PATH \"\$PATH\" \ + tectonic -Z shell-escape '$TEXFILE' --keep-intermediates $* +"