├── .git-crypt ├── .gitattributes └── keys │ └── default │ └── 0 │ └── 0B6155A2A35939A80DF900EC5AC8B3A02B5CE753.gpg ├── .gitattributes ├── .gitignore ├── README.adoc ├── bin ├── activate ├── buffer ├── checkpw ├── dogfood ├── git-fix ├── jira-board ├── ll ├── nexus-rebase ├── private.sh ├── rem ├── rr └── typing-test ├── bootstrap.sh ├── browser └── default.nix ├── common.nix ├── dogfood ├── Spoons.nix ├── default.nix ├── fzf.kak.nix ├── gitout.nix ├── kak-jira.nix ├── kakoune.nix ├── openscad.kak.nix ├── rep.nix └── tableize.nix ├── flake.lock ├── flake.nix ├── fonts ├── Input-Font.zip └── default.nix ├── hosts ├── V3Q9GYKM9C │ └── default.nix ├── cnc │ └── default.nix └── crunch │ └── default.nix ├── kits ├── 3d-printing │ └── default.nix ├── brain │ └── default.nix ├── cnc │ └── default.nix ├── pcbs │ └── default.nix └── workstation │ └── default.nix ├── modules ├── bubbles │ ├── default.nix │ └── file │ │ ├── default.nix │ │ └── magic │ │ └── scheme └── environment │ └── xdg │ └── default.nix ├── networking ├── default.nix ├── ses-email │ ├── default.nix │ └── password ├── ssh │ ├── default.nix │ ├── files │ │ ├── id_dsa │ │ ├── id_dsa.pub │ │ ├── id_rsa │ │ ├── id_rsa-aws-idris │ │ ├── id_rsa-backup │ │ ├── id_rsa-backup.pub │ │ ├── id_rsa-macbook │ │ ├── id_rsa-macbook.pub │ │ ├── id_rsa-terminus-iphone.pub │ │ ├── id_rsa-workingcopy.pub │ │ ├── id_rsa.pub │ │ ├── id_rsa.pub-alex │ │ └── teenyweeny.pem │ └── ssh_config ├── tls │ ├── DigiCert_Global_Root_CA.pem │ ├── DigiCert_Global_Root_G2.pem │ ├── RapidSSL_RSA_CA_2018.pem │ ├── RapidSSL_TLS_RSA_CA_G1.pem │ ├── crunch.eraserhead.net.crt │ ├── crunch.eraserhead.net.csr │ ├── crunch.eraserhead.net.key │ └── default.nix ├── update-dns │ └── default.nix └── wifi │ ├── default.nix │ └── networks.nix ├── os ├── common │ ├── default.nix │ └── modules │ │ ├── k3s │ │ └── default.nix │ │ ├── networking │ │ └── default.nix │ │ └── schedule │ │ └── default.nix ├── nix-darwin │ ├── default.nix │ └── modules │ │ ├── default.nix │ │ ├── hammerspoon │ │ └── default.nix │ │ ├── k3s │ │ ├── default.nix │ │ └── rancher-wrapper │ │ │ └── default.nix │ │ ├── nats │ │ └── default.nix │ │ └── schedule │ │ └── default.nix └── nixos │ ├── default.nix │ └── modules │ ├── default.nix │ ├── homebrew │ └── default.nix │ ├── k3s │ └── default.nix │ ├── networking │ └── default.nix │ └── schedule │ └── default.nix ├── pkg ├── default.nix ├── git-scripts │ ├── default.nix │ ├── git-browse-link │ ├── git-cleanup │ └── git-l ├── k3s │ └── default.nix └── kak-scrollback-pager │ ├── default.nix │ └── kak-scrollback-pager.bash ├── shell └── default.nix ├── terraform ├── .gitignore ├── crunch.eraserhead.net.tf ├── eraserhead.net.tf ├── providers.tf └── terraform.tfstate └── tools ├── 1password └── default.nix ├── R └── default.nix ├── anki └── default.nix ├── aws ├── boto ├── credentials └── default.nix ├── bCNC └── default.nix ├── babashka └── default.nix ├── barrier └── barrier.conf ├── buildkite └── default.nix ├── clang └── default.nix ├── clojure ├── .gitignore ├── default.nix ├── deps.edn └── profiles.clj ├── coscreen └── default.nix ├── cue └── default.nix ├── discord └── default.nix ├── firefox └── default.nix ├── freecad └── default.nix ├── git ├── default.nix └── gitconfig ├── gnupg ├── default.nix └── gpg.conf ├── gnuplot ├── default.nix └── gnuplotrc ├── go └── default.nix ├── gtypist ├── default.nix └── gtypist.typ ├── hammerspoon ├── default.nix └── init.lua ├── i3 ├── default.nix └── sigils.clj ├── inkscape └── default.nix ├── k9s └── default.nix ├── kakoune ├── default.nix ├── kakrc └── wrapper │ ├── default.nix │ └── wrapper.sh ├── kicad └── default.nix ├── kitty └── default.nix ├── meshlab └── default.nix ├── minicom └── default.nix ├── nats ├── default.nix └── token.txt ├── nix └── default.nix ├── npm ├── default.nix └── npmrc ├── obsidian └── default.nix ├── openscad └── default.nix ├── pcb2gcode └── default.nix ├── postgres ├── default.nix └── pgpass.conf ├── postman └── default.nix ├── prusa-slicer ├── default.nix └── snapshots │ └── 20250517T161329Z │ ├── filament │ ├── Taz5 - NONE.ini │ ├── Taz5 - Polyterra PLA.ini │ └── Taz5.ini │ ├── physical_printer │ └── Theseus.ini │ ├── print │ └── Taz5.ini │ ├── printer │ └── Taz5.ini │ ├── snapshot.ini │ └── vendor │ └── PrusaResearch.ini ├── rlwrap └── default.nix ├── signal └── default.nix ├── tex └── default.nix ├── tmux └── default.nix ├── x └── default.nix ├── zoom └── default.nix └── zsh └── default.nix /.git-crypt/.gitattributes: -------------------------------------------------------------------------------- 1 | # Do not edit this file. To specify the files to encrypt, create your own 2 | # .gitattributes file in the directory where your files are. 3 | * !filter !diff 4 | -------------------------------------------------------------------------------- /.git-crypt/keys/default/0/0B6155A2A35939A80DF900EC5AC8B3A02B5CE753.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/.git-crypt/keys/default/0/0B6155A2A35939A80DF900EC5AC8B3A02B5CE753.gpg -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | bin/checkpw filter=git-crypt diff=git-crypt 2 | bin/private.sh filter=git-crypt diff=git-crypt 3 | fonts/Input-Font.zip filter=git-crypt diff=git-crypt 4 | networking/tls/*.key filter=git-crypt diff=git-crypt 5 | networking/ses-email/password filter=git-crypt diff=git-crypt 6 | networking/ssh/files/id_dsa filter=git-crypt diff=git-crypt 7 | networking/ssh/files/id_rsa-aws-idris filter=git-crypt diff=git-crypt 8 | networking/ssh/files/id_rsa-backup filter=git-crypt diff=git-crypt 9 | networking/ssh/files/id_rsa-centralpark-server-dev-1 filter=git-crypt diff=git-crypt 10 | networking/ssh/files/id_rsa-centralpark-server-prod-1 filter=git-crypt diff=git-crypt 11 | networking/ssh/files/id_rsa filter=git-crypt diff=git-crypt 12 | networking/ssh/files/id_rsa-macbook filter=git-crypt diff=git-crypt 13 | networking/ssh/files/teenyweeny.pem filter=git-crypt diff=git-crypt 14 | networking/wifi/networks.nix filter=git-crypt diff=git-crypt 15 | tools/aws/boto filter=git-crypt diff=git-crypt 16 | tools/aws/credentials filter=git-crypt diff=git-crypt 17 | tools/clojure/profiles.clj filter=git-crypt diff=git-crypt 18 | tools/nats/token.txt filter=git-crypt diff=git-crypt 19 | tools/npm/npmrc filter=git-crypt diff=git-crypt 20 | tools/postgres/pgpass.conf filter=git-crypt diff=git-crypt 21 | terraform/terraform.tfstate filter=git-crypt diff=git-crypt 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /result 2 | /old-dotfiles 3 | /neovim/config/nvim.symlink/.netrwhist 4 | /.terraform 5 | /terraform.tfstate.backup 6 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | eraserhd's dotfiles 2 | =================== 3 | 4 | Manual Installation Steps (Still) 5 | --------------------------------- 6 | 7 | - Add Apple ID in System Settings (I think this made 1Password easier). 8 | - `mkdir src && cd src` 9 | - `git clone https://github.com/eraserhd/dotfiles` 10 | - Install Homebrew: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` 11 | - `/opt/homebrew/bin/brew install 1password` 12 | - Install Nix multi-user: `sh <(curl -L https://nixos.org/nix/install)` 13 | - `nix-shell -p gnupg git-crypt` 14 | - `gpg --import --pinentry-mode ask --allow-secret-key-import secret.key # secret.key downloaded from 1Password` 15 | - `git crypt unlock` 16 | - `cp ./networking/ssh/files/id_rsa /tmp/id_rsa && chmod 06040 /tmp/id_rsa && ssh-add /tmp/id_rsa` 17 | - was building for the wrong system, changed hostname for macbook and changed system to aarch64-darwin, but 18 | the twou package no longer worked because the flake doesn't have support for it, so commented it out. 19 | - `nix --extra-experimental-features "nix-command flakes" run nix-darwin -- switch --flake .` 20 | - `git remote set-url origin git@github.com:eraserhd/dotfiles.git` 21 | - `eval $(op signin)`, needed to "Enable integration with 3rd Party Apps" 22 | 23 | 2021 Crunch 24 | ----------- 25 | 26 | * Install NixOS with WPA config 27 | * nix-shell -p kakoune git gnupg 28 | * git clone dotfiles 29 | * Set programs.gnupg.agent.enable = true; nixos-rebuild switch (pinentry problem) 30 | * reboot, because the above doesn't appear to fix it 31 | * Set programs.gnupg.agent.pinentryFlavor and enableExtraSocket (not sure which) 32 | * Lots of systemctl --user restart gpg-agent 33 | * git crypt unlock -- works!! 34 | 35 | 2025 Crunch 36 | ----------- 37 | 38 | Firefox: 39 | 40 | * In about:config, set `layout.css.devPixelsPerPx` to 0.75 41 | * In Tree Style Tab preferences Advanced user stylesheet: 42 | 43 | ---- 44 | tab-item { 45 | --tab-size: 24px; 46 | } 47 | ---- 48 | -------------------------------------------------------------------------------- /bin/activate: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exec osascript -e " 4 | tell application \"$1\" 5 | activate 6 | end tell 7 | " 8 | -------------------------------------------------------------------------------- /bin/buffer: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | exec 9 plumb -i 3 | -------------------------------------------------------------------------------- /bin/checkpw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/bin/checkpw -------------------------------------------------------------------------------- /bin/dogfood: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eo pipefail 4 | 5 | rev=$(git rev-parse HEAD) 6 | owner=eraserhd 7 | repo=$(pwd) 8 | repo=${repo##*/} 9 | 10 | while [[ $# -gt 0 ]]; do 11 | case "$1" in 12 | -o|--owner) owner="$2"; shift;; 13 | esac 14 | shift 15 | done 16 | 17 | destination="$HOME/src/dotfiles/dogfood" 18 | case "$repo" in 19 | *-pluggo) 20 | destination="$HOME/src/nix-plugbench/pkg" 21 | owner=plugbench 22 | ;; 23 | esac 24 | 25 | nix-prefetch-github --nix --rev "$rev" "$owner" "$repo" | 26 | sed -n -e '/fetchFromGitHub {/,/}/{ 27 | s/^.*fetchFromGitHub // 28 | s/ // 29 | p 30 | }' > "$destination/$repo".nix 31 | -------------------------------------------------------------------------------- /bin/git-fix: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | git status --porcelain |awk ' 4 | substr($0, 1, 1) == "U" || substr($0, 2, 1) == "U" { 5 | filename = substr($0, 4); 6 | line_count = 0; 7 | line_number = 1; 8 | at_conflict = 0; 9 | while (getline line < filename) { 10 | line_count++; 11 | if (at_conflict) { 12 | at_conflict = 0; 13 | printf("%s:%d: %s\n", filename, line_number, line); 14 | } 15 | if (line ~ /^<<<"$tmp" 2>&1 8 | errorCode=$? 9 | if (( errorCode > 0 )); then 10 | echo 'Command failed: ' "$@" >&2 11 | cat "$tmp" 12 | rm -f "$tmp" 13 | return $errorCode 14 | fi 15 | rm -f "$tmp" 16 | } 17 | 18 | cloneTempNexus() { 19 | printf 'Cloning nexus...\n' 20 | rm -rf /tmp/nexus 21 | cd /tmp 22 | showOutputOnFail git clone git@github.com:2uinc/nexus.git 23 | cd nexus 24 | } 25 | 26 | applyPatches() { 27 | local patch 28 | for patch in "$@"; do 29 | showOutputOnFail git cherry-pick "origin/staging^{/$patch}" 30 | done 31 | } 32 | 33 | findManagedBranches() { 34 | git log --reverse --format='%s' origin/master..origin/staging |sed -e 's/ .*$//' 35 | git for-each-ref --format='%(refname:strip=3)' 'refs/remotes/origin/staging-*' 36 | printf 'staging\n' 37 | printf 'tools\n' 38 | } 39 | 40 | makeSteps() { 41 | ( 42 | local patch 43 | for patch in "$@"; do 44 | printf 'applyPatch "%s"\n' "$patch" 45 | done 46 | local branch 47 | for branch in $(cat .git/managed-branches); do 48 | printf 'rebaseBranch "%s"\n' "$branch" 49 | done 50 | ) >.git/nexus-steps 51 | } 52 | 53 | do_applyPatch() { 54 | local name="$1" 55 | git cherry-pick "origin/$name" 56 | } 57 | 58 | do_rebaseBranch() { 59 | local branch="$1" 60 | git checkout "$branch" 61 | git reset --hard "origin/$branch" 62 | local base='master' 63 | 64 | 65 | git rebase "$base" 66 | } 67 | 68 | cmd_continue() { 69 | # FIXME: Refactor so queue is on disk! 70 | 71 | local root="$(git rev-parse origin/master)" 72 | local queue=( "$root" ) 73 | local queueStart=0 queueEnd=1 74 | local commit='' nextCommit='' 75 | touch .git/nexus-rebase/done/"$root" # root is done by the reset below 76 | while (( queueStart < queueEnd )); do 77 | commit="${queue[$queueStart]}" 78 | queueStart=$(( queueStart + 1 )) 79 | for nextCommit in $(ls -1 .git/nexus-rebase/reverse-deps/"$commit" 2>/dev/null); do 80 | queue[$queueEnd]="$nextCommit" 81 | queueEnd=$(( queueEnd + 1 )) 82 | done 83 | if [ -e .git/nexus-rebase/done/"$commit" ]; then 84 | continue 85 | fi 86 | printf '>> %s\n' "$commit" 87 | 88 | local branches=( $(ls -1 .git/nexus-rebase/branches/"$commit" 2>/dev/null) ) 89 | local branch="${branches[0]}" 90 | 91 | git checkout "$branch" 92 | if ! git cherry-pick "$commit" >.git/nexus-rebase/cherry.txt 2>&1; then 93 | if grep -q '^The previous cherry-pick is now empty,' .git/nexus-rebase/cherry.txt; then 94 | git cherry-pick --skip 95 | else 96 | cat .git/nexus-rebase/cherry.txt >&2 97 | exit 1 98 | fi 99 | fi 100 | local newCommit="$(git rev-parse HEAD)" 101 | 102 | local first=true 103 | for branch in "${branches[@]}"; do 104 | printf ' -- %s\n' "$branch" 105 | if ! $first; then 106 | git branch -f "$branch" "$newCommit" 107 | fi 108 | first=false 109 | done 110 | 111 | touch .git/nexus-rebase/done/"$commit" 112 | done 113 | } 114 | 115 | cmd_start() { 116 | cloneTempNexus 117 | 118 | #FIXME: Make sure there's no local changes on said branches. 119 | 120 | # Set up commit dependencies for topological sort. The files in reverse-deps 121 | # list all the commits based on top of the commit that is the name of the file. 122 | # The files in branches name all of the branches that contain the commit that is 123 | # the name of the file. 124 | # The files in done are completion flags so that we can restart where we left off. 125 | mkdir -p .git/nexus-rebase/{reverse-deps,branches,done} 126 | local root="$(git rev-parse origin/master)" commit previousCommit branch 127 | local branches=( $(findManagedBranches) ) 128 | 129 | for branch in "${branches[@]}"; do 130 | previousCommit="$root" 131 | exec 4< <(git log --reverse --format='%H' "origin/master..origin/$branch") 132 | while read -r -u 4 commit; do 133 | mkdir -p .git/nexus-rebase/reverse-deps/"$previousCommit" 134 | touch .git/nexus-rebase/reverse-deps/"$previousCommit"/"$commit" 135 | mkdir -p .git/nexus-rebase/branches/"$commit" 136 | touch .git/nexus-rebase/branches/"$commit"/"$branch" 137 | previousCommit="$commit" 138 | done 139 | exec 4<&- 140 | done 141 | 142 | # Check out all branches to ensure we have local copies and they are tracking origin 143 | for branch in "${branches[@]}"; do 144 | git checkout "$branch" 145 | #FIXME: Make sure none have local modifications 146 | done 147 | 148 | # Reset all local copies of managed branches to master 149 | git checkout master 150 | for branch in "${branches[@]}"; do 151 | git branch -f "$branch" "$root" 152 | done 153 | 154 | # Start the queue 155 | 156 | cmd_continue 157 | } 158 | 159 | cmd_push() { 160 | cd /tmp/nexus 161 | git push origin master 162 | git push --force-with-lease origin $(managedBranches) 163 | } 164 | 165 | main() { 166 | local cmd="$1" 167 | shift 168 | "cmd_$cmd" "$@" 169 | } 170 | 171 | main "$@" 172 | -------------------------------------------------------------------------------- /bin/private.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/bin/private.sh -------------------------------------------------------------------------------- /bin/rem: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | project="${PWD##*/}" 4 | task add +next project:"$project" "$@" 5 | -------------------------------------------------------------------------------- /bin/rr: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | next='' 4 | case "$1" in 5 | -n|--next) 6 | next='+next' 7 | shift 8 | ;; 9 | esac 10 | 11 | for task in "$@"; do 12 | task $task modify $next reviewed:now 13 | done 14 | task review 15 | -------------------------------------------------------------------------------- /bin/typing-test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | gtypist -i -b ~/src/dotfiles/tools/gtypist/gtypist.typ 3 | -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | 5 | #Install nix 6 | #Install homebrew 7 | 8 | brew cask install 1password 9 | 10 | nix-env -i gnupg 11 | nix-env -i git-crypt 12 | 13 | git crypt unlock 14 | 15 | 16 | sed -i '' -e 's,git@github\.com:,https://github.com/,' .gitmodules 17 | git submodule init 18 | git submodule update 19 | 20 | # 2u-nix asks for password, fails 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /browser/default.nix: -------------------------------------------------------------------------------- 1 | { config, options, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | listenCommand = schema: let 6 | userArg = if config.plugbench.token == null 7 | then "" 8 | else "--user ${escapeShellArg config.plugbench.token}"; 9 | in '' 10 | nats reply cmd.show.url.${schema} ${userArg} --command "/bin/sh -c '${config.local.browser.command} \"\$NATS_REQUEST_BODY\"'" 11 | ''; 12 | 13 | launchdConfig = schema: { 14 | launchd.user.agents."open-${schema}-in-browser" = { 15 | path = with pkgs; [ natscli ]; 16 | script = listenCommand schema; 17 | serviceConfig = { 18 | KeepAlive = true; 19 | }; 20 | }; 21 | }; 22 | 23 | systemdConfig = schema: { 24 | systemd.user.services."open-${schema}-in-browser" = { 25 | wantedBy = ["default.target"]; 26 | path = with pkgs; [ natscli ]; 27 | script = listenCommand schema; 28 | }; 29 | }; 30 | 31 | schemaLaunchConfig = schema: if (builtins.hasAttr "launchd" options) 32 | then launchdConfig schema 33 | else systemdConfig schema; 34 | 35 | firefox = if (builtins.hasAttr "launchd" options) 36 | then "/Applications/Firefox.app/Contents/MacOS/firefox" 37 | else "${pkgs.firefox}/bin/firefox"; 38 | in { 39 | options.local.browser = { 40 | command = mkOption { 41 | description = "Command to open a URL in a browser"; 42 | type = types.str; 43 | default = "${firefox} --new-tab --url"; 44 | }; 45 | }; 46 | 47 | config = lib.mkMerge [ 48 | (schemaLaunchConfig "http") 49 | (schemaLaunchConfig "https") 50 | ]; 51 | } 52 | -------------------------------------------------------------------------------- /common.nix: -------------------------------------------------------------------------------- 1 | { lib, options, ... }: 2 | 3 | with lib; 4 | { 5 | imports = [ 6 | ./browser 7 | ./dogfood 8 | ./fonts 9 | ./kits/3d-printing 10 | ./kits/brain 11 | ./kits/cnc 12 | ./kits/pcbs 13 | ./kits/workstation 14 | ./modules/bubbles 15 | ./modules/environment/xdg 16 | ./networking 17 | ./networking/ses-email 18 | ./networking/ssh 19 | ./networking/tls 20 | ./networking/update-dns 21 | ./networking/wifi 22 | ./os/common 23 | ./pkg 24 | ./tools/1password 25 | ./tools/anki 26 | ./tools/aws 27 | ./tools/babashka 28 | ./tools/bCNC 29 | ./tools/buildkite 30 | ./tools/clang 31 | ./tools/clojure 32 | ./tools/coscreen 33 | ./tools/cue 34 | ./tools/discord 35 | ./tools/firefox 36 | ./tools/freecad 37 | ./tools/git 38 | ./tools/gnupg 39 | ./tools/gnuplot 40 | ./tools/go 41 | ./tools/gtypist 42 | ./tools/hammerspoon 43 | ./tools/i3 44 | ./tools/inkscape 45 | ./tools/k9s 46 | ./tools/kakoune 47 | ./tools/kicad 48 | ./tools/kitty 49 | ./tools/meshlab 50 | ./tools/minicom 51 | ./tools/nats 52 | ./tools/nix 53 | ./tools/npm 54 | ./tools/obsidian 55 | ./tools/openscad 56 | ./tools/postman 57 | ./tools/pcb2gcode 58 | ./tools/postgres 59 | ./tools/prusa-slicer 60 | ./tools/R 61 | ./tools/rlwrap 62 | ./tools/signal 63 | ./tools/tex 64 | ./tools/tmux 65 | ./tools/x 66 | ./tools/zoom 67 | ./tools/zsh 68 | ./shell 69 | ]; 70 | 71 | config = mkMerge [ 72 | (if (builtins.hasAttr "systemPath" options.environment) then { 73 | environment.systemPath = [ (toString ./bin) ]; 74 | } else { 75 | environment.variables.PATH = [ (toString ./bin) ]; 76 | }) 77 | 78 | { 79 | home-manager.useGlobalPkgs = true; 80 | home-manager.useUserPackages = true; 81 | } 82 | ]; 83 | } 84 | -------------------------------------------------------------------------------- /dogfood/Spoons.nix: -------------------------------------------------------------------------------- 1 | { 2 | owner = "eraserhd"; 3 | repo = "Spoons"; 4 | rev = "ef22e0499d75c0402e0e0fcdd539e55b5387efbf"; 5 | sha256 = "VDA4SM/J0hXekaOAKaeTfQXdiFkjebFk5SGZx2Oc06c="; 6 | fetchSubmodules = true; 7 | } 8 | -------------------------------------------------------------------------------- /dogfood/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | let 4 | dogfood = super: file: overrides: let 5 | source = super.fetchFromGitHub (import file); 6 | in 7 | super.callPackage "${source}/derivation.nix" ({ fetchFromGitHub = _: source; } // overrides); 8 | in 9 | { 10 | config = { 11 | nixpkgs.overlays = [ 12 | (self: super: rec { 13 | kakoune-unwrapped = super.kakoune-unwrapped.overrideAttrs (oldAttrs: { 14 | src = super.pkgs.fetchFromGitHub (import ./kakoune.nix); 15 | # Patch for clang-16 regression made it into master 16 | patches = []; 17 | }); 18 | 19 | kakounePlugins = super.kakounePlugins // { 20 | kak-fzf = super.kakounePlugins.kak-fzf.overrideAttrs (oldAttrs: { 21 | src = super.pkgs.fetchFromGitHub (import ./fzf.kak.nix); 22 | }); 23 | kak-jira = dogfood super ./kak-jira.nix {}; 24 | openscad-kak = super.kakounePlugins.openscad-kak.overrideAttrs (oldAttrs: { 25 | src = super.pkgs.fetchFromGitHub (import ./openscad.kak.nix); 26 | }); 27 | }; 28 | 29 | rep = dogfood super ./rep.nix {}; 30 | 31 | tableize = dogfood super ./tableize.nix {}; 32 | }) 33 | ]; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /dogfood/fzf.kak.nix: -------------------------------------------------------------------------------- 1 | { 2 | owner = "eraserhd"; 3 | repo = "fzf.kak"; 4 | rev = "355f05d832e794b83eb7428ac192c77fc761985e"; 5 | sha256 = "10v7blfdfpsp4wkqm96yxqf0ss307jr9a2phbd1rbmk97ri40b5p"; 6 | } -------------------------------------------------------------------------------- /dogfood/gitout.nix: -------------------------------------------------------------------------------- 1 | { 2 | owner = "eraserhd"; 3 | repo = "gitout"; 4 | rev = "f7517675aa428613206c028d6e2c76821a43a6d2"; 5 | sha256 = "X/IIVSxUWkG3ujDLtc0aBllyTmD7X/JcmWrZUsgZVlc="; 6 | fetchSubmodules = true; 7 | } 8 | -------------------------------------------------------------------------------- /dogfood/kak-jira.nix: -------------------------------------------------------------------------------- 1 | { 2 | owner = "eraserhd"; 3 | repo = "kak-jira"; 4 | rev = "af473ce590c75602277a654df36483b486d3ae12"; 5 | sha256 = "a8MGMAjHshkYV3bzYwGDsgGtyHyLnqxkmdnR7kguFyg="; 6 | fetchSubmodules = true; 7 | } 8 | -------------------------------------------------------------------------------- /dogfood/kakoune.nix: -------------------------------------------------------------------------------- 1 | { 2 | owner = "eraserhd"; 3 | repo = "kakoune"; 4 | rev = "a75c693cf1eb1b51862411a70475c2e84abc42a8"; 5 | hash = "sha256-zcuKNuxQdLyYtjyronf+iyKpHYxK5V/drNkiSmjRZsQ="; 6 | } 7 | -------------------------------------------------------------------------------- /dogfood/openscad.kak.nix: -------------------------------------------------------------------------------- 1 | { 2 | owner = "eraserhd"; 3 | repo = "openscad.kak"; 4 | rev = "af2907b329235f0c2d558c7901f2334699222595"; 5 | hash = "sha256-mZt68lv/AMiVr8p44mtadq/U1DCyKaDMFLUa+eCokD4="; 6 | } 7 | -------------------------------------------------------------------------------- /dogfood/rep.nix: -------------------------------------------------------------------------------- 1 | { 2 | owner = "eraserhd"; 3 | repo = "rep"; 4 | rev = "266d291480206a091cb384ff9233bf2aa6de9a69"; 5 | sha256 = "Opnmr4BfCKMB8yk+/hw325w6Py+OGakw6jYgdhWE0e4="; 6 | fetchSubmodules = true; 7 | } 8 | -------------------------------------------------------------------------------- /dogfood/tableize.nix: -------------------------------------------------------------------------------- 1 | { 2 | owner = "onealexharms"; 3 | repo = "tableize"; 4 | rev = "9c7273d965082076dbd172daf343cc31c24283a1"; 5 | hash = "sha256-kZmyABrfDIDP4uhJmQA3TbNTRrbQaA0eSCFDQqGWGj8="; 6 | } 7 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "add-missing": { 4 | "inputs": { 5 | "flake-utils": "flake-utils", 6 | "nixpkgs": [ 7 | "nixpkgs" 8 | ] 9 | }, 10 | "locked": { 11 | "lastModified": 1737984562, 12 | "narHash": "sha256-7rvgd6Z9zrjyuaGQ9SXPWOW4PEQOkQwXkWtoOgZkdH0=", 13 | "owner": "eraserhd", 14 | "repo": "add-missing", 15 | "rev": "e5e848995626698b8bb8532ab4b3694282f26711", 16 | "type": "github" 17 | }, 18 | "original": { 19 | "owner": "eraserhd", 20 | "repo": "add-missing", 21 | "type": "github" 22 | } 23 | }, 24 | "bCNC-nix": { 25 | "inputs": { 26 | "flake-utils": "flake-utils_2", 27 | "nixpkgs": [ 28 | "nixpkgs" 29 | ] 30 | }, 31 | "locked": { 32 | "lastModified": 1731945362, 33 | "narHash": "sha256-PylPl4yIj75RK781KQP34HS6Vf1lNdc8h6J4wb+HRCs=", 34 | "owner": "eraserhd", 35 | "repo": "bCNC-nix", 36 | "rev": "de9bdbbee00b5e9c2b282aa5d25d27ba9062b620", 37 | "type": "github" 38 | }, 39 | "original": { 40 | "owner": "eraserhd", 41 | "repo": "bCNC-nix", 42 | "type": "github" 43 | } 44 | }, 45 | "clipboard-pluggo": { 46 | "inputs": { 47 | "flake-utils": "flake-utils_6", 48 | "nixpkgs": [ 49 | "plugbench", 50 | "nixpkgs" 51 | ] 52 | }, 53 | "locked": { 54 | "lastModified": 1707774082, 55 | "narHash": "sha256-cZ8DclvoTy8P3nY2YrRWOH8v/UbK0MBd93MC9K4+4HA=", 56 | "owner": "plugbench", 57 | "repo": "clipboard-pluggo", 58 | "rev": "07147803042e6530f1adf3854182c672f9cffdda", 59 | "type": "github" 60 | }, 61 | "original": { 62 | "owner": "plugbench", 63 | "repo": "clipboard-pluggo", 64 | "type": "github" 65 | } 66 | }, 67 | "darwin": { 68 | "inputs": { 69 | "nixpkgs": [ 70 | "nixpkgs" 71 | ] 72 | }, 73 | "locked": { 74 | "lastModified": 1747820204, 75 | "narHash": "sha256-oY/mH8K1LOd+YbO58sw9ORtOdTxy3rR9lvTzOJKVUtA=", 76 | "owner": "LnL7", 77 | "repo": "nix-darwin", 78 | "rev": "e2676937faf868111dcea6a4a9cf4b6549907c9d", 79 | "type": "github" 80 | }, 81 | "original": { 82 | "owner": "LnL7", 83 | "ref": "master", 84 | "repo": "nix-darwin", 85 | "type": "github" 86 | } 87 | }, 88 | "flake-utils": { 89 | "locked": { 90 | "lastModified": 1649676176, 91 | "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", 92 | "owner": "numtide", 93 | "repo": "flake-utils", 94 | "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", 95 | "type": "github" 96 | }, 97 | "original": { 98 | "owner": "numtide", 99 | "repo": "flake-utils", 100 | "type": "github" 101 | } 102 | }, 103 | "flake-utils_2": { 104 | "inputs": { 105 | "systems": "systems" 106 | }, 107 | "locked": { 108 | "lastModified": 1731533236, 109 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 110 | "owner": "numtide", 111 | "repo": "flake-utils", 112 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 113 | "type": "github" 114 | }, 115 | "original": { 116 | "owner": "numtide", 117 | "repo": "flake-utils", 118 | "type": "github" 119 | } 120 | }, 121 | "flake-utils_3": { 122 | "inputs": { 123 | "systems": "systems_2" 124 | }, 125 | "locked": { 126 | "lastModified": 1694529238, 127 | "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", 128 | "owner": "numtide", 129 | "repo": "flake-utils", 130 | "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", 131 | "type": "github" 132 | }, 133 | "original": { 134 | "owner": "numtide", 135 | "repo": "flake-utils", 136 | "type": "github" 137 | } 138 | }, 139 | "flake-utils_4": { 140 | "inputs": { 141 | "systems": "systems_3" 142 | }, 143 | "locked": { 144 | "lastModified": 1731533236, 145 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 146 | "owner": "numtide", 147 | "repo": "flake-utils", 148 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 149 | "type": "github" 150 | }, 151 | "original": { 152 | "owner": "numtide", 153 | "repo": "flake-utils", 154 | "type": "github" 155 | } 156 | }, 157 | "flake-utils_5": { 158 | "inputs": { 159 | "systems": "systems_4" 160 | }, 161 | "locked": { 162 | "lastModified": 1731533236, 163 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 164 | "owner": "numtide", 165 | "repo": "flake-utils", 166 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 167 | "type": "github" 168 | }, 169 | "original": { 170 | "owner": "numtide", 171 | "repo": "flake-utils", 172 | "type": "github" 173 | } 174 | }, 175 | "flake-utils_6": { 176 | "inputs": { 177 | "systems": "systems_5" 178 | }, 179 | "locked": { 180 | "lastModified": 1701680307, 181 | "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", 182 | "owner": "numtide", 183 | "repo": "flake-utils", 184 | "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", 185 | "type": "github" 186 | }, 187 | "original": { 188 | "owner": "numtide", 189 | "repo": "flake-utils", 190 | "type": "github" 191 | } 192 | }, 193 | "flake-utils_7": { 194 | "inputs": { 195 | "systems": "systems_6" 196 | }, 197 | "locked": { 198 | "lastModified": 1726560853, 199 | "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", 200 | "owner": "numtide", 201 | "repo": "flake-utils", 202 | "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", 203 | "type": "github" 204 | }, 205 | "original": { 206 | "owner": "numtide", 207 | "repo": "flake-utils", 208 | "type": "github" 209 | } 210 | }, 211 | "flake-utils_8": { 212 | "inputs": { 213 | "systems": "systems_7" 214 | }, 215 | "locked": { 216 | "lastModified": 1705309234, 217 | "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", 218 | "owner": "numtide", 219 | "repo": "flake-utils", 220 | "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", 221 | "type": "github" 222 | }, 223 | "original": { 224 | "owner": "numtide", 225 | "repo": "flake-utils", 226 | "type": "github" 227 | } 228 | }, 229 | "flake-utils_9": { 230 | "inputs": { 231 | "systems": "systems_8" 232 | }, 233 | "locked": { 234 | "lastModified": 1705309234, 235 | "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", 236 | "owner": "numtide", 237 | "repo": "flake-utils", 238 | "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", 239 | "type": "github" 240 | }, 241 | "original": { 242 | "owner": "numtide", 243 | "repo": "flake-utils", 244 | "type": "github" 245 | } 246 | }, 247 | "home-manager": { 248 | "inputs": { 249 | "nixpkgs": [ 250 | "nixpkgs" 251 | ] 252 | }, 253 | "locked": { 254 | "lastModified": 1747556831, 255 | "narHash": "sha256-Qb84nbYFFk0DzFeqVoHltS2RodAYY5/HZQKE8WnBDsc=", 256 | "owner": "nix-community", 257 | "repo": "home-manager", 258 | "rev": "d0bbd221482c2713cccb80220f3c9d16a6e20a33", 259 | "type": "github" 260 | }, 261 | "original": { 262 | "owner": "nix-community", 263 | "ref": "release-25.05", 264 | "repo": "home-manager", 265 | "type": "github" 266 | } 267 | }, 268 | "kak-ansi": { 269 | "inputs": { 270 | "flake-utils": "flake-utils_3", 271 | "nixpkgs": [ 272 | "nixpkgs" 273 | ] 274 | }, 275 | "locked": { 276 | "lastModified": 1746485009, 277 | "narHash": "sha256-vT/S+ZPbPxHFC/AMGona/4t20iUZ8vJpZ9qaFOnSZd8=", 278 | "owner": "eraserhd", 279 | "repo": "kak-ansi", 280 | "rev": "ef6e1536fc522290c286faedfb21d7d3a58d342a", 281 | "type": "github" 282 | }, 283 | "original": { 284 | "owner": "eraserhd", 285 | "repo": "kak-ansi", 286 | "type": "github" 287 | } 288 | }, 289 | "kak-babashka": { 290 | "inputs": { 291 | "flake-utils": "flake-utils_4", 292 | "nixpkgs": [ 293 | "nixpkgs" 294 | ] 295 | }, 296 | "locked": { 297 | "lastModified": 1739131052, 298 | "narHash": "sha256-cFXC2HRTAZMfbawTwJ25piGlxpnOlCemDANlMO+Qxqg=", 299 | "owner": "eraserhd", 300 | "repo": "kak-babashka", 301 | "rev": "c50a77e3525b6bb13419e7f3123f130ffbc798b6", 302 | "type": "github" 303 | }, 304 | "original": { 305 | "owner": "eraserhd", 306 | "repo": "kak-babashka", 307 | "type": "github" 308 | } 309 | }, 310 | "kakoune-pluggo": { 311 | "inputs": { 312 | "flake-utils": "flake-utils_8", 313 | "nixpkgs": [ 314 | "plugbench", 315 | "nixpkgs" 316 | ] 317 | }, 318 | "locked": { 319 | "lastModified": 1707837328, 320 | "narHash": "sha256-DOLltUTk2Cl1zpvR6eDm3Ek/BzBWIUMOpF/ogopa9MI=", 321 | "owner": "plugbench", 322 | "repo": "kakoune-pluggo", 323 | "rev": "63b6c291bcf54e4197a058827a144ee5b33d6c5c", 324 | "type": "github" 325 | }, 326 | "original": { 327 | "owner": "plugbench", 328 | "repo": "kakoune-pluggo", 329 | "type": "github" 330 | } 331 | }, 332 | "libcamera-src": { 333 | "flake": false, 334 | "locked": { 335 | "lastModified": 1725630279, 336 | "narHash": "sha256-KH30jmHfxXq4j2CL7kv18DYECJRp9ECuWNPnqPZajPA=", 337 | "owner": "raspberrypi", 338 | "repo": "libcamera", 339 | "rev": "69a894c4adad524d3063dd027f5c4774485cf9db", 340 | "type": "github" 341 | }, 342 | "original": { 343 | "owner": "raspberrypi", 344 | "repo": "libcamera", 345 | "rev": "69a894c4adad524d3063dd027f5c4774485cf9db", 346 | "type": "github" 347 | } 348 | }, 349 | "libpisp-src": { 350 | "flake": false, 351 | "locked": { 352 | "lastModified": 1724944683, 353 | "narHash": "sha256-Fo2UJmQHS855YSSKKmGrsQnJzXog1cdpkIOO72yYAM4=", 354 | "owner": "raspberrypi", 355 | "repo": "libpisp", 356 | "rev": "28196ed6edcfeda88d23cc5f213d51aa6fa17bb3", 357 | "type": "github" 358 | }, 359 | "original": { 360 | "owner": "raspberrypi", 361 | "ref": "v1.0.7", 362 | "repo": "libpisp", 363 | "type": "github" 364 | } 365 | }, 366 | "nixpkgs": { 367 | "locked": { 368 | "lastModified": 1747849778, 369 | "narHash": "sha256-pJpN6l6xSfBtAceY/ixp4Mowphyrdtw8pDCxWLzwN2M=", 370 | "owner": "NixOS", 371 | "repo": "nixpkgs", 372 | "rev": "aeacd18dbecd53d231735f242f4184c1b68e9d86", 373 | "type": "github" 374 | }, 375 | "original": { 376 | "owner": "NixOS", 377 | "ref": "release-25.05", 378 | "repo": "nixpkgs", 379 | "type": "github" 380 | } 381 | }, 382 | "parinfer-rust": { 383 | "inputs": { 384 | "flake-utils": "flake-utils_5", 385 | "nixpkgs": [ 386 | "nixpkgs" 387 | ] 388 | }, 389 | "locked": { 390 | "lastModified": 1739197890, 391 | "narHash": "sha256-8b5xx4hEFXqTiCONdLkvwo1rvnk0u1XOY7TPToU9BFc=", 392 | "owner": "eraserhd", 393 | "repo": "parinfer-rust", 394 | "rev": "55bec1e3d4f127527c5c2e507fac96cc934aed6e", 395 | "type": "github" 396 | }, 397 | "original": { 398 | "owner": "eraserhd", 399 | "repo": "parinfer-rust", 400 | "type": "github" 401 | } 402 | }, 403 | "plugbench": { 404 | "inputs": { 405 | "clipboard-pluggo": "clipboard-pluggo", 406 | "flake-utils": "flake-utils_7", 407 | "kakoune-pluggo": "kakoune-pluggo", 408 | "nixpkgs": [ 409 | "nixpkgs" 410 | ], 411 | "plumber-pluggo": "plumber-pluggo" 412 | }, 413 | "locked": { 414 | "lastModified": 1730123503, 415 | "narHash": "sha256-ShYZpIOggDYO3sa3cKGvmDpoHwUyoaiSlJQLQCkIIO0=", 416 | "owner": "plugbench", 417 | "repo": "nix-plugbench", 418 | "rev": "1756c179f3862ac96567650826dd0d1564652e3c", 419 | "type": "github" 420 | }, 421 | "original": { 422 | "owner": "plugbench", 423 | "repo": "nix-plugbench", 424 | "type": "github" 425 | } 426 | }, 427 | "plumber-pluggo": { 428 | "inputs": { 429 | "flake-utils": "flake-utils_9", 430 | "nixpkgs": [ 431 | "plugbench", 432 | "nixpkgs" 433 | ] 434 | }, 435 | "locked": { 436 | "lastModified": 1730123140, 437 | "narHash": "sha256-Rj4uy83Fbc9HaIgvFeOcV2MCvAA0oZ1ufER+iRsX6hk=", 438 | "owner": "plugbench", 439 | "repo": "plumber-pluggo", 440 | "rev": "c06c48babecedd925d0902bac234b7dfe788ee65", 441 | "type": "github" 442 | }, 443 | "original": { 444 | "owner": "plugbench", 445 | "repo": "plumber-pluggo", 446 | "type": "github" 447 | } 448 | }, 449 | "raspberry-pi-nix": { 450 | "inputs": { 451 | "libcamera-src": "libcamera-src", 452 | "libpisp-src": "libpisp-src", 453 | "nixpkgs": [ 454 | "nixpkgs" 455 | ], 456 | "rpi-bluez-firmware-src": "rpi-bluez-firmware-src", 457 | "rpi-firmware-nonfree-src": "rpi-firmware-nonfree-src", 458 | "rpi-firmware-src": "rpi-firmware-src", 459 | "rpi-linux-6_12_17-src": "rpi-linux-6_12_17-src", 460 | "rpi-linux-6_6_78-src": "rpi-linux-6_6_78-src", 461 | "rpi-linux-stable-src": "rpi-linux-stable-src", 462 | "rpicam-apps-src": "rpicam-apps-src" 463 | }, 464 | "locked": { 465 | "lastModified": 1742223591, 466 | "narHash": "sha256-ZNTz8r5jlJ1jvpqf5+aUYgpnYJSVX0iP14doOc1Hm0E=", 467 | "owner": "nix-community", 468 | "repo": "raspberry-pi-nix", 469 | "rev": "3e8100d5e976a6a2be363015cb33463af9ef441a", 470 | "type": "github" 471 | }, 472 | "original": { 473 | "owner": "nix-community", 474 | "repo": "raspberry-pi-nix", 475 | "type": "github" 476 | } 477 | }, 478 | "root": { 479 | "inputs": { 480 | "add-missing": "add-missing", 481 | "bCNC-nix": "bCNC-nix", 482 | "darwin": "darwin", 483 | "home-manager": "home-manager", 484 | "kak-ansi": "kak-ansi", 485 | "kak-babashka": "kak-babashka", 486 | "nixpkgs": "nixpkgs", 487 | "parinfer-rust": "parinfer-rust", 488 | "plugbench": "plugbench", 489 | "raspberry-pi-nix": "raspberry-pi-nix" 490 | } 491 | }, 492 | "rpi-bluez-firmware-src": { 493 | "flake": false, 494 | "locked": { 495 | "lastModified": 1708969706, 496 | "narHash": "sha256-KakKnOBeWxh0exu44beZ7cbr5ni4RA9vkWYb9sGMb8Q=", 497 | "owner": "RPi-Distro", 498 | "repo": "bluez-firmware", 499 | "rev": "78d6a07730e2d20c035899521ab67726dc028e1c", 500 | "type": "github" 501 | }, 502 | "original": { 503 | "owner": "RPi-Distro", 504 | "ref": "bookworm", 505 | "repo": "bluez-firmware", 506 | "type": "github" 507 | } 508 | }, 509 | "rpi-firmware-nonfree-src": { 510 | "flake": false, 511 | "locked": { 512 | "lastModified": 1723266537, 513 | "narHash": "sha256-T7eTKXqY9cxEMdab8Snda4CEOrEihy5uOhA6Fy+Mhnw=", 514 | "owner": "RPi-Distro", 515 | "repo": "firmware-nonfree", 516 | "rev": "4b356e134e8333d073bd3802d767a825adec3807", 517 | "type": "github" 518 | }, 519 | "original": { 520 | "owner": "RPi-Distro", 521 | "ref": "bookworm", 522 | "repo": "firmware-nonfree", 523 | "type": "github" 524 | } 525 | }, 526 | "rpi-firmware-src": { 527 | "flake": false, 528 | "locked": { 529 | "lastModified": 1728405098, 530 | "narHash": "sha256-4gnK0KbqFnjBmWia9Jt2gveVWftmHrprpwBqYVqE/k0=", 531 | "owner": "raspberrypi", 532 | "repo": "firmware", 533 | "rev": "7bbb5f80d20a2335066a8781459c9f33e5eebc64", 534 | "type": "github" 535 | }, 536 | "original": { 537 | "owner": "raspberrypi", 538 | "ref": "1.20241008", 539 | "repo": "firmware", 540 | "type": "github" 541 | } 542 | }, 543 | "rpi-linux-6_12_17-src": { 544 | "flake": false, 545 | "locked": { 546 | "lastModified": 1740765145, 547 | "narHash": "sha256-hoCsGc4+RC/2LmxDtswLBL5ZhWlw4vSiL4Vkl39r2MU=", 548 | "owner": "raspberrypi", 549 | "repo": "linux", 550 | "rev": "5985ce32e511f4e8279a841a1b06a8c7d972b386", 551 | "type": "github" 552 | }, 553 | "original": { 554 | "owner": "raspberrypi", 555 | "ref": "rpi-6.12.y", 556 | "repo": "linux", 557 | "type": "github" 558 | } 559 | }, 560 | "rpi-linux-6_6_78-src": { 561 | "flake": false, 562 | "locked": { 563 | "lastModified": 1740503700, 564 | "narHash": "sha256-Y8+ot4Yi3UKwlZK3ap15rZZ16VZDvmeFkD46+6Ku7bE=", 565 | "owner": "raspberrypi", 566 | "repo": "linux", 567 | "rev": "2e071057fded90e789c0101498e45a1778be93fe", 568 | "type": "github" 569 | }, 570 | "original": { 571 | "owner": "raspberrypi", 572 | "ref": "rpi-6.6.y", 573 | "repo": "linux", 574 | "type": "github" 575 | } 576 | }, 577 | "rpi-linux-stable-src": { 578 | "flake": false, 579 | "locked": { 580 | "lastModified": 1728403745, 581 | "narHash": "sha256-phCxkuO+jUGZkfzSrBq6yErQeO2Td+inIGHxctXbD5U=", 582 | "owner": "raspberrypi", 583 | "repo": "linux", 584 | "rev": "5aeecea9f4a45248bcf564dec924965e066a7bfd", 585 | "type": "github" 586 | }, 587 | "original": { 588 | "owner": "raspberrypi", 589 | "ref": "stable_20241008", 590 | "repo": "linux", 591 | "type": "github" 592 | } 593 | }, 594 | "rpicam-apps-src": { 595 | "flake": false, 596 | "locked": { 597 | "lastModified": 1727515047, 598 | "narHash": "sha256-qCYGrcibOeGztxf+sd44lD6VAOGoUNwRqZDdAmcTa/U=", 599 | "owner": "raspberrypi", 600 | "repo": "rpicam-apps", 601 | "rev": "a8ccf9f3cd9df49875dfb834a2b490d41d226031", 602 | "type": "github" 603 | }, 604 | "original": { 605 | "owner": "raspberrypi", 606 | "ref": "v1.5.2", 607 | "repo": "rpicam-apps", 608 | "type": "github" 609 | } 610 | }, 611 | "systems": { 612 | "locked": { 613 | "lastModified": 1681028828, 614 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 615 | "owner": "nix-systems", 616 | "repo": "default", 617 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 618 | "type": "github" 619 | }, 620 | "original": { 621 | "owner": "nix-systems", 622 | "repo": "default", 623 | "type": "github" 624 | } 625 | }, 626 | "systems_2": { 627 | "locked": { 628 | "lastModified": 1681028828, 629 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 630 | "owner": "nix-systems", 631 | "repo": "default", 632 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 633 | "type": "github" 634 | }, 635 | "original": { 636 | "owner": "nix-systems", 637 | "repo": "default", 638 | "type": "github" 639 | } 640 | }, 641 | "systems_3": { 642 | "locked": { 643 | "lastModified": 1681028828, 644 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 645 | "owner": "nix-systems", 646 | "repo": "default", 647 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 648 | "type": "github" 649 | }, 650 | "original": { 651 | "owner": "nix-systems", 652 | "repo": "default", 653 | "type": "github" 654 | } 655 | }, 656 | "systems_4": { 657 | "locked": { 658 | "lastModified": 1681028828, 659 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 660 | "owner": "nix-systems", 661 | "repo": "default", 662 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 663 | "type": "github" 664 | }, 665 | "original": { 666 | "owner": "nix-systems", 667 | "repo": "default", 668 | "type": "github" 669 | } 670 | }, 671 | "systems_5": { 672 | "locked": { 673 | "lastModified": 1681028828, 674 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 675 | "owner": "nix-systems", 676 | "repo": "default", 677 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 678 | "type": "github" 679 | }, 680 | "original": { 681 | "owner": "nix-systems", 682 | "repo": "default", 683 | "type": "github" 684 | } 685 | }, 686 | "systems_6": { 687 | "locked": { 688 | "lastModified": 1681028828, 689 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 690 | "owner": "nix-systems", 691 | "repo": "default", 692 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 693 | "type": "github" 694 | }, 695 | "original": { 696 | "owner": "nix-systems", 697 | "repo": "default", 698 | "type": "github" 699 | } 700 | }, 701 | "systems_7": { 702 | "locked": { 703 | "lastModified": 1681028828, 704 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 705 | "owner": "nix-systems", 706 | "repo": "default", 707 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 708 | "type": "github" 709 | }, 710 | "original": { 711 | "owner": "nix-systems", 712 | "repo": "default", 713 | "type": "github" 714 | } 715 | }, 716 | "systems_8": { 717 | "locked": { 718 | "lastModified": 1681028828, 719 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 720 | "owner": "nix-systems", 721 | "repo": "default", 722 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 723 | "type": "github" 724 | }, 725 | "original": { 726 | "owner": "nix-systems", 727 | "repo": "default", 728 | "type": "github" 729 | } 730 | } 731 | }, 732 | "root": "root", 733 | "version": 7 734 | } 735 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "eraserhd's machine configs"; 3 | 4 | inputs = { 5 | add-missing.url = "github:eraserhd/add-missing"; 6 | add-missing.inputs.nixpkgs.follows = "nixpkgs"; 7 | bCNC-nix.url = "github:eraserhd/bCNC-nix"; 8 | bCNC-nix.inputs.nixpkgs.follows = "nixpkgs"; 9 | darwin.url = "github:LnL7/nix-darwin/master"; 10 | darwin.inputs.nixpkgs.follows = "nixpkgs"; 11 | home-manager.url = "github:nix-community/home-manager/release-25.05"; 12 | home-manager.inputs.nixpkgs.follows = "nixpkgs"; 13 | kak-ansi.url = "github:eraserhd/kak-ansi"; 14 | kak-ansi.inputs.nixpkgs.follows = "nixpkgs"; 15 | kak-babashka.url = "github:eraserhd/kak-babashka"; 16 | kak-babashka.inputs.nixpkgs.follows = "nixpkgs"; 17 | nixpkgs.url = "github:NixOS/nixpkgs/release-25.05"; 18 | parinfer-rust.url = "github:eraserhd/parinfer-rust"; 19 | parinfer-rust.inputs.nixpkgs.follows = "nixpkgs"; 20 | plugbench.url = "github:plugbench/nix-plugbench"; 21 | plugbench.inputs.nixpkgs.follows = "nixpkgs"; 22 | raspberry-pi-nix.url = "github:nix-community/raspberry-pi-nix"; 23 | raspberry-pi-nix.inputs.nixpkgs.follows = "nixpkgs"; 24 | }; 25 | 26 | outputs = 27 | { self 28 | , add-missing 29 | , bCNC-nix 30 | , darwin 31 | , home-manager 32 | , kak-ansi 33 | , kak-babashka 34 | , nixpkgs 35 | , parinfer-rust 36 | , plugbench 37 | , raspberry-pi-nix 38 | }@inputs: 39 | let 40 | overlays = { 41 | nixpkgs.overlays = [ 42 | add-missing.overlays.default 43 | bCNC-nix.overlays.default 44 | kak-ansi.overlays.default 45 | kak-babashka.overlays.default 46 | parinfer-rust.overlays.default 47 | ]; 48 | }; 49 | in { 50 | darwinConfigurations."V3Q9GYKM9C" = darwin.lib.darwinSystem { 51 | system = "aarch64-darwin"; 52 | modules = [ 53 | ./os/nix-darwin 54 | ./hosts/V3Q9GYKM9C 55 | ./common.nix 56 | home-manager.darwinModules.home-manager 57 | overlays 58 | plugbench.darwinModules.default 59 | ]; 60 | specialArgs = { inherit inputs; }; 61 | }; 62 | 63 | nixosConfigurations.crunch = nixpkgs.lib.nixosSystem { 64 | system = "x86_64-linux"; 65 | modules = [ 66 | ./os/nixos 67 | ./hosts/crunch 68 | ./common.nix 69 | home-manager.nixosModules.home-manager 70 | overlays 71 | plugbench.nixosModules.default 72 | ]; 73 | specialArgs = { inherit inputs; }; 74 | }; 75 | 76 | nixosConfigurations.cnc = nixpkgs.lib.nixosSystem { 77 | system = "aarch64-linux"; 78 | modules = [ 79 | raspberry-pi-nix.nixosModules.raspberry-pi 80 | raspberry-pi-nix.nixosModules.sd-image 81 | ./os/nixos 82 | ./hosts/cnc 83 | ./common.nix 84 | home-manager.nixosModules.home-manager 85 | overlays 86 | plugbench.nixosModules.default 87 | ]; 88 | specialArgs = { inherit inputs; }; 89 | }; 90 | }; 91 | } 92 | -------------------------------------------------------------------------------- /fonts/Input-Font.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/fonts/Input-Font.zip -------------------------------------------------------------------------------- /fonts/default.nix: -------------------------------------------------------------------------------- 1 | { options, lib, pkgs, ... }: 2 | 3 | let 4 | custom-input-fonts = pkgs.stdenv.mkDerivation { 5 | pname = "input-fonts"; 6 | version = "2019-11-25"; # date of the download and checksum 7 | 8 | src = ./Input-Font.zip; 9 | 10 | nativeBuildInputs = [ pkgs.unzip ]; 11 | 12 | phases = [ "unpackPhase" "installPhase" ]; 13 | 14 | sourceRoot = "."; 15 | 16 | installPhase = '' 17 | mkdir -p $out/share/fonts/truetype 18 | find Input_Fonts -name "*.ttf" -exec cp -a {} "$out"/share/fonts/truetype/ \; 19 | mkdir -p "$out"/share/doc 20 | cp -a *.txt "$out"/share/doc/ 21 | ''; 22 | 23 | outputHashAlgo = "sha256"; 24 | outputHashMode = "recursive"; 25 | outputHash = "14bfyjnhsbxv9v76ngn0v7fb6f7xahnmny38251nm9dhai66zqx8"; 26 | 27 | meta = with lib; { 28 | description = "Fonts for Code, from Font Bureau"; 29 | longDescription = '' 30 | Input is a font family designed for computer programming, data, 31 | and text composition. It was designed by David Jonathan Ross 32 | between 2012 and 2014 and published by The Font Bureau. It 33 | contains a wide array of styles so you can fine-tune the 34 | typography that works best in your editing environment. 35 | 36 | Input Mono is a monospaced typeface, where all characters occupy 37 | a fixed width. Input Sans and Serif are proportional typefaces 38 | that are designed with all of the features of a good monospace — 39 | generous spacing, large punctuation, and easily distinguishable 40 | characters — but without the limitations of a fixed width. 41 | ''; 42 | homepage = "https://input.fontbureau.com"; 43 | license = licenses.unfree; 44 | maintainers = with maintainers; [ romildo ]; 45 | platforms = platforms.all; 46 | }; 47 | }; 48 | in { 49 | config = { 50 | fonts = { 51 | packages = with pkgs; [ 52 | custom-input-fonts 53 | mononoki 54 | fira-sans 55 | ]; 56 | }; 57 | }; 58 | } 59 | -------------------------------------------------------------------------------- /hosts/V3Q9GYKM9C/default.nix: -------------------------------------------------------------------------------- 1 | { config, inputs, pkgs, ... }: 2 | 3 | { 4 | nix.nixPath = [ { 5 | inherit (inputs) nixpkgs darwin; 6 | } ]; 7 | 8 | programs.bash.enable = true; 9 | 10 | homebrew = { 11 | enable = true; 12 | onActivation.cleanup = "zap"; 13 | }; 14 | 15 | bubbles.enable = true; 16 | 17 | environment.xdgRuntimeDir.enable = true; 18 | 19 | users.users.jfelice = { 20 | name = "jfelice"; # Needed by home-manager 21 | home = "/Users/jfelice"; 22 | shell = pkgs.zsh; 23 | }; 24 | 25 | local.kits.workstation.enable = true; 26 | local.buildkite.enable = true; 27 | services.k3s.enable = true; 28 | 29 | plugbench.plumber.enable = true; 30 | 31 | # Used for backwards compatibility, please read the changelog before changing. 32 | # $ darwin-rebuild changelog 33 | system.stateVersion = 4; 34 | home-manager.users.jfelice.home.stateVersion = "22.05"; 35 | 36 | # You should generally set this to the total number of logical cores in your system. 37 | # $ sysctl -n hw.ncpu 38 | nix.settings = { 39 | max-jobs = 2; 40 | cores = 4; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /hosts/cnc/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, modulePath, ... }: 2 | 3 | with lib; 4 | { 5 | # Raspberry Pi 3B, 1Gig RAM 6 | raspberry-pi-nix.board = "bcm2711"; 7 | 8 | boot = { 9 | initrd.availableKernelModules = [ "xhci_pci" "usb_storage" "usbhid" ]; 10 | tmp.cleanOnBoot = true; 11 | kernelParams = [ "usbcore.autosuspend=-1" ]; 12 | }; 13 | 14 | fileSystems."/" = { 15 | device = "/dev/disk/by-label/NIXOS_SD"; 16 | fsType = "ext4"; 17 | }; 18 | 19 | hardware.enableRedistributableFirmware = true; 20 | hardware.enableAllFirmware = true; 21 | hardware.firmware = [ 22 | pkgs.linux-firmware 23 | ]; 24 | hardware.graphics.enable = true; 25 | 26 | hardware.raspberry-pi.config."" = { 27 | dt-overlays = { 28 | dwc2 = { 29 | enable = true; 30 | params = { 31 | dr_mode = { 32 | enable = true; 33 | value = "host"; 34 | }; 35 | }; 36 | }; 37 | }; 38 | }; 39 | 40 | networking = { 41 | hostName = "cnc"; 42 | firewall.enable = false; 43 | wireless = { 44 | interfaces = [ "wlan0" ]; 45 | }; 46 | }; 47 | 48 | environment.systemPackages = with pkgs; [ 49 | pinentry 50 | libraspberrypi 51 | raspberrypi-eeprom 52 | ]; 53 | 54 | programs.gnupg.agent = { 55 | enable = true; 56 | enableExtraSocket = false; 57 | }; 58 | 59 | services.openssh.enable = true; 60 | 61 | local.services.X11.enable = true; 62 | services.xserver = { 63 | displayManager.autoLogin = { 64 | enable = true; 65 | user = "jfelice"; 66 | }; 67 | }; 68 | 69 | programs.ssh.startAgent = true; 70 | 71 | nixpkgs.config.allowUnfree = true; 72 | 73 | users.mutableUsers = false; 74 | users.users = { 75 | jfelice = { 76 | uid = 904137886; 77 | group = "twou"; 78 | hashedPassword = "$6$ivLP1KZ08UiUOZT9$xVmR1e.Gw5NEmFWdgIcTLFmybGrh71Vt01I/bIpFajZuX7j7M5C0EURIiEQQJyt4ORM9DPrUsIXfbOU/SEFF4/"; 79 | isNormalUser = true; 80 | home = "/home/jfelice"; 81 | extraGroups = [ "docker" "wheel" "dialout" ]; 82 | openssh.authorizedKeys.keys = config.local.authorizedKeys.jfelice; 83 | }; 84 | alex = { 85 | isNormalUser = true; 86 | home = "/home/alex"; 87 | extraGroups = [ "docker" "wheel" "dialout" ]; 88 | openssh.authorizedKeys.keys = config.local.authorizedKeys.alex; 89 | }; 90 | root.openssh.authorizedKeys.keys = config.local.authorizedKeys.jfelice; 91 | }; 92 | users.groups.twou.gid = 151928526; 93 | 94 | security.sudo.extraConfig = '' 95 | jfelice ALL=(ALL:ALL) NOPASSWD: ALL 96 | alex ALL=(ALL:ALL) NOPASSWD: ALL 97 | ''; 98 | 99 | home-manager.verbose = true; 100 | home-manager.users.jfelice.home.stateVersion = "22.05"; 101 | 102 | system.stateVersion = "25.05"; 103 | 104 | local.networking.respite-wifi.enable = true; 105 | local.sendOutgoingMailWithSES.enable = true; 106 | 107 | local.kits.workstation.enable = true; 108 | local.kits.pcbs.enable = false; 109 | local.kits.cnc.enable = true; 110 | } 111 | -------------------------------------------------------------------------------- /hosts/crunch/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | { 5 | boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ]; 6 | boot.initrd.kernelModules = [ ]; 7 | boot.kernelModules = [ "kvm-amd" ]; 8 | boot.extraModulePackages = [ ]; 9 | boot.kernelPackages = pkgs.linuxPackages_latest; 10 | 11 | # For building Raspberry Pi images 12 | boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; 13 | 14 | fileSystems."/" = { 15 | device = "/dev/disk/by-label/root"; 16 | fsType = "ext4"; 17 | }; 18 | fileSystems."/boot" = { 19 | device = "/dev/disk/by-label/SYSTEM"; 20 | fsType = "vfat"; 21 | }; 22 | swapDevices = [{ 23 | device = "/.swapfile"; 24 | size = 128 * 1024; 25 | }]; 26 | 27 | hardware.enableRedistributableFirmware = true; 28 | # hardware.cpu.amd.updateMicrocode = true; 29 | hardware.enableAllFirmware = true; 30 | hardware.firmware = [ 31 | pkgs.wireless-regdb 32 | pkgs.linux-firmware 33 | ]; 34 | 35 | nix.settings.max-jobs = 2; 36 | nix.settings.cores = 10; 37 | 38 | # Use the systemd-boot EFI boot loader. 39 | boot.loader.systemd-boot.enable = true; 40 | boot.loader.systemd-boot.configurationLimit = 6; 41 | boot.loader.efi.canTouchEfiVariables = true; 42 | boot.tmp.cleanOnBoot = true; 43 | 44 | networking = { 45 | hostName = "crunch"; 46 | firewall.enable = false; 47 | #defaultGateway = { 48 | # address = "10.156.1.1"; 49 | # interface = "wlp5s0"; 50 | #}; 51 | interfaces.enp7s0 = { 52 | useDHCP = true; 53 | #ipv6.addresses = [ 54 | # { 55 | # address = networkParams.ip; 56 | # prefixLength = 64; 57 | # } 58 | #]; 59 | #ipv4.addresses = [ 60 | # { 61 | # address = "10.156.1.42"; 62 | # prefixLength = 24; 63 | # } 64 | #]; 65 | }; 66 | }; 67 | 68 | environment.systemPackages = with pkgs; [ 69 | pinentry 70 | ]; 71 | 72 | documentation.dev.enable = true; 73 | 74 | services.printing = { 75 | enable = true; 76 | drivers = with pkgs; [ 77 | hplip 78 | epson-escpr 79 | epson-escpr2 80 | ]; 81 | }; 82 | services.avahi = { 83 | enable = true; 84 | nssmdns4 = true; 85 | openFirewall = true; 86 | }; 87 | hardware.printers = { 88 | ensurePrinters = [ 89 | { 90 | name = "Laserjet"; 91 | model = "HP/hp-laserjet_200_color_m251-ps.ppd.gz"; 92 | description = "HP Laserjet 200 M251nw (324AEC)"; 93 | deviceUri = "dnssd://HP%20LaserJet%20200%20color%20M251nw%20(324AEC)._ipp._tcp.local/?uuid=434e4431-4837-3733-3536-fc15b4324aec"; 94 | } 95 | { 96 | name = "Epson"; 97 | model = "epson-inkjet-printer-escpr2/Epson-XP-15000_Series-epson-escpr2-en.ppd"; 98 | description = "Epson XP-15000 Series"; 99 | deviceUri = "dnssd://EPSON%20XP-15000%20Series._ipp._tcp.local/?uuid=cfe92100-67c4-11d4-a45f-dccd2fd241db"; 100 | } 101 | ]; 102 | ensureDefaultPrinter = "Laserjet"; 103 | }; 104 | 105 | programs.gnupg.agent = { 106 | enable = true; 107 | enableExtraSocket = false; 108 | # enableSSHSupport = true; 109 | }; 110 | 111 | services.openssh = { 112 | enable = true; 113 | ports = [ 22 443 ]; 114 | extraConfig = '' 115 | ClientAliveCountMax 3 116 | ClientAliveInterval 10 117 | StreamLocalBindUnlink yes 118 | ''; 119 | }; 120 | 121 | services.ollama = { 122 | enable = true; 123 | }; 124 | 125 | virtualisation.docker.enable = true; 126 | 127 | # Allow OpenOCD to access Fiddy Plus 128 | services.udev.extraRules = '' 129 | ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1" 130 | ''; 131 | 132 | local.bluetooth.enable = true; 133 | local.services.X11.enable = true; 134 | services.xserver = { 135 | videoDrivers = [ "nvidia" ]; 136 | xrandrHeads = [ 137 | { 138 | output = "DP-0"; 139 | primary = true; 140 | } 141 | { 142 | output = "HDMI-0"; 143 | } 144 | ]; 145 | screenSection = '' 146 | Option "nvidiaXineramaInfoOrder" "HDMI-0" 147 | Option "metamodes" "HDMI-0: nvidia-auto-select +3840+0, DP-0: nvidia-auto-select +0+0" 148 | ''; 149 | }; 150 | hardware.graphics = { 151 | enable = true; 152 | extraPackages = with pkgs; [ nvidia-vaapi-driver ]; 153 | }; 154 | hardware.nvidia = { 155 | open = true; 156 | package = config.boot.kernelPackages.nvidiaPackages.beta; 157 | }; 158 | services.xserver.displayManager.sessionCommands = '' 159 | xset s off 160 | xset -dpms 161 | xset s noblank 162 | ''; 163 | 164 | security.rtkit.enable = true; # Recommended for pipewire?? 165 | services.pipewire = { 166 | enable = true; 167 | alsa.enable = true; 168 | alsa.support32Bit = true; 169 | pulse.enable = true; 170 | wireplumber.extraConfig.bluetoothEnhancements = { 171 | services.pipewire.wireplumber.extraConfig.bluetoothEnhancements = { 172 | "monitor.bluez.properties" = { 173 | "bluez5.enable-sbc-xq" = true; 174 | "bluez5.enable-msbc" = true; 175 | "bluez5.enable-hw-volume" = true; 176 | "bluez5.roles" = [ "hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag" ]; 177 | "bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ]; 178 | }; 179 | }; 180 | }; 181 | }; 182 | 183 | programs.ssh.startAgent = true; 184 | 185 | nixpkgs.config.allowUnfree = true; 186 | 187 | users.mutableUsers = false; 188 | users.users = { 189 | jfelice = { 190 | hashedPassword = "$6$ivLP1KZ08UiUOZT9$xVmR1e.Gw5NEmFWdgIcTLFmybGrh71Vt01I/bIpFajZuX7j7M5C0EURIiEQQJyt4ORM9DPrUsIXfbOU/SEFF4/"; 191 | isNormalUser = true; 192 | home = "/home/jfelice"; 193 | extraGroups = [ "docker" "wheel" "dialout" ]; 194 | openssh.authorizedKeys.keys = config.local.authorizedKeys.jfelice; 195 | }; 196 | alex = { 197 | isNormalUser = true; 198 | home = "/home/alex"; 199 | extraGroups = [ "docker" "wheel" "dialout" ]; 200 | openssh.authorizedKeys.keys = config.local.authorizedKeys.alex; 201 | }; 202 | root.openssh.authorizedKeys.keys = config.local.authorizedKeys.jfelice; 203 | }; 204 | 205 | security.sudo.extraConfig = '' 206 | jfelice ALL=(ALL:ALL) NOPASSWD: ALL 207 | ''; 208 | 209 | home-manager.verbose = true; 210 | 211 | system.stateVersion = "24.05"; 212 | home-manager.users.jfelice.home.stateVersion = "22.05"; 213 | 214 | local.networking.respite-wifi.enable = true; 215 | local.sendOutgoingMailWithSES.enable = true; 216 | local.updateDNS.enable = true; 217 | local.tmux.paneZeroCommand = "weechat"; 218 | 219 | local.kits.brain.enable = true; 220 | local.kits.workstation.enable = true; 221 | local.kits._3d-printing.enable = true; 222 | local.kits.pcbs.enable = true; 223 | local.kits.cnc.enable = true; 224 | } 225 | -------------------------------------------------------------------------------- /kits/3d-printing/default.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | 3 | with lib; 4 | { 5 | options = { 6 | local.kits._3d-printing.enable = mkEnableOption "3D Printing"; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /kits/brain/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.local.kits.brain; 6 | in { 7 | options = { 8 | local.kits.brain.enable = mkEnableOption "brain"; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /kits/cnc/default.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | 3 | with lib; 4 | { 5 | options = { 6 | local.kits.cnc.enable = mkEnableOption "CNC Head"; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /kits/pcbs/default.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | 3 | with lib; 4 | { 5 | options = { 6 | local.kits.pcbs.enable = mkEnableOption "PCBs"; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /kits/workstation/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | with lib; 4 | { 5 | options = { 6 | local.kits.workstation.enable = mkEnableOption "workstation"; 7 | }; 8 | 9 | config = { 10 | plugbench.token = config.services.nats.settings.authorization.token; 11 | 12 | plugbench.clipboard.enable = true; 13 | plugbench.kakoune.enable = true; 14 | plugbench.plumber.client = true; 15 | }; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /modules/bubbles/default.nix: -------------------------------------------------------------------------------- 1 | { options, config, lib, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.bubbles; 6 | in { 7 | imports = [ 8 | ./file 9 | ]; 10 | options = { 11 | bubbles.enable = mkEnableOption "Bubbles"; 12 | }; 13 | config = mkIf cfg.enable (if (builtins.hasAttr "defaults" options.system) 14 | then { 15 | system.defaults.finder.CreateDesktop = false; 16 | system.defaults.dock.autohide = true; 17 | system.defaults.NSGlobalDomain._HIHideMenuBar = true; 18 | } 19 | else { 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /modules/bubbles/file/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | compiledMagicFile = pkgs.runCommand "compiled-magic" {} '' 6 | mkdir -p $out 7 | ( 8 | cd $out 9 | ${pkgs.file}/bin/file -C -m ${./magic} 10 | mv *-magic.mgc magic.mgc 11 | ) 12 | ''; 13 | in { 14 | config = mkIf config.bubbles.enable { 15 | environment.systemPackages = [ pkgs.file ]; 16 | home-manager.users.jfelice = { pkgs, ... }: { 17 | home.file.".magic.mgc".source = "${compiledMagicFile}/magic.mgc"; 18 | }; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /modules/bubbles/file/magic/scheme: -------------------------------------------------------------------------------- 1 | 0 search/1/w #!/usr/bin/gsi Scheme script text executable 2 | !:mime application/x-scheme 3 | 0 search/1/w #!/usr/bin/env\ gsi Scheme script text executable 4 | !:mime application/x-scheme 5 | 0 search/1/w #!/usr/bin/gsi-script Scheme script text executable 6 | !:mime application/x-scheme 7 | 0 search/1/w #!/usr/bin/env\ gsi-script Scheme script text executable 8 | !:mime application/x-scheme 9 | 0 search/1/w #!/usr/bin/gxi Scheme script text executable 10 | !:mime application/x-scheme 11 | 0 search/1/w #!/usr/bin/env\ gxi Scheme script text executable 12 | !:mime application/x-scheme 13 | -------------------------------------------------------------------------------- /modules/environment/xdg/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.environment.xdgRuntimeDir; 6 | in { 7 | options = { 8 | environment.xdgRuntimeDir.enable = mkEnableOption "Set and make per-user $XDG_RUNTIME_DIR"; 9 | }; 10 | config = mkIf cfg.enable { 11 | assertions = [{ 12 | assertion = pkgs.stdenv.isDarwin; 13 | message = "environment.xdgRuntimeDir.enable is only useful on Darwin"; 14 | }]; 15 | environment.variables.XDG_RUNTIME_DIR = "\$HOME/.run"; 16 | system.activationScripts.userLaunchd.text = '' 17 | mkdir -p ~/.run 18 | launchctl setenv XDG_RUNTIME_DIR ~/.run 19 | ''; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /networking/default.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | 3 | { 4 | config = { 5 | # OpenDNS - AT&T seems to be slowing down all DNS traffic except theirs 6 | #local.networking.nameservers = [ 7 | # "2620:119:35::35" 8 | # "2620:119:53::53" 9 | # "208.67.222.222" 10 | # "208.67.220.220" 11 | #]; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /networking/ses-email/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, options, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.local.sendOutgoingMailWithSES; 6 | in { 7 | options = { 8 | local.sendOutgoingMailWithSES.enable = mkEnableOption "SES"; 9 | }; 10 | 11 | config = mkIf cfg.enable 12 | (if (builtins.hasAttr "msmtp" options.services) 13 | then { 14 | services.msmtp = { 15 | enable = true; 16 | accounts.default = { 17 | auth = true; 18 | user = "AKIATJ6VYKJDVEPD7C75"; 19 | password = builtins.readFile ./password; 20 | host = "email-smtp.us-west-2.amazonaws.com:587"; 21 | domain = "${config.networking.hostName}.${config.networking.domain}"; 22 | port = 587; 23 | tls = true; 24 | tls_starttls = true; 25 | from = "jason.m.felice@gmail.com"; 26 | }; 27 | }; 28 | } 29 | else { 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /networking/ses-email/password: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/networking/ses-email/password -------------------------------------------------------------------------------- /networking/ssh/default.nix: -------------------------------------------------------------------------------- 1 | { options, lib, ... }: 2 | 3 | with lib; 4 | { 5 | options = { 6 | local.authorizedKeys = mkOption { 7 | description = "List of public SSH keys to allow for users"; 8 | type = types.attrsOf (types.listOf types.str); 9 | }; 10 | }; 11 | 12 | config = mkMerge [ 13 | { 14 | local.authorizedKeys = { 15 | alex = [ 16 | (builtins.readFile ./files/id_rsa.pub-alex) 17 | ]; 18 | jfelice = [ 19 | (builtins.readFile ./files/id_rsa.pub) 20 | (builtins.readFile ./files/id_dsa.pub) 21 | (builtins.readFile ./files/id_rsa-backup.pub) 22 | (builtins.readFile ./files/id_rsa-workingcopy.pub) 23 | (builtins.readFile ./files/id_rsa-terminus-iphone.pub) 24 | ("COMMAND=\"#{pkgs.coreutils}/bin/false\" " + (builtins.readFile ./files/id_rsa-macbook.pub)) 25 | ]; 26 | }; 27 | 28 | home-manager.users.jfelice = { pkgs, ... }: { 29 | # .profile is sourced by Xsession, I'm told 30 | home.file.".profile".text = '' 31 | isSshAgentAlive() { 32 | if [ -z "$SSH_AGENT_PID" ]; then 33 | return 1 34 | fi 35 | ps -p "$SSH_AGENT_PID" |grep -q ssh-agent 36 | } 37 | 38 | ensureSshAgent() { 39 | if ! isSshAgentAlive; then 40 | eval "$(ssh-agent)" 41 | fi 42 | } 43 | 44 | case "$0" in 45 | *Xsession) ensureSshAgent;; 46 | esac 47 | ''; 48 | 49 | home.file.".ssh/config".source = ./ssh_config; 50 | }; 51 | } 52 | (if (builtins.hasAttr "launchd" options) 53 | then { 54 | system.activationScripts.extraUserActivation.text = '' 55 | mkdir -p ~/.ssh 56 | chmod 700 ~/.ssh 57 | 58 | cp -ap ${toString ./files}/* ~/.ssh/ 59 | chmod 600 ~/.ssh/id_* ~/.ssh/*.pem 60 | ''; 61 | } 62 | else { 63 | # FIXME: NixOS activation as above 64 | }) 65 | ]; 66 | } 67 | -------------------------------------------------------------------------------- /networking/ssh/files/id_dsa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/networking/ssh/files/id_dsa -------------------------------------------------------------------------------- /networking/ssh/files/id_dsa.pub: -------------------------------------------------------------------------------- 1 | ssh-dss AAAAB3NzaC1kc3MAAACBANIJWwO7dnEaJbWwr1L7Ud/VNUJo8FLu9pc8axq2ofvn5lmHGQRfpL2jWuvCUSR7kDkoOsFNncOr0Tfi3SgWrdnCK1E4bDsZDfI+dcDZuKa7jR0e+sjtr+t1liK4N2ul/BLft6TpawSoBSD1TOtyXu3vZyrciSzSm8Zd/W3/ODDzAAAAFQDHZC2h14wQ6OalHW/ibxtzs2L1xwAAAIBOklm6WUtIQqALFQ48kqCl5cH6kAiSnUFlWnDVCs9DY3A0hDuJoQ3YP01pkB0yu+Cbe2SMxhAS3CDXJIDEtgIsB39Dob/aqqEtoKbG2Qw/zjXd0+PCSUQd12U/XIHOMSTAFqo5wVHQBfe3eHrZV+MnjaUKWYKSYnY350ae0tGXGAAAAIA3s4OkQh5i1rboKzZYPcgu9vm/JhQHCbTOrfvQT8n+QwlfP41/y/tVQsfrC8TplC4StE7/g1Kr872/+Rpli2udntFzU3dMYWhewvq1YjuXNs5KgN4hkcW3m5D5C6I9OIsnh7Z1+NAl28ZEaJ7UgIXWWiqQHhEfwJSKkxjdt9FK6g== jasonf@eraserhead.cronosys.com 2 | -------------------------------------------------------------------------------- /networking/ssh/files/id_rsa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/networking/ssh/files/id_rsa -------------------------------------------------------------------------------- /networking/ssh/files/id_rsa-aws-idris: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/networking/ssh/files/id_rsa-aws-idris -------------------------------------------------------------------------------- /networking/ssh/files/id_rsa-backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/networking/ssh/files/id_rsa-backup -------------------------------------------------------------------------------- /networking/ssh/files/id_rsa-backup.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC0E1j0bYUqeHJLA3NnU98vNRqYtN1aE/9F+HP7dTZfniTtUqQWJ8ljfYisNPmQGL5H2KJILdCs5Q6WGS78X27hOnGjrcBIgJQk5g3ewO1NscIgykzqKp5AMNhMkwzm//zb/pFDbejBwxGBn0Q19CbbOkNEdorOxsQTwvAyyF3wK2TKbvvfSK+YAgYbky3woY1/QQba/7vas4AIOSPDqsBOZ1IMP4JihkdiNlOpycPc7/lIgx7URGmsLmRh7s7p8IqTfJpl/AAmmScgDLMCnpvrPGTgpwgxnY9QLVk3IakBcKHBOvsV+Nk2RSFee0sH9Hf1Jl448eLynHte7CQ+9V9UrVq+mnFr963LYfclLd6K8yLSHRBKw5RqB0bgyXvzky9zL6Dmdx7aGNUwiFlik2PgV2EjNmnHIj2Ik7ISRtQM1AXeWAw8vFBABMXpoaaQRKYzSQtMMC10dmkQzhdUJcsHMAaL3V5Yp6yxt1XTl1a2tvoxCSXiiKFNGSVR0LkDuwc= jfelice@crunch 2 | -------------------------------------------------------------------------------- /networking/ssh/files/id_rsa-macbook: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/networking/ssh/files/id_rsa-macbook -------------------------------------------------------------------------------- /networking/ssh/files/id_rsa-macbook.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLgmnvpJYEkjZYmAemqycqv6qiAYYB4/9gR3HE/2zEYjAhGiD5roiLVV7k2ckFxkjMpv1QYVkyaXsHXwxGE9XoplZCNDbuuXBno//QiDiMHB64jQh0Htckbhp/D2jK/iuOCc3lQ0JiYyK/vRF+bwMLkgnyLnn+PqxRDyYm8LH4T3HcT0r6joMBfIYQfLDY4BwKCcAInWNtjYsWDme1nP3LmOxkKu3mh//zWcn2EGDNoqMJnIvmFvV/2TPquxio7OJbc3DizPhe9gB+ZyQAWFXCxevX0IOSSGfGcGjHh6pbz59EzawSc2En20HGh/9TxsGmFb8dVxdA9kUBr+1PAasx jfelice@C02X421DJHD4 2 | -------------------------------------------------------------------------------- /networking/ssh/files/id_rsa-terminus-iphone.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDWg+Csw7ufYRZdKfyXIwzwJ/5PJ1vAOXDqI7MbFq9d69k8g7zhEaaBkImisSY1d/8l9kODD6BeAsW6ZHs4kkjuXGiTDBi6hFLnZKi2jSVo0HlHjPtFSYHaeR5Iy+sL6+n8rrQWBMvXk9j0uKFqwwdZFJcG+qPaAtxFcD+TKisQnTcr/9Key7MNALmnZtxmO8qYVfNYJ092K/cHllVjBwDdKEBR6kKf552JUufZ6uDYHFigz2eHPM0ZNORiyUyBvtQr/4nCYxxRCKnHfuGYrUdauwyz23Bcp5ysgevbdaj6dHYLcUylh1oqsPHLFlIFtYbye7mKPwqq7+71fg120Q2P Generated By Termius 2 | -------------------------------------------------------------------------------- /networking/ssh/files/id_rsa-workingcopy.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0/PrHaQ5nXnhmeT8ABrxe/to5e8bQz0Cn7N5uXD7JGBc65DdlLP0vPhhQH9GDUHtv+WX3AmkYpIlnUYFeXc1/sLoLbkAQQK8cZuUdx0MEQGWa4EYxIX9FLDrkmIOvs4o2QjQiWIIDmExbk62lNm2CKaQerMiy/m93vRkhpkGnTdnzPafs3DLAMbu4Za+WQGm6kJRdKaCxNw11Rl3cMeixkScwlOpjYIKEs0NbtkKwknAti7gdaxpcoGenjWOsj90GTClCgNZ8jjYQr+3Uo/5FOBlIvhU0S3ctjW7vG4Yww68aSMUrCDIiY3HawccN35X9uT1B6hpu3WpGqg/sz4YV 2 | -------------------------------------------------------------------------------- /networking/ssh/files/id_rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDWF7+WLN7pSk+u/TVjJgwSgGbINq0TWbsHDQI29LNvnbsiMfqXPAUY91zXnaKI/jala3fMH9K96amMhMRRp5qt8X3paJCkTKzPpegxOVNopMOebX9uWf+1BcdUllk4ejNBjeS2dQ63MfpjZ3S5cFeji5G8gUqOLgqZohnPlITs4WU7YEOaIs/1xP/8iKw8MIYr00AUEYqQzq/ucX6ea0ACTHlrw7o0qfqFXWeL4PKaKbad9CwyMXpifAaAoGSW7p2X+bFUFx1uMr01rT+QT8s8+j/u/sVDteAkjMGHDXyMVYmEm1Zc8oa2fUw3OuDk8x/G4YRqZIXkKbCQWAb/5Alb jfelice@2U.com 2 | -------------------------------------------------------------------------------- /networking/ssh/files/id_rsa.pub-alex: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgyqGkRLd8QIHWZDD0CNLfnpMd8LQo/l9H1iLnnkcsvtMDEQ7tQ/gjnJH1TE57Jaz1EHTijFFwBWVnUx7T7bu3VGrKjygelFVp7i0hEJ0tM1pZlI0wA5hcp2Y/iU/nJSc7lqVfb5dCmlMA4D87c5GKaDkXZIdsoNnk4gynBNMC9UJupfZ3NKDTnS9yrepXjOUcwAL2q9dCJUZZw7Ja9Nf8D037OQyYl+0nf0lEUngIpifC+0l35oUzy8WUUgLLHlJ+4gB+pzflU+JErrA7OgudkvSpjx/SXwRbWPNEoex8TYO6LvufKvmRCNwAy60YmCE9nD5vpv6hZHaCzNyn/ikX 2 | -------------------------------------------------------------------------------- /networking/ssh/files/teenyweeny.pem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/networking/ssh/files/teenyweeny.pem -------------------------------------------------------------------------------- /networking/ssh/ssh_config: -------------------------------------------------------------------------------- 1 | IPQoS=none 2 | 3 | Include ~/src/nexus/main/scripts/ssh_config 4 | 5 | Host * 6 | ForwardAgent yes 7 | 8 | Host crunch 9 | HostName crunch.local 10 | ForwardAgent yes 11 | 12 | Host nexus-staging 13 | HostName nexus-staging 14 | User ubuntu 15 | IdentityFile ~/.ssh/nexus-staging.pem 16 | ProxyCommand nc $(aws --region=us-east-2 ec2 describe-instances --filter Name=tag:Name,Values=%h --query="Reservations[*].Instances[*].[LaunchTime, PublicIpAddress]" --output=text |sort |awk '$2 != "None"{n+=1; if (n == 1) print $2}') %p 17 | StrictHostKeyChecking no 18 | UserKnownHostsFile /dev/null 19 | 20 | Host nexus-dev 21 | HostName nexus-dev 22 | User ubuntu 23 | IdentityFile ~/.ssh/nexus-dev.pem 24 | ProxyCommand nc $(aws --region=us-east-1 ec2 describe-instances --filter Name=tag:Name,Values=%h --query="Reservations[*].Instances[*].[LaunchTime, PublicIpAddress]" --output=text |sort |awk '$2 != "None"{n+=1; if (n == 1) print $2}') %p 25 | StrictHostKeyChecking no 26 | UserKnownHostsFile /dev/null 27 | 28 | Host nexus-sfsendgrid 29 | HostName nexus-sfsendgrid 30 | User ubuntu 31 | IdentityFile ~/.ssh/nexus-oregon.pem 32 | ProxyCommand nc $(aws --region=us-west-2 ec2 describe-instances --filter Name=tag:Name,Values=%h --query="Reservations[*].Instances[*].[LaunchTime, PublicIpAddress]" --output=text |sort |awk '$2 != "None"{n+=1; if (n == 1) print $2}') %p 33 | StrictHostKeyChecking no 34 | UserKnownHostsFile /dev/null 35 | -------------------------------------------------------------------------------- /networking/tls/DigiCert_Global_Root_CA.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh 3 | MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 4 | d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD 5 | QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT 6 | MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j 7 | b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG 8 | 9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB 9 | CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97 10 | nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt 11 | 43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P 12 | T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4 13 | gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO 14 | BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR 15 | TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw 16 | DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr 17 | hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg 18 | 06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF 19 | PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls 20 | YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk 21 | CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /networking/tls/DigiCert_Global_Root_G2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh 3 | MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 4 | d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH 5 | MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT 6 | MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j 7 | b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG 8 | 9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI 9 | 2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx 10 | 1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ 11 | q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz 12 | tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ 13 | vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP 14 | BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV 15 | 5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY 16 | 1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4 17 | NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG 18 | Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91 19 | 8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe 20 | pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl 21 | MrY= 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /networking/tls/RapidSSL_RSA_CA_2018.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEsTCCA5mgAwIBAgIQCKWiRs1LXIyD1wK0u6tTSTANBgkqhkiG9w0BAQsFADBh 3 | MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 4 | d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD 5 | QTAeFw0xNzExMDYxMjIzMzNaFw0yNzExMDYxMjIzMzNaMF4xCzAJBgNVBAYTAlVT 6 | MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j 7 | b20xHTAbBgNVBAMTFFJhcGlkU1NMIFJTQSBDQSAyMDE4MIIBIjANBgkqhkiG9w0B 8 | AQEFAAOCAQ8AMIIBCgKCAQEA5S2oihEo9nnpezoziDtx4WWLLCll/e0t1EYemE5n 9 | +MgP5viaHLy+VpHP+ndX5D18INIuuAV8wFq26KF5U0WNIZiQp6mLtIWjUeWDPA28 10 | OeyhTlj9TLk2beytbtFU6ypbpWUltmvY5V8ngspC7nFRNCjpfnDED2kRyJzO8yoK 11 | MFz4J4JE8N7NA1uJwUEFMUvHLs0scLoPZkKcewIRm1RV2AxmFQxJkdf7YN9Pckki 12 | f2Xgm3b48BZn0zf0qXsSeGu84ua9gwzjzI7tbTBjayTpT+/XpWuBVv6fvarI6bik 13 | KB859OSGQuw73XXgeuFwEPHTIRoUtkzu3/EQ+LtwznkkdQIDAQABo4IBZjCCAWIw 14 | HQYDVR0OBBYEFFPKF1n8a8ADIS8aruSqqByCVtp1MB8GA1UdIwQYMBaAFAPeUDVW 15 | 0Uy7ZvCj4hsbw5eyPdFVMA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEF 16 | BQcDAQYIKwYBBQUHAwIwEgYDVR0TAQH/BAgwBgEB/wIBADA0BggrBgEFBQcBAQQo 17 | MCYwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBCBgNVHR8E 18 | OzA5MDegNaAzhjFodHRwOi8vY3JsMy5kaWdpY2VydC5jb20vRGlnaUNlcnRHbG9i 19 | YWxSb290Q0EuY3JsMGMGA1UdIARcMFowNwYJYIZIAYb9bAECMCowKAYIKwYBBQUH 20 | AgEWHGh0dHBzOi8vd3d3LmRpZ2ljZXJ0LmNvbS9DUFMwCwYJYIZIAYb9bAEBMAgG 21 | BmeBDAECATAIBgZngQwBAgIwDQYJKoZIhvcNAQELBQADggEBAH4jx/LKNW5ZklFc 22 | YWs8Ejbm0nyzKeZC2KOVYR7P8gevKyslWm4Xo4BSzKr235FsJ4aFt6yAiv1eY0tZ 23 | /ZN18bOGSGStoEc/JE4ocIzr8P5Mg11kRYHbmgYnr1Rxeki5mSeb39DGxTpJD4kG 24 | hs5lXNoo4conUiiJwKaqH7vh2baryd8pMISag83JUqyVGc2tWPpO0329/CWq2kry 25 | qv66OSMjwulUz0dXf4OHQasR7CNfIr+4KScc6ABlQ5RDF86PGeE6kdwSQkFiB/cQ 26 | ysNyq0jEDQTkfa2pjmuWtMCNbBnhFXBYejfubIhaUbEv2FOQB3dCav+FPg5eEveX 27 | TVyMnGo= 28 | -----END CERTIFICATE----- 29 | -------------------------------------------------------------------------------- /networking/tls/RapidSSL_TLS_RSA_CA_G1.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEszCCA5ugAwIBAgIQCyWUIs7ZgSoVoE6ZUooO+jANBgkqhkiG9w0BAQsFADBh 3 | MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 4 | d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH 5 | MjAeFw0xNzExMDIxMjI0MzNaFw0yNzExMDIxMjI0MzNaMGAxCzAJBgNVBAYTAlVT 6 | MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j 7 | b20xHzAdBgNVBAMTFlJhcGlkU1NMIFRMUyBSU0EgQ0EgRzEwggEiMA0GCSqGSIb3 8 | DQEBAQUAA4IBDwAwggEKAoIBAQC/uVklRBI1FuJdUEkFCuDL/I3aJQiaZ6aibRHj 9 | ap/ap9zy1aYNrphe7YcaNwMoPsZvXDR+hNJOo9gbgOYVTPq8gXc84I75YKOHiVA4 10 | NrJJQZ6p2sJQyqx60HkEIjzIN+1LQLfXTlpuznToOa1hyTD0yyitFyOYwURM+/CI 11 | 8FNFMpBhw22hpeAQkOOLmsqT5QZJYeik7qlvn8gfD+XdDnk3kkuuu0eG+vuyrSGr 12 | 5uX5LRhFWlv1zFQDch/EKmd163m6z/ycx/qLa9zyvILc7cQpb+k7TLra9WE17YPS 13 | n9ANjG+ECo9PDW3N9lwhKQCNvw1gGoguyCQu7HE7BnW8eSSFAgMBAAGjggFmMIIB 14 | YjAdBgNVHQ4EFgQUDNtsgkkPSmcKuBTuesRIUojrVjgwHwYDVR0jBBgwFoAUTiJU 15 | IBiV5uNu5g/6+rkS7QYXjzkwDgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQGCCsG 16 | AQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAGAQH/AgEAMDQGCCsGAQUFBwEB 17 | BCgwJjAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tMEIGA1Ud 18 | HwQ7MDkwN6A1oDOGMWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEds 19 | b2JhbFJvb3RHMi5jcmwwYwYDVR0gBFwwWjA3BglghkgBhv1sAQEwKjAoBggrBgEF 20 | BQcCARYcaHR0cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzALBglghkgBhv1sAQIw 21 | CAYGZ4EMAQIBMAgGBmeBDAECAjANBgkqhkiG9w0BAQsFAAOCAQEAGUSlOb4K3Wtm 22 | SlbmE50UYBHXM0SKXPqHMzk6XQUpCheF/4qU8aOhajsyRQFDV1ih/uPIg7YHRtFi 23 | CTq4G+zb43X1T77nJgSOI9pq/TqCwtukZ7u9VLL3JAq3Wdy2moKLvvC8tVmRzkAe 24 | 0xQCkRKIjbBG80MSyDX/R4uYgj6ZiNT/Zg6GI6RofgqgpDdssLc0XIRQEotxIZcK 25 | zP3pGJ9FCbMHmMLLyuBd+uCWvVcF2ogYAawufChS/PT61D9rqzPRS5I2uqa3tmIT 26 | 44JhJgWhBnFMb7AGQkvNq9KNS9dd3GWc17H/dXa1enoxzWjE0hBdFjxPhUb0W3wi 27 | 8o34/m8Fxw== 28 | -----END CERTIFICATE----- 29 | -------------------------------------------------------------------------------- /networking/tls/crunch.eraserhead.net.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFtzCCBJ+gAwIBAgIQCZnVbzcUbPkWITlVmpTAODANBgkqhkiG9w0BAQsFADBe 3 | MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 4 | d3cuZGlnaWNlcnQuY29tMR0wGwYDVQQDExRSYXBpZFNTTCBSU0EgQ0EgMjAxODAe 5 | Fw0yMDAyMTYwMDAwMDBaFw0yMTAyMTUxMjAwMDBaMCAxHjAcBgNVBAMTFWNydW5j 6 | aC5lcmFzZXJoZWFkLm5ldDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB 7 | AMPHsYf5tS86VcJcWOOHzmg5cry1QCeYvV4JpvgaVyFiM3UCxTb0PtRjivy1daxT 8 | /b4DcPPmK0pvXdzLBIt09/68LUiROYd5rPMM4SSCPUuDtK+cnbuZaB2Na1N2JijA 9 | yVp72XZuSP7TkQ2+X724nJdSjYD4MrZNR3Mmfue05w1KDqIlEfL4acojsUTF9YDe 10 | UXOb4WCk+az3VktA7m/Qxgic2IAI4MuQMpIJQbzvaTIS6fkdb3nfkcN9Et2w4Cr3 11 | CcD0mMZ1TBGkeyI79rjaO/4GDbeAqQMZItQqj1HqfTId/CgNdolxMK3gt0oamSyG 12 | qssARNsHLxzY5umJWzSffrkCAwEAAaOCAq0wggKpMB8GA1UdIwQYMBaAFFPKF1n8 13 | a8ADIS8aruSqqByCVtp1MB0GA1UdDgQWBBSx+ALGMmfyBR4W9HANYw/ge/S5TTAg 14 | BgNVHREEGTAXghVjcnVuY2guZXJhc2VyaGVhZC5uZXQwDgYDVR0PAQH/BAQDAgWg 15 | MB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjA+BgNVHR8ENzA1MDOgMaAv 16 | hi1odHRwOi8vY2RwLnJhcGlkc3NsLmNvbS9SYXBpZFNTTFJTQUNBMjAxOC5jcmww 17 | TAYDVR0gBEUwQzA3BglghkgBhv1sAQIwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly93 18 | d3cuZGlnaWNlcnQuY29tL0NQUzAIBgZngQwBAgEwdQYIKwYBBQUHAQEEaTBnMCYG 19 | CCsGAQUFBzABhhpodHRwOi8vc3RhdHVzLnJhcGlkc3NsLmNvbTA9BggrBgEFBQcw 20 | AoYxaHR0cDovL2NhY2VydHMucmFwaWRzc2wuY29tL1JhcGlkU1NMUlNBQ0EyMDE4 21 | LmNydDAJBgNVHRMEAjAAMIIBBAYKKwYBBAHWeQIEAgSB9QSB8gDwAHcAu9nfvB+K 22 | cbWTlCOXqpJ7RzhXlQqrUugakJZkNo4e0YUAAAFwS8NxlQAABAMASDBGAiEA6tjz 23 | +Cyixo14qg6FN3JyZM6R8PcwNfckOWzEvbUIlxECIQD2dxZyYnfO+bkdan5fE/CV 24 | ypwhbKrkT8NL9jIqgAR6tAB1AESUZS6w7s6vxEAH2Kj+KMDa5oK+2MsxtT/TM5a1 25 | toGoAAABcEvDcV4AAAQDAEYwRAIgZSySM032EDpCXnRBL0uQN44Qs01fJzVw3b1G 26 | 4JKIN4wCICwGH7qcsJA67isM9CbilG1fsvROvCChZDEbpdtnYHc9MA0GCSqGSIb3 27 | DQEBCwUAA4IBAQC9mTHYeG2/ON2cXHg5XiJrarOe/e5ofUDjHzpmv6Z+/TJh6TEs 28 | bvX6jwHcO32WEPNgHEKnIpudBk8WkTBh/b7UvCKNSwVbo3aODgZgesiwW7Kpf2KP 29 | qqDXVzgIVnZ4K4HQ8dUwWHR1HfngwyMASlrkHcOVqgJHOD15FoPriXaiNvAMhQQZ 30 | FPB3tohWbZXO7ZDVeajZcYBoVEQEtx2IZeDeE+nu2lp07/oJf16cPD52F7+H1hld 31 | YztyLr8tYo0JRXz3SNFreUlytlKhRnFlWpXRWjMfAHX05BntXfNTVLDUDYOukNcM 32 | uX5+7eiGFcL60HF4y/idGIXP6/vwT/3v3VE6 33 | -----END CERTIFICATE----- 34 | -------------------------------------------------------------------------------- /networking/tls/crunch.eraserhead.net.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIDJzCCAg8CAQAwgYwxCzAJBgNVBAYTAlVTMQ0wCwYDVQQIDARPaGlvMQ8wDQYD 3 | VQQHDAZFdWNsaWQxFDASBgNVBAoMC01haXRyaWEgTExDMR4wHAYDVQQDDBVjcnVu 4 | Y2guZXJhc2VyaGVhZC5uZXQxJzAlBgkqhkiG9w0BCQEWGGphc29uLm0uZmVsaWNl 5 | QGdtYWlsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMPHsYf5 6 | tS86VcJcWOOHzmg5cry1QCeYvV4JpvgaVyFiM3UCxTb0PtRjivy1daxT/b4DcPPm 7 | K0pvXdzLBIt09/68LUiROYd5rPMM4SSCPUuDtK+cnbuZaB2Na1N2JijAyVp72XZu 8 | SP7TkQ2+X724nJdSjYD4MrZNR3Mmfue05w1KDqIlEfL4acojsUTF9YDeUXOb4WCk 9 | +az3VktA7m/Qxgic2IAI4MuQMpIJQbzvaTIS6fkdb3nfkcN9Et2w4Cr3CcD0mMZ1 10 | TBGkeyI79rjaO/4GDbeAqQMZItQqj1HqfTId/CgNdolxMK3gt0oamSyGqssARNsH 11 | LxzY5umJWzSffrkCAwEAAaBVMFMGCSqGSIb3DQEJDjFGMEQwCwYDVR0PBAQDAgQw 12 | MBMGA1UdJQQMMAoGCCsGAQUFBwMBMCAGA1UdEQQZMBeCFWNydW5jaC5lcmFzZXJo 13 | ZWFkLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAo84xh/e9++OEaS9EWATn+RxCRV7y 14 | gOWH/fuEY7JynsJAExvAHfKZBG2A+ndXyudBwiBSxXtNPvduW9OQYCA4DhgYgnF9 15 | GyOEL7rjx6xmAWKQltO3kG20g6NN4FrA8AovwaLKvDNDwV6xsGd6ALQ15p7OWw74 16 | Zbv+YZpVcJhEjExMs9D7pner/ZhlFdk5klaoGHU1AUgN+k01CwLSJ7I9tER7KY6c 17 | 1I1jAF2iAojXrQE4B2+3ckXPCxLHwD9cg43IByueroHoIQTl1Ex4TLGk4Y95mINZ 18 | T9J2XIZNl0E3QePxp6o5Ouh6HD2+LSd5K31hHadnRjShdm8Ul8Zl1R9qeQ== 19 | -----END CERTIFICATE REQUEST----- 20 | -------------------------------------------------------------------------------- /networking/tls/crunch.eraserhead.net.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/networking/tls/crunch.eraserhead.net.key -------------------------------------------------------------------------------- /networking/tls/default.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | 3 | { 4 | config = { 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /networking/update-dns/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, options, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.local.updateDNS; 6 | in { 7 | options = { 8 | local.updateDNS.enable = mkEnableOption "update DNS"; 9 | }; 10 | 11 | config = mkIf cfg.enable { 12 | local.scheduledJobs.updateDNS = { 13 | period = "5min"; 14 | path = with pkgs; [ awscli2 curl gawk host msmtp ]; 15 | script = '' 16 | current_ip="$(curl -s http://ipinfo.io/ip)" 17 | dns_ip="$(host -t A ${config.networking.hostName}.${config.networking.domain} ns-112.awsdns-14.com |awk '$3 == "address"{print $4}')" 18 | if [[ $current_ip = $dns_ip ]]; then 19 | exit 0 20 | fi 21 | 22 | ( 23 | printf 'Subject: crunch IP change\n' 24 | printf 'From: jfelice@crunch.eraserhead.net\n' 25 | printf '\n' 26 | printf 'Current IP: %s\n' "$current_ip" 27 | printf ' DNS IP: %s\n' "$dns_ip" 28 | printf '\n' 29 | 30 | hosted_zone_id=$(aws --profile=jason.m.felice route53 list-hosted-zones-by-name --dns-name="${config.networking.domain}." |sed -ne ' 31 | /^ *"Id": /{ 32 | s/^ *"Id": "// 33 | s,/hostedzone/,, 34 | s/",// 35 | p 36 | } 37 | ') 38 | 39 | AWS_PROFILE=jason.m.felice \ 40 | aws route53 change-resource-record-sets \ 41 | --hosted-zone-id "$hosted_zone_id" \ 42 | --change-batch '{ 43 | "Comment": "update-dns automatic update", 44 | "Changes": [ { 45 | "Action": "UPSERT", 46 | "ResourceRecordSet": { 47 | "Name": "${config.networking.hostName}.${config.networking.domain}", 48 | "Type": "A", 49 | "TTL": 300, 50 | "ResourceRecords": [ { "Value": "'"$current_ip"'" } ] 51 | } 52 | } ] 53 | }' 54 | 55 | printf '\n' 56 | ) 2>&1 |sendmail jason.m.felice@gmail.com 57 | ''; 58 | }; 59 | }; 60 | } 61 | -------------------------------------------------------------------------------- /networking/wifi/default.nix: -------------------------------------------------------------------------------- 1 | { options, ... }: 2 | 3 | { 4 | config = (if (builtins.hasAttr "wireless" options.networking) 5 | then { 6 | networking.wireless.networks = import ./networks.nix; 7 | } 8 | else { 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /networking/wifi/networks.nix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/networking/wifi/networks.nix -------------------------------------------------------------------------------- /os/common/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./modules/k3s 4 | ./modules/networking 5 | ./modules/schedule 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /os/common/modules/k3s/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.services.k3s; 6 | in { 7 | options = { 8 | services.k3s.manifests = mkOption { 9 | type = types.listOf types.package; 10 | default = []; 11 | description = '' 12 | Manifest to apply on activation. 13 | ''; 14 | }; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /os/common/modules/networking/default.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | 3 | with lib; 4 | { 5 | options = { 6 | local.networking.nameservers = mkOption { 7 | type = types.listOf types.str; 8 | default = []; 9 | example = [ "2620:119:53::53" "208.67.222.222" ]; 10 | description = '' 11 | The list of preferred nameservers. 12 | ''; 13 | }; 14 | 15 | local.networking.respite-wifi.enable = mkEnableOption "Respite Wi-Fi"; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /os/common/modules/schedule/default.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | 3 | with lib; 4 | { 5 | options = { 6 | local.scheduledJobs = mkOption { 7 | default = {}; 8 | description = '' 9 | Lowest-common-denominator, OS-independent scheduled jobs. 10 | ''; 11 | type = types.attrsOf (types.submodule { 12 | options = { 13 | period = mkOption { 14 | description = '' 15 | How often the job runs. 16 | ''; 17 | example = "5min"; 18 | type = types.str; 19 | }; 20 | path = mkOption { 21 | default = []; 22 | type = with types; listOf (oneOf [ package str ]); 23 | description = '' 24 | Packages to add to the job's PATH 25 | environment variable. Both the bin 26 | and sbin subdirectories of each 27 | package are added. 28 | ''; 29 | }; 30 | script = mkOption { 31 | description = '' 32 | Bash shell code to run. 33 | ''; 34 | example = '' 35 | echo hello >>/tmp/log 36 | ''; 37 | type = types.lines; 38 | }; 39 | }; 40 | }); 41 | }; 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /os/nix-darwin/default.nix: -------------------------------------------------------------------------------- 1 | { options, inputs, ... }: 2 | 3 | { 4 | imports = [ 5 | ./modules 6 | ]; 7 | 8 | nix.nixPath = [{ 9 | inherit (inputs) nixpkgs darwin; 10 | }]; 11 | 12 | system.defaults.finder.AppleShowAllExtensions = true; 13 | system.defaults.finder._FXShowPosixPathInTitle = true; 14 | system.defaults.magicmouse.MouseButtonMode = "TwoButton"; 15 | system.defaults.NSGlobalDomain = { 16 | AppleInterfaceStyle = "Dark"; 17 | AppleKeyboardUIMode = 3; 18 | InitialKeyRepeat = 20; 19 | KeyRepeat = 1; 20 | "com.apple.keyboard.fnState" = true; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /os/nix-darwin/modules/default.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | { 3 | imports = [ 4 | ./hammerspoon 5 | ./k3s 6 | ./nats 7 | ./schedule 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /os/nix-darwin/modules/hammerspoon/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.services.hammerspoon; 6 | 7 | cliSymlink = pkgs.writeTextFile { 8 | name = "hammerspoon-cli"; 9 | executable = true; 10 | destination = "/bin/hs"; 11 | text = '' 12 | #!/bin/bash 13 | exec "/Applications/Hammerspoon.app/Contents/Frameworks/hs/hs" "$@" 14 | ''; 15 | }; 16 | in { 17 | options.services.hammerspoon = { 18 | enable = mkEnableOption "Hammerspoon"; 19 | 20 | enableCommandLine = mkOption { 21 | type = types.bool; 22 | default = false; 23 | description = '' 24 | Whether to add `hs` symlink to the path for access to the command-line. 25 | ''; 26 | }; 27 | }; 28 | 29 | config = mkIf cfg.enable { 30 | homebrew.casks = [ "hammerspoon" ]; 31 | 32 | environment.systemPackages = mkIf cfg.enableCommandLine [ 33 | cliSymlink 34 | ]; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /os/nix-darwin/modules/k3s/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.services.k3s; 6 | 7 | # This redirects pacakges to use the rancher-installed versions. An overlay 8 | # is used so that other modules can still refer to these packages to do things 9 | # like run kubectl. 10 | useRancherToolsOverlay = self: super: let 11 | rancher-wrapper = super.callPackage ./rancher-wrapper {}; 12 | in { 13 | docker-compose = rancher-wrapper; 14 | docker-buildx = rancher-wrapper; 15 | helm = rancher-wrapper; 16 | kubectl = rancher-wrapper; 17 | nerdctl = rancher-wrapper; 18 | 19 | inherit rancher-wrapper; 20 | }; 21 | 22 | in { 23 | options = { 24 | services.k3s.enable = mkEnableOption "k3s via Rancher Desktop"; 25 | }; 26 | 27 | config = mkIf cfg.enable { 28 | homebrew.casks = [ "rancher" ]; 29 | environment.systemPackages = with pkgs; [ rancher-wrapper ]; 30 | nixpkgs.overlays = [ useRancherToolsOverlay ]; 31 | 32 | programs.zsh.interactiveShellInit = '' 33 | autoload -Uz compinit 34 | compinit 35 | source <(${pkgs.rancher-wrapper}/bin/kubectl completion zsh) 36 | ''; 37 | programs.bash.interactiveShellInit = '' 38 | source <(${pkgs.rancher-wrapper}/bin/kubectl completion bash) 39 | ''; 40 | programs.fish.interactiveShellInit = '' 41 | ${pkgs.rancher-wrapper}/bin/kubectl completion fish |source 42 | ''; 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /os/nix-darwin/modules/k3s/rancher-wrapper/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv }: 2 | 3 | stdenv.mkDerivation { 4 | name = "rancher-wrapper"; 5 | src = ./.; 6 | installPhase = '' 7 | runHook preInstall 8 | mkdir -p $out/bin 9 | commands=( 10 | docker 11 | docker-buildx 12 | docker-compose 13 | docker-credential-ecr-login 14 | docker-credential-none 15 | docker-credential-osxkeychain 16 | helm 17 | kubectl 18 | kuberlr 19 | nerdctl 20 | rdctl 21 | ) 22 | for command in "''${commands[@]}"; do 23 | ( 24 | printf '#!/usr/bin/env bash\n' 25 | printf 'exec ~/.rd/bin/%s "$@"\n' "$command" 26 | )>"$out/bin/$command" 27 | done 28 | chmod +x $out/bin/* 29 | 30 | runHook postInstall 31 | ''; 32 | } 33 | -------------------------------------------------------------------------------- /os/nix-darwin/modules/nats/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.services.nats; 6 | 7 | format = pkgs.formats.json { }; 8 | 9 | configFile = format.generate "nats.conf" cfg.settings; 10 | 11 | in { 12 | options = { 13 | services.nats = { 14 | enable = mkEnableOption (mdDoc "NATS messaging system"); 15 | 16 | user = mkOption { 17 | type = types.str; 18 | default = "nats"; 19 | description = mdDoc "User account under which NATS runs."; 20 | }; 21 | 22 | group = mkOption { 23 | type = types.str; 24 | default = "nats"; 25 | description = mdDoc "Group under which NATS runs."; 26 | }; 27 | 28 | serverName = mkOption { 29 | default = "nats"; 30 | example = "n1-c3"; 31 | type = types.str; 32 | description = mdDoc "Name of the NATS server, must be unique if clustered."; 33 | }; 34 | 35 | jetstream = mkEnableOption (mdDoc "JetStream"); 36 | 37 | port = mkOption { 38 | default = 4222; 39 | type = types.port; 40 | description = mdDoc "Port on which to listen"; 41 | }; 42 | 43 | dataDir = mkOption { 44 | default = "/private/var/lib/nats"; 45 | type = types.path; 46 | description = mdDoc '' 47 | The NATS data directory. Only used if JetStream is enabled, for 48 | storing stream metadata and messages. 49 | 50 | If left as the default value this directory will automatically be 51 | created before the NATS server starts, otherwise the sysadmin is 52 | responsible for ensuring the directory exists with appropriate 53 | ownership and permissions. 54 | ''; 55 | }; 56 | 57 | settings = mkOption { 58 | default = { }; 59 | type = format.type; 60 | example = literalExpression '' 61 | { 62 | jetstream = { 63 | max_mem = "1G"; 64 | max_file = "10G"; 65 | }; 66 | }; 67 | ''; 68 | description = mdDoc '' 69 | Declarative NATS configuration. See the 70 | [ 71 | NATS documentation](https://docs.nats.io/nats-server/configuration) for a list of options. 72 | ''; 73 | }; 74 | }; 75 | }; 76 | 77 | config = mkIf cfg.enable { 78 | services.nats.settings = { 79 | server_name = cfg.serverName; 80 | port = cfg.port; 81 | jetstream = optionalAttrs cfg.jetstream { store_dir = cfg.dataDir; }; 82 | }; 83 | 84 | launchd.daemons.nats = { 85 | path = with pkgs; [ nats-server ]; 86 | script = '' 87 | nats-server -c ${configFile} 88 | ''; 89 | serviceConfig = { 90 | KeepAlive = true; 91 | UserName = cfg.user; 92 | GroupName = cfg.group; 93 | StandardOutPath = "/var/log/nats.out.log"; 94 | StandardErrorPath = "/var/log/nats.err.log"; 95 | }; 96 | }; 97 | 98 | system.activationScripts.preActivation.text = '' 99 | mkdir -p '${cfg.dataDir}' 100 | touch /var/log/nats.out.log /var/log/nats.err.log 101 | chown 4222:4222 '${cfg.dataDir}' /var/log/nats.out.log /var/log/nats.err.log 102 | ''; 103 | 104 | users.knownUsers = ["nats"]; 105 | users.knownGroups = ["nats"]; 106 | 107 | users.users = mkIf (cfg.user == "nats") { 108 | nats = { 109 | uid = 4222; 110 | description = "NATS daemon user"; 111 | home = cfg.dataDir; 112 | }; 113 | }; 114 | 115 | users.groups = mkIf (cfg.group == "nats") { 116 | nats = { 117 | gid = 4222; 118 | description = "NATS daemon group"; 119 | members = [ cfg.user ]; 120 | }; 121 | }; 122 | }; 123 | } 124 | -------------------------------------------------------------------------------- /os/nix-darwin/modules/schedule/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | 3 | let 4 | cfg = config.local.scheduledJobs; 5 | in { 6 | config = lib.mkIf (cfg != {}) { 7 | assertions = [{ 8 | assertion = false; 9 | message = "local.scheduledJobs not yet implemented on nix-darwin"; 10 | }]; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /os/nixos/default.nix: -------------------------------------------------------------------------------- 1 | { options, config, inputs, lib, pkgs, ... }: 2 | 3 | with lib; 4 | { 5 | imports = [ 6 | ./modules 7 | ]; 8 | 9 | options = { 10 | local.bluetooth.enable = mkEnableOption "Bluetooth"; 11 | }; 12 | 13 | config = mkMerge [ 14 | { 15 | environment.systemPackages = with pkgs; [ 16 | pciutils 17 | ]; 18 | 19 | nix.nixPath = [ 20 | "nixpkgs=${inputs.nixpkgs}" 21 | ]; 22 | 23 | time.timeZone = "America/New_York"; 24 | } 25 | (mkIf config.local.bluetooth.enable { 26 | hardware.bluetooth = { 27 | enable = true; 28 | powerOnBoot = true; 29 | settings = { 30 | General = { 31 | Enable = "Source,Sink,Media,Socket"; 32 | Experimental = true; 33 | KernelExperimental = true; 34 | FastConnectable = true; 35 | MultiProfile = "multiple"; 36 | JustWorksRepairing = "always"; 37 | }; 38 | Policy = { 39 | AutoEnable = true; 40 | }; 41 | }; 42 | package = pkgs.bluez5-experimental; 43 | }; 44 | # for bluetoothctl 45 | environment.systemPackages = with pkgs; [ 46 | bluez 47 | ]; 48 | }) 49 | ]; 50 | } 51 | -------------------------------------------------------------------------------- /os/nixos/modules/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | ./homebrew 4 | ./k3s 5 | ./networking 6 | ./schedule 7 | ]; 8 | } 9 | -------------------------------------------------------------------------------- /os/nixos/modules/homebrew/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | # This is a stub module for NixOS so the same config modules can be used as 4 | # on nix-darwin. 5 | 6 | with lib; 7 | { 8 | options.homebrew = { 9 | enable = mkEnableOption "Homebrew"; 10 | 11 | taps = mkOption { 12 | type = with types; listOf str; 13 | default = []; 14 | }; 15 | 16 | extraConfig = mkOption { 17 | type = types.str; 18 | default = ""; 19 | }; 20 | 21 | casks = mkOption { 22 | type = with types; listOf str; 23 | default = []; 24 | }; 25 | 26 | formulae = mkOption { 27 | type = with types; listOf str; 28 | default = []; 29 | }; 30 | }; 31 | 32 | config = { 33 | assertions = [ 34 | { 35 | assertion = !config.homebrew.enable; 36 | message = "Cannnot enable Homebrew support on NixOS"; 37 | } 38 | ]; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /os/nixos/modules/k3s/default.nix: -------------------------------------------------------------------------------- 1 | { config, options, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.services.k3s; 6 | in { 7 | config = mkIf cfg.enable { 8 | environment.systemPackages = with pkgs; [ k3s kubectl ]; 9 | services.k3s = { 10 | role = "server"; 11 | }; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /os/nixos/modules/networking/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | 3 | with lib; 4 | { 5 | config = mkIf config.local.networking.respite-wifi.enable { 6 | networking.domain = "eraserhead.net"; 7 | networking.wireless.enable = true; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /os/nixos/modules/schedule/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.local.scheduledJobs; 6 | in { 7 | config = { 8 | systemd.timers = mapAttrs (name: job: { 9 | wantedBy = [ "timers.target" ]; 10 | partOf = [ "${name}.service" ]; 11 | timerConfig = { 12 | OnBootSec = job.period; 13 | OnUnitActiveSec = job.period; 14 | Unit = "${name}.service"; 15 | }; 16 | }) cfg; 17 | 18 | systemd.services = mapAttrs (name: job: { 19 | serviceConfig.Type = "oneshot"; 20 | inherit (job) path script; 21 | }) cfg; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /pkg/default.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | 3 | { 4 | config = { 5 | nixpkgs.overlays = [ 6 | (final: prev: { 7 | local = (prev.local or {}) // { 8 | git-scripts = prev.callPackage ./git-scripts {}; 9 | kak-scrollback-pager = prev.callPackage ./kak-scrollback-pager {}; 10 | }; 11 | bCNC = prev.callPackage ./bCNC {}; 12 | }) 13 | ]; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /pkg/git-scripts/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv, bash, git, gitAndTools }: 2 | 3 | stdenv.mkDerivation { 4 | name = "local-git-scripts-2019.09.05"; 5 | src = ./.; 6 | installPhase = '' 7 | mkdir -p $out/bin 8 | cp git-cleanup git-l git-browse-link $out/bin/ 9 | substituteInPlace $out/bin/git-cleanup \ 10 | --subst-var-by bash '${bash}' \ 11 | --subst-var-by git '${git}' 12 | substituteInPlace $out/bin/git-l \ 13 | --subst-var-by bash '${bash}' \ 14 | --subst-var-by git '${git}' 15 | ''; 16 | } 17 | -------------------------------------------------------------------------------- /pkg/git-scripts/git-browse-link: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bb 2 | (require 3 | '[babashka.fs :as fs] 4 | '[clojure.java.shell :as shell] 5 | '[clojure.string :as str]) 6 | 7 | (def ^:dynamic *dir* (fs/path ".")) 8 | 9 | (defn sh [& args] 10 | (let [{:keys [:out :err :exit]} (apply shell/sh (concat args [:dir (str *dir*)]))] 11 | (when-not (zero? exit) 12 | (printf "Error running %s:\n" (str/join " " args)) 13 | (println err) 14 | (System/exit 3)) 15 | out)) 16 | 17 | (defn reachable? [from to] 18 | (= (sh "git" "merge-base" from to) 19 | (sh "git" "rev-parse" "--verify" from))) 20 | 21 | (defn remote-branches [remote] 22 | (-> (sh "git" "for-each-ref" "--format=%(refname)" (str "refs/remotes/" remote)) 23 | str/split-lines)) 24 | 25 | (defn reachable-from-remote? [head remote] 26 | (not (empty? (->> (remote-branches remote) 27 | (filter #(reachable? head %)))))) 28 | 29 | (defn remotes [] 30 | (-> (sh "git" "remote") 31 | str/split-lines)) 32 | 33 | (defn best-remote [head] 34 | (let [remotes (into #{} (remotes)) 35 | ordered (concat 36 | (when (remotes "upstream") ["upstream"]) 37 | (when (remotes "origin") ["origin"]) 38 | (set/difference remotes #{"upstream" "origin"}))] 39 | (->> ordered 40 | (filter #(reachable-from-remote? head %)) 41 | first))) 42 | 43 | (defn head [] 44 | (-> (sh "git" "rev-parse" "HEAD") 45 | str/trim-newline)) 46 | 47 | (defn origin-url [] 48 | (let [head (head) 49 | remote (best-remote head)] 50 | (when-not remote 51 | (println "git-browse-link: Cannot find HEAD in any remote (push!)") 52 | (System/exit 4)) 53 | (str/trim-newline (sh "git" "remote" "get-url" remote)))) 54 | 55 | (defn make-browse-url-prefix [origin-url] 56 | (let [github (fn [[_ owner repo]] 57 | (format "https://github.com/%s/%s/blob" owner repo))] 58 | (condp re-matches origin-url 59 | #"^git@github\.com:([^/]*)/([^/]*?)(?:\.git)?$" :>> github 60 | #"^https://github\.com/([^/]*)/([^/]*?)(?:\.git)?$" :>> github 61 | origin-url))) 62 | 63 | (defn make-position-anchor [position] 64 | (if-let [[_ line1 line2] (re-matches #"^(\d+)\.\d+,(\d+)\.\d+" (or position ""))] 65 | (let [[line1 line2] (sort [(read-string line1) (read-string line2)])] 66 | (format "#L%s-%s" line1 line2)) 67 | "")) 68 | 69 | (defn full-path-within-repo [filename] 70 | (-> (sh "git" "ls-files" "--full-name" filename) 71 | str/trim-newline)) 72 | 73 | (defn make-git-browse-link [filename position] 74 | (if-let [origin (origin-url)] 75 | (format "%s/%s/%s%s" 76 | (make-browse-url-prefix origin) 77 | (head) 78 | (full-path-within-repo filename) 79 | (make-position-anchor position)) 80 | (do 81 | (printf "git-browse-link: cannot find a remote with commit %s\n" (head)) 82 | (System/exit 3)))) 83 | 84 | (defn -main [filename & [position]] 85 | (let [working-dir (fs/parent (fs/absolutize filename)) 86 | basename (str (last (fs/components filename)))] 87 | (when-not (fs/exists? filename) 88 | (printf "git-browse-link: %s: No such file or directory\n" filename) 89 | (System/exit 1)) 90 | (when (fs/directory? filename) 91 | (printf "git-browse-link: %s is a directory\n" filename) 92 | (System/exit 1)) 93 | (binding [*dir* working-dir] 94 | (println (make-git-browse-link basename position))))) 95 | 96 | (apply -main *command-line-args*) 97 | -------------------------------------------------------------------------------- /pkg/git-scripts/git-cleanup: -------------------------------------------------------------------------------- 1 | #!@bash@/bin/bash 2 | 3 | export PATH="@git@/bin:$PATH" 4 | 5 | # Stop tracking remote branches which are 6 | git fetch || exit $? 7 | for remote in $(git remote) 8 | do 9 | git remote prune "$remote" || exit $? 10 | done 11 | 12 | # Remove local branches which have already been merged 13 | remote_primary_branch=$(git symbolic-ref --short refs/remotes/origin/HEAD) 14 | local_primary_branch=${remote_primary_branch#origin/} 15 | git for-each-ref --format '%(refname)' --merged "$remote_primary_branch" 'refs/heads/*' | \ 16 | while read refname 17 | do 18 | branchname=${refname#refs/heads/} 19 | if [[ $branchname != $local_primary_branch ]] 20 | then 21 | git branch -d "$branchname" 22 | fi 23 | done 24 | -------------------------------------------------------------------------------- /pkg/git-scripts/git-l: -------------------------------------------------------------------------------- 1 | #!@bash@/bin/bash 2 | 3 | HASH="%C(yellow)%h%C(reset)" 4 | RELATIVE_TIME="%C(green)%ar%C(reset)" 5 | AUTHOR="%C(bold blue)%an%C(reset)" 6 | REFS="%C(red)%d%C(reset)" 7 | SUBJECT="%s" 8 | 9 | FORMAT="%<|(21)$HASH%<|(33,trunc)$RELATIVE_TIME %<|(50,trunc)$AUTHOR$REFS $SUBJECT" 10 | 11 | exec @git@/bin/git log --graph --pretty="tformat:$FORMAT" "$@" 12 | -------------------------------------------------------------------------------- /pkg/k3s/default.nix: -------------------------------------------------------------------------------- 1 | { k3s 2 | , makeWrapper 3 | , symlinkJoin 4 | }: 5 | 6 | symlinkJoin { 7 | name = "k3s"; 8 | paths = [ k3s ]; 9 | buildInputs = [ makeWrapper ]; 10 | 11 | postBuild = '' 12 | : 13 | ''; 14 | } 15 | -------------------------------------------------------------------------------- /pkg/kak-scrollback-pager/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , bash 3 | , kakoune 4 | }: 5 | 6 | stdenv.mkDerivation { 7 | name = "kak-scrollback-pager"; 8 | src = ./.; 9 | installPhase = '' 10 | mkdir -p $out/bin 11 | substitute kak-scrollback-pager.bash $out/bin/kak-scrollback-pager \ 12 | --subst-var-by bash '${bash}' \ 13 | --subst-var-by kakoune '${kakoune}' 14 | ''; 15 | } 16 | -------------------------------------------------------------------------------- /pkg/kak-scrollback-pager/kak-scrollback-pager.bash: -------------------------------------------------------------------------------- 1 | #!@bash@/bin/bash 2 | # 3 | # This works with kak-ansi. It might work without if `--stdin-add-formatting` 4 | # is removed below. 5 | # 6 | # Example kitty config: 7 | # scrollback_lines 5000 8 | # map shift+ctrl+h launch --stdin-add-formatting --stdin-source=@screen_scrollback --cwd=current --type=overlay kak-scrollback-pager @scrolled-by @cursor-x @cursor-y @line-count 9 | # 10 | 11 | scrolledBy="$1" 12 | cursorX="$2" 13 | cursorY="$3" 14 | lines="$4" 15 | 16 | # select must happen in the window context, but we are notified of new 17 | # content in the buffer context. For scrollback buffers, we assume there's 18 | # only one client, and the user does not change the buffer in it. 19 | exec @kakoune@/bin/kak -e ' 20 | try %{ declare-option str kak_scrollback_pager_client } 21 | set-option buffer kak_scrollback_pager_client %val{client} 22 | hook -group kak-scrollback-pager buffer BufReadFifo .* %{ 23 | evaluate-commands -client %opt{kak_scrollback_pager_client} %sh{ 24 | cursorLine=$(( kak_buf_line_count - '"$scrolledBy"' - '"$lines"' + '"$cursorY"' )) 25 | printf "select %d.%d,%d.%d\n" "$cursorLine" "'"$cursorX"'" "$cursorLine" "'"$cursorX"'" 26 | printf "execute-keys vt\n" 27 | if [ '"$cursorY"' -gt 2 ]; then 28 | printf "execute-keys %dvk\n" $(( '"$cursorY"' - 2 )) 29 | fi 30 | } 31 | } 32 | map window normal ": delete-buffer! ; quit" 33 | try %{ set-option buffer plumb_wdir %{'"$(pwd)"'} } 34 | ' 35 | -------------------------------------------------------------------------------- /shell/default.nix: -------------------------------------------------------------------------------- 1 | { options, config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.local.loginShell; 6 | 7 | homeDirectory = config.users.users.jfelice.home; 8 | in { 9 | options = { 10 | local.loginShell.package = mkOption { 11 | type = types.package; 12 | default = pkgs.bashInteractive; 13 | description = '' 14 | Package containing user shell. 15 | ''; 16 | example = "pkgs.bashInteractive"; 17 | }; 18 | }; 19 | 20 | config = { 21 | environment.interactiveShellInit = '' 22 | :r() { 23 | local readlink_bin="${pkgs.coreutils}/bin/readlink" 24 | if command -v darwin-rebuild >/dev/null; then 25 | pushd ~/src/dotfiles >/dev/null 26 | TERM=xterm darwin-rebuild build --flake $HOME/src/dotfiles --show-trace || return $? 27 | if [ "$($readlink_bin -f /run/current-system)" != "$($readlink_bin -f ./result)" ] || [ "$1" = "--force" ]; then 28 | TERM=xterm VERBOSE=1 darwin-rebuild switch --flake $HOME/src/dotfiles || return $? 29 | fi 30 | popd >/dev/null 31 | elif command -v nixos-rebuild >/dev/null; then 32 | pushd ~/src/dotfiles >/dev/null 33 | nixos-rebuild build --flake $HOME/src/dotfiles || return $? 34 | if [ "$($readlink_bin -f /run/current-system)" != "$($readlink_bin -f ./result)" ] || [ "$1" = "--force" ]; then 35 | nixos-rebuild switch --use-remote-sudo --flake $HOME/src/dotfiles || return $? 36 | fi 37 | popd >/dev/null 38 | fi 39 | unset __NIX_DARWIN_SET_ENVIRONMENT_DONE __NIXOS_SET_ENVIRONMENT_DONE 40 | unset __ETC_BASHRC_SOURCED __ETC_PROFILE_SOURCED __ETC_PROFILE_DONE 41 | unset __ETC_ZSHENV_SOURCED __ETC_ZSHRC_SOURCED 42 | exec '${pkgs.zsh}${pkgs.zsh.shellPath}' -l 43 | } 44 | 45 | source_if_exists() { 46 | if [ -f "$1" ] 47 | then 48 | source "$1" 49 | fi 50 | } 51 | 52 | source_if_exists ~/.nix-profile/etc/profile.d/nix.sh 53 | source ${homeDirectory}/src/dotfiles/bin/private.sh 54 | 55 | alias k=kubectl 56 | ''; 57 | 58 | environment.variables = { 59 | CLICOLOR = "1"; 60 | }; 61 | 62 | environment.systemPackages = with pkgs; [ 63 | add-missing 64 | bat 65 | broot 66 | direnv 67 | entr 68 | file 69 | fzf 70 | jq 71 | killall 72 | man-pages-posix 73 | nix-prefetch-github 74 | shellcheck 75 | silver-searcher 76 | tableize 77 | tree 78 | unzip 79 | wget 80 | zip 81 | ]; 82 | } // (if (builtins.hasAttr "defaultUserShell" options.users) 83 | then { 84 | users.defaultUserShell = cfg.package; 85 | documentation.man.generateCaches = true; 86 | } 87 | else { 88 | }); 89 | } 90 | -------------------------------------------------------------------------------- /terraform/.gitignore: -------------------------------------------------------------------------------- 1 | /.terraform 2 | /.terraform.lock.hcl 3 | /terraform.tfstate.backup 4 | -------------------------------------------------------------------------------- /terraform/crunch.eraserhead.net.tf: -------------------------------------------------------------------------------- 1 | resource "aws_route53_record" "crunch_eraserhead_net_mx" { 2 | zone_id = aws_route53_zone.eraserhead_net_zone.id 3 | name = "crunch.eraserhead.net" 4 | type = "MX" 5 | ttl = 14400 6 | records = [ "10 inbound-smtp.us-west-2.amazonaws.com" ] 7 | } 8 | 9 | resource "aws_route53_record" "_amazonses_crunch_eraserhead_net" { 10 | zone_id = aws_route53_zone.eraserhead_net_zone.id 11 | name = "_amazonses.crunch.eraserhead.net" 12 | type = "TXT" 13 | ttl = 3600 14 | records = [ "r8xzecfaQLfrrZaXnENC8vnsJsVBG2BUZ8gXLaojV04=" ] 15 | } 16 | 17 | resource "aws_route53_record" "crunch_eraserhead_net_aaaa" { 18 | zone_id = aws_route53_zone.eraserhead_net_zone.id 19 | name = "crunch" 20 | type = "AAAA" 21 | ttl = 3600 22 | records = [ 23 | jsondecode(file("${path.module}/../hosts/crunch/ip.json")).ip 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /terraform/eraserhead.net.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = "us-west-2" 3 | profile = "jason.m.felice" 4 | } 5 | 6 | provider "aws" { 7 | region = "us-east-1" 8 | profile = "jason.m.felice" 9 | alias = "us-east-1" 10 | } 11 | 12 | resource "aws_route53_zone" "eraserhead_net_zone" { 13 | name = "eraserhead.net" 14 | } 15 | 16 | resource "aws_s3_bucket" "eraserhead_net_bucket" { 17 | bucket = "eraserhead.net" 18 | acl = "public-read" 19 | policy = <window-id 23 | "Returns a map of sigil symbol names to window ids" 24 | [] 25 | (let [label? (fn label?* [node] 26 | (and (empty? (:nodes node)) 27 | (= "normal" (:window_type node)))) 28 | to-label (fn to-label* [node] 29 | (concat 30 | (when (label? node) 31 | [node]) 32 | (mapcat to-label* (:nodes node))))] 33 | (into {} (map (fn [window sigil] 34 | [sigil (:window window)]) 35 | (to-label (container-tree)) 36 | sigils)))) 37 | 38 | (defn interpret-dollar-bracket [text] 39 | (let [sigil->window-id (sigil->window-id)] 40 | (str/replace text #"\$\((.)\)" (comp str sigil->window-id second)))) 41 | 42 | ;; ====================================================================== 43 | 44 | (defmulti command 45 | (fn [cmd & args] 46 | (keyword cmd))) 47 | 48 | (defmethod command :i3-exec 49 | [_ msg-text] 50 | (spit "/tmp/foo.txt" msg-text) 51 | (i3-msg (interpret-dollar-bracket msg-text))) 52 | 53 | (defmethod command :relabel 54 | [_] 55 | (let [commands (map (fn [[sigil window-id]] 56 | (format "[id=%d] title_format \"[%s] %%title\"" 57 | window-id 58 | sigil)) 59 | (sigil->window-id))] 60 | (i3-msg (str/join " ; " commands)))) 61 | 62 | (apply command *command-line-args*) 63 | 64 | nil 65 | -------------------------------------------------------------------------------- /tools/inkscape/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.local.kits._3d-printing; 6 | in { 7 | config = mkIf cfg.enable { 8 | environment.systemPackages = [ pkgs.inkscape ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /tools/k9s/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | config = { 5 | environment.systemPackages = with pkgs; [ k9s ]; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /tools/kakoune/default.nix: -------------------------------------------------------------------------------- 1 | { config, options, pkgs, lib, ... }: 2 | 3 | with lib; 4 | { 5 | config = { 6 | nixpkgs.overlays = [ 7 | (self: super: { 8 | kakoune = super.callPackage ./wrapper { 9 | kakoune = super.kakoune.override { 10 | plugins = with pkgs.kakounePlugins; [ 11 | case-kak 12 | kak-ansi 13 | kak-babashka 14 | kak-jira 15 | kakoune-lsp 16 | openscad-kak 17 | parinfer-rust 18 | rep 19 | ]; 20 | }; 21 | }; 22 | }) 23 | ]; 24 | 25 | environment.systemPackages = with pkgs; [ 26 | python310Packages.editorconfig 27 | kakoune 28 | kakoune-lsp 29 | ]; 30 | 31 | environment.variables.EDITOR = "${pkgs.kakoune}/bin/kak"; 32 | environment.interactiveShellInit = '' 33 | man() { 34 | if (( $# == 2 )); then 35 | kak -e "man $2($1)" 36 | return $? 37 | else 38 | kak -e "man $*" 39 | return $? 40 | fi 41 | } 42 | ''; 43 | 44 | home-manager.users.jfelice = { pkgs, ... }: { 45 | home.file.".config/kak/kakrc".source = ./kakrc; 46 | }; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /tools/kakoune/kakrc: -------------------------------------------------------------------------------- 1 | # General Settings 2 | # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ 3 | 4 | set-option global autoreload yes 5 | set-option global grepcmd 'ag --column' 6 | 7 | hook global BufWritePre .* %{ nop %sh{ mkdir -p $(dirname "$kak_hook_param") }} 8 | hook global WinCreate ^[^*]+$ editorconfig-load 9 | 10 | #FIXME: alias global gn grep-next-match 11 | #FIXME: alias global gp grep-previous-match 12 | 13 | # Mappings 14 | # ‾‾‾‾‾‾‾‾ 15 | 16 | map global normal ': execute-keys %val{count}v' 17 | map global normal v ': nop' 18 | 19 | map global normal w ': execute-keys %val{count}a-w' 20 | map global normal W ': execute-keys %val{count}a-W' 21 | map global normal ': execute-keys %val{count}w' 22 | map global normal ': execute-keys %val{count}W' 23 | map global normal b ': execute-keys %val{count}a-b' 24 | map global normal B ': execute-keys %val{count}a-B' 25 | map global normal ': execute-keys %val{count}b' 26 | map global normal ': execute-keys %val{count}B' 27 | map global normal e ': execute-keys %val{count}a-e' 28 | map global normal E ': execute-keys %val{count}a-E' 29 | map global normal ': execute-keys %val{count}e' 30 | map global normal ': execute-keys %val{count}E' 31 | 32 | # Prompt navigation in scrollback 33 | # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ 34 | 35 | map global normal 'gh^ᐅ [^\n];' 36 | map global normal '/^ᐅ \K[^\n]' 37 | 38 | # Appearance 39 | # ‾‾‾‾‾‾‾‾‾‾ 40 | 41 | colorscheme palenight 42 | 43 | set-face global Default rgb:bfc7d5,default 44 | set-face global Whitespace rgb:4b5263,default+fg 45 | set-face global StatusLine rgb:bfc7d5,default 46 | set-face global BufferPadding rgb:4b5263,default 47 | set-face global Prompt rgb:c792ea,default 48 | 49 | set-face global PrimarySelection default,rgb:8700af+g 50 | set-face global SecondarySelection default,rgb:5f0087+g 51 | 52 | set-option global ui_options terminal_assistant=none terminal_status_on_top=true terminal_set_title=false 53 | 54 | set-face global LineNumbersWrapped black 55 | add-highlighter global/matching show-matching 56 | 57 | hook global WinCreate '\*stdin(?:-\d+)?\*' %{ 58 | set-option window filetype scrollback 59 | } 60 | hook global WinSetOption filetype=(?!scrollback).* %{ 61 | try %{ add-highlighter window/number number-lines } 62 | try %{ add-highlighter window/whitespace show-whitespaces -spc ' ' -tab '➤' -lf '↩' } 63 | } 64 | hook global WinSetOption filetype=scrollback %{ 65 | try %{ remove-highlighter window/number } 66 | try %{ remove-highlighter window/whitespace } 67 | } 68 | 69 | define-command highlight-trailing-whitespace %{ 70 | evaluate-commands %sh{ 71 | if [ -z "$kak_client" ]; then 72 | exit 73 | fi 74 | printf %s\\n 'try %{ remove-highlighter window/trailing-whitespace }' 75 | case "$kak_opt_filetype" in 76 | diff) printf %s\\n 'add-highlighter window/trailing-whitespace regex '"'"'^[^\n]+?\K\h+$'"'"' 0:default,rgb:ff5370+g' ;; 77 | *) printf %s\\n 'add-highlighter window/trailing-whitespace regex '"'"'\h+$'"'"' 0:default,rgb:ff5370+g' ;; 78 | esac 79 | } 80 | } 81 | 82 | hook global WinSetOption filetype=(!scrollback).* %{ 83 | hook -once window NormalIdle .* highlight-trailing-whitespace 84 | } 85 | 86 | # Scratch buffers 87 | hook global BufCreate '\*scratch(-\d+)?\*' %{ execute-keys '%' } 88 | 89 | 90 | # Highlight Current Word 91 | # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ 92 | 93 | # Stolen from mawww (and heavily modified!) 94 | declare-option -hidden regex curword 95 | declare-option -hidden str curword_type 'normal' 96 | declare-option -hidden regex curword_word_class 97 | set-face global Reference default,rgb:4a4a4a 98 | add-highlighter global/ dynregex '%opt{curword}' 0:Reference 99 | 100 | define-command -override -hidden highlight-curword-normal %{ 101 | evaluate-commands -draft %{ 102 | try %{ 103 | execute-keys w 104 | set-option buffer curword "(?\A\h+\zi" 188 | } } 189 | } 190 | 191 | define-command -params 0 keep-tabs %{ 192 | remove-hooks window expand-tabs 193 | } 194 | 195 | hook global WinSetOption expandtabs=yes expand-tabs 196 | hook global WinSetOption expandtabs=no keep-tabs 197 | 198 | 199 | # Jump 200 | # ‾‾‾‾ 201 | 202 | declare-option -hidden str jump_search_result 203 | 204 | define-command -hidden -params 1 jump-helper %{ 205 | evaluate-commands %sh{ 206 | if [ "$1" -ef "${kak_buffile}" ]; then 207 | printf 'set-option global jump_search_result "%s"\n' "${kak_client}" 208 | fi 209 | } 210 | } 211 | 212 | define-command -override \ 213 | -docstring %{jump [] [ []] 214 | 215 | Takes all the same switches as edit.} \ 216 | -params 1..3 \ 217 | -file-completion \ 218 | jump %{ 219 | set-option global jump_search_result %opt{jumpclient} 220 | evaluate-commands %sh{ 221 | for client in ${kak_client_list}; do 222 | echo "evaluate-commands -client \"${client}\" %{jump-helper \"$1\"}" 223 | done 224 | } 225 | evaluate-commands -try-client %opt{jump_search_result} %{ 226 | edit %arg{@} 227 | try %{ focus } 228 | } 229 | } 230 | 231 | # Normal Mode 232 | # ‾‾‾‾‾‾‾‾‾‾‾ 233 | 234 | map global normal * 'w"/yn' 235 | map global normal 'w"/y' 236 | 237 | map global user c ': enter-user-mode case' 238 | 239 | # Filetypes 240 | # ‾‾‾‾‾‾‾‾‾ 241 | 242 | hook global WinSetOption filetype=nix %{ 243 | set-option window indentwidth 2 244 | } 245 | 246 | hook global WinSetOption filetype=ruby %{ 247 | set-option window indentwidth 2 248 | } 249 | 250 | # Autowrap 251 | # ‾‾‾‾‾‾‾‾ 252 | 253 | set-option global autowrap_column 78 254 | set-option global autowrap_fmtcmd 'fmt -w %c' 255 | set-option global autowrap_format_paragraph yes 256 | 257 | # Git 258 | # ‾‾‾ 259 | 260 | define-command \ 261 | -override \ 262 | -params 0 \ 263 | git-browse-link %{ 264 | evaluate-commands %sh{ 265 | link=$(git browse-link "$kak_buffile" "$kak_selection_desc" 2>&1) 266 | if [ $? -ne 0 ]; then 267 | printf "fail '" 268 | printf "%s" "$link" |sed -e "s/'/''/g" 269 | printf "'\\n" 270 | exit 271 | fi 272 | printf "set-register '\"' '" 273 | printf "%s" "$link" |sed -e "s/'/''/g" 274 | printf "'\\n" 275 | } 276 | } 277 | 278 | declare-user-mode git 279 | map -docstring 'Git' global user g ': enter-user-mode git' 280 | map -docstring 'Copy a git browse link' global git b ': git-browse-link' 281 | 282 | declare-option -hidden str gist_selection 283 | 284 | define-command -override \ 285 | -docstring %{} \ 286 | gist %{ 287 | evaluate-commands -draft %sh{ 288 | if [ $kak_selection_length -eq 1 ]; then 289 | printf "execute-keys '%%'\\n" 290 | fi 291 | printf 'set-option buffer gist_selection "%%val{selection}"\n' 292 | } 293 | evaluate-commands %sh{ 294 | filename=$(basename "$kak_bufname") 295 | url=$(printf %s "$kak_opt_gist_selection" |gh gist create --filename "$filename" -) 296 | printf "set-register dquote '" 297 | printf %s "$url" |sed -e "s/'/''/g" 298 | printf "'\n" 299 | } 300 | } 301 | 302 | map -docstring 'Copy selection (or file) to a gist' global git g ': gist' 303 | 304 | # Clojure 305 | # ‾‾‾‾‾‾‾ 306 | 307 | hook -once global ModuleLoaded clojure %{ 308 | set-option global clojure_source_directories '(?:[^/.][^/]*)(?:/src|/test|/dev)' 309 | } 310 | 311 | hook global WinSetOption filetype=(clojure|scheme|racket|lisp) %{ 312 | parinfer-enable-window -smart 313 | } 314 | 315 | declare-option -hidden str clojure_buffer_contents 316 | declare-option -hidden str-list clojure_selections 317 | 318 | define-command -override -params 1 -docstring %{Clojure element} \ 319 | clojure-select-object %{ 320 | evaluate-commands -draft %{ 321 | execute-keys '%' 322 | set-option buffer clojure_buffer_contents %val{selection} 323 | } 324 | set-option buffer clojure_selections 325 | evaluate-commands %sh{ 326 | kind="$1" 327 | count="${kak_count-1}" 328 | result_selections='' 329 | for desc in $kak_selections_char_desc; do 330 | anchor_line="${desc%%.*}" 331 | desc="${desc#*.}" 332 | anchor_column="${desc%%,*}" 333 | desc="${desc#*,}" 334 | cursor_line="${desc%%.*}" 335 | cursor_column="${desc#*.}" 336 | extent=whole 337 | case "|${kak_object_flags}|" in 338 | *"|inner|"*) extent=inside;; 339 | esac 340 | direction='' 341 | case "${kak_object_flags}" in 342 | *to_begin*to_end*|*to_end*to_begin*) direction='';; 343 | *to_begin*) direction=to_begin;; 344 | *to_end*) direction=to_end;; 345 | esac 346 | if [ $cursor_line -lt $anchor_line ]; then 347 | dir=forward 348 | elif [ $cursor_line -eq $anchor_line ] && [ $cursor_column -lt $anchor_column ]; then 349 | dir=forward 350 | fi 351 | if [ "$dir" = forward ]; then 352 | cursor_column=$(( cursor_column - 1 )) 353 | else 354 | anchor_column=$(( anchor_column - 1 )) 355 | fi 356 | eval "$(rep --port="@.nrepl-port@${kak_buffile-.}" \ 357 | --op=select \ 358 | --send kind,string,$kind \ 359 | --send count,integer,$count \ 360 | --send combine,string,$kak_select_mode \ 361 | --send direction,string,$direction \ 362 | --send extent,string,$extent \ 363 | --send cursor-line,integer,$cursor_line \ 364 | --send cursor-column,integer,$cursor_column \ 365 | --send anchor-line,integer,$anchor_line \ 366 | --send anchor-column,integer,$anchor_column \ 367 | --print cursor-line,1,ok=yes%ncursor_line=%{cursor-line}%ncursor_column=%{cursor-column}%nanchor_line=%{anchor-line}%nanchor_column=%{anchor-column}%n \ 368 | --print out,2,%{out} \ 369 | --print err,2,%{err} \ 370 | --print value,2,%{value}%n \ 371 | "$kak_opt_clojure_buffer_contents" )" 372 | if [ "$ok" = "yes" ]; then 373 | dir='' 374 | if [ $cursor_line -lt $anchor_line ]; then 375 | dir=forward 376 | elif [ $cursor_line -eq $anchor_line ] && [ $cursor_column -lt $anchor_column ]; then 377 | dir=forward 378 | fi 379 | if [ "$dir" = forward ]; then 380 | cursor_column=$(( cursor_column + 1 )) 381 | else 382 | anchor_column=$(( anchor_column + 1 )) 383 | fi 384 | result_selections="${result_selections} ${anchor_line}.${anchor_column},${cursor_line}.${cursor_column}" 385 | fi 386 | done 387 | printf 'select -codepoint %s\n' "$result_selections" 388 | } 389 | } 390 | 391 | define-command -override centralpark-enable %{ 392 | hook -group centralpark window WinSetOption curword=.* %{ 393 | evaluate-commands %sh{ 394 | cd "$(dirname "$kak_buffile")" 395 | curword=$(printf %s "$kak_opt_curword" |sed -e 's/^.*\\Q//' -e 's/\\E.*$//') 396 | info="$(rep "(dev/describe-curword \"$curword\")" 2>/dev/null |sed -e '/^nil$/d')" 397 | if [ -n "$info" ]; then 398 | printf "info '" 399 | printf %s "$info" |sed -e "s/'/''/g" 400 | printf "'\n" 401 | fi 402 | } 403 | } 404 | } 405 | 406 | define-command -override centralpark-disable %{ 407 | remove-hooks window centralpark 408 | } 409 | 410 | hook -group centralpark global WinSetOption filetype=clojure %{ 411 | evaluate-commands %sh{ 412 | printf 'triggered %s\n' "$kak_buffile" >&2 413 | case "$kak_buffile" in 414 | */src/centralpark/*) printf 'centralpark-enable\n';; 415 | esac 416 | } 417 | } 418 | 419 | define-command -override -params 0 -docstring %{Run all Clojure tests} \ 420 | clojure-test-all %{ 421 | evaluate-commands -draft %{ 422 | repl-send-text "(refresh) (run-tests) 423 | " 424 | } 425 | } 426 | 427 | define-command -override -params 0 -docstring %{Run tests in current Clojure namespace} \ 428 | clojure-test-ns %{ 429 | evaluate-commands -draft %{ 430 | rep-find-namespace 431 | repl-send-text "(refresh) (run-tests '%opt{rep_namespace}) 432 | " 433 | } 434 | } 435 | 436 | define-command -override -params 0 -docstring %{Run selected Clojure test} \ 437 | clojure-test-this %{ 438 | evaluate-commands -draft %{ 439 | clojure-select-object toplevel 440 | execute-keys 'e' 441 | execute-keys 'deftest' # Ensure this is a test 442 | execute-keys '\e\b"ty' 443 | rep-find-namespace 444 | repl-send-text "(refresh) (run-tests '%opt{rep_namespace}/%reg{t}) 445 | " 446 | } 447 | } 448 | 449 | declare-user-mode clojure-test 450 | map -docstring 'Run all tests' global clojure-test a ': clojure-test-all' 451 | map -docstring 'Test this namespace' global clojure-test n ': clojure-test-ns' 452 | map -docstring 'Run test under cursor' global clojure-test t ': clojure-test-this' 453 | 454 | hook -group clojure-objects global WinSetOption filetype=clojure %{ 455 | set-option window indentwidth 2 456 | map -docstring 'Clojure element' window object e ' clojure-select-object element' 457 | map -docstring 'Clojure form' window object f ' clojure-select-object form' 458 | map -docstring 'top-level Clojure form' window object t ' clojure-select-object toplevel' 459 | 460 | #map window normal b '[ clojure-select-object element' 461 | #map window normal B '{ clojure-select-object element' 462 | #map window normal e '] clojure-select-object element' 463 | #map window normal E '} clojure-select-object element' 464 | #map window normal w ' clojure-select-object element' 465 | 466 | map -docstring 'Run tests' window user t ': enter-user-mode clojure-test' 467 | } 468 | 469 | # LSP 470 | # ‾‾‾ 471 | 472 | evaluate-commands %sh{kak-lsp --kakoune -s $kak_session} 473 | hook global WinSetOption filetype=go lsp-enable-window 474 | map global user l ': enter-user-mode lsp' 475 | 476 | # Allow goto to be plumbed with the right dir 477 | hook global WinSetOption lsp_project_root=.+ %{ 478 | set-option window plumb_wdir "%opt{lsp_project_root}" 479 | } 480 | 481 | # Misc 482 | # ‾‾‾‾ 483 | 484 | define-command rm -params 0 %{ 485 | nop %sh{ rm -f "$kak_buffile" } 486 | delete-buffer! 487 | } 488 | 489 | define-command \ 490 | -override \ 491 | -docstring %{mv : move this file to dir or file} \ 492 | -shell-script-candidates 'echo "$kak_bufname"' \ 493 | -params 1 \ 494 | mv %{ 495 | evaluate-commands %sh{ 496 | target="$1" 497 | if $kak_modified; then 498 | printf 'fail "mv: buffer is modified."\n' 499 | exit 500 | fi 501 | if [ -d "$target" ]; then 502 | target="${target}/$(basename "$kak_buffile")" 503 | fi 504 | mkdir -p "$(dirname "$target")" 505 | mv "$kak_buffile" "$target" 506 | if [ $? -ne 0 ]; then 507 | printf 'fail "mv: unable to move file."\n' 508 | exit 509 | fi 510 | printf 'delete-buffer\n' 511 | printf 'edit %%{%s}\n' "$target" 512 | } 513 | } 514 | 515 | # Diff 516 | # ‾‾‾‾ 517 | 518 | hook -group diff-text-objects global WinSetOption filetype=diff %{ 519 | map window -docstring 'diff file' object f ' diff-select-file' 520 | map window -docstring 'diff hunk' object h ' diff-select-hunk' 521 | hook -once -always window WinSetOption filetype=.* %{ 522 | unmap window object f 523 | unmap window object h 524 | } 525 | } 526 | 527 | hook -once global ModuleLoaded diff %{ 528 | add-highlighter shared/diff/comment regex '^#[^\n]*' 0:comment 529 | add-highlighter shared/diff/feedback regex '^>[^\n]*' 0:title 530 | # Use kak-plumb , not diff.kak 531 | # FIXME: There should be a better way to resolve this. 532 | define-command -override diff-jump -params .. plumb-click-diff 533 | } 534 | 535 | # Jumpclient 536 | # ‾‾‾‾‾‾‾‾‾‾ 537 | 538 | set-option global jumpclient %val{client} 539 | hook -group manage-jumpclient global ClientClose .* %{ 540 | evaluate-commands %sh{ 541 | if [ "$kak_opt_jumpclient" = "$kak_hook_param" ]; then 542 | for client in $kak_client_list; do 543 | if [ "$client" != "$kak_hook_param" ]; then 544 | printf 'set-option global jumpclient "%s"\n' "$client" 545 | exit 0 546 | fi 547 | done 548 | fi 549 | } 550 | } 551 | 552 | map global user j ': set-option global jumpclient %val{client}' 553 | 554 | # Nexus 555 | # ‾‾‾‾‾ 556 | define-command \ 557 | -override \ 558 | -params 1 \ 559 | -shell-script-candidates '( cd nexus/services/core/sql && ls -1 *.sql )' \ 560 | N-sql %{ 561 | edit "nexus/services/core/sql/%arg{1}" 562 | } 563 | 564 | # Kubernetes 565 | # ‾‾‾‾‾‾‾‾‾‾ 566 | 567 | hook global BufCreate .*/\.kube/config %{ 568 | set-option buffer filetype yaml 569 | } 570 | 571 | # OpenSCAD 572 | # ‾‾‾‾‾‾‾‾ 573 | 574 | hook global BufCreate .*\.scad\.m4 %{ 575 | set-option buffer filetype openscad 576 | expand-tabs 577 | } 578 | 579 | # Elixir 580 | # ‾‾‾‾‾‾ 581 | 582 | hook global BufCreate .*\.exs? %{ 583 | set-option buffer indentwidth 2 584 | expand-tabs 585 | } 586 | 587 | # Obsidian 588 | # ‾‾‾‾‾‾‾‾ 589 | 590 | hook global ModuleLoaded markdown %{ 591 | require-module javascript 592 | add-highlighter shared/markdown/obsidian-templater region '<%[*-]?' '-?%>' ref javascript 593 | } 594 | -------------------------------------------------------------------------------- /tools/kakoune/wrapper/default.nix: -------------------------------------------------------------------------------- 1 | { bash, kakoune, stdenv }: 2 | 3 | stdenv.mkDerivation { 4 | name = "kakouneWrapper"; 5 | buildInputs = [ bash kakoune ]; 6 | src = ./wrapper.sh; 7 | 8 | phases = [ "installPhase" "fixupPhase" ]; 9 | 10 | installPhase = '' 11 | mkdir -p $out/bin 12 | cp $src $out/bin/kak 13 | substituteInPlace $out/bin/kak \ 14 | --subst-var-by bash "${bash}" \ 15 | --subst-var-by kakoune "${kakoune}" 16 | ''; 17 | } 18 | -------------------------------------------------------------------------------- /tools/kakoune/wrapper/wrapper.sh: -------------------------------------------------------------------------------- 1 | #!@bash@/bin/bash 2 | # 3 | # kak - A wrapper for Kakoune which connects to (or creates) a session named 4 | # for the current tmux window. 5 | # 6 | 7 | kak="@kakoune@/bin/kak" 8 | declare -a extraArgs=() 9 | 10 | canSpecifySession() { 11 | while (( $# != 0 )); do 12 | case "$1" in 13 | -l|-c|-s|-n|-p) return 1;; 14 | -e|-E|-f|-i|-ui|-debug) shift;; 15 | esac 16 | shift 17 | done 18 | return 0 19 | } 20 | 21 | findSessionName() { 22 | printf 'kakoune\n' 23 | } 24 | 25 | sessionExists() { 26 | local session="$1" exists=false name='' 27 | "$kak" -clear 28 | exec 3< <("$kak" -l 2>/dev/null) 29 | while read -u 3 name; do 30 | if [[ $name = $session ]]; then 31 | exists=true 32 | break 33 | fi 34 | done 35 | exec 3<&- 36 | if [[ $exists = true ]]; then 37 | return 0 38 | else 39 | return 1 40 | fi 41 | } 42 | 43 | addSessionArgs() { 44 | if ! canSpecifySession "$@"; then 45 | return 46 | fi 47 | local session="$(findSessionName)" 48 | if sessionExists "$session"; then 49 | extraArgs+=( -c "$session" ) 50 | else 51 | extraArgs+=( -s "$session" ) 52 | fi 53 | } 54 | 55 | addSessionArgs "$@" 56 | exec "$kak" "${extraArgs[@]}" "$@" 57 | -------------------------------------------------------------------------------- /tools/kicad/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.local.kits.pcbs; 6 | in { 7 | config = mkIf cfg.enable { 8 | #FIXME: The build seems to be non-deterministically broken 9 | # environment.systemPackages = [ pkgs.kicad ]; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /tools/kitty/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, options, ... }: 2 | 3 | with lib; 4 | let 5 | environment = user: let 6 | fixVariableReferences = s: 7 | let 8 | result = builtins.match "(.*)\\$([a-zA-Z0-9_]+)(.*)" s; 9 | in 10 | if (builtins.isNull result) 11 | then s 12 | else (fixVariableReferences "${builtins.elemAt result 0}\${${builtins.elemAt result 1}}${builtins.elemAt result 2}"); 13 | vars = config.environment.variables // { 14 | HOME = (builtins.getAttr user config.users.users).home; 15 | } // (if (hasAttr "systemPath" config.environment) 16 | then { 17 | PATH = config.environment.systemPath; 18 | } 19 | else { 20 | }); 21 | in 22 | mapAttrs (name: value: fixVariableReferences value) vars; 23 | 24 | homeDirectory = config.users.users.jfelice.home; 25 | 26 | # hacky 27 | isMacOS = builtins.hasAttr "launchd" options; 28 | in { 29 | config = { 30 | environment.systemPackages = with pkgs; [ 31 | kitty 32 | local.kak-scrollback-pager 33 | ]; 34 | environment.interactiveShellInit = '' 35 | ssh() { 36 | kitty +kitten ssh "$@" 37 | } 38 | ''; 39 | 40 | programs.zsh.interactiveShellInit = '' 41 | if [ -n "$KITTY_INSTALLATION_DIR" ]; then 42 | autoload -Uz -- "$KITTY_INSTALLATION_DIR"/shell-integration/zsh/kitty-integration 43 | kitty-integration 44 | unfunction kitty-integration 45 | fi 46 | ''; 47 | 48 | home-manager.users.jfelice = { pkgs, ... }: { 49 | programs.kitty = { 50 | enable = true; 51 | font = { 52 | name = "mononoki-Regular"; 53 | size = (if isMacOS 54 | then 13 55 | else 10); 56 | }; 57 | settings = { 58 | bold_font = "mononoki-Bold"; 59 | italic_font = "mononoki-Italic"; 60 | bold_italic_font = "mononoki-BoldItalic"; 61 | 62 | allow_remote_control = true; 63 | 64 | scrollback_lines = "5000"; 65 | 66 | window_resize_step_cells = 1; 67 | window_resize_step_lines = 1; 68 | window_margin_width = "5.0"; 69 | 70 | macos_option_as_alt = true; 71 | 72 | shell_integration = "enabled"; 73 | clipboard_control = "write-clipboard read-clipboard"; 74 | 75 | foreground = "#bfc7d5"; 76 | background = "#14161f"; 77 | 78 | paste_actions = "quote-urls-at-prompt"; 79 | 80 | confirm_os_window_close = 0; 81 | 82 | cursor_text_color = "#c782ea"; 83 | 84 | #: black 85 | color0 = "#292d3e"; 86 | color8 = "#292d3e"; 87 | 88 | #: red 89 | color1 = "#ff5370"; 90 | color9 = "#ff5370"; 91 | 92 | #: green 93 | color2 = "#c3e88d"; 94 | color10 = "#c3e88d"; 95 | 96 | #: yellow 97 | color3 = "#ffcb6b"; 98 | color11 = "#ffcb6b"; 99 | 100 | #: blue 101 | color4 = "#82b1ff"; 102 | color12 = "#82b1ff"; 103 | 104 | #: magenta 105 | color5 = "#c792ea"; 106 | color13 = "#c792ea"; 107 | 108 | #: cyan 109 | color6 = "#89ddff"; 110 | color14 = "#89ddff"; 111 | 112 | #: white 113 | color7 = "#bfc7d5"; 114 | color15 = "#bfc7d5"; 115 | }; 116 | # Not sure why these work different on MacOS than Linux 117 | extraConfig = mkIf isMacOS '' 118 | modify_font cell_height -2px 119 | modify_font baseline +2px 120 | modify_font cell_width 85% 121 | ''; 122 | keybindings = { 123 | "shift+ctrl+g" = "launch --stdin-add-formatting --stdin-source=@screen_scrollback --cwd=current --type=overlay ${pkgs.local.kak-scrollback-pager}/bin/kak-scrollback-pager @scrolled-by @cursor-x @cursor-y @line-count"; 124 | "shift+ctrl+h" = "launch --stdin-add-formatting --stdin-source=@last_cmd_output --cwd=current --type=overlay ${pkgs.local.kak-scrollback-pager}/bin/kak-scrollback-pager @scrolled-by @cursor-x @cursor-y @line-count"; 125 | }; 126 | environment = environment "jfelice"; 127 | } // (if pkgs.stdenv.isDarwin 128 | then { 129 | darwinLaunchOptions = [ 130 | "--listen-on=unix:${homeDirectory}/.run/kitty" 131 | "--single-instance" 132 | "--directory=${homeDirectory}/src" 133 | ]; 134 | } 135 | else {} 136 | ); 137 | }; 138 | }; 139 | } 140 | -------------------------------------------------------------------------------- /tools/meshlab/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; { 4 | config = mkIf config.local.kits._3d-printing.enable { 5 | environment.systemPackages = with pkgs; [ 6 | meshlab 7 | ]; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /tools/minicom/default.nix: -------------------------------------------------------------------------------- 1 | { lib, config, pkgs, ... }: 2 | 3 | with lib; 4 | { 5 | config = mkIf config.local.kits.cnc.enable { 6 | environment.systemPackages = [ pkgs.minicom ]; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /tools/nats/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | enable = config.local.kits.workstation.enable; 6 | 7 | token = builtins.readFile ./token.txt; 8 | 9 | in { 10 | config = { 11 | environment.systemPackages = with pkgs; [ 12 | natscli 13 | ]; 14 | services.nats = { 15 | enable = true; 16 | jetstream = true; 17 | settings = { 18 | authorization = { 19 | inherit token; 20 | }; 21 | jetstream = { 22 | max_memory_store = 128 * 1024 * 1024; 23 | max_file_store = 128 * 1024 * 1024; 24 | }; 25 | leafnodes = { 26 | port = 7422; 27 | }; 28 | }; 29 | }; 30 | 31 | home-manager.users.jfelice = { pkgs, ... }: { 32 | home.file.".config/nats/context.txt".text = "plugbench"; 33 | home.file.".config/nats/context/plugbench.json".text = '' 34 | { 35 | "description": "Plugbench", 36 | "url": "nats://127.0.0.1:4222", 37 | "token": "${token}", 38 | "user": "", 39 | "password": "", 40 | "creds": "", 41 | "nkey": "", 42 | "cert": "", 43 | "key": "", 44 | "ca": "", 45 | "nsc": "", 46 | "jetstream_domain": "", 47 | "jetstream_api_prefix": "", 48 | "jetstream_event_prefix": "", 49 | "inbox_prefix": "", 50 | "user_jwt": "" 51 | } 52 | ''; 53 | }; 54 | }; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /tools/nats/token.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/tools/nats/token.txt -------------------------------------------------------------------------------- /tools/nix/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | config = { 5 | nix.extraOptions = '' 6 | experimental-features = nix-command flakes 7 | ''; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /tools/npm/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | config = { 5 | home-manager.users.jfelice = { pkgs, ... }: { 6 | home.file.".npmrc".source = ./npmrc; 7 | }; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /tools/npm/npmrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/tools/npm/npmrc -------------------------------------------------------------------------------- /tools/obsidian/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | with lib; 4 | let 5 | isWorkstation = config.local.kits.workstation.enable; 6 | in { 7 | config = mkIf isWorkstation { 8 | environment.systemPackages = [ pkgs.obsidian ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /tools/openscad/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, options, config, lib, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.local.kits._3d-printing; 6 | 7 | in { 8 | config = mkIf cfg.enable 9 | (if (builtins.hasAttr "launchd" options) 10 | then { 11 | homebrew.casks = [ "openscad" ]; 12 | environment.systemPackages = let 13 | openscad-wrapper = pkgs.writeScriptBin "openscad" '' 14 | readonly OPENSCAD=/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD 15 | exec "$OPENSCAD" "$@" 16 | ''; 17 | in [ openscad-wrapper ]; 18 | } 19 | else { 20 | environment.systemPackages = [ pkgs.openscad-unstable ]; 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /tools/pcb2gcode/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: 2 | 3 | with lib; 4 | { 5 | config = mkIf config.local.kits.pcbs.enable { 6 | environment.systemPackages = [ pkgs.pcb2gcode ]; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /tools/postgres/default.nix: -------------------------------------------------------------------------------- 1 | { lib, options, ... }: 2 | 3 | with lib; 4 | { 5 | config = (if (builtins.hasAttr "launchd" options) 6 | then { 7 | system.activationScripts.extraUserActivation.text = '' 8 | rm -f ~/.pgpass 9 | cp -ap ${toString ./pgpass.conf} ~/.pgpass 10 | chmod 600 ~/.pgpass 11 | ''; 12 | } 13 | else { 14 | # FIXME: NixOS activation as above 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /tools/postgres/pgpass.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eraserhd/dotfiles/50f9205c3c67c74acb8001327554ec9082f68e60/tools/postgres/pgpass.conf -------------------------------------------------------------------------------- /tools/postman/default.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | { 3 | config = { 4 | homebrew.casks = [ "postman" ]; 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /tools/prusa-slicer/default.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.local.kits._3d-printing; 6 | in { 7 | config = mkIf cfg.enable { 8 | environment.systemPackages = [ pkgs.prusa-slicer ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /tools/prusa-slicer/snapshots/20250517T161329Z/filament/Taz5 - NONE.ini: -------------------------------------------------------------------------------- 1 | # generated by PrusaSlicer 2.9.0 on 2025-05-17 at 15:52:47 UTC 2 | bed_temperature = 0 3 | bridge_fan_speed = 100 4 | chamber_minimal_temperature = 0 5 | chamber_temperature = 0 6 | compatible_printers = 7 | compatible_printers_condition = 8 | compatible_prints = 9 | compatible_prints_condition = 10 | cooling = 1 11 | disable_fan_first_layers = 3 12 | enable_dynamic_fan_speeds = 0 13 | end_filament_gcode = "; Filament-specific end gcode \n;END gcode for filament\n" 14 | extrusion_multiplier = 1 15 | fan_always_on = 0 16 | fan_below_layer_time = 60 17 | filament_abrasive = 0 18 | filament_colour = #29B2B2 19 | filament_cooling_final_speed = 3.4 20 | filament_cooling_initial_speed = 2.2 21 | filament_cooling_moves = 4 22 | filament_cost = 0 23 | filament_density = 0 24 | filament_deretract_speed = nil 25 | filament_diameter = 2.85 26 | filament_infill_max_crossing_speed = 0 27 | filament_infill_max_speed = 0 28 | filament_load_time = 0 29 | filament_loading_speed = 28 30 | filament_loading_speed_start = 3 31 | filament_max_volumetric_speed = 0 32 | filament_minimal_purge_on_wipe_tower = 15 33 | filament_multitool_ramming = 0 34 | filament_multitool_ramming_flow = 10 35 | filament_multitool_ramming_volume = 10 36 | filament_notes = "" 37 | filament_purge_multiplier = 100% 38 | filament_ramming_parameters = "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0| 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6" 39 | filament_retract_before_travel = nil 40 | filament_retract_before_wipe = nil 41 | filament_retract_layer_change = nil 42 | filament_retract_length = nil 43 | filament_retract_length_toolchange = nil 44 | filament_retract_lift = nil 45 | filament_retract_lift_above = nil 46 | filament_retract_lift_below = nil 47 | filament_retract_restart_extra = nil 48 | filament_retract_restart_extra_toolchange = nil 49 | filament_retract_speed = nil 50 | filament_seam_gap_distance = nil 51 | filament_settings_id = "" 52 | filament_shrinkage_compensation_xy = 0% 53 | filament_shrinkage_compensation_z = 0% 54 | filament_soluble = 0 55 | filament_spool_weight = 0 56 | filament_stamping_distance = 0 57 | filament_stamping_loading_speed = 20 58 | filament_toolchange_delay = 0 59 | filament_travel_lift_before_obstacle = nil 60 | filament_travel_max_lift = nil 61 | filament_travel_ramping_lift = nil 62 | filament_travel_slope = nil 63 | filament_type = PLA 64 | filament_unload_time = 0 65 | filament_unloading_speed = 90 66 | filament_unloading_speed_start = 100 67 | filament_vendor = (Unknown) 68 | filament_wipe = nil 69 | first_layer_bed_temperature = 0 70 | first_layer_temperature = 0 71 | full_fan_speed_layer = 0 72 | idle_temperature = 30 73 | inherits = 74 | max_fan_speed = 100 75 | min_fan_speed = 35 76 | min_print_speed = 10 77 | overhang_fan_speed_0 = 0 78 | overhang_fan_speed_1 = 0 79 | overhang_fan_speed_2 = 0 80 | overhang_fan_speed_3 = 0 81 | slowdown_below_layer_time = 5 82 | start_filament_gcode = "; Filament gcode\n" 83 | temperature = 0 84 | -------------------------------------------------------------------------------- /tools/prusa-slicer/snapshots/20250517T161329Z/filament/Taz5 - Polyterra PLA.ini: -------------------------------------------------------------------------------- 1 | # generated by PrusaSlicer 2.9.0 on 2025-05-17 at 15:50:04 UTC 2 | bed_temperature = 60 3 | bridge_fan_speed = 100 4 | chamber_minimal_temperature = 0 5 | chamber_temperature = 0 6 | compatible_printers = 7 | compatible_printers_condition = 8 | compatible_prints = 9 | compatible_prints_condition = 10 | cooling = 1 11 | disable_fan_first_layers = 3 12 | enable_dynamic_fan_speeds = 0 13 | end_filament_gcode = "; Filament-specific end gcode \n;END gcode for filament\n" 14 | extrusion_multiplier = 1 15 | fan_always_on = 0 16 | fan_below_layer_time = 60 17 | filament_abrasive = 0 18 | filament_colour = #29B2B2 19 | filament_cooling_final_speed = 3.4 20 | filament_cooling_initial_speed = 2.2 21 | filament_cooling_moves = 4 22 | filament_cost = 0 23 | filament_density = 0 24 | filament_deretract_speed = nil 25 | filament_diameter = 2.85 26 | filament_infill_max_crossing_speed = 0 27 | filament_infill_max_speed = 0 28 | filament_load_time = 0 29 | filament_loading_speed = 28 30 | filament_loading_speed_start = 3 31 | filament_max_volumetric_speed = 0 32 | filament_minimal_purge_on_wipe_tower = 15 33 | filament_multitool_ramming = 0 34 | filament_multitool_ramming_flow = 10 35 | filament_multitool_ramming_volume = 10 36 | filament_notes = "" 37 | filament_purge_multiplier = 100% 38 | filament_ramming_parameters = "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0| 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6" 39 | filament_retract_before_travel = nil 40 | filament_retract_before_wipe = nil 41 | filament_retract_layer_change = nil 42 | filament_retract_length = nil 43 | filament_retract_length_toolchange = nil 44 | filament_retract_lift = nil 45 | filament_retract_lift_above = nil 46 | filament_retract_lift_below = nil 47 | filament_retract_restart_extra = nil 48 | filament_retract_restart_extra_toolchange = nil 49 | filament_retract_speed = nil 50 | filament_seam_gap_distance = nil 51 | filament_settings_id = "" 52 | filament_shrinkage_compensation_xy = 0% 53 | filament_shrinkage_compensation_z = 0% 54 | filament_soluble = 0 55 | filament_spool_weight = 0 56 | filament_stamping_distance = 0 57 | filament_stamping_loading_speed = 20 58 | filament_toolchange_delay = 0 59 | filament_travel_lift_before_obstacle = nil 60 | filament_travel_max_lift = nil 61 | filament_travel_ramping_lift = nil 62 | filament_travel_slope = nil 63 | filament_type = PLA 64 | filament_unload_time = 0 65 | filament_unloading_speed = 90 66 | filament_unloading_speed_start = 100 67 | filament_vendor = (Unknown) 68 | filament_wipe = nil 69 | first_layer_bed_temperature = 60 70 | first_layer_temperature = 180 71 | full_fan_speed_layer = 0 72 | idle_temperature = 30 73 | inherits = 74 | max_fan_speed = 100 75 | min_fan_speed = 35 76 | min_print_speed = 10 77 | overhang_fan_speed_0 = 0 78 | overhang_fan_speed_1 = 0 79 | overhang_fan_speed_2 = 0 80 | overhang_fan_speed_3 = 0 81 | slowdown_below_layer_time = 5 82 | start_filament_gcode = "; Filament gcode\n" 83 | temperature = 180 84 | -------------------------------------------------------------------------------- /tools/prusa-slicer/snapshots/20250517T161329Z/filament/Taz5.ini: -------------------------------------------------------------------------------- 1 | # generated by PrusaSlicer 2.9.0 on 2025-05-16 at 02:03:52 UTC 2 | bed_temperature = 60 3 | bridge_fan_speed = 100 4 | chamber_minimal_temperature = 0 5 | chamber_temperature = 0 6 | compatible_printers = 7 | compatible_printers_condition = 8 | compatible_prints = 9 | compatible_prints_condition = 10 | cooling = 1 11 | disable_fan_first_layers = 3 12 | enable_dynamic_fan_speeds = 0 13 | end_filament_gcode = "; Filament-specific end gcode \n;END gcode for filament\n" 14 | extrusion_multiplier = 1 15 | fan_always_on = 0 16 | fan_below_layer_time = 60 17 | filament_abrasive = 0 18 | filament_colour = #29B2B2 19 | filament_cooling_final_speed = 3.4 20 | filament_cooling_initial_speed = 2.2 21 | filament_cooling_moves = 4 22 | filament_cost = 0 23 | filament_density = 0 24 | filament_deretract_speed = nil 25 | filament_diameter = 2.85 26 | filament_infill_max_crossing_speed = 0 27 | filament_infill_max_speed = 0 28 | filament_load_time = 0 29 | filament_loading_speed = 28 30 | filament_loading_speed_start = 3 31 | filament_max_volumetric_speed = 0 32 | filament_minimal_purge_on_wipe_tower = 15 33 | filament_multitool_ramming = 0 34 | filament_multitool_ramming_flow = 10 35 | filament_multitool_ramming_volume = 10 36 | filament_notes = "" 37 | filament_purge_multiplier = 100% 38 | filament_ramming_parameters = "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0| 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6" 39 | filament_retract_before_travel = nil 40 | filament_retract_before_wipe = nil 41 | filament_retract_layer_change = nil 42 | filament_retract_length = nil 43 | filament_retract_length_toolchange = nil 44 | filament_retract_lift = nil 45 | filament_retract_lift_above = nil 46 | filament_retract_lift_below = nil 47 | filament_retract_restart_extra = nil 48 | filament_retract_restart_extra_toolchange = nil 49 | filament_retract_speed = nil 50 | filament_seam_gap_distance = nil 51 | filament_settings_id = "" 52 | filament_shrinkage_compensation_xy = 0% 53 | filament_shrinkage_compensation_z = 0% 54 | filament_soluble = 0 55 | filament_spool_weight = 0 56 | filament_stamping_distance = 0 57 | filament_stamping_loading_speed = 20 58 | filament_toolchange_delay = 0 59 | filament_travel_lift_before_obstacle = nil 60 | filament_travel_max_lift = nil 61 | filament_travel_ramping_lift = nil 62 | filament_travel_slope = nil 63 | filament_type = PLA 64 | filament_unload_time = 0 65 | filament_unloading_speed = 90 66 | filament_unloading_speed_start = 100 67 | filament_vendor = (Unknown) 68 | filament_wipe = nil 69 | first_layer_bed_temperature = 60 70 | first_layer_temperature = 180 71 | full_fan_speed_layer = 0 72 | idle_temperature = nil 73 | inherits = 74 | max_fan_speed = 100 75 | min_fan_speed = 35 76 | min_print_speed = 10 77 | overhang_fan_speed_0 = 0 78 | overhang_fan_speed_1 = 0 79 | overhang_fan_speed_2 = 0 80 | overhang_fan_speed_3 = 0 81 | slowdown_below_layer_time = 5 82 | start_filament_gcode = "; Filament gcode\n" 83 | temperature = 180 84 | -------------------------------------------------------------------------------- /tools/prusa-slicer/snapshots/20250517T161329Z/physical_printer/Theseus.ini: -------------------------------------------------------------------------------- 1 | # generated by PrusaSlicer 2.9.0 on 2025-05-17 at 15:55:19 UTC 2 | host_type = moonraker 3 | preset_name = Taz5 4 | preset_names = Taz5 5 | print_host = taz5.lan 6 | printer_technology = FFF 7 | printhost_apikey = 8 | printhost_authorization_type = key 9 | printhost_cafile = 10 | printhost_password = 11 | printhost_port = 12 | printhost_ssl_ignore_revoke = 0 13 | printhost_user = 14 | -------------------------------------------------------------------------------- /tools/prusa-slicer/snapshots/20250517T161329Z/print/Taz5.ini: -------------------------------------------------------------------------------- 1 | # generated by PrusaSlicer 2.9.0 on 2025-05-16 at 02:03:52 UTC 2 | arc_fitting = disabled 3 | automatic_extrusion_widths = 0 4 | automatic_infill_combination = 0 5 | automatic_infill_combination_max_layer_height = 100% 6 | avoid_crossing_curled_overhangs = 0 7 | avoid_crossing_perimeters = 0 8 | avoid_crossing_perimeters_max_detour = 0 9 | bottom_fill_pattern = monotonic 10 | bottom_solid_layers = 3 11 | bottom_solid_min_thickness = 0 12 | bridge_acceleration = 0 13 | bridge_angle = 0 14 | bridge_flow_ratio = 1 15 | bridge_speed = 60 16 | brim_separation = 0 17 | brim_type = outer_only 18 | brim_width = 0 19 | compatible_printers = 20 | compatible_printers_condition = 21 | complete_objects = 0 22 | default_acceleration = 0 23 | dont_support_bridges = 1 24 | draft_shield = disabled 25 | elefant_foot_compensation = 0 26 | enable_dynamic_overhang_speeds = 0 27 | ensure_vertical_shell_thickness = enabled 28 | external_perimeter_acceleration = 0 29 | external_perimeter_extrusion_width = 0.56 30 | external_perimeter_speed = 50% 31 | external_perimeters_first = 0 32 | extra_perimeters = 1 33 | extra_perimeters_on_overhangs = 0 34 | extruder_clearance_height = 20 35 | extruder_clearance_radius = 20 36 | extrusion_width = 0.56 37 | fill_angle = 45 38 | fill_density = 20% 39 | fill_pattern = stars 40 | first_layer_acceleration = 0 41 | first_layer_acceleration_over_raft = 0 42 | first_layer_extrusion_width = 0.52 43 | first_layer_height = 0.35 44 | first_layer_speed = 30 45 | first_layer_speed_over_raft = 30 46 | fuzzy_skin = none 47 | fuzzy_skin_point_dist = 0.8 48 | fuzzy_skin_thickness = 0.3 49 | gap_fill_enabled = 1 50 | gap_fill_speed = 20 51 | gcode_comments = 0 52 | gcode_label_objects = disabled 53 | gcode_resolution = 0.0125 54 | gcode_substitutions = 55 | infill_acceleration = 0 56 | infill_anchor = 600% 57 | infill_anchor_max = 50 58 | infill_every_layers = 1 59 | infill_extruder = 1 60 | infill_extrusion_width = 0.56 61 | infill_first = 0 62 | infill_overlap = 25% 63 | infill_speed = 80 64 | inherits = 65 | interface_shells = 0 66 | ironing = 0 67 | ironing_flowrate = 15% 68 | ironing_spacing = 0.1 69 | ironing_speed = 15 70 | ironing_type = top 71 | layer_height = 0.3 72 | max_print_speed = 80 73 | max_volumetric_extrusion_rate_slope_negative = 0 74 | max_volumetric_extrusion_rate_slope_positive = 0 75 | max_volumetric_speed = 0 76 | min_bead_width = 85% 77 | min_feature_size = 25% 78 | min_skirt_length = 0 79 | mmu_segmented_region_interlocking_depth = 0 80 | mmu_segmented_region_max_width = 0 81 | notes = 82 | only_one_perimeter_first_layer = 0 83 | only_retract_when_crossing_perimeters = 0 84 | ooze_prevention = 0 85 | output_filename_format = [input_filename_base].gcode 86 | overhang_speed_0 = 15 87 | overhang_speed_1 = 15 88 | overhang_speed_2 = 20 89 | overhang_speed_3 = 25 90 | overhangs = 1 91 | perimeter_acceleration = 0 92 | perimeter_extruder = 1 93 | perimeter_extrusion_width = 0.56 94 | perimeter_generator = arachne 95 | perimeter_speed = 60 96 | perimeters = 3 97 | post_process = 98 | print_settings_id = 99 | raft_contact_distance = 0.1 100 | raft_expansion = 1.5 101 | raft_first_layer_density = 90% 102 | raft_first_layer_expansion = 3 103 | raft_layers = 0 104 | resolution = 0 105 | scarf_seam_entire_loop = 0 106 | scarf_seam_length = 20 107 | scarf_seam_max_segment_length = 1 108 | scarf_seam_on_inner_perimeters = 0 109 | scarf_seam_only_on_smooth = 1 110 | scarf_seam_placement = nowhere 111 | scarf_seam_start_height = 0% 112 | seam_gap_distance = 15% 113 | seam_position = aligned 114 | single_extruder_multi_material_priming = 1 115 | skirt_distance = 6 116 | skirt_height = 1 117 | skirts = 1 118 | slice_closing_radius = 0.049 119 | slicing_mode = regular 120 | small_perimeter_speed = 15 121 | solid_infill_acceleration = 0 122 | solid_infill_below_area = 70 123 | solid_infill_every_layers = 0 124 | solid_infill_extruder = 1 125 | solid_infill_extrusion_width = 0.56 126 | solid_infill_speed = 20 127 | spiral_vase = 0 128 | staggered_inner_seams = 0 129 | standby_temperature_delta = -5 130 | support_material = 0 131 | support_material_angle = 0 132 | support_material_auto = 1 133 | support_material_bottom_contact_distance = 0 134 | support_material_bottom_interface_layers = -1 135 | support_material_buildplate_only = 0 136 | support_material_closing_radius = 2 137 | support_material_contact_distance = 0.2 138 | support_material_enforce_layers = 0 139 | support_material_extruder = 1 140 | support_material_extrusion_width = 0.44 141 | support_material_interface_contact_loops = 0 142 | support_material_interface_extruder = 1 143 | support_material_interface_layers = 3 144 | support_material_interface_pattern = rectilinear 145 | support_material_interface_spacing = 0 146 | support_material_interface_speed = 100% 147 | support_material_pattern = rectilinear 148 | support_material_spacing = 2.5 149 | support_material_speed = 60 150 | support_material_style = grid 151 | support_material_synchronize_layers = 0 152 | support_material_threshold = 0 153 | support_material_with_sheath = 1 154 | support_material_xy_spacing = 50% 155 | support_tree_angle = 40 156 | support_tree_angle_slow = 25 157 | support_tree_branch_diameter = 2 158 | support_tree_branch_diameter_angle = 5 159 | support_tree_branch_diameter_double_wall = 3 160 | support_tree_branch_distance = 1 161 | support_tree_tip_diameter = 0.8 162 | support_tree_top_rate = 15% 163 | thick_bridges = 1 164 | thin_walls = 1 165 | top_fill_pattern = monotonic 166 | top_infill_extrusion_width = 0.5 167 | top_one_perimeter_type = none 168 | top_solid_infill_acceleration = 0 169 | top_solid_infill_speed = 15 170 | top_solid_layers = 3 171 | top_solid_min_thickness = 0 172 | travel_acceleration = 0 173 | travel_speed = 130 174 | travel_speed_z = 0 175 | wall_distribution_count = 1 176 | wall_transition_angle = 10 177 | wall_transition_filter_deviation = 25% 178 | wall_transition_length = 100% 179 | wipe_tower = 0 180 | wipe_tower_acceleration = 0 181 | wipe_tower_bridging = 10 182 | wipe_tower_brim_width = 2 183 | wipe_tower_cone_angle = 0 184 | wipe_tower_extra_flow = 100% 185 | wipe_tower_extra_spacing = 100% 186 | wipe_tower_extruder = 0 187 | wipe_tower_no_sparse_layers = 0 188 | wipe_tower_width = 60 189 | xy_size_compensation = 0 190 | -------------------------------------------------------------------------------- /tools/prusa-slicer/snapshots/20250517T161329Z/printer/Taz5.ini: -------------------------------------------------------------------------------- 1 | # generated by PrusaSlicer 2.9.0 on 2025-05-17 at 15:35:54 UTC 2 | autoemit_temperature_commands = 0 3 | bed_custom_model = 4 | bed_custom_texture = 5 | bed_shape = -17x-2,278x-2,278x277,-17x277 6 | before_layer_gcode = 7 | between_objects_gcode = 8 | binary_gcode = 0 9 | color_change_gcode = M600 10 | cooling_tube_length = 5 11 | cooling_tube_retraction = 91.5 12 | default_filament_profile = 13 | default_print_profile = 14 | deretract_speed = 0,0 15 | end_gcode = END_PRINT\n 16 | extra_loading_move = -2 17 | extruder_colour = ; 18 | extruder_offset = 0x0,0x0 19 | gcode_flavor = klipper 20 | high_current_on_filament_swap = 0 21 | host_type = prusalink 22 | inherits = 23 | layer_gcode = 24 | machine_limits_usage = time_estimate_only 25 | machine_max_acceleration_e = 10000,5000 26 | machine_max_acceleration_extruding = 1500,1250 27 | machine_max_acceleration_retracting = 1500,1250 28 | machine_max_acceleration_travel = 1500,1250 29 | machine_max_acceleration_x = 9000,1000 30 | machine_max_acceleration_y = 9000,1000 31 | machine_max_acceleration_z = 500,200 32 | machine_max_feedrate_e = 120,120 33 | machine_max_feedrate_x = 500,200 34 | machine_max_feedrate_y = 500,200 35 | machine_max_feedrate_z = 12,12 36 | machine_max_jerk_e = 2.5,2.5 37 | machine_max_jerk_x = 10,10 38 | machine_max_jerk_y = 10,10 39 | machine_max_jerk_z = 0.2,0.4 40 | machine_min_extruding_rate = 0,0 41 | machine_min_travel_rate = 0,0 42 | max_layer_height = 0,0 43 | max_print_height = 270 44 | min_layer_height = 0.07,0.07 45 | multimaterial_purging = 140 46 | nozzle_diameter = 0.5,0.5 47 | nozzle_high_flow = 0,0 48 | parking_pos_retraction = 92 49 | pause_print_gcode = M601 50 | prefer_clockwise_movements = 0 51 | print_host = 52 | printer_model = 53 | printer_notes = 54 | printer_settings_id = 55 | printer_technology = FFF 56 | printer_variant = 57 | printer_vendor = 58 | printhost_apikey = 59 | printhost_cafile = 60 | remaining_times = 1 61 | retract_before_travel = 2,2 62 | retract_before_wipe = 0%,0% 63 | retract_layer_change = 0,0 64 | retract_length = 2,2 65 | retract_length_toolchange = 10,10 66 | retract_lift = 0,0 67 | retract_lift_above = 0,0 68 | retract_lift_below = 0,0 69 | retract_restart_extra = 0,0 70 | retract_restart_extra_toolchange = 0,0 71 | retract_speed = 40,40 72 | silent_mode = 1 73 | single_extruder_multi_material = 0 74 | start_gcode = START_PRINT USE_EXTRUDER_1=True USE_EXTRUDER_2=True BED_TEMPERATURE={first_layer_bed_temperature[0]} EXTRUDER_1_TEMPERATURE={first_layer_temperature[0]} EXTRUDER_2_TEMPERATURE={first_layer_temperature[1]} 75 | template_custom_gcode = 76 | thumbnails = 32x32/PNG, 400x300/PNG 77 | thumbnails_format = PNG 78 | toolchange_gcode = 79 | travel_lift_before_obstacle = 0,0 80 | travel_max_lift = 0,0 81 | travel_ramping_lift = 0,0 82 | travel_slope = 0,0 83 | use_firmware_retraction = 0 84 | use_relative_e_distances = 0 85 | use_volumetric_e = 0 86 | variable_layer_height = 1 87 | wipe = 0,0 88 | z_offset = 0 89 | -------------------------------------------------------------------------------- /tools/prusa-slicer/snapshots/20250517T161329Z/snapshot.ini: -------------------------------------------------------------------------------- 1 | # generated by PrusaSlicer 2.9.0 on 2025-05-17 at 16:13:29 UTC 2 | 3 | [snapshot] 4 | id = 20250517T161329Z 5 | time_captured = 20250517T161329Z 6 | slic3r_version_captured = 2.9.0 7 | comment = first_known_good 8 | reason = user 9 | 10 | [presets] 11 | print = Taz5 12 | sla_print = 13 | filament = Taz5 - Polyterra PLA 14 | filament_1 = Taz5 - NONE 15 | sla_material = 16 | printer = Taz5 17 | physical_printer = Theseus * Taz5 18 | -------------------------------------------------------------------------------- /tools/rlwrap/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | config = { 5 | environment.systemPackages = [ pkgs.rlwrap ]; 6 | 7 | home-manager.users.jfelice = { pkgs, ... }: { 8 | home.file.".inputrc".text = '' 9 | "\C-x\C-e": rlwrap-call-editor 10 | ''; 11 | }; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /tools/signal/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | config = { 5 | environment.systemPackages = [ pkgs.signal-desktop ]; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /tools/tex/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | config = { 5 | environment.systemPackages = [ 6 | pkgs.texlive.combined.scheme-full 7 | #(pkgs.texlive.combine { 8 | # inherit (pkgs.texlive) 9 | # scheme-tetex 10 | # collection-fontsextra 11 | # enumitem; 12 | #}) 13 | ]; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /tools/tmux/default.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs, config, options, ... }: 2 | 3 | with lib; 4 | let 5 | sessionName = if (config.networking.hostName == null) 6 | then "UNKNOWN" 7 | else config.networking.hostName; 8 | shellPackage = config.local.loginShell.package; 9 | 10 | defaultCommand = if pkgs.stdenv.isDarwin 11 | then "exec ${pkgs.reattach-to-user-namespace}/bin/reattach-to-user-namespace -l ${shellPackage}${shellPackage.shellPath}" 12 | else "exec ${shellPackage}${shellPackage.shellPath}"; 13 | 14 | tmuxConfig = '' 15 | #### Use C-a as prefix #### 16 | set-option -g prefix C-a 17 | unbind C-b 18 | bind C-a send-prefix 19 | bind a send-prefix 20 | 21 | set-option -g default-command '${defaultCommand}' 22 | set-option -g update-environment ''' 23 | 24 | ##### Basic Usage ##### 25 | 26 | 27 | ##### Scrollback Navigation ##### 28 | 29 | 30 | # Reduce the command delay time to something a bit shorter 31 | set -sg escape-time 25 32 | setw -g xterm-keys on 33 | set -sa terminal-overrides ",xterm*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@" # Shift+Arrow 34 | set -sa terminal-overrides ',xterm*:sitm=\E[3m' # italics 35 | 36 | ##### Window/Pane Management ##### 37 | 38 | set -g status off 39 | 40 | # Support true color in Alacritty 41 | set -sa terminal-overrides ",xterm-256color:Tc" 42 | set -g default-terminal "tmux-256color" 43 | 44 | # Pane borders 45 | set -g pane-border-status top 46 | set -g pane-border-style "fg=#181a1f,bg=#292d3e" 47 | set -g pane-active-border-style "fg=#181a1f,bg=#292d3e" 48 | set -g pane-border-format "#[bg=#{?pane_active,#bfc7d5,#292d3e},fg=#292d3e]#[fg=#{?@ctrlw_active,#ff5370,#{?pane_active,#292d3e,#697098}}] #P #[fg=#{?pane_active,#bfc7d5,#292d3e},bg=#697098]#[fg=#{?pane_active,#bfc7d5,#292d3e}] #T #[bg=#292d3e,fg=#697098]" 49 | 50 | # Command line 51 | set -g message-style "fg=#bfc7d5,bg=#292d3e,bright" 52 | 53 | # Status bar 54 | set -g status-style "fg=white,bg=#292d3e" 55 | set -g status-position top 56 | set -g status-justify left 57 | set -g status-left-length 40 58 | set -g status-left "#[fg=#292d3e,bg=#697098] #S #[fg=#697098,bg=#292d3e] " 59 | set -g status-right "#[bg=#292d3e,fg=#697098] %d %b %R " 60 | 61 | # Window list 62 | setw -g window-status-format "#I #W" 63 | setw -g window-status-separator "#[fg=#697098]  " 64 | setw -g window-status-style "fg=#697098,bg=#292d3e" 65 | setw -g window-status-current-format "#I #W" 66 | setw -g window-status-current-style "fg=#697098,italics" 67 | setw -g window-status-activity-style "fg=#697098" 68 | 69 | # Monitor windows for activity 70 | setw -g monitor-activity on 71 | set -g visual-activity on 72 | 73 | #### Plugins #### 74 | 75 | run-shell ${pkgs.tmuxPlugins.sensible}/share/tmux-plugins/sensible/sensible.tmux 76 | run-shell ${pkgs.tmuxPlugins.ctrlw}/share/tmux-plugins/ctrlw/ctrlw.tmux 77 | 78 | setw -g mode-keys vi 79 | 80 | ### Default Session ### 81 | 82 | new-session -c ~/src -n 'main' -s '${sessionName}' 83 | split-window -h -c ~/src 84 | split-window -h -c ~/src 85 | split-window -h -c ~/src 86 | select-layout -E 87 | split-window -v -c ~/src 88 | split-window -v -c ~/src 89 | select-layout -E 90 | send-keys -t %1 kak Enter 91 | send-keys -t %0 '${config.local.tmux.paneZeroCommand}' Enter 92 | send-keys -t %2 'sleep 2; kak' Enter 93 | send-keys -t %3 'sleep 2; kak -e "edit *debug*"' Enter 94 | ''; 95 | in 96 | { 97 | options = { 98 | local.tmux.paneZeroCommand = mkOption { 99 | type = types.str; 100 | description = '' 101 | Command to run in leftmost pane on start. 102 | ''; 103 | default = "sleep 2; kak"; 104 | }; 105 | }; 106 | config = { 107 | programs.tmux = { 108 | enable = true; 109 | extraConfig = tmuxConfig; 110 | }; 111 | }; 112 | } 113 | -------------------------------------------------------------------------------- /tools/x/default.nix: -------------------------------------------------------------------------------- 1 | { options, config, lib, pkgs, ... }: 2 | 3 | with lib; 4 | let 5 | cfg = config.local.services.X11; 6 | in { 7 | options = { 8 | local.services.X11.enable = mkEnableOption "X11"; 9 | }; 10 | 11 | config = mkIf cfg.enable ({ 12 | environment.systemPackages = [ 13 | pkgs.xorg.xev 14 | pkgs.flameshot 15 | ]; 16 | } // (if (builtins.hasAttr "xserver" options.services) 17 | then { 18 | services.xserver = { 19 | enable = true; 20 | windowManager.i3.enable = true; 21 | autoRepeatDelay = 200; 22 | autoRepeatInterval = 40; 23 | }; 24 | services.libinput = { 25 | enable = true; 26 | mouse = { 27 | naturalScrolling = true; 28 | accelSpeed = "-0.9"; 29 | }; 30 | }; 31 | } 32 | else { 33 | })); 34 | } 35 | -------------------------------------------------------------------------------- /tools/zoom/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | config = { 5 | environment.systemPackages = [ 6 | pkgs.zoom-us 7 | ]; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /tools/zsh/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | config = { 5 | local.loginShell.package = pkgs.zsh; 6 | programs.zsh.enable = true; 7 | programs.zsh.enableCompletion = true; 8 | programs.zsh.interactiveShellInit = '' 9 | autoload -U edit-command-line 10 | zle -N edit-command-line 11 | bindkey '^xe' edit-command-line 12 | bindkey '^x^e' edit-command-line 13 | bindkey '\ef' emacs-forward-word 14 | bindkey '\eb' emacs-backward-word 15 | 16 | setopt auto_cd 17 | cdpath=(~/src ~/src/dotfiles/pkg) 18 | 19 | setopt nonomatch 20 | 21 | eval "$(${pkgs.direnv}/bin/direnv hook zsh)" 22 | ''; 23 | programs.zsh.promptInit = '' 24 | autoload -Uz vcs_info 25 | precmd() { 26 | vcs_info 27 | } 28 | zstyle ':vcs_info:*' formats '(%b)' 29 | zstyle ':vcs_info:*' actionformats '(%b[%a])' 30 | setopt prompt_subst 31 | PROMPT=' 32 | %(?.%F{green}.%F{red})%* %? %n@%m %1d ''${vcs_info_msg_0_} 33 | ᐅ%f ' 34 | RPS1="" 35 | ''; 36 | environment.shells = [ pkgs.zsh ]; 37 | 38 | home-manager.users.jfelice = { pkgs, ... }: { 39 | home.file.".zshrc".text = '' 40 | # empty file to prevent zsh from trying to initialize 41 | ''; 42 | }; 43 | }; 44 | } 45 | --------------------------------------------------------------------------------