├── .gitignore ├── .gitmodules ├── Makefile ├── bin ├── build ├── current ├── current.nix ├── de ├── env-build ├── git-sha ├── myhost ├── nb ├── nix-shell-sample ├── nixpkgs-bisect ├── nixpkgs-rev ├── repl ├── revinfo ├── runemacs ├── start-nix-docker ├── travel-ready ├── u ├── upgrade └── yubikey-switch ├── bootstrap.org ├── config ├── athena.nix ├── clio.nix ├── darwin.nix ├── emacs.nix ├── envs.nix ├── firefox.nix ├── hera.nix ├── home.nix ├── key-files.nix ├── packages.nix └── vulcan.nix ├── flake.lock ├── flake.nix └── overlays ├── 00-last-known-good.nix ├── 00-nix-scripts.nix ├── 10-coq.nix ├── 10-emacs.nix ├── 10-haskell.nix ├── 20-ai.nix ├── 20-dirscan.nix ├── 20-filetags.nix ├── 20-ghi.nix ├── 20-git-annex.nix ├── 20-git-lfs.nix ├── 20-git-scripts.nix ├── 20-hammer.nix ├── 20-hashdb.nix ├── 20-hyperorg.nix ├── 20-ledger.nix ├── 20-linkdups.nix ├── 20-lipotell.nix ├── 20-my-scripts.nix ├── 20-org2tc.nix ├── 20-pass-git-helper.nix ├── 20-sanoid.nix ├── 20-sift.nix ├── 20-sshify.nix ├── 20-tsvutils.nix ├── 20-yamale.nix ├── 20-z.nix ├── Dedupe-RPATH-entries.patch ├── coq ├── category-theory.nix └── fiat.nix ├── dovecot └── pagesize.patch ├── emacs ├── 0001-mac-gui-loop-block-lifetime.patch ├── 0002-mac-gui-loop-block-autorelease.patch ├── Chat.icns ├── builder.nix ├── clean-env-27.patch ├── clean-env.patch ├── edit-env.el ├── edit-var.el ├── flymake-1.0.9.el ├── mk-wrapper-subdirs.el ├── ox-extra.el ├── patches │ ├── at-fdcwd.patch │ ├── company-coq.patch │ ├── emacs-26.patch │ ├── esh-buf-stack.patch │ ├── git-link.patch │ ├── haskell-mode-stylish-args.patch │ ├── haskell-mode.patch │ ├── helm-google.patch │ ├── hyperbole.patch │ ├── indent-shift.patch │ ├── magit.patch │ ├── multi-term.patch │ ├── noflet.patch │ ├── org-ref.patch │ ├── pass.patch │ ├── pdf-tools.patch │ └── sky-color-clock.patch ├── project-0.5.3.el ├── rs-gnus-summary.el ├── site-start.el ├── supercite.el ├── tramp-detect-wrapped-gvfsd.patch ├── wrapper.nix └── wrapper.sh ├── hyperorg.patch └── tests └── llm-plugin.nix /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /result* -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "nixpkgs"] 2 | path = nixpkgs 3 | url = git://github.com/jwiegley/nixpkgs.git 4 | [submodule "darwin"] 5 | path = darwin 6 | url = git://github.com/jwiegley/nix-darwin.git 7 | [submodule "home-manager"] 8 | path = home-manager 9 | url = git@github.com:rycee/home-manager.git 10 | [submodule "forks/timeparsers"] 11 | path = forks/timeparsers 12 | url = git://github.com/jwiegley/timeparsers.git 13 | [submodule "overlays/emacs-overlay"] 14 | path = overlays/emacs-overlay 15 | url = git://github.com/jwiegley/emacs-overlay.git 16 | [submodule "nix-darwin"] 17 | path = nix-darwin 18 | url = git@github.com:LnL7/nix-darwin.git 19 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | HOSTNAME = hera 2 | REMOTES = clio athena 3 | GIT_REMOTE = jwiegley 4 | MAX_AGE = 14 5 | NIX_CONF = $(HOME)/src/nix 6 | NIXOPTS = 7 | 8 | ifneq ($(BUILDER),) 9 | NIXOPTS := $(NIXOPTS) --option builders 'ssh://$(BUILDER)' 10 | endif 11 | 12 | all: switch 13 | 14 | %-all: % 15 | @for host in $(REMOTES); do \ 16 | ssh $$host "NIX_CONF=$(NIX_CONF) u $$host $<"; \ 17 | done 18 | 19 | define announce 20 | @echo 21 | @echo '┌────────────────────────────────────────────────────────────────────────────┐' 22 | @echo -n '│ >>> $(1)' 23 | @printf "%$$((72 - $(shell echo '$(1)' | wc -c)))s│\n" 24 | @echo '└────────────────────────────────────────────────────────────────────────────┘' 25 | endef 26 | 27 | test: 28 | $(call announce,this is a test) 29 | 30 | tools: 31 | @echo HOSTNAME=$(HOSTNAME) 32 | @echo BUILDER=$(BUILDER) 33 | 34 | @echo export PATH=$(PATH) 35 | @echo export NIXOPTS=$(NIXOPTS) 36 | 37 | which field \ 38 | find \ 39 | git \ 40 | head \ 41 | make \ 42 | nix \ 43 | nix-build \ 44 | nix-env \ 45 | sort \ 46 | uniq 47 | 48 | repl: 49 | nix --extra-experimental-features repl-flake \ 50 | repl .#darwinConfigurations.$(HOSTNAME).pkgs 51 | 52 | build: 53 | $(call announce,darwin-rebuild build --impure --flake .#$(HOSTNAME)) 54 | @darwin-rebuild build --impure --flake .#$(HOSTNAME) 55 | @rm -f result* 56 | 57 | switch: 58 | $(call announce,darwin-rebuild switch --impure --flake .#$(HOSTNAME)) 59 | @sudo darwin-rebuild switch --impure --flake .#$(HOSTNAME) 60 | @echo "Darwin generation: $$(darwin-rebuild --list-generations | tail -1)" 61 | 62 | update: 63 | $(call announce,nix flake update && brew update) 64 | nix flake update 65 | @for project in $(shell grep "^[^#]" $(HOME)/.config/projects); do \ 66 | ( cd $(HOME)/$$project ; \ 67 | echo "### $(HOME)/$$project" ; \ 68 | nix flake update \ 69 | ); \ 70 | done 71 | @if [[ -f /opt/homebrew/bin/brew ]]; then \ 72 | eval "$(/opt/homebrew/bin/brew shellenv)"; \ 73 | elif [[ -f /usr/local/bin/brew ]]; then \ 74 | eval "$(/usr/local/bin/brew shellenv)"; \ 75 | fi 76 | brew update 77 | 78 | upgrade-tasks: switch travel-ready 79 | @if [[ -f /opt/homebrew/bin/brew ]]; then \ 80 | eval "$(/opt/homebrew/bin/brew shellenv)"; \ 81 | elif [[ -f /usr/local/bin/brew ]]; then \ 82 | eval "$(/usr/local/bin/brew shellenv)"; \ 83 | fi 84 | brew upgrade --greedy 85 | 86 | upgrade: update upgrade-tasks check 87 | 88 | changes: 89 | @for project in $(shell grep "^[^#]" $(HOME)/.config/projects); do \ 90 | ( cd $(HOME)/$$project ; \ 91 | echo "### $(HOME)/$$project" ; \ 92 | changes \ 93 | ); \ 94 | done 95 | echo "### ~/.config/pushme" 96 | (cd ~/.config/pushme ; changes) 97 | echo "### ~/.emacs.d" 98 | (cd ~/.emacs.d ; changes) 99 | echo "### ~/src/nix" 100 | (cd ~/src/nix ; changes) 101 | echo "### ~/src/scripts" 102 | (cd ~/src/scripts ; changes) 103 | echo "### ~/doc" 104 | (cd ~/doc ; changes) 105 | echo "### ~/org" 106 | (cd ~/org ; changes) 107 | 108 | ######################################################################## 109 | 110 | copy: 111 | $(call announce,copy) 112 | @for host in $(REMOTES); do \ 113 | nix copy --to "ssh-ng://$$host" \ 114 | $(HOME)/.local/state/nix/profiles/profile; \ 115 | for project in $(shell grep "^[^#]" $(HOME)/.config/projects); do \ 116 | echo $$project; \ 117 | ( cd $(HOME)/$$project ; \ 118 | if [[ -f .envrc.cache ]]; then \ 119 | source <(direnv apply_dump .envrc.cache) ; \ 120 | if [[ -n "$$buildInputs" ]]; then \ 121 | eval nix copy --to ssh-ng://$$host $$buildInputs; \ 122 | fi; \ 123 | fi \ 124 | ); \ 125 | done; \ 126 | done 127 | 128 | ######################################################################## 129 | 130 | define delete-generations 131 | nix-env $(1) --delete-generations \ 132 | $(shell nix-env $(1) \ 133 | --list-generations | field 1 | head -n -$(2)) 134 | endef 135 | 136 | define delete-generations-all 137 | $(call delete-generations,,$(1)) 138 | $(call delete-generations,-p /nix/var/nix/profiles/system,$(1)) 139 | endef 140 | 141 | check: 142 | $(call announce,nix store verify --no-trust --repair --all) 143 | @nix store verify --no-trust --repair --all 144 | 145 | sizes: 146 | df -H /nix 2>&1 | grep /dev 147 | 148 | clean: 149 | $(call delete-generations-all,$(MAX_AGE)) 150 | nix-collect-garbage --delete-older-than $(MAX_AGE)d 151 | sudo nix-collect-garbage --delete-older-than $(MAX_AGE)d 152 | 153 | purge: 154 | $(call delete-generations-all,1) 155 | nix-collect-garbage --delete-old 156 | sudo nix-collect-garbage --delete-old 157 | 158 | sign: 159 | $(call announce,nix store sign -k "" --all) 160 | @nix store sign -k $(HOME)/.config/gnupg/nix-signing-key.sec --all 161 | 162 | PROJECTS = $(HOME)/.config/projects 163 | 164 | travel-ready: 165 | $(call announce,travel-ready) 166 | @readarray -t projects < <(egrep -v '^(#.+)?$$' "$(PROJECTS)") 167 | @for dir in "$${projects[@]}"; do \ 168 | echo "Updating direnv on $(HOSTNAME) for ~/$$dir"; \ 169 | (cd ~/$$dir && \ 170 | rm -f .envrc .envrc.cache; \ 171 | if [[ $(HOSTNAME) == athena ]]; then \ 172 | $(NIX_CONF)/bin/de; \ 173 | elif [[ $(HOSTNAME) == hera ]]; then \ 174 | $(NIX_CONF)/bin/de; \ 175 | elif [[ $(HOSTNAME) == clio ]]; then \ 176 | $(NIX_CONF)/bin/de; \ 177 | else \ 178 | unset BUILDER; \ 179 | $(NIX_CONF)/bin/de; \ 180 | fi); \ 181 | done 182 | 183 | .ONESHELL: 184 | -------------------------------------------------------------------------------- /bin/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | exec nix build -f . --arg pkgs '(import {}).pkgs' 3 | -------------------------------------------------------------------------------- /bin/current: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LKG=$(git --git-dir=$HOME/src/nix/nixpkgs/.git rev-parse last-known-good) 4 | SHA=$(nix-build ~/src/nix/bin/current.nix \ 5 | --argstr rev $LKG \ 6 | --argstr sha256 "1cwm2gvnb7dfw9pjrwzlxb2klix58chc36nnymahjqaa1qmnpbpq" 2>&1 | \ 7 | perl -ne 'print $1, "\n" if /got: sha256:(.+)/') 8 | 9 | cat ~/src/nix/bin/current.nix | \ 10 | sed "s/970b2b853d41ec80a3c2aba3e585f52818fbbfa3/$LKG/" | \ 11 | sed "s/0cwm2gvnb7dfw9pjrwzlxb2klix58chc36nnymahjqaa1qmnpbpq/$SHA/" | \ 12 | tail -n +2 | head -n -2 13 | -------------------------------------------------------------------------------- /bin/current.nix: -------------------------------------------------------------------------------- 1 | { foo ? null 2 | , rev ? "970b2b853d41ec80a3c2aba3e585f52818fbbfa3" 3 | , sha256 ? "0cwm2gvnb7dfw9pjrwzlxb2klix58chc36nnymahjqaa1qmnpbpq" 4 | , pkgs ? import (builtins.fetchTarball { 5 | url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; 6 | inherit sha256; }) { 7 | config.allowUnfree = true; 8 | config.allowBroken = false; 9 | } 10 | }: 11 | { inherit (pkgs) coreutils; } 12 | -------------------------------------------------------------------------------- /bin/de: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # jww (2020-04-01): I use this to keep build products in a separate directory 6 | # tree. 7 | PRODUCTS="" 8 | if [[ -d $HOME/Products ]]; then 9 | PRODUCTS=$(echo $PWD | sed -E 's/\b(kadena|src)\b/Products/') 10 | echo "There is a ~/Products directory" 11 | fi 12 | 13 | NOCACHE=false 14 | if [[ "$1" == "--no-cache" ]]; then 15 | shift 1 16 | NOCACHE=true 17 | echo "Disabling use of the Nix cache" 18 | fi 19 | 20 | NIXOPTS=(--cores 2 -j4) 21 | NIXOPTS_MORE=() 22 | 23 | if [[ $PWD =~ kadena || $PWD =~ athena ]]; then 24 | if [[ $NOCACHE == false ]]; then 25 | echo Building direnv cache for a Kadena project... 26 | NIXOPTS+=(--extra-substituters 'https://nixcache.chainweb.com') 27 | NIXOPTS+=(--extra-trusted-public-keys 'nixcache.chainweb.com:FVN503ABX9F8x8K0ptnc99XEz5SaA4Sks6kNcZn2pBY=') 28 | fi 29 | elif [[ -f flake.nix ]]; then 30 | echo "Using the package set for " 31 | # NIXOPTS_MORE+=(--override-input nixpkgs nixpkgs --inputs-from ~/src/nix) 32 | else 33 | echo "Using the package set for " 34 | NIXOPTS_MORE+=(--arg pkgs '(import{}).pkgs') 35 | fi 36 | 37 | if [[ -n ${BUILDER+x} ]]; then 38 | NIXOPTS+=(--option builders "ssh-ng://${BUILDER}") 39 | echo "Using builder: ssh-ng://${BUILDER}" 40 | fi 41 | 42 | if [[ ! -f .envrc ]]; then 43 | cat > .envrc <<'EOF' 44 | keep_vars() { 45 | local v 46 | for k in $@; do 47 | eval "v=\$$k" 48 | DIRENV_kept="$DIRENV_kept"$(printf "%s=%s\000" "$k" "$v" | base64) 49 | done 50 | } 51 | 52 | reset_kept() { 53 | : ${DIRENV_kept?No environment stored. Missing keep_except()?} 54 | echo "$DIRENV_kept" | base64 -d | while IFS= read -r -d '' V; do 55 | echo "export ${V%%=*}='${V#*=}'" 56 | done 57 | unset DIRENV_kept 58 | } 59 | 60 | keep_vars \ 61 | ALTERNATE_EDITOR \ 62 | EDITOR \ 63 | EMACS_SERVER_FILE \ 64 | GIT_PROMPT_EXECUTABLE \ 65 | ITERM_SESSION_ID \ 66 | NIX_PATH \ 67 | SECURITYSESSIONID \ 68 | SSH_AUTH_SOCK \ 69 | SSL_CERT_FILE \ 70 | TERM \ 71 | TERM_SESSION_ID \ 72 | TMPDIR \ 73 | XDG_DATA_DIRS \ 74 | __GIT_PROMPT_DIR 75 | 76 | source <(direnv apply_dump .envrc.cache) 77 | source <(reset_kept) 78 | 79 | watch_file .envrc 80 | watch_file .envrc.cache 81 | watch_file default.nix 82 | EOF 83 | 84 | [[ -f package.nix ]] && echo "watch_file package.nix" >> .envrc 85 | [[ -f shell.nix ]] && echo "watch_file shell.nix" >> .envrc 86 | 87 | if [[ -n "$PRODUCTS" ]]; then 88 | if [[ -f package.yaml \ 89 | || -n "$(find . -maxdepth 1 -name '*.cabal')" ]]; then 90 | cat >> .envrc <> .envrc < /dev/null) == 192.168.50.5 ]]; then 7 | echo hera 8 | elif [[ $(hostname) =~ [Aa]thena || \ 9 | $(ipaddr en0 2> /dev/null) == 192.168.50.235 ]]; then 10 | echo athena 11 | elif [[ $(hostname) =~ [Cc]lio || \ 12 | $(ipaddr en0 2> /dev/null) == 192.168.50.112 ]]; then 13 | echo clio 14 | else 15 | echo clio # assume we're on the laptop 16 | fi 17 | -------------------------------------------------------------------------------- /bin/nb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | cd ~/src/nix 5 | export NIXPKGS_ALLOW_INSECURE=1 6 | bash -c "$(u hera build-command | grep PATH) $@" 7 | -------------------------------------------------------------------------------- /bin/nix-shell-sample: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env nix-shell 2 | #! nix-shell -i python -p python pythonPackages.pygments 3 | 4 | print "hello world" 5 | -------------------------------------------------------------------------------- /bin/nixpkgs-bisect: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git bisect start 4 | git bisect bad HEAD 5 | git bisect good last-known-good 6 | exec git bisect run nix-build '' -A pkgs.$1 7 | -------------------------------------------------------------------------------- /bin/nixpkgs-rev: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASE_URL=https://github.com/NixOS/nixpkgs/archive 4 | REV=$(git --git-dir ~/src/nix/nixpkgs/.git rev-parse ${1:-last-known-good}) 5 | SHA=$(nix-prefetch-url ${BASE_URL}/${REV}.tar.gz 2>&1 | tail -1) 6 | 7 | echo ", rev ? \"$REV\"" 8 | echo ", sha256 ? \"$SHA\"" 9 | -------------------------------------------------------------------------------- /bin/repl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | exec nix repl '' 3 | -------------------------------------------------------------------------------- /bin/revinfo: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | REV=$1 4 | SHA=$(nix-prefetch-url https://github.com/NixOS/nixpkgs/archive/${REV}.tar.gz) 5 | 6 | cat <>> upgrade .config/projects │' 32 | echo '└────────────────────────────────────────────────────────────────────────────┘' 33 | 34 | ### Kadena projects 35 | 36 | echo ~/kadena/pact-fv 37 | ( 38 | cd ~/kadena/pact-fv 39 | source .envrc 40 | cabal v2-update 41 | cabal v2-configure --enable-tests --disable-profiling --disable-executable-profiling 42 | cabal v2-build 43 | cabal v2-test 44 | ) > /tmp/pact-fv-build.log 2>&1 45 | 46 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 47 | 48 | # echo ~/kadena/evm/reth 49 | # ( 50 | # cd ~/kadena/evm/reth 51 | # source .envrc 52 | # cargo update 53 | # cargo build 54 | # cargo test 55 | # cargo doc 56 | # cargo clippy 57 | # ) > /tmp/reth-build.log 2>&1 58 | 59 | # if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 60 | 61 | ### Coq projects 62 | 63 | echo ~/src/category-theory 64 | ( 65 | cd ~/src/category-theory 66 | source .envrc 67 | make clean 68 | make 69 | ) > /tmp/category-theory-build.log 2>&1 70 | 71 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 72 | 73 | echo ~/src/ltl/coq 74 | ( 75 | cd ~/src/ltl/coq 76 | source .envrc 77 | make clean 78 | make 79 | ) > /tmp/ltl-coq-build.log 2>&1 80 | 81 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 82 | 83 | ### Haskell projects 84 | 85 | echo ~/src/notes/haskell 86 | ( 87 | cd ~/src/notes/haskell 88 | echo ~/src/notes/haskell 89 | source .envrc 90 | cabal v2-update 91 | cabal v2-configure --disable-tests \ 92 | --disable-profiling --disable-executable-profiling 93 | ) > /tmp/notes-haskell-build.log 2>&1 94 | 95 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 96 | 97 | echo ~/src/org-jw 98 | ( 99 | cd ~/src/org-jw 100 | echo ~/src/org-jw 101 | source .envrc 102 | cabal v2-update 103 | cabal v2-configure --enable-tests \ 104 | --enable-profiling --enable-executable-profiling 105 | cabal v2-build all 106 | cabal v2-test all 107 | ) > /tmp/org-jw-build.log 2>&1 108 | 109 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 110 | 111 | echo ~/src/pushme 112 | ( 113 | cd ~/src/pushme 114 | echo ~/src/pushme 115 | source .envrc 116 | cabal v2-update 117 | cabal v2-configure --enable-tests \ 118 | --enable-profiling --enable-executable-profiling 119 | cabal v2-build 120 | cabal v2-test 121 | ) > /tmp/pushme-build.log 2>&1 122 | 123 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 124 | 125 | echo ~/src/gitlib 126 | ( 127 | cd ~/src/gitlib 128 | echo ~/src/gitlib 129 | source .envrc 130 | cabal v2-update 131 | cabal v2-configure --enable-tests \ 132 | --disable-profiling --disable-executable-profiling 133 | cabal v2-build all 134 | cabal v2-test all 135 | ) > /tmp/gitlib-build.log 2>&1 136 | 137 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 138 | 139 | echo ~/src/hours 140 | ( 141 | cd ~/src/hours 142 | echo ~/src/hours 143 | source .envrc 144 | cabal v2-update 145 | cabal v2-configure --enable-tests \ 146 | --enable-profiling --enable-executable-profiling 147 | cabal v2-build 148 | cabal v2-test 149 | ) > /tmp/hours-build.log 2>&1 150 | 151 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 152 | 153 | echo ~/src/renamer 154 | ( 155 | cd ~/src/renamer 156 | echo ~/src/renamer 157 | source .envrc 158 | cabal v2-update 159 | cabal v2-configure --enable-tests \ 160 | --enable-profiling --enable-executable-profiling 161 | cabal v2-build 162 | cabal v2-test 163 | ) > /tmp/renamer-build.log 2>&1 164 | 165 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 166 | 167 | echo ~/src/simple-amount 168 | ( 169 | cd ~/src/simple-amount 170 | echo ~/src/simple-amount 171 | source .envrc 172 | cabal v2-update 173 | cabal v2-configure --enable-tests \ 174 | --disable-profiling --disable-executable-profiling 175 | cabal v2-build 176 | cabal v2-test 177 | ) > /tmp/simple-amount-build.log 2>&1 178 | 179 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 180 | 181 | echo ~/src/sizes 182 | ( 183 | cd ~/src/sizes 184 | echo ~/src/sizes 185 | source .envrc 186 | cabal v2-update 187 | cabal v2-configure --enable-tests \ 188 | --disable-profiling --disable-executable-profiling 189 | cabal v2-build 190 | cabal v2-test 191 | ) > /tmp/sizes-build.log 2>&1 192 | 193 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 194 | 195 | echo ~/src/three-partition 196 | ( 197 | cd ~/src/three-partition 198 | echo ~/src/three-partition 199 | source .envrc 200 | cabal v2-update 201 | cabal v2-configure --enable-tests \ 202 | --disable-profiling --disable-executable-profiling 203 | cabal v2-build 204 | cabal v2-test 205 | ) > /tmp/three-partition-build.log 2>&1 206 | 207 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 208 | 209 | echo ~/src/trade-journal 210 | ( 211 | cd ~/src/trade-journal 212 | echo ~/src/trade-journal 213 | source .envrc 214 | cabal v2-update 215 | cabal v2-configure --enable-tests \ 216 | --disable-profiling --disable-executable-profiling 217 | cabal v2-build 218 | cabal v2-test 219 | ) > /tmp/trade-journal-build.log 2>&1 220 | 221 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 222 | 223 | echo ~/src/una 224 | ( 225 | cd ~/src/una 226 | echo ~/src/una 227 | source .envrc 228 | cabal v2-update 229 | cabal v2-configure --enable-tests \ 230 | --disable-profiling --disable-executable-profiling 231 | cabal v2-build 232 | cabal v2-test 233 | ) > /tmp/una-build.log 2>&1 234 | 235 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 236 | 237 | ### Rust projects 238 | 239 | echo ~/src/comparable 240 | ( 241 | cd ~/src/comparable 242 | echo ~/src/comparable 243 | source .envrc 244 | cargo update 245 | cargo build 246 | cargo test 247 | cargo doc 248 | cargo clippy 249 | ) > /tmp/comparable-build.log 2>&1 250 | 251 | if [[ $? = 0 ]]; then echo done; else echo FAIL; fi 252 | -------------------------------------------------------------------------------- /bin/yubikey-switch: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | cd ~/.config/gnupg/private-keys-v1.d 4 | 5 | for i in \ 6 | 4975B4558FC5A7699D4E6DFD940DF0A5633B661F.key \ 7 | 99C79A2052C3B513DF26BB5B03519C83328F13E1.key \ 8 | A8ADF3692CFDEA476DD3EF8191DF7C5806C0C825.key 9 | do 10 | if [[ "$1" == "restore" ]]; then 11 | if [[ ! -d /Volumes/File ]]; then 12 | echo Please mount /Volumes/Files 13 | exit 1 14 | fi 15 | cp -pv /Volumes/Files/Keys/GnuPG/private-keys-v1.d/$i $i 16 | else 17 | if [[ ! -f ${i}.$1 ]]; then 18 | echo "Could not find key file $PWD/${i}.$1!" 19 | exit 1 20 | fi 21 | cp -pv ${i}.$1 $i 22 | fi 23 | done 24 | 25 | (sudo killall gpg-agent 2> /dev/null || exit 0) 26 | sleep 2 27 | (sudo killall -9 gpg-agent 2> /dev/null || exit 0) 28 | 29 | gpg --card-status 30 | 31 | (cd ~/src/category-theory; git remote update) 32 | 33 | if [[ ! -f ~/.yubico/challenge-$1 && -x $(which ykpamcfg 2> /dev/null) ]]; then 34 | ykpamcfg -2 35 | fi 36 | -------------------------------------------------------------------------------- /bootstrap.org: -------------------------------------------------------------------------------- 1 | :PROPERTIES: 2 | :ID: 5AB0D908-77B6-4FF0-993F-808861D0A7C6 3 | :CREATED: [2024-08-01 Thu 11:36] 4 | :END: 5 | #+title: Bootstrap new macOS system with Nix 6 | 7 | After the system installation and copying of the =~/src= directory, first thing 8 | is to make =sudo= easier to use, if desired: 9 | 10 | #+begin_src sh 11 | EDITOR=vi sudo visudo 12 | #+end_src 13 | 14 | Install Nix: 15 | #+begin_src sh 16 | sh <(curl -L https://nixos.org/nix/install) 17 | #+end_src 18 | 19 | Logout and back in, then install the minimum needed tools, which is =git= and 20 | =make=: 21 | #+begin_src sh 22 | nix-env -i git gnumake 23 | #+end_src 24 | 25 | Setup the shell environment, since a few things are missing: 26 | #+begin_src sh 27 | export HOSTNAME=clio 28 | export NIX_CONF=/Users/johnw/src/nix 29 | export NIX_PATH=/Users/johnw/.nix-defexpr/channels:darwin=/Users/johnw/src/nix/darwin:darwin-config=/Users/johnw/src/nix/config/darwin.nix:hm-config=/Users/johnw/src/nix/config/home.nix:home-manager=/Users/johnw/src/nix/home-manager:localconfig=/Users/johnw/src/nix/config/${HOSTNAME}.nix:nixpkgs=/Users/johnw/src/nix/nixpkgs:ssh-auth-sock=/Users/johnw/.config/gnupg/S.gpg-agent.ssh:ssh-config-file=/Users/johnw/.ssh/config 30 | #+end_src 31 | 32 | Build the Nix environment. This will take a very long time: 33 | #+begin_src sh 34 | ~/src/nix/bin/u clio build 35 | #+end_src 36 | 37 | In order to switch to the new environment, we need =darwin-rebuild= to be on the 38 | path: 39 | #+begin_src sh 40 | export DARWIN_REBUILD=$(find /nix/store -name darwin-rebuild -type f | head -1) 41 | export PATH=${DARWIN_REBUILD}/..:$PATH 42 | #+end_src 43 | 44 | Remove what we installed manually above. Note that these may also need to be 45 | manually added to the path, as we did for =darwin-rebuild=. 46 | #+begin_src sh 47 | nix-env -e git gnumake 48 | #+end_src 49 | 50 | Now we can switch: 51 | #+begin_src sh 52 | ~/src/nix/bin/u clio switch 53 | #+end_src 54 | 55 | # build-users-group = nixbld 56 | -------------------------------------------------------------------------------- /config/athena.nix: -------------------------------------------------------------------------------- 1 | { 2 | hostname = "athena"; 3 | } 4 | -------------------------------------------------------------------------------- /config/clio.nix: -------------------------------------------------------------------------------- 1 | { 2 | hostname = "clio"; 3 | } 4 | -------------------------------------------------------------------------------- /config/darwin.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, hostname, inputs, overlays, ... }: 2 | 3 | let home = "/Users/johnw"; 4 | tmpdir = "/tmp"; 5 | 6 | xdg_configHome = "${home}/.config"; 7 | xdg_dataHome = "${home}/.local/share"; 8 | xdg_cacheHome = "${home}/.cache"; 9 | 10 | in { 11 | users = { 12 | users.johnw = { 13 | name = "johnw"; 14 | inherit home; 15 | shell = pkgs.zsh; 16 | 17 | openssh.authorizedKeys = { 18 | keys = [ 19 | # GnuPG auth key stored on Yubikeys 20 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJAj2IzkXyXEl+ReCg9H+t55oa6GIiumPWeufcYCWy3F yubikey-gnupg" 21 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAING2r8bns7h9vZIfZSGsX+YmTSe2Tv1X8f/Qlqo+RGBb yubikey-14476831-gnupg" 22 | # ShellFish iPhone key 23 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJD0sIKWWVF+zIWcNm/BfsbCQxuUBHD8nRNSpZV+mCf+ ShellFish@iPhone-28062024" 24 | # ShellFish iPad key 25 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIZQeQ/gKkOwuwktwD4z0ZZ8tpxNej3qcHS5ZghRcdAd ShellFish@iPad-22062024" 26 | ]; 27 | keyFiles = 28 | # Each machine accepts SSH key authentication from the rest 29 | import ./key-files.nix { inherit (pkgs) lib; } 30 | [ "hera" "clio" "athena" ] home hostname; 31 | }; 32 | }; 33 | }; 34 | 35 | fonts.packages = with pkgs; [ 36 | dejavu_fonts 37 | nerd-fonts.dejavu-sans-mono 38 | scheherazade-new 39 | ia-writer-duospace 40 | liberation_ttf 41 | ]; 42 | 43 | programs = { 44 | zsh = { 45 | enable = true; 46 | enableCompletion = false; 47 | }; 48 | 49 | gnupg.agent = { 50 | enable = true; 51 | enableSSHSupport = false; 52 | }; 53 | }; 54 | 55 | services = lib.optionalAttrs (hostname == "clio" || hostname == "hera") { 56 | postgresql = { 57 | enable = true; 58 | package = pkgs.postgresql.withPackages (p: with p; [ pgvector ]); 59 | dataDir = "${home}/${hostname}/postgresql"; 60 | authentication = '' 61 | local all all trust 62 | host all all localhost trust 63 | host all all 127.0.0.1/32 trust 64 | ''; 65 | }; 66 | }; 67 | 68 | homebrew = { 69 | enable = true; 70 | onActivation = { 71 | autoUpdate = false; 72 | upgrade = false; 73 | cleanup = "zap"; 74 | }; 75 | 76 | taps = [ 77 | "kadena-io/pact" 78 | ]; 79 | brews = [ 80 | "ykman" 81 | "nss" 82 | # Brews for Kadena 83 | "kadena-io/pact/pact" 84 | "openssl" 85 | "z3" 86 | ]; 87 | 88 | casks = [ 89 | "carbon-copy-cloner" 90 | "docker" 91 | "drivedx" 92 | "iterm2" 93 | "vmware-fusion" 94 | # "vagrant" 95 | # "vagrant-manager" 96 | # "vagrant-vmware-utility" 97 | "wireshark" 98 | ] ++ lib.optionals (hostname == "hera") [ 99 | "fujitsu-scansnap-home" 100 | "gzdoom" 101 | "raspberry-pi-imager" 102 | ] ++ lib.optionals (pkgs.system == "aarch64-darwin") [ 103 | # "lm-studio" 104 | "diffusionbee" 105 | ] ++ lib.optionals (hostname == "clio") [ 106 | "aldente" 107 | ] ++ lib.optionals (hostname != "athena") [ 108 | "1password" 109 | "1password-cli" 110 | "affinity-photo" 111 | "anki" 112 | # { name = "arc"; greedy = true; } 113 | "asana" 114 | "audacity" 115 | { name = "brave-browser"; greedy = true; } 116 | "choosy" 117 | # "datagraph" # Use DataGraph in App Store 118 | "dbvisualizer" 119 | "devonagent" 120 | "devonthink" 121 | "discord" 122 | { name = "duckduckgo"; greedy = true; } 123 | "dungeon-crawl-stone-soup-tiles" 124 | "element" 125 | "expandrive" 126 | "fantastical" 127 | { name = "firefox"; greedy = true; } 128 | "geektool" 129 | "grammarly-desktop" 130 | "keyboard-maestro" 131 | "launchbar" 132 | "lectrote" 133 | "ledger-live" 134 | # "macwhisper" # Use Whisper Transcription in App Store 135 | # "marked" # Use Marked 2 in App Store 136 | "mellel" 137 | "netdownloadhelpercoapp" 138 | # "notion" 139 | # "omnigraffle" # Stay at version 6 140 | { name = "opera"; greedy = true; } 141 | "pdf-expert" 142 | # "screenflow" # Stay at version 9 143 | "signal" 144 | "slack" 145 | # "soulver" # Use Soulver 3 in App Store 146 | "spamsieve" 147 | "steam" 148 | "suspicious-package" 149 | "telegram" 150 | "thinkorswim" 151 | "tor-browser" 152 | "ukelele" 153 | "unicodechecker" 154 | "virtual-ii" 155 | { name = "vivaldi"; greedy = true; } 156 | "vlc" 157 | "whatsapp" 158 | "xnviewmp" 159 | { name = "zoom"; greedy = true; } 160 | "zotero" 161 | # "zulip" 162 | ]; 163 | 164 | ## The following software, or versions of software, are not available 165 | ## via Homebrew or the App Store: 166 | 167 | # "Bookmap" 168 | # "Digital Photo Professional" 169 | # "EOS Utility" 170 | # "Kadena Chainweaver" 171 | # "MotiveWave" 172 | # "ScanSnap Online Update" 173 | # "Photo Supreme" 174 | # "ABBYY FineReader for ScanSnap" 175 | 176 | masApps = lib.optionalAttrs (hostname != "athena") { 177 | "1Password for Safari" = 1569813296; 178 | "Bible Study" = 472790630; 179 | "DataGraph" = 407412840; 180 | "Drafts" = 1435957248; 181 | "Grammarly for Safari" = 1462114288; 182 | "Just Press Record" = 1033342465; 183 | "Keynote" = 409183694; 184 | "Kindle" = 302584613; 185 | "Marked 2" = 890031187; 186 | "Microsoft Excel" = 462058435; 187 | "Microsoft PowerPoint" = 462062816; 188 | "Microsoft Word" = 462054704; 189 | "Ninox Database" = 901110441; 190 | "Notability" = 360593530; 191 | "Paletter" = 1494948845; 192 | "Pixelmator Pro" = 1289583905; 193 | "Prime Video" = 545519333; 194 | "Shell Fish" = 1336634154; 195 | "Soulver 3" = 1508732804; 196 | "Speedtest" = 1153157709; 197 | "Whisper Transcription" = 1668083311; 198 | "WireGuard" = 1451685025; 199 | "Xcode" = 497799835; 200 | "iMovie" = 408981434; 201 | }; 202 | }; 203 | 204 | nixpkgs = { 205 | config = { 206 | allowUnfree = true; 207 | allowBroken = false; 208 | allowInsecure = false; 209 | allowUnsupportedSystem = false; 210 | 211 | permittedInsecurePackages = [ 212 | "emacs-mac-macport-with-packages-29.4" 213 | "emacs-mac-macport-29.4" 214 | "emacs-29.4" 215 | "python-2.7.18.7" 216 | "libressl-3.4.3" 217 | ]; 218 | }; 219 | 220 | overlays = overlays 221 | ++ (let path = ../overlays; in with builtins; 222 | map (n: import (path + ("/" + n))) 223 | (filter (n: match ".*\\.nix" n != null || 224 | pathExists (path + ("/" + n + "/default.nix"))) 225 | (attrNames (readDir path)))) 226 | ++ [ (import ./envs.nix) ]; 227 | }; 228 | 229 | nix = 230 | let 231 | hera = { 232 | hostName = "hera"; 233 | protocol = "ssh-ng"; 234 | system = "aarch64-darwin"; 235 | sshUser = "johnw"; 236 | maxJobs = 24; 237 | speedFactor = 4; 238 | }; 239 | 240 | athena = { 241 | hostName = "athena"; 242 | protocol = "ssh-ng"; 243 | system = "aarch64-darwin"; 244 | sshUser = "johnw"; 245 | maxJobs = 10; 246 | speedFactor = 2; 247 | }; 248 | in { 249 | 250 | package = pkgs.nix; 251 | 252 | # This entry lets us to define a system registry entry so that 253 | # `nixpkgs#foo` will use the nixpkgs that nix-darwin was last built with, 254 | # rather than whatever is the current unstable version. 255 | # 256 | # See https://yusef.napora.org/blog/pinning-nixpkgs-flake 257 | # registry = lib.mapAttrs (_: value: { flake = value; }) inputs; 258 | 259 | nixPath = lib.mkForce ( 260 | lib.mapAttrsToList (key: value: "${key}=${value.to.path}") 261 | config.nix.registry 262 | ++ [{ ssh-config-file = "${home}/.ssh/config"; 263 | darwin-config = "${home}/src/nix/config/darwin.nix"; 264 | hm-config = "${home}/src/nix/config/home.nix"; 265 | }]); 266 | 267 | settings = { 268 | trusted-users = [ "@admin" "@builders" "johnw" ]; 269 | max-jobs = if (hostname == "clio") then 10 else 24; 270 | cores = 2; 271 | 272 | substituters = [ 273 | # "https://cache.iog.io" 274 | ]; 275 | trusted-substituters = [ 276 | ]; 277 | trusted-public-keys = [ 278 | "newartisans.com:RmQd/aZOinbJR/G5t+3CIhIxT5NBjlCRvTiSbny8fYw=" 279 | "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" 280 | ]; 281 | }; 282 | 283 | distributedBuilds = true; 284 | buildMachines = 285 | if hostname == "clio" 286 | then [ hera athena ] 287 | else if hostname == "athena" 288 | then [ hera ] 289 | else []; 290 | 291 | extraOptions = '' 292 | gc-keep-derivations = true 293 | gc-keep-outputs = true 294 | secret-key-files = ${xdg_configHome}/gnupg/nix-signing-key.sec 295 | experimental-features = nix-command flakes 296 | ''; 297 | }; 298 | 299 | ids.gids.nixbld = if hostname == "athena" then 30000 else 350; 300 | 301 | system = { 302 | stateVersion = 4; 303 | 304 | primaryUser = "johnw"; 305 | 306 | defaults = { 307 | NSGlobalDomain = { 308 | AppleKeyboardUIMode = 3; 309 | AppleInterfaceStyle = "Dark"; 310 | AppleShowAllExtensions = true; 311 | NSAutomaticWindowAnimationsEnabled = false; 312 | NSNavPanelExpandedStateForSaveMode = true; 313 | NSNavPanelExpandedStateForSaveMode2 = true; 314 | "com.apple.keyboard.fnState" = true; 315 | _HIHideMenuBar = hostname != "clio"; 316 | "com.apple.mouse.tapBehavior" = 1; 317 | "com.apple.sound.beep.volume" = 0.0; 318 | "com.apple.sound.beep.feedback" = 0; 319 | ApplePressAndHoldEnabled = false; 320 | }; 321 | 322 | CustomUserPreferences = { 323 | "com.apple.finder" = { 324 | ShowExternalHardDrivesOnDesktop = false; 325 | ShowHardDrivesOnDesktop = false; 326 | ShowMountedServersOnDesktop = true; 327 | ShowRemovableMediaOnDesktop = true; 328 | _FXSortFoldersFirst = true; 329 | # When performing a search, search the current folder by default 330 | FXDefaultSearchScope = "SCcf"; 331 | }; 332 | 333 | "com.apple.desktopservices" = { 334 | # Avoid creating .DS_Store files on network or USB volumes 335 | DSDontWriteNetworkStores = true; 336 | DSDontWriteUSBStores = true; 337 | }; 338 | 339 | "com.apple.spaces" = { 340 | "spans-displays" = 0; # Display have seperate spaces 341 | }; 342 | 343 | "com.apple.WindowManager" = { 344 | EnableStandardClickToShowDesktop = 0; # Click wallpaper to reveal desktop 345 | StandardHideDesktopIcons = 0; # Show items on desktop 346 | HideDesktop = 0; # Do not hide items on desktop & stage manager 347 | StageManagerHideWidgets = 0; 348 | StandardHideWidgets = 0; 349 | }; 350 | 351 | "com.apple.screencapture" = { 352 | location = "~/Downloads"; 353 | type = "png"; 354 | }; 355 | 356 | "com.apple.AdLib" = { 357 | allowApplePersonalizedAdvertising = false; 358 | }; 359 | 360 | # Prevent Photos from opening automatically when devices are plugged in 361 | "com.apple.ImageCapture".disableHotPlug = true; 362 | 363 | "com.apple.print.PrintingPrefs" = { 364 | # Automatically quit printer app once the print jobs complete 365 | "Quit When Finished" = true; 366 | }; 367 | 368 | "com.apple.SoftwareUpdate" = { 369 | AutomaticCheckEnabled = true; 370 | # Check for software updates daily, not just once per week 371 | ScheduleFrequency = 1; 372 | # Download newly available updates in background 373 | AutomaticDownload = 1; 374 | # Install System data files & security updates 375 | CriticalUpdateInstall = 1; 376 | }; 377 | "com.apple.TimeMachine".DoNotOfferNewDisksForBackup = true; 378 | 379 | # Turn on app auto-update 380 | "com.apple.commerce".AutoUpdate = true; 381 | }; 382 | 383 | ".GlobalPreferences" = { 384 | "com.apple.sound.beep.sound" = "/System/Library/Sounds/Funk.aiff"; 385 | }; 386 | 387 | dock = { 388 | autohide = true; 389 | orientation = "right"; 390 | launchanim = false; 391 | show-process-indicators = true; 392 | show-recents = false; 393 | static-only = true; 394 | }; 395 | 396 | finder = { 397 | AppleShowAllExtensions = true; 398 | ShowPathbar = true; 399 | FXEnableExtensionChangeWarning = false; 400 | }; 401 | 402 | trackpad = { 403 | Clicking = true; 404 | TrackpadThreeFingerDrag = true; 405 | }; 406 | }; 407 | 408 | keyboard = { 409 | enableKeyMapping = true; 410 | remapCapsLockToControl = true; 411 | }; 412 | }; 413 | 414 | launchd = { 415 | daemons = { 416 | limits = { 417 | script = '' 418 | /bin/launchctl limit maxfiles 524288 524288 419 | /bin/launchctl limit maxproc 8192 8192 420 | ''; 421 | serviceConfig.RunAtLoad = true; 422 | serviceConfig.KeepAlive = false; 423 | }; 424 | } 425 | // lib.optionalAttrs (hostname == "hera") { 426 | "sysctl-vram-limit" = { 427 | script = '' 428 | # This leaves 64 GB of working memory remaining 429 | # /usr/sbin/sysctl iogpu.wired_limit_mb=458752 430 | 431 | # This leaves 32 GB of working memory remaining, and is best for 432 | # when the machine will only be used headless as a server from 433 | # remote, during longer trips. 434 | /usr/sbin/sysctl iogpu.wired_limit_mb=491520 435 | ''; 436 | serviceConfig.RunAtLoad = true; 437 | }; 438 | }; 439 | 440 | user = { 441 | agents = { 442 | aria2c = { 443 | script = '' 444 | ${pkgs.aria2}/bin/aria2c \ 445 | --enable-rpc \ 446 | --dir ${home}/Downloads \ 447 | --check-integrity \ 448 | --continue 449 | ''; 450 | serviceConfig.RunAtLoad = true; 451 | serviceConfig.KeepAlive = true; 452 | }; 453 | } // lib.optionalAttrs (hostname == "hera") { 454 | llama-swap = { 455 | script = '' 456 | ${pkgs.llama-swap}/bin/llama-swap --config ${home}/Models/llama-swap.yaml --watch-config 457 | ''; 458 | serviceConfig.RunAtLoad = true; 459 | serviceConfig.KeepAlive = true; 460 | }; 461 | 462 | llama-swap-https-proxy = 463 | let 464 | logDir = "${xdg_cacheHome}/llama-swap-proxy"; 465 | config = pkgs.writeText "nginx.conf" '' 466 | worker_processes 1; 467 | pid ${logDir}/nginx.pid; 468 | error_log ${logDir}/error.log warn; 469 | events { 470 | worker_connections 1024; 471 | } 472 | http { 473 | server { 474 | listen 8443 ssl; 475 | 476 | ssl_certificate /Users/johnw/hera/hera.local+4.pem; 477 | ssl_certificate_key /Users/johnw/hera/hera.local+4-key.pem; 478 | ssl_protocols TLSv1.2 TLSv1.3; 479 | ssl_prefer_server_ciphers on; 480 | ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305; 481 | 482 | access_log ${logDir}/access.log; 483 | 484 | location / { 485 | proxy_pass http://localhost:8080; 486 | 487 | proxy_set_header Host $host; 488 | proxy_set_header X-Real-IP $remote_addr; 489 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 490 | proxy_set_header X-Forwarded-Proto $scheme; 491 | 492 | proxy_connect_timeout 600; 493 | proxy_send_timeout 600; 494 | proxy_read_timeout 600; 495 | send_timeout 600; 496 | 497 | add_header 'Access-Control-Allow-Origin' $http_origin; 498 | add_header 'Access-Control-Allow-Credentials' 'true'; 499 | add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range'; 500 | add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH'; 501 | } 502 | } 503 | } 504 | ''; in { 505 | script = '' 506 | mkdir -p ${logDir} 507 | ${pkgs.nginx}/bin/nginx -c ${config} -g "daemon off;" -e ${logDir}/error.log 508 | ''; 509 | serviceConfig.RunAtLoad = true; 510 | serviceConfig.KeepAlive = true; 511 | }; 512 | 513 | # ollama = { 514 | # script = '' 515 | # export OLLAMA_HOST=0.0.0.0:11434 516 | # export OLLAMA_KEEP_ALIVE=${if hostname == "clio" then "5m" else "60m"} 517 | # export OLLAMA_NOHISTORY=true 518 | # ${pkgs.ollama}/bin/ollama serve 519 | # ''; 520 | # serviceConfig.RunAtLoad = true; 521 | # serviceConfig.KeepAlive = true; 522 | # }; 523 | 524 | # lmstudio = { 525 | # script = "${xdg_dataHome}/lmstudio/bin/lms server start"; 526 | # serviceConfig.RunAtLoad = true; 527 | # serviceConfig.KeepAlive = true; 528 | # }; 529 | }; 530 | }; 531 | }; 532 | } 533 | -------------------------------------------------------------------------------- /config/emacs.nix: -------------------------------------------------------------------------------- 1 | pkgs: epkgs: with epkgs; 2 | [ 3 | epkgs."2048-game" 4 | ace-mc 5 | ace-window 6 | adoc-mode 7 | agda2-mode 8 | aggressive-indent 9 | aio 10 | alert 11 | all-the-icons 12 | anaphora 13 | anki-editor 14 | apiwrap 15 | aria2 16 | ascii 17 | asoc 18 | async 19 | auctex 20 | auto-yasnippet 21 | avy 22 | avy-zap 23 | awesome-tray 24 | backup-each-save 25 | biblio 26 | bm 27 | boogie-friends 28 | bookmark-plus 29 | browser-hist 30 | browse-kill-ring 31 | bufler 32 | burly 33 | button-lock 34 | calfw 35 | calfw-cal 36 | calfw-org 37 | cape 38 | cargo 39 | # casual 40 | centaur-tabs 41 | centered-cursor-mode 42 | change-inner 43 | chatgpt-shell 44 | chess 45 | citar 46 | citar-embark 47 | citar-org-roam 48 | citre 49 | cmake-font-lock 50 | cmake-mode 51 | col-highlight 52 | color-moccur 53 | color-theme 54 | command-log-mode 55 | company 56 | company-coq 57 | company-math 58 | consult 59 | consult-company 60 | consult-dir 61 | consult-flycheck 62 | consult-gh 63 | consult-gh-embark 64 | consult-gh-forge 65 | consult-gh-with-pr-review 66 | consult-git-log-grep 67 | consult-hoogle 68 | consult-lsp 69 | consult-omni 70 | consult-org-roam 71 | consult-projectile 72 | consult-yasnippet 73 | copy-as-format 74 | corfu 75 | corsair 76 | crosshairs 77 | csv-mode 78 | ctable 79 | ctrlf 80 | cursor-chg 81 | dape 82 | deadgrep 83 | dedicated 84 | deferred 85 | delve lister 86 | diff-hl 87 | diffview 88 | diminish 89 | dired-hist 90 | # dired-plus 91 | dired-rsync 92 | dired-subtree 93 | dired-toggle 94 | diredfl 95 | direnv 96 | discover-my-major 97 | docker 98 | docker-compose-mode 99 | dockerfile-mode 100 | eager-state 101 | easy-kill 102 | eat 103 | ebdb 104 | edbi 105 | edit-env 106 | edit-indirect 107 | edit-server 108 | edit-var 109 | egerrit 110 | eglot 111 | eglot-booster 112 | el-mock 113 | elisp-depend 114 | elisp-docstring-mode 115 | elisp-refs 116 | elisp-slime-nav 117 | elmacro 118 | elpy 119 | emacsql 120 | emamux 121 | embark 122 | embark-consult 123 | embark-org-roam 124 | ement 125 | emojify 126 | engine-mode 127 | epc 128 | epl 129 | erc-highlight-nicknames 130 | erc-yank 131 | eshell-bookmark 132 | eshell-up 133 | eshell-z 134 | esxml 135 | eval-expr 136 | evil 137 | expand-region 138 | eyebrowse 139 | f 140 | feebleline 141 | fence-edit 142 | flycheck 143 | flycheck-haskell 144 | flycheck-package 145 | fn 146 | focus 147 | font-lock-studio 148 | forge 149 | format-all 150 | free-keys 151 | fringe-helper 152 | fuzzy 153 | gerrit 154 | ghub 155 | git-link 156 | git-timemachine 157 | git-undo 158 | gnus-alias 159 | gnus-harvest 160 | gnus-recent 161 | google-this 162 | goto-last-change 163 | gptel llama 164 | gptel-aibo 165 | gptel-fn-complete 166 | gptel-quick 167 | graphviz-dot-mode 168 | haskell-mode 169 | hcl-mode 170 | helpful 171 | highlight 172 | highlight-cl 173 | highlight-defined 174 | highlight-numbers 175 | hl-line-plus 176 | hl-todo 177 | ht 178 | hydra 179 | ialign 180 | iflipb 181 | imenu-list 182 | indent-shift 183 | inspector tree-inspector 184 | ipcalc 185 | jinx 186 | jobhours 187 | jq-mode 188 | js2-mode 189 | json-mode 190 | json-reformat 191 | json-snatcher 192 | jupyter 193 | key-chord 194 | keypression 195 | khoj 196 | know-your-http-well 197 | kv 198 | lasgun 199 | ledger-mode 200 | link-hint 201 | lispy 202 | list-utils 203 | listen 204 | literate-calc-mode 205 | lively 206 | logito 207 | loop 208 | lsp-bridge 209 | lua-mode 210 | m-buffer 211 | macrostep 212 | magit 213 | magit-annex 214 | magit-imerge 215 | magit-lfs 216 | magit-popup 217 | magit-tbdiff 218 | magit-todos 219 | makey 220 | malyon 221 | marginalia 222 | markdown-mode 223 | markdown-preview-mode 224 | marshal 225 | math-symbol-lists 226 | mc-calc 227 | mc-extras 228 | mediawiki 229 | memory-usage 230 | minesweeper 231 | moccur-edit 232 | move-text 233 | multi-term 234 | multi-vterm 235 | multifiles 236 | multiple-cursors 237 | names 238 | nginx-mode 239 | nix-mode 240 | noflet 241 | nov 242 | oauth2 243 | ob-async 244 | ob-coq 245 | ob-diagrams 246 | ob-emamux 247 | ob-restclient 248 | ob-solidity 249 | olivetti 250 | onepassword-el 251 | onnx 252 | operate-on-number 253 | orderless 254 | org 255 | org-alert 256 | org-anki 257 | org-annotate 258 | org-appear 259 | org-auto-expand 260 | org-auto-expand 261 | org-autolist 262 | org-bookmark-heading 263 | org-caldav 264 | org-contacts 265 | org-drill 266 | org-edit-indirect 267 | org-edna 268 | org-extra-emphasis 269 | org-fancy-priorities 270 | org-gcal 271 | org-mime 272 | org-modern 273 | org-mru-clock 274 | org-msg 275 | org-noter 276 | org-notifications 277 | org-pdftools 278 | org-pretty-table 279 | org-projectile org-project-capture org-category-capture 280 | org-ql 281 | org-quick-peek 282 | org-real 283 | org-recent-headings 284 | org-remark 285 | org-review 286 | org-rich-yank 287 | org-roam 288 | org-roam-ui 289 | org-sidebar 290 | org-sql 291 | org-srs fsrs 292 | org-sticky-header 293 | org-super-agenda 294 | org-superstar 295 | org-timeline 296 | org-transclusion 297 | org-upcoming-modeline 298 | org-vcard 299 | org-web-tools 300 | orgit 301 | orgit-forge 302 | origami 303 | osm 304 | ov 305 | ovpn-mode 306 | ox-gfm 307 | ox-odt 308 | ox-pandoc 309 | ox-slack 310 | ox-texinfo-plus 311 | package-lint 312 | pact-mode 313 | pandoc-mode 314 | paradox 315 | paredit 316 | parent-mode 317 | parse-csv 318 | parsebib 319 | parsec 320 | pass 321 | password-store 322 | pcre2el 323 | pdf-tools 324 | pdfgrep 325 | peg 326 | persistent-scratch 327 | persistent-soft 328 | peval 329 | pfuture 330 | phi-search 331 | phi-search-mc 332 | pkg-info 333 | plantuml-mode 334 | popper 335 | popup 336 | popup-pos-tip 337 | popup-ruler 338 | popwin 339 | pos-tip 340 | pp-c-l 341 | prodigy 342 | projectile 343 | proof-general 344 | protobuf-mode 345 | pr-review 346 | python-mode 347 | quick-peek 348 | rainbow-delimiters 349 | rainbow-mode 350 | redshank 351 | regex-tool 352 | request 353 | restclient 354 | reveal-in-osx-finder 355 | rich-minority 356 | riscv-mode 357 | rs-gnus-summary 358 | rust-mode 359 | s 360 | sbt-mode 361 | scala-mode 362 | sdcv-mode 363 | selected 364 | separedit 365 | shackle 366 | shell-toggle 367 | shift-number 368 | simple-httpd 369 | sky-color-clock 370 | # slack circe 371 | slime 372 | smart-newline 373 | smartparens 374 | solidity-flycheck 375 | solidity-mode 376 | sort-words 377 | spinner 378 | sql-indent 379 | string-inflection 380 | sudo-edit 381 | sunrise-commander 382 | super-save 383 | supercite 384 | swift-mode 385 | tablist 386 | tagedit 387 | templatel 388 | terraform-mode 389 | tidy 390 | tla-mode 391 | toc-org 392 | ts 393 | transpose-mark 394 | treemacs 395 | tuareg 396 | typescript-mode 397 | typo 398 | ultra-scroll-mac 399 | undo-fu 400 | undo-propose 401 | unicode-fonts 402 | uniline 403 | use-package 404 | uuidgen 405 | vagrant 406 | vagrant-tramp 407 | vcard-mode 408 | vdiff 409 | verb 410 | vertico 411 | vimish-fold 412 | virtual-auto-fill 413 | visual-fill-column 414 | visual-regexp 415 | visual-regexp-steroids 416 | vline 417 | vterm 418 | vulpea 419 | vundo 420 | w3m 421 | wat-mode 422 | web 423 | web-mode 424 | web-server 425 | websocket 426 | wgrep 427 | which-key 428 | whitespace-cleanup-mode 429 | window-purpose 430 | with-editor 431 | word-count-mode 432 | writeroom-mode 433 | x86-lookup 434 | xeft 435 | xml-rpc 436 | xr 437 | xray 438 | yaml-mode 439 | yaoddmuse 440 | yasnippet 441 | z3-mode 442 | zoom 443 | zoutline 444 | ztree 445 | 446 | prescient 447 | vertico-prescient 448 | outline-indent 449 | easysession 450 | compile-angel 451 | inhibit-mouse 452 | buffer-terminator 453 | ] 454 | -------------------------------------------------------------------------------- /config/envs.nix: -------------------------------------------------------------------------------- 1 | self: pkgs: 2 | 3 | let myEmacsPackages = import ./emacs.nix pkgs; in rec { 4 | emacs29MacPortEnv = pkgs.emacs29MacPortEnv myEmacsPackages; 5 | emacs30Env = pkgs.emacs30Env myEmacsPackages; 6 | emacsHEADEnv = pkgs.emacsHEADEnv myEmacsPackages; 7 | } 8 | -------------------------------------------------------------------------------- /config/firefox.nix: -------------------------------------------------------------------------------- 1 | { hostname, home, pkgs, ...}: 2 | { 3 | enable = true; 4 | package = null; # firefox is installed using homebrew 5 | 6 | betterfox = { 7 | enable = true; 8 | # version = "128.0"; # defaults to main branch 9 | }; 10 | 11 | policies = { 12 | AppAutoUpdate = false; 13 | BackgroundAppUpdate = false; 14 | 15 | DisableBuiltinPDFViewer = true; 16 | DisableFirefoxStudies = true; 17 | DisableFirefoxAccounts = false; 18 | DisableFirefoxScreenshots = true; 19 | DisableForgetButton = true; 20 | DisableMasterPasswordCreation = true; 21 | DisableProfileImport = true; 22 | DisableProfileRefresh = true; 23 | DisableSetDesktopBackground = true; 24 | DisplayMenuBar = "default-off"; 25 | DisplayBookmarksToolbar = "default-off"; 26 | DisablePocket = true; 27 | DisableTelemetry = true; 28 | DisableFormHistory = true; 29 | DisablePasswordReveal = true; 30 | DontCheckDefaultBrowser = true; 31 | 32 | OfferToSaveLogins = false; 33 | EnableTrackingProtection = { 34 | Value = true; 35 | Locked = true; 36 | Cryptomining = true; 37 | Fingerprinting = true; 38 | EmailTracking = true; 39 | }; 40 | DefaultDownloadDirectory = "${home}/Downloads"; 41 | OverrideFirstRunPage = ""; 42 | OverridePostUpdatePage = ""; 43 | ExtensionUpdate = false; 44 | SearchBar = "unified"; 45 | 46 | FirefoxSuggest = { 47 | WebSuggestions = false; 48 | SponsoredSuggestions = false; 49 | ImproveSuggest = false; 50 | Locked = true; 51 | }; 52 | 53 | Handlers = { 54 | mimeTypes."application/pdf".action = "saveToDisk"; 55 | }; 56 | PasswordManagerEnabled = false; 57 | PromptForDownloadLocation = false; 58 | 59 | SanitizeOnShutdown = { 60 | Cache = true; 61 | Cookies = true; 62 | Downloads = true; 63 | FormData = true; 64 | History = false; 65 | Sessions = false; 66 | SiteSettings = false; 67 | OfflineApps = true; 68 | Locked = true; 69 | }; 70 | 71 | SearchEngines = { 72 | PreventInstalls = true; 73 | Add = [ 74 | { 75 | Name = "Kagi"; 76 | URLTemplate = "https://kagi.com/search?q={searchTerms}"; 77 | Method = "GET"; 78 | IconURL = "https://kagi.com/asset/405c65f/favicon-32x32.png?v=49886a9a8f55fd41f83a89558e334f673f9e25cf"; 79 | Description = "Kagi Search"; 80 | } 81 | ]; 82 | Remove = [ 83 | "Bing" 84 | ]; 85 | Default = "Kagi"; 86 | }; 87 | SearchSuggestEnabled = false; 88 | }; 89 | 90 | profiles = pkgs.lib.optionalAttrs (hostname == "hera") { 91 | "3xz6u5ly.default-release" = { 92 | id = 0; 93 | name = "default-release"; 94 | isDefault = true; 95 | betterfox.enable = false; 96 | }; 97 | 98 | "3ltwg757.default" = { 99 | id = 1; 100 | name = "default"; 101 | betterfox.enable = false; 102 | }; 103 | } // pkgs.lib.optionalAttrs (hostname == "clio") { 104 | "unj6oien.default-release" = { 105 | id = 0; 106 | name = "default-release"; 107 | isDefault = true; 108 | betterfox.enable = false; 109 | }; 110 | 111 | "v7m0m1sc.default" = { 112 | id = 1; 113 | name = "default"; 114 | betterfox.enable = false; 115 | }; 116 | } // { 117 | johnw = { 118 | id = 2; 119 | name = "John Wiegley"; 120 | isDefault = hostname == "athena"; 121 | 122 | betterfox = { 123 | enable = true; 124 | enableAllSections = true; 125 | }; 126 | 127 | extraConfig = '' 128 | # These two are required for the extensions mentioned below to be 129 | # enabled. 130 | user_pref("extensions.autoDisableScopes", 0); 131 | user_pref("extensions.enabledScopes", 15); 132 | 133 | user_pref("app.update.auto", false); 134 | user_pref("browser.engagement.sidebar-button.has-used", true); 135 | user_pref("browser.newtabpage.activity-stream.feeds.section.highlights", true); 136 | user_pref("browser.newtabpage.activity-stream.feeds.topsites", true); 137 | user_pref("browser.newtabpage.enabled", false); 138 | user_pref("browser.preferences.experimental.hidden", true); 139 | user_pref("browser.startup.homepage", "chrome://browser/content/blanktab.html"); 140 | user_pref("browser.startup.page", 3); 141 | user_pref("browser.tabs.hoverPreview.showThumbnails", false); 142 | user_pref("browser.tabs.warnOnClose", true); 143 | user_pref("browser.toolbarbuttons.introduced.sidebar-button", true); 144 | user_pref("browser.toolbars.bookmarks.visibility", "never"); 145 | user_pref("browser.urlbar.placeholderName.private", "DuckDuckGo"); 146 | user_pref("browser.warnOnQuitShortcut", true); 147 | user_pref("datareporting.usage.uploadEnabled", false); 148 | user_pref("doh-rollout.disable-heuristics", true); 149 | user_pref("doh-rollout.mode", 0); 150 | user_pref("doh-rollout.uri", "https://mozilla.cloudflare-dns.com/dns-query"); 151 | user_pref("dom.disable_open_during_load", false); 152 | user_pref("dom.security.https_only_mode", true); 153 | user_pref("dom.security.https_only_mode_ever_enabled", true); 154 | user_pref("extensions.formautofill.addresses.enabled", false); 155 | user_pref("extensions.formautofill.creditCards.enabled", false); 156 | user_pref("extensions.ui.extension.hidden", false); 157 | user_pref("extensions.ui.plugin.hidden", false); 158 | user_pref("font.name.serif.x-western", "Bookerly"); 159 | user_pref("media.videocontrols.picture-in-picture.video-toggle.enabled", false); 160 | user_pref("pdfjs.enabledCache.state", false); 161 | user_pref("pref.downloads.disable_button.edit_actions", false); 162 | user_pref("privacy.clearOnShutdown_v2.browsingHistoryAndDownloads", false); 163 | user_pref("privacy.globalprivacycontrol.enabled", false); 164 | user_pref("privacy.sanitize.sanitizeOnShutdown", true); 165 | user_pref("services.sync.engine.prefs.modified", true); 166 | user_pref("sidebar.backupState", "{\"command\":\"\",\"launcherWidth\":49,\"launcherExpanded\":false,\"launcherVisible\":true}"); 167 | user_pref("sidebar.revamp", true); 168 | user_pref("sidebar.verticalTabs", true); 169 | user_pref("signon.management.page.breach-alerts.enabled", false); 170 | user_pref("signon.rememberSignons", false); 171 | ''; 172 | 173 | containers = { 174 | "Kadena" = { 175 | id = 2; 176 | color = "red"; 177 | icon = "chill"; 178 | }; 179 | "Assembly" = { 180 | id = 6; 181 | color = "green"; 182 | icon = "fence"; 183 | }; 184 | "Copper to Gold" = { 185 | id = 7; 186 | color = "orange"; 187 | icon = "circle"; 188 | }; 189 | "Banking" = { 190 | id = 3; 191 | color = "green"; 192 | icon = "dollar"; 193 | }; 194 | "Shopping" = { 195 | id = 4; 196 | color = "pink"; 197 | icon = "cart"; 198 | }; 199 | "Social Media" = { 200 | id = 9; 201 | color = "purple"; 202 | icon = "fingerprint"; 203 | }; 204 | }; 205 | 206 | extensions = { 207 | force = true; 208 | packages = with pkgs.nur.repos.rycee.firefox-addons; [ 209 | onepassword-password-manager 210 | audiocontext-suspender 211 | copy-as-org-mode 212 | darkreader 213 | multi-account-containers 214 | history-cleaner 215 | old-reddit-redirect 216 | org-capture 217 | reddit-enhancement-suite 218 | single-file 219 | skip-redirect 220 | ublacklist 221 | ublock-origin 222 | video-downloadhelper 223 | vimium-c 224 | 225 | # Activate Reader View 226 | # Grammarly 227 | # LeechBlock NG 228 | # Privacy Settings 229 | # aria2-integration 230 | # augmented-steam 231 | # auto-tab-discard 232 | # bookmarks-organizer 233 | # choosy 234 | # colorzilla 235 | # downthemall 236 | # edit-with-emacs 237 | # font-finder 238 | # foxytab 239 | # imagus 240 | # native-mathml 241 | # open-multiple-urls 242 | # orbit 243 | # sidebery 244 | # simple-translate 245 | # stylus 246 | # tridactyl 247 | # umatrix 248 | # vimium 249 | # web-archives 250 | # web-developer 251 | # zotero-connector 252 | ]; 253 | 254 | # Addon IDs can be found in about:support#addons 255 | settings = with pkgs.nur.repos.rycee.firefox-addons; { 256 | # "${auto-tab-discard.addonId}".settings = { 257 | # audio = true; 258 | # battery = false; 259 | # click = "click.popup"; 260 | # faqs = false; 261 | # favicon = false; 262 | # favicon-delay = 500; 263 | # "force.hostnames" = []; 264 | # form = true; 265 | # go-hidden = false; 266 | # idle = true; 267 | # idle-timeout = 300; 268 | # "link.context" = true; 269 | # log = false; 270 | # "max.single.discard" = 50; 271 | # memory-enabled = false; 272 | # memory-value = 60; 273 | # mode = "time-based"; 274 | # "notification.permission" = false; 275 | # number = 0; 276 | # online = true; 277 | # "page.context" = true; 278 | # paused = false; 279 | # period = 600; 280 | # pinned = false; 281 | # prepends = "💤"; 282 | # simultaneous-jobs = 10; 283 | # startup-pinned = true; 284 | # startup-release-pinned = false; 285 | # startup-unpinned = true; 286 | # "tab.context" = true; 287 | # "trash.period" = 24; 288 | # "trash.unloaded" = false; 289 | # "trash.whitelist-url" = []; 290 | # whitelist = [ 291 | # "app.slack.com" 292 | # ]; 293 | # whitelist-url = []; 294 | # }; 295 | 296 | # "${history-cleaner.addonId}".settings = {}; 297 | 298 | # "${single-file.addonId}".settings = {}; 299 | 300 | "${ublock-origin.addonId}".settings = { 301 | userSettings = rec { 302 | advancedUserEnabled = true; 303 | cloudStorageEnabled = false; 304 | # collapseBlocked = false; 305 | uiAccentCustom = true; 306 | uiAccentCustom0 = "#ACA0F7"; 307 | externalLists = pkgs.lib.concatStringsSep "\n" importedLists; 308 | importedLists = [ 309 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/anti.piracy.txt" 310 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/doh-vpn-proxy-bypass.txt" 311 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/dyndns.txt" 312 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/fake.txt" 313 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/gambling.txt" 314 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/hoster.txt" 315 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/nsfw.txt" 316 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/pro.mini.txt" 317 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/spam-tlds-ublock.txt" 318 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/tif.txt" 319 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/ultimate.txt" 320 | ]; 321 | largeMediaSize = 250; 322 | # popupPanelSections = 31; 323 | tooltipsDisabled = true; 324 | }; 325 | dynamicFilteringString = '' 326 | no-cosmetic-filtering: * true 327 | no-cosmetic-filtering: appleid.apple.com false 328 | no-cosmetic-filtering: bing.com false 329 | no-cosmetic-filtering: cnn.com false 330 | no-cosmetic-filtering: google.com false 331 | no-cosmetic-filtering: www.notion.com false 332 | no-cosmetic-filtering: www.notion.so false 333 | no-cosmetic-filtering: old.reddit.com false 334 | no-cosmetic-filtering: slack.com false 335 | no-cosmetic-filtering: kadena-io.slack.com false 336 | no-cosmetic-filtering: twitch.tv false 337 | no-cosmetic-filtering: youtube.com false 338 | no-csp-reports: * true 339 | no-large-media: * true 340 | no-large-media: www.amazon.com false 341 | no-large-media: appleid.apple.com false 342 | no-large-media: login.bmwusa.com false 343 | no-large-media: www.ftb.ca.gov false 344 | no-large-media: www.notion.com false 345 | no-large-media: www.notion.so false 346 | no-large-media: old.reddit.com false 347 | no-large-media: client.schwab.com false 348 | no-large-media: sws-gateway-nr.schwab.com false 349 | no-large-media: slack.com false 350 | no-large-media: kadena-io.slack.com false 351 | no-large-media: www.youtube.com false 352 | no-remote-fonts: * true 353 | no-remote-fonts: www.amazon.com false 354 | no-remote-fonts: appleid.apple.com false 355 | no-remote-fonts: login.bmwusa.com false 356 | no-remote-fonts: www.ftb.ca.gov false 357 | no-remote-fonts: docs.google.com false 358 | no-remote-fonts: drive.google.com false 359 | no-remote-fonts: gemini.google.com false 360 | no-remote-fonts: notebooklm.google.com false 361 | no-remote-fonts: www.google.com false 362 | no-remote-fonts: kadena.latticehq.com false 363 | no-remote-fonts: www.notion.com false 364 | no-remote-fonts: www.notion.so false 365 | no-remote-fonts: usa.onlinesrp.org false 366 | no-remote-fonts: old.reddit.com false 367 | no-remote-fonts: client.schwab.com false 368 | no-remote-fonts: sws-gateway-nr.schwab.com false 369 | no-remote-fonts: slack.com false 370 | no-remote-fonts: app.slack.com false 371 | no-remote-fonts: kadena-io.slack.com false 372 | no-remote-fonts: www.youtube.com false 373 | * * 3p-frame block 374 | * * 3p-script block 375 | * cloudflare.com * noop 376 | www.amazon.com * 3p noop 377 | www.amazon.com * 3p-frame noop 378 | www.amazon.com * 3p-script noop 379 | console.anthropic.com * 3p-frame noop 380 | console.anthropic.com * 3p-script noop 381 | appleid.apple.com * 3p-frame noop 382 | appleid.apple.com * 3p-script noop 383 | app.asana.com * 3p-frame noop 384 | app.asana.com * 3p-script noop 385 | behind-the-scene * * noop 386 | behind-the-scene * 1p-script noop 387 | behind-the-scene * 3p noop 388 | behind-the-scene * 3p-frame noop 389 | behind-the-scene * 3p-script noop 390 | behind-the-scene * image noop 391 | behind-the-scene * inline-script noop 392 | app01.us.bill.com * 3p-frame noop 393 | app01.us.bill.com * 3p-script noop 394 | login.bmwusa.com * 3p-frame noop 395 | login.bmwusa.com * 3p-script noop 396 | www.facebook.com * 3p noop 397 | www.facebook.com * 3p-frame noop 398 | www.facebook.com * 3p-script noop 399 | www.fidium.net * 3p-frame noop 400 | www.fidium.net * 3p-script noop 401 | file-scheme * 3p-frame noop 402 | file-scheme * 3p-script noop 403 | github.com * 3p noop 404 | github.com * 3p-frame noop 405 | github.com * 3p-script noop 406 | accounts.google.com * 3p-frame noop 407 | accounts.google.com * 3p-script noop 408 | docs.google.com * 3p-frame noop 409 | docs.google.com * 3p-script noop 410 | drive.google.com * 3p noop 411 | drive.google.com * 3p-frame noop 412 | drive.google.com * 3p-script noop 413 | notebooklm.google.com * 3p noop 414 | notebooklm.google.com * 3p-frame noop 415 | notebooklm.google.com * 3p-script noop 416 | huggingface.co * 3p-frame noop 417 | huggingface.co * 3p-script noop 418 | kadena.latticehq.com * 3p-frame noop 419 | kadena.latticehq.com * 3p-script noop 420 | www.linkedin.com * 3p noop 421 | www.notion.com * 3p-frame noop 422 | www.notion.com * 3p-script noop 423 | www.notion.so * 3p-frame noop 424 | www.notion.so * 3p-script noop 425 | old.reddit.com * 3p noop 426 | old.reddit.com * 3p-frame noop 427 | old.reddit.com * 3p-script noop 428 | www.reddit.com * 3p noop 429 | www.reddit.com * 3p-frame noop 430 | www.reddit.com * 3p-script noop 431 | respected-meat-54f.notion.site * 3p noop 432 | myprofile.saccounty.gov * 3p-frame noop 433 | myprofile.saccounty.gov * 3p-script noop 434 | myutilities.saccounty.gov * 3p-frame noop 435 | myutilities.saccounty.gov * 3p-script noop 436 | client.schwab.com * 3p-frame noop 437 | client.schwab.com * 3p-script noop 438 | sws-gateway-nr.schwab.com * 3p-frame noop 439 | sws-gateway-nr.schwab.com * 3p-script noop 440 | slack.com * 3p-frame noop 441 | slack.com * 3p-script noop 442 | app.slack.com * 3p noop 443 | app.slack.com * 3p-frame noop 444 | app.slack.com * 3p-script noop 445 | kadena-io.slack.com * 3p-frame noop 446 | kadena-io.slack.com * 3p-script noop 447 | www.tripit.com * 3p noop 448 | www.tripit.com * 3p-frame noop 449 | www.tripit.com * 3p-script noop 450 | www.usaa.com * 3p-frame noop 451 | www.usaa.com * 3p-script noop 452 | secure.verizon.com * 3p-frame noop 453 | secure.verizon.com * 3p-script noop 454 | www.verizon.com * 3p-frame noop 455 | www.verizon.com * 3p-script noop 456 | www.youtube.com * 3p-frame noop 457 | www.youtube.com * 3p-script noop 458 | ''; 459 | urlFilteringString = ""; 460 | hostnameSwitchesString = '' 461 | no-remote-fonts: * true 462 | no-large-media: * true 463 | no-csp-reports: * true 464 | no-remote-fonts: www.ftb.ca.gov false 465 | no-large-media: www.ftb.ca.gov false 466 | no-remote-fonts: app.slack.com false 467 | no-remote-fonts: notebooklm.google.com false 468 | ''; 469 | userFilters = ""; 470 | selectedFilterLists = [ 471 | "user-filters" 472 | "ublock-filters" 473 | "ublock-badware" 474 | "ublock-privacy" 475 | "ublock-quick-fixes" 476 | "ublock-unbreak" 477 | "easylist" 478 | "easyprivacy" 479 | "adguard-spyware" 480 | "adguard-spyware-url" 481 | "urlhaus-1" 482 | "plowe-0" 483 | "fanboy-cookiemonster" 484 | "ublock-cookies-easylist" 485 | "fanboy-social" 486 | "easylist-chat" 487 | "easylist-newsletters" 488 | "easylist-notifications" 489 | "easylist-annoyances" 490 | "ublock-annoyances" 491 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/hoster.txt" 492 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/fake.txt" 493 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/pro.mini.txt" 494 | "https://raw.githubusercontent.com/hagezi/dns-blocklists/main/adblock/spam-tlds-ublock.txt" 495 | ]; 496 | whitelist = [ 497 | "chrome-extension-scheme" 498 | "moz-extension-scheme" 499 | ]; 500 | }; 501 | 502 | "${vimium-c.addonId}".settings = { 503 | keyMappings = [ 504 | "#!no-check" 505 | "map s LinkHints.activateSelect" 506 | "map K previousTab" 507 | "map , previousTab" 508 | "map J nextTab" 509 | "map . nextTab" 510 | "map q LinkHints.activateWithQueue" 511 | ]; 512 | notifyUpdate = false; 513 | searchUrl = "https://kagi.com/search?q=$s Kagi"; 514 | }; 515 | }; 516 | }; 517 | }; 518 | }; 519 | } 520 | -------------------------------------------------------------------------------- /config/hera.nix: -------------------------------------------------------------------------------- 1 | { 2 | hostname = "hera"; 3 | } 4 | -------------------------------------------------------------------------------- /config/key-files.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | 3 | hosts: home: hostname: 4 | let 5 | # Create an entry for each host with public keys of all other hosts 6 | makeKeyEntry = host: 7 | lib.nameValuePair host ( 8 | lib.filter (x: x != null) ( 9 | map (otherHost: 10 | if otherHost != host 11 | then "${home}/${hostname}/id_${otherHost}.pub" 12 | else null 13 | ) hosts 14 | ) 15 | ); 16 | 17 | # Generate the entire structure by mapping over all hosts 18 | keyFilesAttr = builtins.listToAttrs (map makeKeyEntry hosts); 19 | in 20 | # Return the entry for the current hostname 21 | keyFilesAttr.${hostname} 22 | -------------------------------------------------------------------------------- /config/packages.nix: -------------------------------------------------------------------------------- 1 | { hostname, inputs, pkgs, ...}: with pkgs; 2 | 3 | let exe = if stdenv.targetPlatform.isx86_64 4 | then haskell.lib.justStaticExecutables 5 | else lib.id; 6 | 7 | rag-client-pkg = import /Users/johnw/src/rag-client; 8 | rag-client = rag-client-pkg.packages.${pkgs.system}.default; 9 | 10 | in [ 11 | (exe haskellPackages.hasktags) 12 | (exe haskellPackages.hpack) 13 | (exe haskellPackages.ormolu) 14 | (exe haskellPackages.pointfree) 15 | # haskellPackages.git-all 16 | haskellPackages.git-monitor 17 | haskellPackages.hours 18 | haskellPackages.org-jw 19 | haskellPackages.pushme 20 | haskellPackages.renamer 21 | haskellPackages.sizes 22 | haskellPackages.trade-journal 23 | haskellPackages.una 24 | act 25 | apg 26 | aria2 27 | asciidoctor 28 | aspell 29 | aspellDicts.en 30 | awscli2 31 | b3sum 32 | backblaze-b2 33 | bandwhich 34 | bash-completion 35 | bashInteractive 36 | bat 37 | btop 38 | cacert 39 | cargo-cache 40 | cbor-diag 41 | contacts 42 | coreutils 43 | csvkit 44 | ctop 45 | curl 46 | darwin.cctools 47 | diffstat 48 | diffutils 49 | direnv 50 | ditaa 51 | dnsutils 52 | dot2tex 53 | doxygen 54 | emacs29MacPortEnv 55 | emacs30Env 56 | # emacsHEADEnv 57 | emacs-lsp-booster 58 | entr 59 | exiv2 60 | eza 61 | fd 62 | fdupes 63 | ffmpeg 64 | figlet 65 | filetags 66 | findutils 67 | fio 68 | fontconfig 69 | fping 70 | fswatch 71 | fzf 72 | fzf-zsh 73 | gawk 74 | getopt 75 | gitAndTools.delta 76 | gitAndTools.gh 77 | gitAndTools.ghi 78 | gitAndTools.gist 79 | gitAndTools.git-absorb 80 | gitAndTools.git-branchless 81 | gitAndTools.git-branchstack 82 | gitAndTools.git-cliff 83 | gitAndTools.git-crypt 84 | gitAndTools.git-delete-merged-branches 85 | (lowPrio gitAndTools.git-extras) 86 | (lowPrio gitAndTools.git-fame) 87 | gitAndTools.git-gone 88 | gitAndTools.git-hub 89 | gitAndTools.git-imerge 90 | gitAndTools.git-lfs 91 | gitAndTools.git-machete 92 | gitAndTools.git-my 93 | gitAndTools.git-octopus 94 | gitAndTools.git-quick-stats 95 | gitAndTools.git-quickfix 96 | gitAndTools.git-recent 97 | gitAndTools.git-reparent 98 | gitAndTools.git-repo 99 | gitAndTools.git-scripts 100 | gitAndTools.git-secret 101 | gitAndTools.git-series 102 | gitAndTools.git-sizer 103 | (hiPrio gitAndTools.git-standup) 104 | gitAndTools.git-subrepo 105 | gitAndTools.git-vendor 106 | gitAndTools.git-when-merged 107 | gitAndTools.git-workspace 108 | gitAndTools.gitRepo 109 | gitAndTools.gitflow 110 | gitAndTools.gitls 111 | gitAndTools.gitstats 112 | gitAndTools.hub 113 | gitAndTools.tig 114 | gitAndTools.top-git 115 | global 116 | gnugrep 117 | gnumake 118 | gnuplot 119 | gnused 120 | gnutar 121 | go-jira 122 | google-cloud-sdk 123 | graphviz-nox 124 | groff 125 | hammer 126 | hashdb 127 | highlight 128 | pkgs.hostname 129 | html-tidy 130 | htop 131 | httm 132 | httpie 133 | httrack 134 | iftop 135 | imagemagickBig 136 | imapfilter 137 | imgcat 138 | inkscape.out 139 | iperf 140 | isync 141 | jdk 142 | jiq 143 | jo 144 | jq 145 | jqp 146 | jujutsu 147 | jupyter 148 | khard 149 | killall 150 | kubectl 151 | ledger_HEAD 152 | less 153 | lftp 154 | librsvg 155 | libxml2 156 | libxslt 157 | linkdups 158 | lipotell 159 | lnav 160 | loccount 161 | lsof 162 | lzip 163 | lzop 164 | m-cli 165 | m4 166 | macmon 167 | metabase 168 | mitmproxy 169 | mkcert 170 | more 171 | mtr 172 | multitail 173 | my-scripts 174 | nix-diff 175 | nix-index 176 | nix-info 177 | nix-prefetch-git 178 | nix-scripts 179 | nix-tree 180 | nixpkgs-fmt 181 | nixfmt-classic 182 | nmap 183 | nodejs_22 184 | nss 185 | opensc 186 | openssh 187 | openssl 188 | openvpn 189 | org2tc 190 | p7zip 191 | pandoc 192 | paperkey 193 | parallel 194 | pass-git-helper 195 | patch 196 | patchutils 197 | pcre 198 | pdnsd 199 | pdfgrep 200 | (perl.withPackages ( 201 | perl-pkgs: with perl-pkgs; [ 202 | ImageExifTool 203 | ])) 204 | pinentry_mac 205 | plantuml 206 | pngpaste 207 | pnpm 208 | poppler_utils 209 | (postgresql.withPackages ( 210 | postgres-pkgs: with postgres-pkgs; [ 211 | pgvector 212 | ])) 213 | libpq 214 | procps 215 | protobufc 216 | psrecord 217 | pstree 218 | pv 219 | (hiPrio 220 | (python3.withPackages ( 221 | python-pkgs: with python-pkgs; [ 222 | venvShellHook 223 | numpy 224 | requests 225 | stdenv 226 | orgparse 227 | basedpyright 228 | autoflake 229 | pylint 230 | isort # Python code formatter 231 | black # Python code formatter 232 | flake8 # Python code linter 233 | ]))) 234 | pyright # LSP server for Python 235 | qdrant 236 | qemu libvirt 237 | qpdf 238 | qrencode 239 | rag-client 240 | ratpoison 241 | rclone 242 | # recoll-nox 243 | renameutils 244 | restic 245 | ripgrep 246 | rlwrap 247 | rmtrash 248 | rsync 249 | ruby 250 | samba 251 | sanoid 252 | sbcl 253 | scc 254 | sccache 255 | screen 256 | sdcv 257 | shfmt 258 | siege 259 | sift 260 | sipcalc 261 | smartmontools 262 | socat 263 | sourceHighlight 264 | spiped 265 | sqlite 266 | sqlite-analyzer 267 | sqldiff 268 | squashfsTools 269 | srm 270 | sshify 271 | stow 272 | subversion 273 | svg2tikz 274 | taskjuggler 275 | terminal-notifier 276 | time 277 | tlaplus 278 | tmux 279 | translate-shell 280 | travis 281 | tree 282 | tree-sitter 283 | tsvutils 284 | (lowPrio ctags) 285 | universal-ctags 286 | unixtools.ifconfig 287 | unixtools.netstat 288 | unixtools.ping 289 | unixtools.route 290 | unixtools.top 291 | unrar 292 | unzip 293 | uv 294 | w3m 295 | wabt 296 | watch 297 | watchman 298 | wget 299 | wireguard-tools 300 | xapian 301 | xdg-utils 302 | xorg.xauth 303 | xorg.xhost 304 | xquartz 305 | xz 306 | yamale 307 | yq 308 | yuicompressor 309 | z 310 | z3 311 | zbar 312 | zfs-prune-snapshots 313 | zip 314 | zsh 315 | zsh-syntax-highlighting 316 | 317 | litellm 318 | (hiPrio llama-cpp) 319 | llama-swap 320 | koboldcpp 321 | gguf-tools 322 | openmpi 323 | claude-code 324 | github-mcp-server 325 | mcp-server-fetch 326 | mcp-server-filesystem 327 | (hiPrio mcp-server-sequential-thinking) 328 | mcp-server-memory 329 | # mcp-server-qdrant 330 | qdrant 331 | qdrant-web-ui 332 | 333 | (exe gitAndTools.git-annex) 334 | gitAndTools.git-annex-remote-rclone 335 | ] 336 | -------------------------------------------------------------------------------- /config/vulcan.nix: -------------------------------------------------------------------------------- 1 | { 2 | hostname = "vulcan"; 3 | } 4 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "betterfox": { 4 | "inputs": { 5 | "nixpkgs": [ 6 | "nixpkgs" 7 | ] 8 | }, 9 | "locked": { 10 | "lastModified": 1745154287, 11 | "narHash": "sha256-kOYbNDnaP/1rQxeRu7e71yap4+aQFeObr29GFJou/jo=", 12 | "owner": "HeitorAugustoLN", 13 | "repo": "betterfox-nix", 14 | "rev": "f76d3767f46c0d5536b911d3453ef76e186b344a", 15 | "type": "github" 16 | }, 17 | "original": { 18 | "owner": "HeitorAugustoLN", 19 | "repo": "betterfox-nix", 20 | "type": "github" 21 | } 22 | }, 23 | "darwin": { 24 | "inputs": { 25 | "nixpkgs": [ 26 | "nixpkgs" 27 | ] 28 | }, 29 | "locked": { 30 | "lastModified": 1748352827, 31 | "narHash": "sha256-sNUUP6qxGkK9hXgJ+p362dtWLgnIWwOCmiq72LAWtYo=", 32 | "owner": "lnl7", 33 | "repo": "nix-darwin", 34 | "rev": "44a7d0e687a87b73facfe94fba78d323a6686a90", 35 | "type": "github" 36 | }, 37 | "original": { 38 | "owner": "lnl7", 39 | "repo": "nix-darwin", 40 | "type": "github" 41 | } 42 | }, 43 | "flake-parts": { 44 | "inputs": { 45 | "nixpkgs-lib": [ 46 | "nurpkgs", 47 | "nixpkgs" 48 | ] 49 | }, 50 | "locked": { 51 | "lastModified": 1733312601, 52 | "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", 53 | "owner": "hercules-ci", 54 | "repo": "flake-parts", 55 | "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", 56 | "type": "github" 57 | }, 58 | "original": { 59 | "owner": "hercules-ci", 60 | "repo": "flake-parts", 61 | "type": "github" 62 | } 63 | }, 64 | "home-manager": { 65 | "inputs": { 66 | "nixpkgs": [ 67 | "nixpkgs" 68 | ] 69 | }, 70 | "locked": { 71 | "lastModified": 1748830238, 72 | "narHash": "sha256-EB+LzYHK0D5aqxZiYoPeoZoOzSAs8eqBDxm3R+6wMKU=", 73 | "owner": "nix-community", 74 | "repo": "home-manager", 75 | "rev": "c7fdb7e90bff1a51b79c1eed458fb39e6649a82a", 76 | "type": "github" 77 | }, 78 | "original": { 79 | "owner": "nix-community", 80 | "repo": "home-manager", 81 | "type": "github" 82 | } 83 | }, 84 | "mcp-servers-nix": { 85 | "inputs": { 86 | "nixpkgs": [ 87 | "nixpkgs" 88 | ] 89 | }, 90 | "locked": { 91 | "lastModified": 1748828869, 92 | "narHash": "sha256-yWFrZG9UryIf3EW8BoYNqRU61hL5iyqYrEOX0wXWuhk=", 93 | "owner": "natsukium", 94 | "repo": "mcp-servers-nix", 95 | "rev": "e068d6aa5d9972987aa8aed198b7bb763b1af161", 96 | "type": "github" 97 | }, 98 | "original": { 99 | "owner": "natsukium", 100 | "repo": "mcp-servers-nix", 101 | "type": "github" 102 | } 103 | }, 104 | "nixpkgs": { 105 | "locked": { 106 | "lastModified": 1748792178, 107 | "narHash": "sha256-BHmgfHlCJVNisJShVaEmfDIr/Ip58i/4oFGlD1iK6lk=", 108 | "owner": "NixOS", 109 | "repo": "nixpkgs", 110 | "rev": "5929de975bcf4c7c8d8b5ca65c8cd9ef9e44523e", 111 | "type": "github" 112 | }, 113 | "original": { 114 | "owner": "NixOS", 115 | "ref": "nixpkgs-unstable", 116 | "repo": "nixpkgs", 117 | "type": "github" 118 | } 119 | }, 120 | "nurpkgs": { 121 | "inputs": { 122 | "flake-parts": "flake-parts", 123 | "nixpkgs": [ 124 | "nixpkgs" 125 | ], 126 | "treefmt-nix": "treefmt-nix" 127 | }, 128 | "locked": { 129 | "lastModified": 1748896983, 130 | "narHash": "sha256-dNmvYMJEYnsSrOk1fnx6za29vfN/gOONQ3+8gJVF2Eo=", 131 | "owner": "nix-community", 132 | "repo": "NUR", 133 | "rev": "4ed8a3213ef31a7ed7cd98d51ed36147a63c1fb3", 134 | "type": "github" 135 | }, 136 | "original": { 137 | "owner": "nix-community", 138 | "repo": "NUR", 139 | "type": "github" 140 | } 141 | }, 142 | "root": { 143 | "inputs": { 144 | "betterfox": "betterfox", 145 | "darwin": "darwin", 146 | "home-manager": "home-manager", 147 | "mcp-servers-nix": "mcp-servers-nix", 148 | "nixpkgs": "nixpkgs", 149 | "nurpkgs": "nurpkgs", 150 | "rycee-nurpkgs": "rycee-nurpkgs" 151 | } 152 | }, 153 | "rycee-nurpkgs": { 154 | "inputs": { 155 | "nixpkgs": [ 156 | "nixpkgs" 157 | ] 158 | }, 159 | "locked": { 160 | "dir": "pkgs/firefox-addons", 161 | "lastModified": 1748837002, 162 | "narHash": "sha256-K6//1B2kN+gZ2kOIRLqvY6LuOWHjiV7+7eFS4JNXR/g=", 163 | "owner": "rycee", 164 | "repo": "nur-expressions", 165 | "rev": "0a907047c5b56503dd2e889dbbb694c61b8daf25", 166 | "type": "gitlab" 167 | }, 168 | "original": { 169 | "dir": "pkgs/firefox-addons", 170 | "owner": "rycee", 171 | "repo": "nur-expressions", 172 | "type": "gitlab" 173 | } 174 | }, 175 | "treefmt-nix": { 176 | "inputs": { 177 | "nixpkgs": [ 178 | "nurpkgs", 179 | "nixpkgs" 180 | ] 181 | }, 182 | "locked": { 183 | "lastModified": 1733222881, 184 | "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", 185 | "owner": "numtide", 186 | "repo": "treefmt-nix", 187 | "rev": "49717b5af6f80172275d47a418c9719a31a78b53", 188 | "type": "github" 189 | }, 190 | "original": { 191 | "owner": "numtide", 192 | "repo": "treefmt-nix", 193 | "type": "github" 194 | } 195 | } 196 | }, 197 | "root": "root", 198 | "version": 7 199 | } 200 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Darwin configuration"; 3 | 4 | inputs = { 5 | # nixpkgs.url = "git+file:///Users/johnw/Products/nixpkgs"; 6 | nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 7 | 8 | darwin = { 9 | url = "github:lnl7/nix-darwin"; 10 | inputs.nixpkgs.follows = "nixpkgs"; 11 | }; 12 | home-manager = { 13 | url = "github:nix-community/home-manager"; 14 | inputs.nixpkgs.follows = "nixpkgs"; 15 | }; 16 | rycee-nurpkgs = { 17 | url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; 18 | inputs.nixpkgs.follows = "nixpkgs"; 19 | }; 20 | nurpkgs = { 21 | url = "github:nix-community/NUR"; 22 | inputs.nixpkgs.follows = "nixpkgs"; 23 | }; 24 | betterfox = { 25 | url = "github:HeitorAugustoLN/betterfox-nix"; 26 | inputs.nixpkgs.follows = "nixpkgs"; 27 | }; 28 | mcp-servers-nix = { 29 | url = "github:natsukium/mcp-servers-nix"; 30 | inputs.nixpkgs.follows = "nixpkgs"; 31 | }; 32 | # emacs30-overlay = { 33 | # # url = "github:what-the-functor/nix-emacs30-macport-overlay"; 34 | # url = "git+file:///Users/johnw/src/nix/nix-emacs30-overlay"; 35 | # inputs.nixpkgs.follows = "nixpkgs"; 36 | # }; 37 | }; 38 | 39 | outputs = inputs: with inputs; rec { 40 | darwinConfigurations = 41 | let 42 | overlays = with inputs; [ 43 | (final: prev: 44 | let 45 | pkgs = (import nixpkgs { system = prev.system; }).extend ( 46 | _final: prev: { 47 | ld64 = prev.ld64.overrideAttrs (o: { 48 | patches = o.patches ++ [./overlays/Dedupe-RPATH-entries.patch]; 49 | }); 50 | libarchive = prev.libarchive.overrideAttrs (_old: { 51 | doCheck = false; 52 | }); 53 | } 54 | ); in { 55 | emacs30 = pkgs.emacs30; 56 | }) 57 | nurpkgs.overlays.default 58 | mcp-servers-nix.overlays.default 59 | # emacs30-overlay.overlays.default 60 | ]; 61 | configure = hostname: system: darwin.lib.darwinSystem { 62 | inherit inputs system; 63 | specialArgs = { 64 | inherit darwin system hostname inputs overlays; 65 | }; 66 | modules = [ 67 | ./config/darwin.nix 68 | home-manager.darwinModules.home-manager 69 | { 70 | home-manager = { 71 | useGlobalPkgs = true; 72 | useUserPackages = true; 73 | sharedModules = [ 74 | inputs.betterfox.homeManagerModules.betterfox 75 | ]; 76 | users.johnw = import ./config/home.nix; 77 | 78 | backupFileExtension = "hm-bak"; 79 | extraSpecialArgs = { inherit hostname inputs; }; 80 | }; 81 | } 82 | ]; 83 | }; 84 | in { 85 | hera = configure "hera" "aarch64-darwin"; 86 | clio = configure "clio" "aarch64-darwin"; 87 | athena = configure "athena" "aarch64-darwin"; 88 | }; 89 | 90 | darwinPackages = darwinConfigurations."hera".pkgs; 91 | }; 92 | } 93 | -------------------------------------------------------------------------------- /overlays/00-last-known-good.nix: -------------------------------------------------------------------------------- 1 | self: pkgs: 2 | 3 | let nixpkgs = args@{ rev, sha256 }: 4 | import (pkgs.fetchFromGitHub (args // { 5 | owner = "NixOS"; 6 | repo = "nixpkgs"; })) {}; 7 | in { 8 | inherit (nixpkgs { 9 | rev = "d9a676dbb008c2b98133e6ee81b6f92264f0a06e"; 10 | sha256 = "sha256-jLGUC9mf9OE4uM+Hnelbw6u+xFNb1TWR+j/IeOwsikg="; 11 | }) 12 | siege 13 | ; 14 | 15 | inherit (nixpkgs { 16 | rev = "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160"; 17 | sha256 = "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y="; 18 | }) 19 | texinfo4 20 | ; 21 | 22 | inherit (nixpkgs { 23 | rev = "4bc9c909d9ac828a039f288cf872d16d38185db8"; 24 | sha256 = "sha256-nIYdTAiKIGnFNugbomgBJR+Xv5F1ZQU+HfaBqJKroC0="; 25 | }) 26 | asymptote 27 | ; 28 | 29 | inherit (nixpkgs { 30 | rev = "9a5db3142ce450045840cc8d832b13b8a2018e0c"; 31 | sha256 = "sha256-pUvLijVGARw4u793APze3j6mU1Zwdtz7hGkGGkD87qw="; 32 | }) 33 | xquartz 34 | backblaze-b2 35 | ; 36 | } 37 | -------------------------------------------------------------------------------- /overlays/00-nix-scripts.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | nix-scripts = with self; stdenv.mkDerivation { 4 | name = "nix-scripts"; 5 | 6 | src = ../bin; 7 | 8 | buildInputs = []; 9 | 10 | installPhase = '' 11 | mkdir -p $out/bin 12 | find . -maxdepth 1 \( -type f -o -type l \) -executable \ 13 | -exec cp -pL {} $out/bin \; 14 | ''; 15 | 16 | meta = with super.lib; { 17 | description = "John Wiegley's various scripts"; 18 | homepage = https://github.com/jwiegley; 19 | license = licenses.mit; 20 | maintainers = with maintainers; [ jwiegley ]; 21 | platforms = platforms.darwin; 22 | }; 23 | }; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /overlays/10-coq.nix: -------------------------------------------------------------------------------- 1 | self: pkgs: 2 | 3 | { 4 | 5 | coqPackages = self.coqPackages_8_19; 6 | 7 | # coqPackages_HEAD = self.mkCoqPackages self.coq_HEAD; 8 | coqPackages_8_19 = self.mkCoqPackages self.coq_8_19; 9 | coqPackages_8_18 = self.mkCoqPackages self.coq_8_18; 10 | coqPackages_8_17 = self.mkCoqPackages self.coq_8_17; 11 | coqPackages_8_16 = self.mkCoqPackages self.coq_8_16; 12 | coqPackages_8_15 = self.mkCoqPackages self.coq_8_15; 13 | coqPackages_8_14 = self.mkCoqPackages self.coq_8_14; 14 | coqPackages_8_13 = self.mkCoqPackages self.coq_8_13; 15 | coqPackages_8_12 = self.mkCoqPackages self.coq_8_12; 16 | coqPackages_8_11 = self.mkCoqPackages self.coq_8_11; 17 | coqPackages_8_10 = self.mkCoqPackages self.coq_8_10; 18 | 19 | coq = self.coq_8_19; 20 | 21 | # coq_HEAD = (self.coq_8_19.override { 22 | # buildIde = false; 23 | # version = /Users/johnw/src/coq; 24 | # }).overrideAttrs (attrs: { 25 | # buildInputs = attrs.buildInputs 26 | # ++ (with pkgs; [ 27 | # texlive.combined.scheme-full which hevea fig2dev imagemagick_light git 28 | # ]); 29 | # }); 30 | 31 | coq_8_19 = pkgs.coq_8_19.override { buildIde = false; }; 32 | coq_8_18 = pkgs.coq_8_18.override { buildIde = false; }; 33 | coq_8_17 = pkgs.coq_8_17.override { buildIde = false; }; 34 | coq_8_16 = pkgs.coq_8_16.override { buildIde = false; }; 35 | coq_8_15 = pkgs.coq_8_15.override { buildIde = false; }; 36 | coq_8_14 = pkgs.coq_8_14.override { buildIde = false; }; 37 | coq_8_13 = pkgs.coq_8_13.override { buildIde = false; }; 38 | coq_8_12 = pkgs.coq_8_12.override { buildIde = false; }; 39 | coq_8_11 = pkgs.coq_8_11.override { buildIde = false; }; 40 | coq_8_10 = pkgs.coq_8_10.override { buildIde = false; }; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /overlays/10-haskell.nix: -------------------------------------------------------------------------------- 1 | self: pkgs: 2 | 3 | let 4 | srcs = [ 5 | # "async-pool" 6 | # "bindings-DSL" 7 | # "c2hsc" 8 | # "git-all" 9 | "gitlib/gitlib" 10 | "gitlib/gitlib-test" 11 | [ "gitlib/gitlib-cmdline" { inherit (self.gitAndTools) git; } ] 12 | [ "gitlib/hlibgit2" { inherit (self.gitAndTools) git; } ] 13 | "gitlib/gitlib-libgit2" 14 | "gitlib/git-monitor" 15 | "hours" 16 | # "hnix" 17 | # "logging" 18 | # "monad-extras" 19 | "org-jw/org-jw" 20 | "org-jw/org-types" 21 | "org-jw/flatparse-util" 22 | "org-jw/org-cbor" 23 | "org-jw/org-json" 24 | "org-jw/org-data" 25 | "org-jw/org-lint" 26 | "org-jw/org-parse" 27 | "org-jw/org-print" 28 | "org-jw/org-filetags" 29 | "org-jw/org-site" 30 | # "parsec-free" 31 | # "pipes-async" 32 | # "pipes-files" 33 | "pushme" 34 | # "recursors" 35 | "renamer" 36 | # "runmany" 37 | # "simple-amount" 38 | "sizes" 39 | "trade-journal" 40 | "una" 41 | ]; 42 | 43 | packageDrv = ghc: 44 | callPackage (usingWithHoogle self.haskell.packages.${ghc}) ghc; 45 | 46 | otherHackagePackages = ghc: hself: hsuper: with pkgs.haskell.lib; { 47 | pushme = unmarkBroken (doJailbreak hsuper.pushme); 48 | 49 | hakyll = hself.callCabal2nix "hakyll" (pkgs.fetchFromGitHub { 50 | owner = "jwiegley"; 51 | repo = "hakyll"; 52 | rev = "1784bb74b0bfcaa0899c522f34f2063b92728bd8"; 53 | sha256 = "sha256-hNr59HQ5hwKctVTfBfgZZMPXJTohsFgAmLKjxuiHqHs="; 54 | }) {}; 55 | 56 | time-recurrence = unmarkBroken (doJailbreak 57 | (hself.callCabal2nix "time-recurrence" (pkgs.fetchFromGitHub { 58 | owner = "jwiegley"; 59 | repo = "time-recurrence"; 60 | rev = "d1771331ffd495035cb7f1b2dd14cdf86b11d2fa"; 61 | sha256 = "1l9vf5mzq2r22gph45jk1a4cl8i53ayinlwq1m8dbx3lpnzsjc09"; 62 | # date = 2021-03-21T14:27:27-07:00; 63 | }) {})); 64 | }; 65 | 66 | callPackage = hpkgs: ghc: path: args: 67 | filtered ( 68 | if builtins.pathExists (path + "/flake.nix") 69 | then (import (path + "/default.nix")).default 70 | else 71 | if builtins.pathExists (path + "/default.nix") 72 | then hpkgs.callPackage path 73 | ({ pkgs = self; 74 | compiler = ghc; 75 | returnShellEnv = false; } // args) 76 | else hpkgs.callCabal2nix (builtins.baseNameOf path) path args); 77 | 78 | myHaskellPackages = ghc: hself: hsuper: 79 | let fromSrc = arg: 80 | let 81 | path = if builtins.isList arg then builtins.elemAt arg 0 else arg; 82 | args = if builtins.isList arg then builtins.elemAt arg 1 else {}; 83 | in { 84 | name = builtins.baseNameOf path; 85 | value = callPackage hself ghc (/Users/johnw/src + "/${path}") args; 86 | }; 87 | in builtins.listToAttrs (builtins.map fromSrc srcs); 88 | 89 | usingWithHoogle = hpkgs: hpkgs // rec { 90 | ghc = hpkgs.ghc // { withPackages = hpkgs.ghc.withHoogle; }; 91 | ghcWithPackages = hpkgs.ghcWithHoogle; 92 | }; 93 | 94 | overrideHask = ghc: hpkgs: hoverrides: hpkgs.override { 95 | overrides = 96 | pkgs.lib.composeExtensions hoverrides 97 | (pkgs.lib.composeExtensions (otherHackagePackages ghc) 98 | (pkgs.lib.composeExtensions (myHaskellPackages ghc) 99 | (hself: hsuper: { 100 | developPackage = 101 | { root 102 | , name ? builtins.baseNameOf root 103 | , source-overrides ? {} 104 | , overrides ? self: super: {} 105 | , modifier ? drv: drv 106 | , returnShellEnv ? pkgs.lib.inNixShell }: 107 | let 108 | hpkgs = 109 | (pkgs.lib.composeExtensions 110 | (_: _: hself) 111 | (pkgs.lib.composeExtensions 112 | (hself.packageSourceOverrides source-overrides) 113 | overrides)) {} hsuper; 114 | drv = 115 | hpkgs.callCabal2nix name root {}; 116 | in if returnShellEnv 117 | then (modifier drv).env 118 | else modifier drv; 119 | }))); 120 | }; 121 | 122 | breakout = hsuper: names: 123 | builtins.listToAttrs 124 | (builtins.map 125 | (x: { name = x; 126 | value = pkgs.haskell.lib.doJailbreak hsuper.${x}; }) 127 | names); 128 | 129 | filtered = drv: 130 | drv.overrideAttrs 131 | (attrs: { src = self.haskellFilterSource [] attrs.src; }); 132 | 133 | in { 134 | 135 | haskellFilterSource = paths: src: pkgs.lib.cleanSourceWith { 136 | inherit src; 137 | filter = path: type: 138 | let baseName = baseNameOf path; in 139 | !( type == "directory" 140 | && builtins.elem baseName ([".git" ".cabal-sandbox" "dist"] ++ paths)) 141 | && 142 | !( type == "unknown" 143 | || baseName == "cabal.sandbox.config" 144 | || baseName == "result" 145 | || pkgs.lib.hasSuffix ".hdevtools.sock" path 146 | || pkgs.lib.hasSuffix ".sock" path 147 | || pkgs.lib.hasSuffix ".hi" path 148 | || pkgs.lib.hasSuffix ".hi-boot" path 149 | || pkgs.lib.hasSuffix ".o" path 150 | || pkgs.lib.hasSuffix ".dyn_o" path 151 | || pkgs.lib.hasSuffix ".dyn_p" path 152 | || pkgs.lib.hasSuffix ".o-boot" path 153 | || pkgs.lib.hasSuffix ".p_o" path); 154 | }; 155 | 156 | haskell = pkgs.haskell // { 157 | packages = pkgs.haskell.packages // rec { 158 | ghc94 = overrideHask "ghc94" pkgs.haskell.packages.ghc94 (_hself: _hsuper: {}); 159 | ghc96 = overrideHask "ghc96" pkgs.haskell.packages.ghc96 (_hself: hsuper: 160 | with pkgs.haskell.lib; { 161 | system-fileio = unmarkBroken hsuper.system-fileio; 162 | }); 163 | ghc98 = overrideHask "ghc98" pkgs.haskell.packages.ghc98 (_hself: _hsuper: {}); 164 | ghc910 = overrideHask "ghc910" pkgs.haskell.packages.ghc910 (_hself: _hsuper: {}); 165 | ghc912 = overrideHask "ghc912" pkgs.haskell.packages.ghc912 (_hself: _hsuper: {}); 166 | }; 167 | }; 168 | 169 | haskellPackages_9_4 = self.haskell.packages.ghc94; 170 | haskellPackages_9_6 = self.haskell.packages.ghc96; 171 | haskellPackages_9_8 = self.haskell.packages.ghc98; 172 | haskellPackages_9_10 = self.haskell.packages.ghc910; 173 | haskellPackages_9_12 = self.haskell.packages.ghc912; 174 | 175 | ghcDefaultVersion = "ghc98"; 176 | haskellPackages = self.haskell.packages.${self.ghcDefaultVersion}; 177 | 178 | } 179 | -------------------------------------------------------------------------------- /overlays/20-ai.nix: -------------------------------------------------------------------------------- 1 | self: super: 2 | 3 | let 4 | llm-mlx = { 5 | lib, 6 | callPackage, 7 | buildPythonPackage, 8 | fetchFromGitHub, 9 | setuptools, 10 | llm, 11 | mlx, 12 | pytestCheckHook, 13 | pytest-asyncio, 14 | pytest-recording, 15 | writableTmpDirAsHomeHook, 16 | }: 17 | buildPythonPackage rec { 18 | pname = "llm-mlx"; 19 | version = "0.4"; 20 | pyproject = true; 21 | 22 | src = fetchFromGitHub { 23 | owner = "simonw"; 24 | repo = "llm-mlx"; 25 | tag = version; 26 | hash = "sha256-9SGbvhuNeKgMYGa0ZiOLm+H/JbNpvFWBcUL4De5xO4o="; 27 | }; 28 | 29 | build-system = [ 30 | setuptools 31 | llm 32 | ]; 33 | dependencies = [ mlx ]; 34 | 35 | nativeCheckInputs = [ 36 | pytestCheckHook 37 | pytest-asyncio 38 | pytest-recording 39 | writableTmpDirAsHomeHook 40 | ]; 41 | 42 | pythonImportsCheck = [ "llm_mlx" ]; 43 | 44 | passthru.tests = { 45 | llm-plugin = callPackage ./tests/llm-plugin.nix { }; 46 | }; 47 | 48 | meta = { 49 | description = "LLM access to models using MLX"; 50 | homepage = "https://github.com/simonw/llm-mlx"; 51 | changelog = "https://github.com/simonw/llm-mlx/releases/tag/${version}/CHANGELOG.md"; 52 | license = lib.licenses.asl20; 53 | maintainers = with lib.maintainers; [ jwiegley ]; 54 | }; 55 | }; 56 | in 57 | { 58 | 59 | gguf-tools = with super; stdenv.mkDerivation rec { 60 | name = "gguf-tools-${version}"; 61 | version = "8fa6eb65"; 62 | 63 | src = fetchFromGitHub { 64 | owner = "antirez"; 65 | repo = "gguf-tools"; 66 | rev = "8fa6eb65236618e28fd7710a0fba565f7faa1848"; 67 | sha256 = "084xwlqa6qq8ns2fzxvmgxhacgv7wy1l4mppwsmk7ac5yg46z4fp"; 68 | # date = 2025-01-09T16:46:11+01:00; 69 | }; 70 | 71 | installPhase = '' 72 | mkdir -p $out/bin 73 | cp -p gguf-tools $out/bin 74 | ''; 75 | 76 | meta = { 77 | homepage = https://github.com/antirez/gguf-tools; 78 | description = "This is a work in progress library to manipulate GGUF files"; 79 | license = lib.licenses.mit; 80 | maintainers = with lib.maintainers; [ jwiegley ]; 81 | }; 82 | }; 83 | 84 | hfdownloader = with super; buildGoModule rec { 85 | pname = "hfdownloader"; 86 | version = "1.4.2"; 87 | vendorHash = "sha256-0tAJEPJQJTUYoV0IU2YYmSV60189rDRdwoxQsewkMEU="; 88 | 89 | src = fetchFromGitHub { 90 | owner = "bodaay"; 91 | repo = "HuggingFaceModelDownloader"; 92 | rev = "${version}"; 93 | hash = "sha256-sec+NGh1I5YmQif+ifm+AJmG6TVKOW/enffh8UE0I+E="; 94 | }; 95 | 96 | meta = with lib; { 97 | description = "The HuggingFace Model Downloader is a utility tool for downloading models and datasets from the HuggingFace website"; 98 | homepage = "https://github.com/bodaay/HuggingFaceModelDownloader"; 99 | license = licenses.asl20; 100 | maintainers = [ maintainers.jwiegley ]; 101 | }; 102 | }; 103 | 104 | koboldcpp = super.koboldcpp.overrideAttrs(attrs: rec { 105 | version = "1.91"; 106 | 107 | src = super.fetchFromGitHub { 108 | owner = "LostRuins"; 109 | repo = "koboldcpp"; 110 | tag = "v${version}"; 111 | hash = "sha256-s2AfdKF4kUez3F1P+FYMbP2KD+J6+der/datxrdTiZU="; 112 | }; 113 | }); 114 | 115 | llama-cpp = super.llama-cpp.overrideAttrs(attrs: rec { 116 | version = "5572"; 117 | 118 | src = super.fetchFromGitHub { 119 | owner = "ggml-org"; 120 | repo = "llama.cpp"; 121 | tag = "b${version}"; 122 | hash = "sha256-IJ6bB49Gc9Xj+2VDTbfVSjHe+lR74A6G6LkOEtz/Ud0="; 123 | }; 124 | }); 125 | 126 | llama-swap = with super; buildGoModule rec { 127 | pname = "llama-swap"; 128 | version = "123"; 129 | vendorHash = "sha256-5mmciFAGe8ZEIQvXejhYN+ocJL3wOVwevIieDuokhGU=" 130 | ; 131 | src = fetchFromGitHub { 132 | owner = "mostlygeek"; 133 | repo = "llama-swap"; 134 | rev = "v${version}"; 135 | hash = "sha256-Xh8TDngSEpYHZMWJAcxz6mrOsFRtnmQYYiAZeA3i6yA="; 136 | }; 137 | 138 | doCheck = false; 139 | 140 | meta = with lib; { 141 | description = "llama-swap is a light weight, transparent proxy server that provides automatic model swapping to llama.cpp's server"; 142 | homepage = "https://github.com/mostlygeek/llama-swap"; 143 | license = licenses.mit; 144 | maintainers = [ maintainers.jwiegley ]; 145 | }; 146 | }; 147 | 148 | mlx-lm = with self; with self.python3Packages; buildPythonApplication rec { 149 | pname = "mlx-lm"; 150 | version = "0.24.1"; 151 | pyproject = true; 152 | 153 | src = fetchFromGitHub { 154 | owner = "mlx-explore"; 155 | repo = "mlx-lm"; 156 | tag = version; 157 | hash = "sha256-8SGbvhuNeKgMYGa0ZiOLm+H/JbNpvFWBcUL4De5xO4o="; 158 | }; 159 | 160 | build-system = [ 161 | setuptools 162 | llm 163 | ]; 164 | dependencies = [ mlx ]; 165 | 166 | nativeCheckInputs = [ 167 | pytestCheckHook 168 | pytest-asyncio 169 | pytest-recording 170 | writableTmpDirAsHomeHook 171 | ]; 172 | 173 | meta = { 174 | description = "LLM access to models using MLX"; 175 | homepage = "https://github.com/mlx-explore/mlx-lm"; 176 | license = lib.licenses.mit; 177 | maintainers = with lib.maintainers; [ jwiegley ]; 178 | }; 179 | }; 180 | 181 | pythonPackagesExtensions = (super.pythonPackagesExtensions or []) ++ [ 182 | (pfinal: pprev: 183 | let 184 | nanobind = pprev.nanobind.overridePythonAttrs (oldAttrs: rec { 185 | version = "2.4.0"; 186 | src = super.fetchFromGitHub { 187 | owner = "wjakob"; 188 | repo = "nanobind"; 189 | rev = "v${version}"; 190 | fetchSubmodules = true; 191 | hash = "sha256-9OpDsjFEeJGtbti4Q9HHl78XaGf8M3lG4ukvHCMzyMU="; 192 | }; 193 | }); 194 | in { 195 | mlx = pprev.mlx.overridePythonAttrs (oldAttrs: rec { 196 | # version = "0.25.2"; 197 | # src = super.fetchFromGitHub { 198 | # owner = "ml-explore"; 199 | # repo = "mlx"; 200 | # rev = "refs/tags/v${version}"; 201 | # hash = "sha256-fkf/kKATr384WduFG/X81c5InEAZq5u5+hwrAJIg7MI="; 202 | # }; 203 | patches = []; 204 | env = { 205 | PYPI_RELEASE = oldAttrs.version; 206 | CMAKE_ARGS = with self; toString [ 207 | # (lib.cmakeBool "MLX_BUILD_METAL" true) 208 | (lib.cmakeOptionType "filepath" "FETCHCONTENT_SOURCE_DIR_GGUFLIB" "${gguf-tools}") 209 | (lib.cmakeOptionType "filepath" "FETCHCONTENT_SOURCE_DIR_JSON" "${nlohmann_json}") 210 | ]; 211 | }; 212 | # buildInputs = (oldAttrs.buildInputs or []) ++ [ 213 | # self.darwin.apple_sdk_14_4 214 | # ]; 215 | # nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [ 216 | # nanobind 217 | # ]; 218 | }); 219 | 220 | llm-mlx = pfinal.callPackage llm-mlx {}; 221 | }) 222 | ]; 223 | 224 | } 225 | -------------------------------------------------------------------------------- /overlays/20-dirscan.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | dirscan = with super; python3Packages.buildPythonPackage rec { 4 | pname = "dirscan"; 5 | version = "2.0"; 6 | format = "source"; 7 | 8 | src = /Users/johnw/src/dirscan; 9 | 10 | phases = [ "unpackPhase" "installPhase" ]; 11 | 12 | installPhase = '' 13 | mkdir -p $out/bin $out/libexec 14 | cp dirscan.py $out/libexec 15 | python -mpy_compile $out/libexec/dirscan.py 16 | cp cleanup $out/bin 17 | ''; 18 | 19 | meta = { 20 | homepage = https://github.com/jwiegley/dirscan; 21 | description = "Stateful directory scanning in Python"; 22 | license = lib.licenses.mit; 23 | maintainers = with lib.maintainers; [ jwiegley ]; 24 | }; 25 | }; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /overlays/20-filetags.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | filetags = with super; with python3Packages; buildPythonPackage rec { 4 | pname = "filetags"; 5 | version = "20240113"; 6 | name = "${pname}-${version}"; 7 | pyproject = false; 8 | 9 | src = fetchFromGitHub { 10 | owner = "novoid"; 11 | repo = "filetags"; 12 | rev = "a7f4d58998e02f53578c9d2dec73f30b5880fc1a"; 13 | sha256 = "1n97aa12sdjvqav5h7bz72kw0hfx8qmhhqxb80yki1vfavin62bk"; 14 | # date = "2024-01-13T18:29:31+01:00"; 15 | }; 16 | 17 | propagatedBuildInputs = [ 18 | colorama clint 19 | ]; 20 | 21 | installPhase = '' 22 | mkdir -p $out/bin 23 | cp -p filetags/__init__.py $out/bin/filetags 24 | chmod +x $out/bin/filetags 25 | ''; 26 | 27 | meta = { 28 | homepage = https://github.com/novoid/filetags; 29 | description = "Management of simple tags within file names."; 30 | license = lib.licenses.gpl3; 31 | maintainers = with lib.maintainers; [ jwiegley ]; 32 | }; 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /overlays/20-ghi.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | pygments.rb = with super; buildRubyGem rec { 4 | inherit ruby; 5 | name = "${gemName}-${version}"; 6 | gemName = "pygments.rb"; 7 | version = "2.3.0"; 8 | source.sha256 = "sha256-TEHIuu4QaA2Aiy/amyNv5rJ5nNTOXBXim5Ns9L+X9RA="; 9 | buildInputs = [ bundler ]; 10 | }; 11 | 12 | multi_json = with super; buildRubyGem rec { 13 | inherit ruby; 14 | name = "${gemName}-${version}"; 15 | gemName = "multi_json"; 16 | version = "1.15.0"; 17 | source.sha256 = "sha256-H9BBOLbkqQAX6NG4BMA5AxOZhm/z+6u3girqNnx4YV0="; 18 | buildInputs = [ bundler ]; 19 | }; 20 | 21 | ghi = with super; buildRubyGem rec { 22 | inherit ruby; 23 | name = "${gemName}-${version}"; 24 | gemName = "ghi"; 25 | version = "1.2.1"; 26 | src = fetchFromGitHub { 27 | owner = "drazisil"; 28 | repo = "ghi"; 29 | rev = "886479e122f1175f8587c1eb86d19e1aa571c76e"; 30 | sha256 = "1s0bwk2rcb6rbck0xgbsyi7m6cw8qbjigclrcd79pmv3zczpq2n2"; 31 | # date = "2022-03-20T20:37:28-04:00"; 32 | }; 33 | buildInputs = [ bundler self.pygments.rb self.multi_json ]; 34 | }; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /overlays/20-git-annex.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | # gitAndTools = super.gitAndTools // { 4 | # # This currently fails three tests, all of which output the following: 5 | # # gpg: can't connect to the agent: IPC connect call failed 6 | # # gpg: error getting the KEK: No agent running 7 | # # gpg: error reading '[stdin]': No agent running 8 | # # gpg: import from '[stdin]' failed: No agent running 9 | # git-annex = super.haskell.lib.dontCheck super.gitAndTools.git-annex; 10 | # }; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /overlays/20-git-lfs.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | git-lfs = with super; stdenv.mkDerivation rec { 4 | name = "git-lfs-${version}"; 5 | version = "2.13.2"; 6 | 7 | src = fetchurl { 8 | url = "https://github.com/git-lfs/git-lfs/releases/download/v${version}/git-lfs-darwin-amd64-v${version}.zip"; 9 | sha256 = "1jsng8v9xhd9q2sg0h7iy0x7g3hsg99ffsrs0671x0mfvx15vfn2"; 10 | # date = 2020-05-16T00:38:51-0800; 11 | }; 12 | 13 | phases = [ "unpackPhase" "installPhase" ]; 14 | 15 | buildInputs = [ unzip ]; 16 | 17 | unpackPhase = '' 18 | unzip ${src} 19 | ''; 20 | 21 | installPhase = '' 22 | mkdir -p $out/bin 23 | cp -p git-lfs $out/bin 24 | ''; 25 | 26 | meta = with super.lib; { 27 | description = "An open source Git extension for versioning large files"; 28 | homepage = https://git-lfs.github.com/; 29 | license = licenses.mit; 30 | maintainers = with maintainers; [ jwiegley ]; 31 | platforms = platforms.unix; 32 | }; 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /overlays/20-git-scripts.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | git-scripts = with self; stdenv.mkDerivation { 4 | name = "git-scripts"; 5 | 6 | src = builtins.filterSource (path: type: 7 | type != "directory" || baseNameOf path != ".git") 8 | /Users/johnw/src/git-scripts; 9 | 10 | buildInputs = []; 11 | 12 | installPhase = '' 13 | mkdir -p $out/bin 14 | find . -maxdepth 1 \( -type f -o -type l \) -executable \ 15 | -exec cp -pL {} $out/bin \; 16 | ''; 17 | 18 | meta = with super.lib; { 19 | description = "John Wiegley's various scripts"; 20 | homepage = https://github.com/jwiegley; 21 | license = licenses.mit; 22 | maintainers = with maintainers; [ jwiegley ]; 23 | platforms = platforms.darwin; 24 | }; 25 | }; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /overlays/20-hammer.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | hammer = with super; stdenv.mkDerivation rec { 4 | name = "hammer-${version}"; 5 | version = "1.3"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "jwiegley"; 9 | repo = "hammer"; 10 | rev = "80d3b1270f9912a2f5df7d6078f50aa4d0ed12e4"; 11 | sha256 = "16njr6w6gql5n35cwxdw4mq9g4gjlcc8ca73zkmym3pb0nwvkij7"; 12 | # date = 2011-09-10T19:08:08-05:00; 13 | }; 14 | 15 | phases = [ "unpackPhase" "installPhase" ]; 16 | 17 | installPhase = '' 18 | mkdir -p $out/bin 19 | cp -p hammer $out/bin 20 | ''; 21 | 22 | meta = { 23 | homepage = https://github.com/jwiegley/hammer; 24 | description = "A tool for fixing broken symlinks"; 25 | license = lib.licenses.mit; 26 | maintainers = with lib.maintainers; [ jwiegley ]; 27 | }; 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /overlays/20-hashdb.nix: -------------------------------------------------------------------------------- 1 | _: super: { 2 | 3 | hashdb = with super; stdenv.mkDerivation rec { 4 | name = "hashdb-${version}"; 5 | version = "1.0"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "jwiegley"; 9 | repo = "hashdb"; 10 | rev = "86c8675d4116c03e81a7468cc66c4c987f1d203e"; 11 | sha256 = "0vp70rcsmff9sgrjg5fn1cbxcvr0qvcfjwnxclbnc0rj5ymixkdf"; 12 | # date = 2011-10-04T03:27:40-05:00; 13 | }; 14 | 15 | phases = [ "unpackPhase" "installPhase" ]; 16 | 17 | installPhase = '' 18 | mkdir -p $out/bin 19 | cp -p hashdb $out/bin 20 | ''; 21 | 22 | meta = { 23 | homepage = https://github.com/jwiegley/hashdb; 24 | description = "A simply key/value store for keeping hashes"; 25 | license = lib.licenses.mit; 26 | maintainers = with lib.maintainers; [ jwiegley ]; 27 | }; 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /overlays/20-hyperorg.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | hyperorg = with super; with python3Packages; buildPythonPackage rec { 4 | pname = "hyperorg"; 5 | version = "a814c4bf5e"; 6 | pyproject = true; 7 | 8 | src = fetchgit { 9 | url = "https://codeberg.org/buhtz/hyperorg.git"; 10 | rev = "a814c4bf5e95bd522fabe66d7baed9d71a7090e9"; 11 | sha256 = "1zw9ha79g8qb2gg83hkpigaarsfvkz948mrjksfgbh5im4n7qykp"; 12 | # date = 2024-08-25T21:16:09+02:00; 13 | }; 14 | 15 | patches = [ 16 | ./hyperorg.patch 17 | ]; 18 | 19 | build-system = [ 20 | setuptools 21 | setuptools-scm 22 | ]; 23 | 24 | dependencies = [ 25 | setuptools 26 | orgparse 27 | dateutil 28 | packaging 29 | requests 30 | ]; 31 | 32 | meta = { 33 | homepage = https://codeberg.org/buhtz/hyperorg; 34 | description = "Hyperorg converts org-files and especially orgroam-v2-files into html-files."; 35 | license = lib.licenses.mit; 36 | maintainers = with lib.maintainers; [ jwiegley ]; 37 | }; 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /overlays/20-ledger.nix: -------------------------------------------------------------------------------- 1 | self: pkgs: 2 | 3 | let ledgerPkg = import /Users/johnw/src/ledger; 4 | ledger = ledgerPkg.packages.${pkgs.system}.ledger; in 5 | 6 | { 7 | 8 | ledger_HEAD = ledger.overrideAttrs (attrs: { 9 | boost = pkgs.boost.override { python = pkgs.python3; }; 10 | 11 | preConfigure = '' 12 | sed -i -e "s%DESTINATION \\\''${Python_SITEARCH}%DESTINATION $out/lib/python37/site-packages%" src/CMakeLists.txt 13 | ''; 14 | 15 | preInstall = '' 16 | mkdir -p $out/lib/python37/site-packages 17 | ''; 18 | }); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /overlays/20-linkdups.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | linkdups = with super; stdenv.mkDerivation rec { 4 | name = "linkdups-${version}"; 5 | version = "1.3"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "jwiegley"; 9 | repo = "linkdups"; 10 | rev = "57bb79332d3b79418692d0c974acba83a4fd3fc9"; 11 | sha256 = "1d400vanbsrmfxf1w4na3r4k3nw18xnv05qcf4rkqajmnfrbzh3h"; 12 | # date = 2025-05-13T11:29:24-07:00; 13 | }; 14 | 15 | phases = [ "unpackPhase" "installPhase" ]; 16 | 17 | installPhase = '' 18 | mkdir -p $out/bin 19 | cp -p linkdups $out/bin 20 | ''; 21 | 22 | meta = { 23 | homepage = https://github.com/jwiegley/linkdups; 24 | description = "A tool for hard-linking duplicate files"; 25 | license = lib.licenses.mit; 26 | maintainers = with lib.maintainers; [ jwiegley ]; 27 | }; 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /overlays/20-lipotell.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | lipotell = with super; stdenv.mkDerivation rec { 4 | name = "lipotell-${version}"; 5 | version = "1.1"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "jwiegley"; 9 | repo = "lipotell"; 10 | rev = "1502a4753f42618efcf2d0d561c818af377b0d92"; 11 | sha256 = "0vnkbf0ldzh2b7aiwhpxl5dr1h158xnbw2i8q4hwxkfialca4xjf"; 12 | # date = 2011-09-10T18:57:01-05:00; 13 | }; 14 | 15 | phases = [ "unpackPhase" "installPhase" ]; 16 | 17 | installPhase = '' 18 | mkdir -p $out/bin 19 | cp -p lipotell $out/bin 20 | ''; 21 | 22 | meta = { 23 | homepage = https://github.com/jwiegley/lipotell; 24 | description = "A tool to find large files within a directory"; 25 | license = lib.licenses.mit; 26 | maintainers = with lib.maintainers; [ jwiegley ]; 27 | }; 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /overlays/20-my-scripts.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | my-scripts = with self; stdenv.mkDerivation { 4 | name = "my-scripts"; 5 | 6 | src = builtins.filterSource (path: type: 7 | type != "directory" || baseNameOf path != ".git") 8 | /Users/johnw/src/scripts; 9 | 10 | buildInputs = []; 11 | 12 | installPhase = '' 13 | mkdir -p $out/bin 14 | find . -maxdepth 1 \( -type f -o -type l \) -executable \ 15 | -exec cp -pL {} $out/bin \; 16 | ${self.perl}/bin/perl -i -pe \ 17 | 's^#!/usr/bin/env runhaskell^#!${self.haskellPackages.ghc}/bin/runhaskell^;' $out/bin/* 18 | ''; 19 | 20 | meta = with pkgs.lib; { 21 | description = "John Wiegley's various scripts"; 22 | homepage = https://github.com/jwiegley; 23 | license = licenses.mit; 24 | maintainers = with maintainers; [ jwiegley ]; 25 | platforms = platforms.darwin; 26 | }; 27 | }; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /overlays/20-org2tc.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | org2tc = with super; stdenv.mkDerivation rec { 4 | name = "org2tc-${version}"; 5 | version = "7d52a20"; 6 | 7 | src = /Users/johnw/src/hours/org2tc; 8 | 9 | phases = [ "unpackPhase" "installPhase" ]; 10 | 11 | installPhase = '' 12 | mkdir -p $out/bin 13 | cp -p org2tc $out/bin 14 | ''; 15 | 16 | meta = with super.lib; { 17 | description = "Conversion utility from Org-mode to timeclock format"; 18 | homepage = https://github.com/jwiegley/org2tc; 19 | license = licenses.mit; 20 | maintainers = with maintainers; [ jwiegley ]; 21 | platforms = platforms.unix; 22 | }; 23 | }; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /overlays/20-pass-git-helper.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | pass-git-helper = with super; with python3Packages; buildPythonPackage rec { 4 | pname = "pass-git-helper"; 5 | version = "2.0.0"; 6 | name = "${pname}-${version}"; 7 | 8 | src = fetchFromGitHub { 9 | owner = "languitar"; 10 | repo = "pass-git-helper"; 11 | rev = "cdcf24de34cab16071e25f2d2ffccd4bf8c55bf8"; 12 | sha256 = "07cfz8qj5vnmqdjqxayw4v6sb200gxd08i0a7r3zkpjl4grnl68d"; 13 | # date = 2024-06-18T19:04:24+02:00; 14 | }; 15 | 16 | buildInputs = [ pyxdg pytest ]; 17 | 18 | pythonPath = [ pyxdg pytest ]; 19 | doCheck = false; 20 | 21 | meta = { 22 | homepage = https://github.com/languitar/pass-git-helper; 23 | description = "A git credential helper interfacing with pass, the standard unix password manager"; 24 | license = lib.licenses.lgpl3; 25 | maintainers = with lib.maintainers; [ jwiegley ]; 26 | }; 27 | }; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /overlays/20-sanoid.nix: -------------------------------------------------------------------------------- 1 | self: pkgs: with pkgs; { 2 | 3 | sanoid = pkgs.sanoid.overrideAttrs(attrs: { 4 | preInstall = '' 5 | sed -i \ 6 | -e "s%'zfs'%'/usr/local/zfs/bin/zfs'%" \ 7 | -e "s%'zpool'%'/usr/local/zfs/bin/zpool'%" \ 8 | sanoid 9 | sed -i \ 10 | -e "s%'zfs'%'/usr/local/zfs/bin/zfs'%" \ 11 | -e "s%'zpool'%'/usr/local/zfs/bin/zpool'%" \ 12 | syncoid 13 | ''; 14 | 15 | installPhase = '' 16 | runHook preInstall 17 | 18 | mkdir -p "$out/bin" 19 | mkdir -p "$out/etc/sanoid" 20 | cp sanoid.defaults.conf "$out/etc/sanoid/sanoid.defaults.conf" 21 | # Hardcode path to default config 22 | substitute sanoid "$out/bin/sanoid" \ 23 | --replace "\$args{'configdir'}/sanoid.defaults.conf" "$out/etc/sanoid/sanoid.defaults.conf" 24 | chmod +x "$out/bin/sanoid" 25 | # Prefer ZFS userspace tools from /run/booted-system/sw/bin to avoid 26 | # incompatibilities with the ZFS kernel module. 27 | wrapProgram "$out/bin/sanoid" \ 28 | --prefix PERL5LIB : "$PERL5LIB" \ 29 | --prefix PATH : "${lib.makeBinPath [ procps ]}" 30 | 31 | install -m755 syncoid "$out/bin/syncoid" 32 | wrapProgram "$out/bin/syncoid" \ 33 | --prefix PERL5LIB : "$PERL5LIB" \ 34 | --prefix PATH : "${lib.makeBinPath [ openssh procps which pv lzop gzip pigz ]}" 35 | 36 | install -m755 findoid "$out/bin/findoid" 37 | wrapProgram "$out/bin/findoid" \ 38 | --prefix PERL5LIB : "$PERL5LIB" \ 39 | --prefix PATH : "${lib.makeBinPath [ ]}" 40 | 41 | runHook postInstall 42 | ''; 43 | }); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /overlays/20-sift.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | sift = with super; stdenv.mkDerivation rec { 4 | name = "sift-${version}"; 5 | version = "1.0"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "jwiegley"; 9 | repo = "sift"; 10 | rev = "c823f340be8818cc7aa970f9da4c81247f5b5535"; 11 | sha256 = "1yadjgjcghi2fhyayl3ry67w3cz6f7w0ibni9dikdp3vnxp94y58"; 12 | # date = 2011-09-10T19:05:37-05:00; 13 | }; 14 | 15 | phases = [ "unpackPhase" "installPhase" ]; 16 | 17 | installPhase = '' 18 | mkdir -p $out/bin 19 | cp -p sift $out/bin 20 | ''; 21 | 22 | meta = { 23 | homepage = https://github.com/jwiegley/sift; 24 | description = "A tool for sifting apart large patch files"; 25 | license = lib.licenses.mit; 26 | maintainers = with lib.maintainers; [ jwiegley ]; 27 | }; 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /overlays/20-sshify.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | sshify = with super; stdenv.mkDerivation rec { 4 | name = "sshify-${version}"; 5 | version = "1.0"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "jwiegley"; 9 | repo = "sshify"; 10 | rev = "a6fb0d529ec01158dd031431099b0ba8c8d64eb6"; 11 | sha256 = "12vc4n9a667h7mjafa7g1qy2n6bgwk3ar40pf5mq39282mk82pf2"; 12 | # date = 2018-01-27T17:11:59-08:00; 13 | }; 14 | 15 | phases = [ "unpackPhase" "installPhase" ]; 16 | 17 | installPhase = '' 18 | mkdir -p $out/bin 19 | cp -p sshify $out/bin 20 | ''; 21 | 22 | meta = { 23 | homepage = https://github.com/jwiegley/sshify; 24 | description = "A tool for installing SSH authorized_key on remote servers"; 25 | license = lib.licenses.mit; 26 | maintainers = with lib.maintainers; [ jwiegley ]; 27 | }; 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /overlays/20-tsvutils.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | tsvutils = with super; stdenv.mkDerivation rec { 4 | name = "tsvutils-${version}"; 5 | version = "a286c817"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "brendano"; 9 | repo = "tsvutils"; 10 | rev = "a286c8179342285803871834bb92c39cd52e516d"; 11 | sha256 = "1jrg36ckvpmwjx9350lizfjghr3pfrmad0p3qibxwj14qw3wplni"; 12 | # date = 2019-08-11T16:06:16-04:00; 13 | }; 14 | 15 | phases = [ "unpackPhase" "installPhase" ]; 16 | 17 | installPhase = '' 18 | mkdir -p $out/bin 19 | find . -maxdepth 1 \( -type f -o -type l \) -executable \ 20 | -exec cp -pL {} $out/bin \; 21 | ''; 22 | 23 | meta = with super.lib; { 24 | description = "Utilities for processing tab-separated files"; 25 | homepage = https://github.com/brendano/tsvutils; 26 | license = licenses.mit; 27 | maintainers = with maintainers; [ jwiegley ]; 28 | platforms = platforms.unix; 29 | }; 30 | }; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /overlays/20-yamale.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | yamale = with super; with python3Packages; buildPythonPackage rec { 4 | pname = "yamale"; 5 | version = "bacaa1d8"; 6 | name = "${pname}-${version}"; 7 | 8 | src = fetchFromGitHub { 9 | owner = "23andMe"; 10 | repo = "Yamale"; 11 | rev = "bacaa1d8e20395e11fe087cb7a7cb0365c2afd50"; 12 | sha256 = "0ac9j5rm0bgfkwmri131d8v16abyndfxx58lnnkmil1rkl0r0a4a"; 13 | # date = 2024-04-30T16:14:31-04:00; 14 | }; 15 | 16 | propagatedBuildInputs = [ pyyaml ]; 17 | buildInputs = [ pytest ]; 18 | 19 | meta = { 20 | homepage = https://github.com/23andMe/Yamale; 21 | description = "A schema and validator for YAML"; 22 | license = lib.licenses.mit; 23 | maintainers = with lib.maintainers; [ jwiegley ]; 24 | }; 25 | }; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /overlays/20-z.nix: -------------------------------------------------------------------------------- 1 | self: super: { 2 | 3 | z = with super; stdenv.mkDerivation rec { 4 | name = "z-${version}"; 5 | version = "d37a763a"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "rupa"; 9 | repo = "z"; 10 | rev = "d37a763a6a30e1b32766fecc3b8ffd6127f8a0fd"; 11 | sha256 = "10azqw3da1mamfxhx6r0x481gsnjjipcfv6q91vp2bhsi22l35hy"; 12 | # date = 2023-12-09T17:41:33-05:00; 13 | }; 14 | 15 | phases = [ "unpackPhase" "installPhase" ]; 16 | 17 | installPhase = '' 18 | mkdir -p $out/share 19 | cp -p z.sh $out/share/z.sh 20 | ''; 21 | 22 | meta = with super.lib; { 23 | description = "Tracks your most used directories, based on 'frecency'."; 24 | homepage = https://github.com/rupa/z; 25 | license = licenses.mit; 26 | maintainers = with maintainers; [ jwiegley ]; 27 | platforms = platforms.unix; 28 | }; 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /overlays/Dedupe-RPATH-entries.patch: -------------------------------------------------------------------------------- 1 | --- a/src/ld/HeaderAndLoadCommands.hpp 2025-06-01 14:18:21.265095063 -0700 2 | +++ b/src/ld/HeaderAndLoadCommands.hpp 2025-06-01 14:23:55.542717508 -0700 3 | @@ -470,7 +470,14 @@ 4 | 5 | if ( _hasRPathLoadCommands ) { 6 | const std::vector& rpaths = _options.rpaths(); 7 | + std::set seen; 8 | + 9 | for (std::vector::const_iterator it = rpaths.begin(); it != rpaths.end(); ++it) { 10 | + std::string it_(*it); 11 | + if (seen.find(it_) != std::end(seen)) 12 | + continue; 13 | + seen.insert(it_); 14 | + 15 | sz += alignedSize(sizeof(macho_rpath_command

) + strlen(*it) + 1); 16 | } 17 | } 18 | @@ -579,7 +586,17 @@ 19 | 20 | count += _dylibLoadCommmandsCount; 21 | 22 | - count += _options.rpaths().size(); 23 | + { 24 | + const std::vector& rpaths = _options.rpaths(); 25 | + std::set seen; 26 | + for (std::vector::const_iterator it = rpaths.begin(); it != rpaths.end(); ++it) { 27 | + std::string it_(*it); 28 | + if (seen.find(it_) != std::end(seen)) 29 | + continue; 30 | + seen.insert(it_); 31 | + ++count; 32 | + } 33 | + } 34 | 35 | if ( _hasSubFrameworkLoadCommand ) 36 | ++count; 37 | @@ -1764,7 +1781,15 @@ 38 | 39 | if ( _hasRPathLoadCommands ) { 40 | const std::vector& rpaths = _options.rpaths(); 41 | + std::set seen; 42 | + 43 | for (std::vector::const_iterator it = rpaths.begin(); it != rpaths.end(); ++it) { 44 | + std::string it_(*it); 45 | + if (seen.find(it_) != std::end(seen)) 46 | + continue; 47 | + 48 | + seen.insert(it_); 49 | + 50 | p = this->copyRPathLoadCommand(p, *it); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /overlays/coq/category-theory.nix: -------------------------------------------------------------------------------- 1 | { pkgs, coq, equations }: with pkgs; 2 | 3 | stdenv.mkDerivation rec { 4 | name = "coq${coq.coq-version}-category-theory-${version}"; 5 | version = "1.0"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "jwiegley"; 9 | repo = "category-theory"; 10 | rev = "380ff60d34c306f7005babc3dade1d96b5eeb935"; 11 | sha256 = "1r4v5lm090i23kqa1ad39sgfph7pfl458kh8rahsh1mr6yl1cbv9"; 12 | # date = 2020-01-12T15:09:07-08:00; 13 | }; 14 | 15 | # src = builtins.filterSource (path: type: 16 | # let baseName = baseNameOf path; in 17 | # !( type == "directory" && builtins.elem baseName [".git"]) 18 | # && 19 | # !( type == "unknown" 20 | # || pkgs.lib.hasSuffix ".vo" path 21 | # || pkgs.lib.hasSuffix ".aux" path 22 | # || pkgs.lib.hasSuffix ".v.d" path 23 | # || pkgs.lib.hasSuffix ".glob" path)) 24 | # ~/src/category-theory; 25 | 26 | buildInputs = [ coq.ocaml coq.camlp5 coq.findlib coq equations ]; 27 | 28 | preBuild = "coq_makefile -f _CoqProject -o Makefile"; 29 | 30 | installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; 31 | 32 | meta = with pkgs.lib; { 33 | homepage = https://github.com/jwiegley/category-theory; 34 | description = "An axiom-free category theory library in Coq"; 35 | maintainers = with maintainers; [ jwiegley ]; 36 | platforms = coq.meta.platforms; 37 | }; 38 | 39 | passthru = { 40 | compatibleCoqVersions = v: builtins.elem v [ "8.5" "8.6" "8.7" "8.8" ]; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /overlays/coq/fiat.nix: -------------------------------------------------------------------------------- 1 | { pkgs, coq }: with pkgs; 2 | 3 | stdenv.mkDerivation rec { 4 | name = "coq-fiat-core-${coq.coq-version}-unstable-${version}"; 5 | version = "2018-05-14"; 6 | 7 | src = pkgs.fetchFromGitHub { 8 | owner = "jwiegley"; 9 | repo = "fiat-core"; 10 | rev = "5d2d1fdfba7c3ed5a3120dad2415b0bb958b6d02"; 11 | sha256 = "190v5sz8fmdhbndknq9mkwpj3jf570gzdibww7f76g81a34v3qli"; 12 | fetchSubmodules = true; 13 | # date = 2018-05-14T10:05:32-07:00; 14 | }; 15 | 16 | buildInputs = [ coq coq.ocaml coq.camlp5 coq.findlib 17 | pkgs.git pkgs.python3 ]; 18 | propagatedBuildInputs = [ coq ]; 19 | 20 | doCheck = false; 21 | 22 | enableParallelBuilding = true; 23 | buildPhase = "make -j$NIX_BUILD_CORES"; 24 | 25 | installPhase = '' 26 | COQLIB=$out/lib/coq/${coq.coq-version}/ 27 | mkdir -p $COQLIB/user-contrib/Fiat 28 | cp -pR src/* $COQLIB/user-contrib/Fiat 29 | ''; 30 | 31 | meta = with pkgs.lib; { 32 | homepage = http://plv.csail.mit.edu/fiat/; 33 | description = "A library for the Coq proof assistant for synthesizing efficient correct-by-construction programs from declarative specifications"; 34 | maintainers = with maintainers; [ jwiegley ]; 35 | platforms = coq.meta.platforms; 36 | }; 37 | 38 | passthru = { 39 | compatibleCoqVersions = v: builtins.elem v [ "8.5" "8.6" "8.7" "8.8" ]; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /overlays/dovecot/pagesize.patch: -------------------------------------------------------------------------------- 1 | --- i/src/fts-xapian-plugin.h 2 | +++ w/src/fts-xapian-plugin.h 3 | @@ -56,6 +56,7 @@ static const char * chars_sep[] = { "'", "\"", "\r", "\n", "\t", ",", "> 4 | struct fts_xapian_settings 5 | { 6 | long verbose; 7 | + unsigned long pagesize; 8 | long lowmemory; 9 | long partial,full; 10 | bool detach; 11 | -------------------------------------------------------------------------------- /overlays/emacs/0001-mac-gui-loop-block-lifetime.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/macappkit.m b/src/macappkit.m 2 | index babb3560c7..457bd4d549 100644 3 | --- a/src/macappkit.m 4 | +++ b/src/macappkit.m 5 | @@ -16137,19 +16137,21 @@ - (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)finishedPlaying 6 | mac_gui_loop (void) 7 | { 8 | eassert (pthread_main_np ()); 9 | - void (^block) (void); 10 | 11 | do 12 | { 13 | BEGIN_AUTORELEASE_POOL; 14 | + void (^block) (void); 15 | + 16 | dispatch_semaphore_wait (mac_gui_semaphore, DISPATCH_TIME_FOREVER); 17 | block = [mac_gui_queue dequeue]; 18 | - if (block) 19 | - block (); 20 | + if (!block) 21 | + break; 22 | + block (); 23 | dispatch_semaphore_signal (mac_lisp_semaphore); 24 | END_AUTORELEASE_POOL; 25 | } 26 | - while (block); 27 | + while (1); 28 | } 29 | 30 | static void 31 | -------------------------------------------------------------------------------- /overlays/emacs/0002-mac-gui-loop-block-autorelease.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/macappkit.m b/src/macappkit.m 2 | index babb3560c7..29b0ab3511 100644 3 | --- a/src/macappkit.m 4 | +++ b/src/macappkit.m 5 | @@ -16145,9 +16145,9 @@ - (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)finishedPlaying 6 | dispatch_semaphore_wait (mac_gui_semaphore, DISPATCH_TIME_FOREVER); 7 | block = [mac_gui_queue dequeue]; 8 | if (block) 9 | - block (); 10 | - dispatch_semaphore_signal (mac_lisp_semaphore); 11 | + block (); 12 | END_AUTORELEASE_POOL; 13 | + dispatch_semaphore_signal (mac_lisp_semaphore); 14 | } 15 | while (block); 16 | } 17 | @@ -16161,9 +16161,9 @@ - (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)finishedPlaying 18 | dispatch_semaphore_wait (mac_gui_semaphore, DISPATCH_TIME_FOREVER); 19 | block = [mac_gui_queue dequeue]; 20 | eassert (block); 21 | - block (); 22 | - dispatch_semaphore_signal (mac_lisp_semaphore); 23 | + block (); 24 | END_AUTORELEASE_POOL; 25 | + dispatch_semaphore_signal (mac_lisp_semaphore); 26 | } 27 | 28 | /* Ask execution of BLOCK to the GUI thread synchronously. The 29 | -------------------------------------------------------------------------------- /overlays/emacs/Chat.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwiegley/nix-config/6850bf29d4dd22080bd6da2538dda8e282c53acc/overlays/emacs/Chat.icns -------------------------------------------------------------------------------- /overlays/emacs/builder.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , pkgs 3 | , emacs 4 | , name 5 | , src 6 | , buildInputs ? [] 7 | , propagatedBuildInputs ? [] 8 | , patches ? [] 9 | , preBuild ? "" 10 | }: 11 | 12 | stdenv.mkDerivation { 13 | inherit name src patches propagatedBuildInputs; 14 | unpackCmd = '' 15 | test -f "${src}" && mkdir el && cp -p ${src} el/${name} 16 | ''; 17 | buildInputs = [ emacs ] ++ buildInputs; 18 | buildPhase = '' 19 | ${preBuild} 20 | set -x 21 | ARGS=$(find ${pkgs.lib.concatStrings 22 | (builtins.map (arg: arg + "/share/emacs/site-lisp ") buildInputs)} \ 23 | -type d -exec echo -L {} \;) 24 | mkdir $out 25 | export HOME=$out 26 | if ${emacs}/bin/emacs --version | grep 29; then 27 | ${emacs}/bin/emacs -Q -nw -L . $ARGS --batch -f batch-byte-compile *.el 28 | else 29 | ${emacs}/bin/emacs -Q -nw -L . $ARGS --batch --eval "(setq byte-compile-warnings '(not docstrings))" -f batch-byte-compile *.el 30 | fi 31 | ''; 32 | installPhase = '' 33 | mkdir -p $out/share/emacs/site-lisp 34 | install *.el* $out/share/emacs/site-lisp 35 | ''; 36 | meta = { 37 | description = "Emacs projects from the Internet that just compile .el files"; 38 | homepage = http://www.emacswiki.org; 39 | platforms = pkgs.lib.platforms.all; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /overlays/emacs/clean-env-27.patch: -------------------------------------------------------------------------------- 1 | Dump temacs in an empty environment to prevent -dev paths from ending 2 | up in the dumped image. 3 | 4 | diff --git a/src/Makefile.in b/src/Makefile.in 5 | --- a/src/Makefile.in 6 | +++ b/src/Makefile.in 7 | @@ -570,7 +570,7 @@ 8 | lisp.mk $(etc)/DOC $(lisp) \ 9 | $(lispsource)/international/charprop.el ${charsets} 10 | ifeq ($(DUMPING),unexec) 11 | - LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump 12 | + env -i LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump 13 | ifneq ($(PAXCTL_dumped),) 14 | $(PAXCTL_dumped) emacs$(EXEEXT) 15 | endif 16 | @@ -581,7 +581,7 @@ 17 | 18 | ifeq ($(DUMPING),pdumper) 19 | $(pdmp): emacs$(EXEEXT) 20 | - LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=pdump 21 | + env -i LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=pdump 22 | cp -f $@ $(bootstrap_pdmp) 23 | endif 24 | 25 | -------------------------------------------------------------------------------- /overlays/emacs/clean-env.patch: -------------------------------------------------------------------------------- 1 | Dump temacs in an empty environment to prevent -dev paths from ending 2 | up in the dumped image. 3 | 4 | diff --git a/src/Makefile.in b/src/Makefile.in 5 | index fd05a45df5..13f529c253 100644 6 | --- a/src/Makefile.in 7 | +++ b/src/Makefile.in 8 | @@ -570,7 +570,7 @@ emacs$(EXEEXT): temacs$(EXEEXT) \ 9 | lisp.mk $(etc)/DOC $(lisp) \ 10 | $(lispsource)/international/charprop.el ${charsets} 11 | ifeq ($(DUMPING),unexec) 12 | - LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump 13 | + env -i LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump 14 | ifneq ($(PAXCTL_dumped),) 15 | $(PAXCTL_dumped) emacs$(EXEEXT) 16 | endif 17 | -------------------------------------------------------------------------------- /overlays/emacs/edit-env.el: -------------------------------------------------------------------------------- 1 | ;;; edit-env.el --- display and edit environment variables 2 | 3 | ;; Copyright (C) 2001 Benjamin Rutt 4 | ;; 5 | ;; Maintainer: Benjamin Rutt 6 | ;; Version: 1.0 7 | 8 | ;; This file is not part of GNU Emacs. 9 | 10 | ;; This file is free software; you can redistribute it and/or modify 11 | ;; it under the terms of the GNU General Public License as published 12 | ;; by the Free Software Foundation; either version 2, or (at your 13 | ;; option) any later version. 14 | 15 | ;; This program is distributed in the hope that it will be useful, 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;; GNU General Public License for more details. 19 | 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with GNU Emacs; see the file COPYING. If not, send e-mail to 22 | ;; this program's maintainer or write to the Free Software Foundation, 23 | ;; Inc., 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. 24 | 25 | ;;; Commentary: 26 | 27 | ;; This file uses the widget library to display, edit, delete and add 28 | ;; environment variables. Inspired by "G c" in a gnus *Group* buffer. 29 | ;; Bug reports or patches are welcome, please use the above email 30 | ;; address. 31 | 32 | ;;; Usage: 33 | 34 | ;; put this file in your load-path and add the line 35 | ;; 36 | ;; (require 'edit-env) 37 | ;; 38 | ;; to your ~/.emacs file. 39 | ;; 40 | ;; Then, type 41 | ;; 42 | ;; M-x edit-env 43 | ;; 44 | ;; to enter the environment editor. To change variables, simply edit 45 | ;; their values in place. To delete variables, delete their values. 46 | ;; To add variables, add a new rows to the list at the bottom by 47 | ;; pressing [INS]; then, add a new name/value pair of the form 48 | ;; VAR=VALUE (e.g. FOO=BAR). After changing and/or deleting and/or 49 | ;; adding environment variables, press the [done] button at the top. 50 | ;; Note that environment variable changes will only be visible to your 51 | ;; current emacs session or child processes thereof. 52 | 53 | ;;; Code: 54 | 55 | ;; XEmacs compatibility stuff 56 | (if (string-match "XEmacs" (emacs-version)) 57 | (require 'overlay)) 58 | 59 | (require 'widget) 60 | 61 | (require 'wid-edit) 62 | (eval-when-compile (require 'cl)) 63 | 64 | (defvar edit-env-ls nil) 65 | (defvar edit-env-changed-ls nil) 66 | (defvar edit-env-added-ls nil) 67 | 68 | (defun edit-env-update () 69 | (let ((var nil) 70 | (value nil) 71 | (vars-changed nil)) 72 | (when edit-env-changed-ls 73 | (mapcar 74 | (lambda (x) 75 | (setq var (car x)) 76 | (setq value (widget-value (cadr x))) 77 | (if (equal value "") 78 | (setenv var nil) ;; i.e. unset var 79 | (setenv var value)) 80 | (add-to-list 'vars-changed var)) 81 | edit-env-changed-ls) 82 | (setq edit-env-changed-ls nil)) 83 | 84 | (when edit-env-added-ls 85 | (mapcar 86 | (lambda (x) 87 | (if (and x (not (string-match "^[ \t\n]*$" x))) 88 | (progn 89 | (let ((splits (split-string x "="))) 90 | (if (not (= (length splits) 2)) 91 | (message "invalid format %s" x) 92 | (setq var (car splits)) 93 | (setq value (cadr splits)) 94 | (if value (add-to-list 'vars-changed var)) 95 | (setenv var value)))))) 96 | (widget-value edit-env-added-ls)) 97 | (setq edit-env-added-ls nil)) 98 | (when vars-changed 99 | ;; Need to regenerate the buffer before burial. An alternative 100 | ;; to re-generation followed by burial would be simply to 101 | ;; kill-buffer. 102 | (edit-env) 103 | (message 104 | (format "Updated environment variable%s %s" 105 | (if (> (length vars-changed) 1) "s" "") 106 | (mapconcat 'identity vars-changed ", ")))) 107 | (bury-buffer))) 108 | 109 | (defun edit-env-mark-changed (widget) 110 | (add-to-list 'edit-env-changed-ls 111 | (list (widget-get widget 'environment-variable-name) 112 | widget))) 113 | 114 | (defun edit-env () 115 | "Display, edit, delete and add environment variables." 116 | (interactive) 117 | (setq edit-env-ls nil 118 | edit-env-changed-ls nil 119 | edit-env-added-ls nil) 120 | (switch-to-buffer "*Environment Variable Editor*") 121 | (kill-all-local-variables) 122 | (let ((inhibit-read-only t)) 123 | (erase-buffer)) 124 | (let ((all (overlay-lists))) 125 | ;; Delete all the overlays. 126 | (mapcar 'delete-overlay (car all)) 127 | (mapcar 'delete-overlay (cdr all))) 128 | (widget-insert "Edit environment variables below, and press ") 129 | (let ((pair nil) 130 | (var nil) 131 | (val nil) 132 | (longest-var 0) 133 | (current-widget nil)) 134 | (setq edit-env-ls (copy-list process-environment)) 135 | (setq edit-env-ls (sort edit-env-ls (lambda (a b) (string-lessp a b)))) 136 | 137 | (widget-create 'push-button 138 | :notify (lambda (widget &rest ignore) 139 | (edit-env-update)) 140 | :help-echo "press to update environment variables" 141 | "done") 142 | (widget-insert ".\n") 143 | 144 | (mapcar 145 | (lambda (x) 146 | (let* ((pair (split-string x "=")) 147 | (var (car pair)) 148 | (val (cadr pair))) 149 | (setq longest-var (max longest-var (length var))))) 150 | edit-env-ls) 151 | (mapcar 152 | (lambda (x) 153 | (let* ((pair (split-string x "=")) 154 | (var (car pair)) 155 | (val (or (cadr pair) ""))) 156 | (widget-insert "\n") 157 | (widget-insert (format (format "%%%ds" (1+ longest-var)) var)) 158 | (widget-insert " ") 159 | (setq current-widget 160 | (widget-create 'editable-field 161 | :size (1- (length val)) 162 | :notify (lambda (widget &rest ignore) 163 | (edit-env-mark-changed widget)) 164 | :format "%v" val)) 165 | (widget-put current-widget 'environment-variable-name var))) 166 | edit-env-ls) 167 | (widget-insert "\n\nTo add environment variables, ") 168 | (widget-insert "add rows of the form VAR=VALUE\n") 169 | (widget-insert "to the following list:\n") 170 | (setq edit-env-added-ls 171 | (widget-create 172 | 'editable-list 173 | :entry-format "%i %d %v" 174 | :value nil 175 | '(editable-field :value ""))) 176 | (use-local-map widget-keymap) 177 | (widget-setup) 178 | (setq truncate-lines t) 179 | ;; in future GNU emacs >= 21, auto-show-mode may be removed. 180 | (when (fboundp 'auto-show-mode) 181 | (auto-show-mode 1)) 182 | (goto-char (point-min)))) 183 | 184 | (provide 'edit-env) 185 | 186 | ;; edit-env.el ends here 187 | -------------------------------------------------------------------------------- /overlays/emacs/edit-var.el: -------------------------------------------------------------------------------- 1 | ;;; edit-var.el --- display and edit Lisp variables 2 | 3 | (defvar edit-variable-buffer) 4 | (defvar edit-variable-symbol) 5 | (defvar edit-variable-windows) 6 | 7 | (make-variable-buffer-local 'edit-variable-buffer) 8 | (make-variable-buffer-local 'edit-variable-symbol) 9 | (make-variable-buffer-local 'edit-variable-windows) 10 | 11 | ;;;###autoload 12 | (defun edit-variable (variable) 13 | "Edit the value of VARIABLE." 14 | (interactive (list (completing-read "Edit variable: " obarray 'boundp))) 15 | (let* ((symbol (intern variable)) 16 | (value (symbol-value symbol)) 17 | (buffer (current-buffer))) 18 | (with-current-buffer (get-buffer-create (format "*var %s*" variable)) 19 | (erase-buffer) 20 | (emacs-lisp-mode) 21 | (setq edit-variable-buffer buffer 22 | edit-variable-symbol symbol 23 | edit-variable-windows (current-window-configuration)) 24 | (insert (pp-to-string value)) 25 | (goto-char (point-min)) 26 | (select-window (display-buffer (current-buffer))) 27 | (define-key (current-local-map) [(control ?c) (control ?c)] 28 | (function 29 | (lambda () 30 | (interactive) 31 | (goto-char (point-min)) 32 | (let ((symbol edit-variable-symbol) 33 | (value (read (current-buffer)))) 34 | (with-current-buffer edit-variable-buffer 35 | (set symbol value))) 36 | (set-window-configuration edit-variable-windows))))))) 37 | 38 | (provide 'edit-var) 39 | 40 | ;; edit-var.el ends here 41 | -------------------------------------------------------------------------------- /overlays/emacs/mk-wrapper-subdirs.el: -------------------------------------------------------------------------------- 1 | (defmacro mk-subdirs-expr (path) 2 | `(setq load-path 3 | (delete-dups (append '(,path) 4 | ',(let ((default-directory path)) 5 | (normal-top-level-add-subdirs-to-load-path)) 6 | load-path)))) 7 | -------------------------------------------------------------------------------- /overlays/emacs/ox-extra.el: -------------------------------------------------------------------------------- 1 | ;;; ox-extra.el --- Convenience functions for org export 2 | 3 | ;; Copyright (C) 2014 Aaron Ecay 4 | 5 | ;; Author: Aaron Ecay 6 | 7 | ;; This program is free software; you can redistribute it and/or modify 8 | ;; it under the terms of the GNU General Public License as published by 9 | ;; the Free Software Foundation, either version 3 of the License, or 10 | ;; (at your option) any later version. 11 | 12 | ;; This program is distributed in the hope that it will be useful, 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ;; GNU General Public License for more details. 16 | 17 | ;; You should have received a copy of the GNU General Public License 18 | ;; along with this program. If not, see . 19 | 20 | ;;; Commentary: 21 | 22 | ;; This file contains some convenience functions for org export, which 23 | ;; are not part of org's core. Call `ox-extras-activate' passing a 24 | ;; list of symbols naming extras, which will be installed globally in 25 | ;; your org session. 26 | ;; 27 | ;; For example, you could include the following in your .emacs file: 28 | ;; 29 | ;; (require 'ox-extra) 30 | ;; (ox-extras-activate '(latex-header-blocks ignore-headlines)) 31 | ;; 32 | 33 | ;; Currently available extras: 34 | 35 | ;; - `latex-header-blocks' -- allow the use of latex blocks, the 36 | ;; contents of which which will be interpreted as #+latex_header lines 37 | ;; for export. These blocks should be tagged with #+header: :header 38 | ;; yes. For example: 39 | ;; #+header: :header yes 40 | ;; #+begin_export latex 41 | ;; ... 42 | ;; #+end_export 43 | 44 | ;; - `ignore-headlines' -- allow a headline (but not its children) to 45 | ;; be ignored. Any headline tagged with the 'ignore' tag will be 46 | ;; ignored (i.e. will not be included in the export), but any child 47 | ;; headlines will not be ignored (unless explicitly tagged to be 48 | ;; ignored), and will instead have their levels promoted by one. 49 | 50 | ;; TODO: 51 | ;; - add a function to org-mode-hook that looks for a ox-extras local 52 | ;; variable and activates the specified extras buffer-locally 53 | ;; - allow specification of desired extras to be activated via 54 | ;; customize 55 | 56 | ;;; Code: 57 | 58 | (require 'ox) 59 | (require 'cl-lib) 60 | 61 | (defun org-latex-header-blocks-filter (backend) 62 | (when (org-export-derived-backend-p backend 'latex) 63 | (let ((positions 64 | (org-element-map (org-element-parse-buffer 'greater-element nil) 'export-block 65 | (lambda (block) 66 | (when (and (string= (org-element-property :type block) "LATEX") 67 | (string= (org-export-read-attribute 68 | :header block :header) 69 | "yes")) 70 | (list (org-element-property :begin block) 71 | (org-element-property :end block) 72 | (org-element-property :post-affiliated block))))))) 73 | (mapc (lambda (pos) 74 | (goto-char (nth 2 pos)) 75 | (cl-destructuring-bind 76 | (beg end &rest ignore) 77 | ;; FIXME: `org-edit-src-find-region-and-lang' was 78 | ;; removed in 9c06f8cce (2014-11-11). 79 | (org-edit-src-find-region-and-lang) 80 | (let ((contents-lines (split-string 81 | (buffer-substring-no-properties beg end) 82 | "\n"))) 83 | (delete-region (nth 0 pos) (nth 1 pos)) 84 | (dolist (line contents-lines) 85 | (insert (concat "#+latex_header: " 86 | (replace-regexp-in-string "\\` *" "" line) 87 | "\n")))))) 88 | ;; go in reverse, to avoid wrecking the numeric positions 89 | ;; earlier in the file 90 | (reverse positions))))) 91 | 92 | 93 | ;; During export headlines which have the "ignore" tag are removed 94 | ;; from the parse tree. Their contents are retained (leading to a 95 | ;; possibly invalid parse tree, which nevertheless appears to function 96 | ;; correctly with most export backends) all children headlines are 97 | ;; retained and are promoted to the level of the ignored parent 98 | ;; headline. 99 | ;; 100 | ;; This makes it possible to add structure to the original Org-mode 101 | ;; document which does not effect the exported version, such as in the 102 | ;; following examples. 103 | ;; 104 | ;; Wrapping an abstract in a headline 105 | ;; 106 | ;; * Abstract :ignore: 107 | ;; #+LaTeX: \begin{abstract} 108 | ;; #+HTML:

109 | ;; 110 | ;; ... 111 | ;; 112 | ;; #+HTML:
113 | ;; #+LaTeX: \end{abstract} 114 | ;; 115 | ;; Placing References under a headline (using ox-bibtex in contrib) 116 | ;; 117 | ;; * References :ignore: 118 | ;; #+BIBLIOGRAPHY: dissertation plain 119 | ;; 120 | ;; Inserting an appendix for LaTeX using the appendix package. 121 | ;; 122 | ;; * Appendix :ignore: 123 | ;; #+LaTeX: \begin{appendices} 124 | ;; ** Reproduction 125 | ;; ... 126 | ;; ** Definitions 127 | ;; #+LaTeX: \end{appendices} 128 | ;; 129 | (defun org-export-ignore-headlines (data backend info) 130 | "Remove headlines tagged \"ignore\" retaining contents and promoting children. 131 | Each headline tagged \"ignore\" will be removed retaining its 132 | contents and promoting any children headlines to the level of the 133 | parent." 134 | (org-element-map data 'headline 135 | (lambda (object) 136 | (when (member "ignore" (org-element-property :tags object)) 137 | (let ((level-top (org-element-property :level object)) 138 | level-diff) 139 | (mapc (lambda (el) 140 | ;; recursively promote all nested headlines 141 | (org-element-map el 'headline 142 | (lambda (el) 143 | (when (equal 'headline (org-element-type el)) 144 | (unless level-diff 145 | (setq level-diff (- (org-element-property :level el) 146 | level-top))) 147 | (org-element-put-property el 148 | :level (- (org-element-property :level el) 149 | level-diff))))) 150 | ;; insert back into parse tree 151 | (org-element-insert-before el object)) 152 | (org-element-contents object))) 153 | (org-element-extract-element object))) 154 | info nil) 155 | (org-extra--merge-sections data backend info) 156 | data) 157 | 158 | (defun org-extra--merge-sections (data _backend info) 159 | (org-element-map data 'headline 160 | (lambda (hl) 161 | (let ((sections 162 | (cl-loop 163 | for el in (org-element-map (org-element-contents hl) 164 | '(headline section) #'identity info) 165 | until (eq (org-element-type el) 'headline) 166 | collect el))) 167 | (when (and sections 168 | (> (length sections) 1)) 169 | (apply #'org-element-adopt-elements 170 | (car sections) 171 | (cl-mapcan (lambda (s) (org-element-contents s)) 172 | (cdr sections))) 173 | (mapc #'org-element-extract-element (cdr sections))))) 174 | info)) 175 | 176 | (defconst ox-extras 177 | '((latex-header-blocks org-latex-header-blocks-filter org-export-before-parsing-hook) 178 | (ignore-headlines org-export-ignore-headlines org-export-filter-parse-tree-functions)) 179 | "A list of org export extras that can be enabled. 180 | 181 | Should be a list of items of the form (NAME FN HOOK). NAME is a 182 | symbol, which can be passed to `ox-extras-activate'. FN is a 183 | function which will be added to HOOK.") 184 | 185 | (defun ox-extras-activate (extras) 186 | "Activate certain org export extras. 187 | 188 | EXTRAS should be a list of extras (defined in `ox-extras') which 189 | should be activated." 190 | (dolist (extra extras) 191 | (let* ((lst (assq extra ox-extras)) 192 | (fn (nth 1 lst)) 193 | (hook (nth 2 lst))) 194 | (when (and fn hook) 195 | (add-hook hook fn))))) 196 | 197 | (defun ox-extras-deactivate (extras) 198 | "Deactivate certain org export extras. 199 | 200 | This function is the opposite of `ox-extras-activate'. EXTRAS 201 | should be a list of extras (defined in `ox-extras') which should 202 | be activated." 203 | (dolist (extra extras) 204 | (let* ((lst (assq extra ox-extras)) 205 | (fn (nth 1 lst)) 206 | (hook (nth 2 lst))) 207 | (when (and fn hook) 208 | (remove-hook hook fn))))) 209 | 210 | (provide 'ox-extra) 211 | ;;; ox-extra.el ends here 212 | -------------------------------------------------------------------------------- /overlays/emacs/patches/at-fdcwd.patch: -------------------------------------------------------------------------------- 1 | diff --git a/lib/careadlinkat.h b/lib/careadlinkat.h 2 | index 84ede3e..8e8f42e 100644 3 | --- a/lib/careadlinkat.h 4 | +++ b/lib/careadlinkat.h 5 | @@ -23,6 +23,10 @@ 6 | #include 7 | #include 8 | 9 | +#ifndef AT_FDCWD 10 | +#define AT_FDCWD -2 11 | +#endif 12 | + 13 | struct allocator; 14 | 15 | /* Assuming the current directory is FD, get the symbolic link value 16 | -------------------------------------------------------------------------------- /overlays/emacs/patches/company-coq.patch: -------------------------------------------------------------------------------- 1 | --- a/company-coq.el 2 | +++ b/company-coq.el 3 | @@ -5485,7 +5485,7 @@ Tweaks company-mode settings for smoother use with Coq." 4 | (company-coq-do-in-coq-buffers 5 | (pcase arg 6 | (`on 7 | - (setq-local company-idle-delay 0.01) 8 | + (setq-local company-idle-delay nil) 9 | (setq-local company-tooltip-align-annotations t) 10 | (setq-local company-abort-manual-when-too-short t) 11 | ;; See https://github.com/cpitclaudel/company-coq/issues/42 12 | -------------------------------------------------------------------------------- /overlays/emacs/patches/emacs-26.patch: -------------------------------------------------------------------------------- 1 | commit cfb95bf3b4827ac821f81dbc90dffd89c79377ad 2 | Author: John Wiegley 3 | Date: Mon Jan 22 18:45:37 2018 -0800 4 | 5 | Disable em-ls-test-bug27844 6 | 7 | diff --git a/test/lisp/eshell/em-ls-tests.el b/test/lisp/eshell/em-ls-tests.el 8 | index 1ce832f1dc..cf57f3f383 100644 9 | --- a/test/lisp/eshell/em-ls-tests.el 10 | +++ b/test/lisp/eshell/em-ls-tests.el 11 | @@ -75,22 +75,22 @@ 12 | (customize-set-variable 'eshell-ls-use-in-dired orig) 13 | (and (buffer-live-p buf) (kill-buffer))))) 14 | 15 | -(ert-deftest em-ls-test-bug27844 () 16 | - "Test for https://debbugs.gnu.org/27844 ." 17 | - (let ((orig eshell-ls-use-in-dired) 18 | - (dired-use-ls-dired 'unspecified) 19 | - buf insert-directory-program) 20 | - (unwind-protect 21 | - (progn 22 | - (customize-set-variable 'eshell-ls-use-in-dired t) 23 | - (setq buf (dired (expand-file-name "lisp/*.el" source-directory))) 24 | - (dired-toggle-marks) 25 | - (should (cdr (dired-get-marked-files))) 26 | - (kill-buffer buf) 27 | - (setq buf (dired (expand-file-name "lisp/subr.el" source-directory))) 28 | - (should (looking-at "subr\\.el"))) 29 | - (customize-set-variable 'eshell-ls-use-in-dired orig) 30 | - (and (buffer-live-p buf) (kill-buffer))))) 31 | +;; (ert-deftest em-ls-test-bug27844 () 32 | +;; "Test for https://debbugs.gnu.org/27844 ." 33 | +;; (let ((orig eshell-ls-use-in-dired) 34 | +;; (dired-use-ls-dired 'unspecified) 35 | +;; buf insert-directory-program) 36 | +;; (unwind-protect 37 | +;; (progn 38 | +;; (customize-set-variable 'eshell-ls-use-in-dired t) 39 | +;; (setq buf (dired (expand-file-name "lisp/*.el" source-directory))) 40 | +;; (dired-toggle-marks) 41 | +;; (should (cdr (dired-get-marked-files))) 42 | +;; (kill-buffer buf) 43 | +;; (setq buf (dired (expand-file-name "lisp/subr.el" source-directory))) 44 | +;; (should (looking-at "subr\\.el"))) 45 | +;; (customize-set-variable 'eshell-ls-use-in-dired orig) 46 | +;; (and (buffer-live-p buf) (kill-buffer))))) 47 | 48 | 49 | (provide 'em-ls-test) 50 | -------------------------------------------------------------------------------- /overlays/emacs/patches/esh-buf-stack.patch: -------------------------------------------------------------------------------- 1 | --- a/esh-buf-stack.el 2 | +++ b/esh-buf-stack.el 3 | @@ -52,6 +52,7 @@ 4 | "Pop a command from the buffer stack." 5 | (interactive) 6 | (when *eshell-buffer-stack* 7 | + (goto-char (point-max)) 8 | (insert (pop *eshell-buffer-stack*)))) 9 | 10 | ;;;###autoload 11 | -------------------------------------------------------------------------------- /overlays/emacs/patches/git-link.patch: -------------------------------------------------------------------------------- 1 | --- a/git-link.el 2 | +++ b/git-link.el 3 | @@ -207,7 +207,8 @@ As an example, \"gitlab\" will match with both \"gitlab.com\" and 4 | (defun git-link--branch () 5 | (or (git-link--get-config "git-link.branch") 6 | git-link-default-branch 7 | - (git-link--current-branch))) 8 | + (git-link--current-branch) 9 | + (car (git-link--exec "rev-parse" "HEAD")))) 10 | 11 | (defun git-link--remote () 12 | (let* ((branch (git-link--current-branch)) 13 | -------------------------------------------------------------------------------- /overlays/emacs/patches/haskell-mode-stylish-args.patch: -------------------------------------------------------------------------------- 1 | commit 42243f5565a50c284f73f31cf4a559e0fd7e9212 2 | Author: Ivan Malison 3 | Date: Mon May 13 14:16:29 2019 -0700 4 | 5 | Add support for passing arguments to the command specified by haskell-mode-stylish-haskell-path 6 | 7 | diff --git a/haskell-commands.el b/haskell-commands.el 8 | index b089855..7d59dbf 100644 9 | --- a/haskell-commands.el 10 | +++ b/haskell-commands.el 11 | @@ -43,6 +43,11 @@ 12 | :group 'haskell 13 | :type 'string) 14 | 15 | +(defcustom haskell-mode-stylish-haskell-args nil 16 | + "Arguments to pass to program specified by haskell-mode-stylish-haskell-path." 17 | + :group 'haskell 18 | + :type 'list) 19 | + 20 | (defcustom haskell-interactive-set-+c 21 | t 22 | "Issue ':set +c' in interactive session to support type introspection." 23 | @@ -806,9 +811,9 @@ stylish-haskell executable. This function tries to preserve 24 | cursor position and markers by using 25 | `haskell-mode-buffer-apply-command'." 26 | (interactive) 27 | - (haskell-mode-buffer-apply-command haskell-mode-stylish-haskell-path)) 28 | + (haskell-mode-buffer-apply-command haskell-mode-stylish-haskell-path haskell-mode-stylish-haskell-args)) 29 | 30 | -(defun haskell-mode-buffer-apply-command (cmd) 31 | +(defun haskell-mode-buffer-apply-command (cmd &optional args) 32 | "Execute shell command CMD with current buffer as input and output. 33 | Use buffer as input and replace the whole buffer with the 34 | output. If CMD fails the buffer remains unchanged." 35 | @@ -817,9 +822,9 @@ output. If CMD fails the buffer remains unchanged." 36 | (err-file (make-temp-file "stylish-error"))) 37 | (unwind-protect 38 | (let* ((_errcode 39 | - (call-process-region (point-min) (point-max) cmd nil 40 | - `((:file ,out-file) ,err-file) 41 | - nil)) 42 | + (apply 'call-process-region (point-min) (point-max) cmd nil 43 | + `((:file ,out-file) ,err-file) 44 | + nil args)) 45 | (err-file-empty-p 46 | (equal 0 (nth 7 (file-attributes err-file)))) 47 | (out-file-empty-p 48 | -------------------------------------------------------------------------------- /overlays/emacs/patches/haskell-mode.patch: -------------------------------------------------------------------------------- 1 | --- a/haskell-mode.el 2 | +++ b/haskell-mode.el 3 | @@ -1043,7 +1043,7 @@ To be added to `flymake-init-create-temp-buffer-copy'." 4 | (split-string haskell-saved-check-command)))) 5 | (list (car checker-elts) 6 | (append (cdr checker-elts) 7 | - (list (flymake-init-create-temp-buffer-copy 8 | + (list (flymake-proc-init-create-temp-buffer-copy 9 | 'flymake-create-temp-inplace)))))) 10 | 11 | (add-to-list 'flymake-allowed-file-name-masks '("\\.l?hs\\'" haskell-flymake-init)) 12 | -------------------------------------------------------------------------------- /overlays/emacs/patches/helm-google.patch: -------------------------------------------------------------------------------- 1 | --- a/helm-google.el 2 | +++ b/helm-google.el 3 | @@ -73,9 +73,7 @@ searches you will want to use `www.google.TLD'." 4 | "\n" "" 5 | (with-temp-buffer 6 | (insert html) 7 | - (if (fboundp 'html2text) 8 | - (html2text) 9 | - (shr-render-region (point-min) (point-max))) 10 | + (shr-render-region (point-min) (point-max)) 11 | (buffer-substring-no-properties (point-min) (point-max))))) 12 | 13 | (defmacro helm-google--with-buffer (buf &rest body) 14 | -------------------------------------------------------------------------------- /overlays/emacs/patches/hyperbole.patch: -------------------------------------------------------------------------------- 1 | --- a/hyperbole.el 2 | +++ b/hyperbole.el 3 | @@ -280,12 +280,12 @@ Entry format is: (key-description key-sequence key-binding)." 4 | ;; button renames without invoking the Hyperbole menu. 5 | ;; 6 | ;; Don't override local bindings of this key. 7 | - (hkey-maybe-global-set-key "\C-c\C-r" 'hui:ebut-rename t) 8 | + ;; (hkey-maybe-global-set-key "\C-c\C-r" 'hui:ebut-rename t) 9 | ;; 10 | ;; Binds {C-c RET} to select larger and larger synctactical units in a 11 | ;; buffer when invoked repeatedly, showing in the minibuffer the type 12 | ;; of unit selected each time. 13 | - (hkey-maybe-global-set-key "\C-c\C-m" 'hui-select-thing) 14 | + ;; (hkey-maybe-global-set-key "\C-c\C-m" 'hui-select-thing) 15 | ;; 16 | ;; Binds {C-c \} to interactively manage windows and frames. 17 | (hkey-maybe-global-set-key "\C-c\\" 'hycontrol-enable-windows-mode) 18 | Re-enable Hyperbole after a workaround 19 | @@ -262,13 +262,13 @@ Entry format is: (key-description key-sequence key-binding)." 20 | ;; commands from the keyboard. This is most useful for rapidly creating 21 | ;; Hyperbole link buttons from the keyboard without invoking the Hyperbole 22 | ;; menu. Only works if Hyperbole is run under a window system. 23 | - (when (hyperb:window-system) 24 | - (if (eq (global-key-binding "\M-o") 'facemenu-keymap) 25 | - ;; Override facemenu package that adds a keymap on M-o, 26 | - ;; since this binding is more important to Hyperbole 27 | - ;; users. 28 | - (hkey-global-set-key "\M-o" 'hkey-operate) 29 | - (hkey-maybe-global-set-key "\M-o" 'hkey-operate))) 30 | + ;; (when (hyperb:window-system) 31 | + ;; (if (eq (global-key-binding "\M-o") 'facemenu-keymap) 32 | + ;; ;; Override facemenu package that adds a keymap on M-o, 33 | + ;; ;; since this binding is more important to Hyperbole 34 | + ;; ;; users. 35 | + ;; (hkey-global-set-key "\M-o" 'hkey-operate) 36 | + ;; (hkey-maybe-global-set-key "\M-o" 'hkey-operate))) 37 | ;; 38 | ;; Binds {C-c @} to created a user-specified sized grid of windows 39 | ;; displaying different buffers. 40 | --- a/hmouse-drv.el 41 | +++ b/hmouse-drv.el 42 | @@ -431,10 +431,10 @@ Return non-nil iff associated documentation is found." 43 | (interactive) 44 | (hkey-help 'assist)) 45 | 46 | -;; Overload help-mode quit-window function to support Hyperbole 47 | -;; hkey--wconfig window configurations. 48 | -(unless (eq (symbol-function #'quit-window) #'hkey-help-hide) 49 | - (defalias 'hkey-quit-window (hypb:function-copy #'quit-window))) 50 | +;; ;; Overload help-mode quit-window function to support Hyperbole 51 | +;; ;; hkey--wconfig window configurations. 52 | +;; (unless (eq (symbol-function #'quit-window) #'hkey-help-hide) 53 | +;; (defalias 'hkey-quit-window (hypb:function-copy #'quit-window))) 54 | 55 | ;;;###autoload 56 | (defun hkey-help-hide (&optional kill window) 57 | @@ -451,7 +451,7 @@ details." 58 | (hkey-quit-window kill window))) 59 | (setq hkey--wconfig nil)) 60 | 61 | -(defalias 'quit-window 'hkey-help-hide) 62 | +;; (defalias 'quit-window 'hkey-help-hide) 63 | 64 | ;; Newer versions of Emacs define this variable but older versions, 65 | ;; e.g. Emacs 22, do not. Calls to the `with-help-buffer' macro 66 | -------------------------------------------------------------------------------- /overlays/emacs/patches/indent-shift.patch: -------------------------------------------------------------------------------- 1 | --- a/indent-shift.el 2 | +++ b/indent-shift.el 3 | @@ -30,7 +30,7 @@ 4 | "Rigidly indent region. 5 | Region is from START to END. Move 6 | COUNT number of spaces if it is non-nil otherwise use 7 | -`tab-width'." 8 | +`4'." 9 | (interactive 10 | (if mark-active 11 | (list (region-beginning) (region-end) current-prefix-arg) 12 | @@ -39,7 +39,7 @@ COUNT number of spaces if it is non-nil otherwise use 13 | current-prefix-arg))) 14 | (if count 15 | (setq count (prefix-numeric-value count)) 16 | - (setq count tab-width)) 17 | + (setq count 4)) 18 | (when (> count 0) 19 | (let ((deactivate-mark nil)) 20 | (save-excursion 21 | @@ -55,7 +55,7 @@ COUNT number of spaces if it is non-nil otherwise use 22 | (defun indent-shift-right (start end &optional count) 23 | "Indent region between START and END rigidly to the right. 24 | If COUNT has been specified indent by that much, otherwise look at 25 | -`tab-width'." 26 | +`4'." 27 | (interactive 28 | (if mark-active 29 | (list (region-beginning) (region-end) current-prefix-arg) 30 | @@ -65,7 +65,7 @@ If COUNT has been specified indent by that much, otherwise look at 31 | (let ((deactivate-mark nil)) 32 | (if count 33 | (setq count (prefix-numeric-value count)) 34 | - (setq count tab-width)) 35 | + (setq count 4)) 36 | (indent-rigidly start end count))) 37 | 38 | (add-to-list 'debug-ignored-errors "^Can't shift all lines enough") 39 | -------------------------------------------------------------------------------- /overlays/emacs/patches/magit.patch: -------------------------------------------------------------------------------- 1 | --- a/lisp/magit-git.el 2 | +++ b/lisp/magit-git.el 3 | @@ -754,16 +754,41 @@ 4 | 5 | ;;; Revisions and References 6 | 7 | +(defvar magit--rev-parse-toplevel-cache (make-hash-table :test #'equal)) 8 | +(defvar magit--rev-parse-cdup-cache (make-hash-table :test #'equal)) 9 | +(defvar magit--rev-parse-git-dir-cache (make-hash-table :test #'equal)) 10 | + 11 | +(defmacro magit--use-rev-parse-cache (cmd args) 12 | + `(pcase ,args 13 | + ('("--show-toplevel") 14 | + (or (gethash default-directory magit--rev-parse-toplevel-cache) 15 | + (let ((dir ,cmd)) 16 | + (puthash default-directory dir magit--rev-parse-toplevel-cache) 17 | + dir))) 18 | + ('("--show-cdup") 19 | + (or (gethash default-directory magit--rev-parse-cdup-cache) 20 | + (let ((dir ,cmd)) 21 | + (puthash default-directory dir magit--rev-parse-cdup-cache) 22 | + dir))) 23 | + ('("--git-dir") 24 | + (or (gethash default-directory magit--rev-parse-git-dir-cache) 25 | + (let ((dir ,cmd)) 26 | + (puthash default-directory dir magit--rev-parse-git-dir-cache) 27 | + dir))) 28 | + (_ ,cmd))) 29 | + 30 | (defun magit-rev-parse (&rest args) 31 | "Execute `git rev-parse ARGS', returning first line of output. 32 | -If there is no output, return nil." 33 | - (apply #'magit-git-string "rev-parse" args)) 34 | + If there is no output, return nil." 35 | + (magit--use-rev-parse-cache 36 | + (apply #'magit-git-string "rev-parse" args) args)) 37 | 38 | (defun magit-rev-parse-safe (&rest args) 39 | "Execute `git rev-parse ARGS', returning first line of output. 40 | -If there is no output, return nil. Like `magit-rev-parse' but 41 | -ignore `magit-git-debug'." 42 | - (apply #'magit-git-str "rev-parse" args)) 43 | + If there is no output, return nil. Like `magit-rev-parse' but 44 | + ignore `magit-git-debug'." 45 | + (magit--use-rev-parse-cache 46 | + (apply #'magit-git-str "rev-parse" args) args)) 47 | 48 | (defun magit-rev-parse-p (&rest args) 49 | "Execute `git rev-parse ARGS', returning t if it prints \"true\". 50 | 51 | -------------------------------------------------------------------------------- /overlays/emacs/patches/multi-term.patch: -------------------------------------------------------------------------------- 1 | --- a/multi-term.el 2 | +++ b/multi-term.el 3 | @@ -345,13 +345,13 @@ So please turn on this option if you want to skip `multi-term' dedicated window 4 | 5 | Default is nil." 6 | :type 'boolean 7 | - :set (lambda (symbol value) 8 | - (set symbol value) 9 | - ;; ad-advised-definition-p no longer exists on Emacs 24.4 as of 2014-01-03. 10 | - (when (fboundp 'multi-term-dedicated-handle-other-window-advice) 11 | - (if (fboundp 'ad-advised-definition-p) 12 | - (when (ad-advised-definition-p 'other-window) 13 | - (multi-term-dedicated-handle-other-window-advice value)) 14 | - (when (ad-is-advised 'other-window) 15 | - (multi-term-dedicated-handle-other-window-advice value))))) 16 | + ;; :set (lambda (symbol value) 17 | + ;; (set symbol value) 18 | + ;; ;; ad-advised-definition-p no longer exists on Emacs 24.4 as of 2014-01-03. 19 | + ;; (when (fboundp 'multi-term-dedicated-handle-other-window-advice) 20 | + ;; (if (fboundp 'ad-advised-definition-p) 21 | + ;; (when (ad-advised-definition-p 'other-window) 22 | + ;; (multi-term-dedicated-handle-other-window-advice value)) 23 | + ;; (when (ad-is-advised 'other-window) 24 | + ;; (multi-term-dedicated-handle-other-window-advice value))))) 25 | :group 'multi-term) 26 | 27 | (defcustom multi-term-dedicated-select-after-open-p nil 28 | -------------------------------------------------------------------------------- /overlays/emacs/patches/noflet.patch: -------------------------------------------------------------------------------- 1 | --- a/noflet.el 2 | +++ b/noflet.el 3 | @@ -28,6 +28,7 @@ 4 | 5 | ;;; Code: 6 | 7 | +(require 'dash) 8 | (eval-when-compile (require 'cl)) 9 | (if (version< emacs-version "24.4.1") 10 | (load-library "cl-indent") 11 | -------------------------------------------------------------------------------- /overlays/emacs/patches/org-ref.patch: -------------------------------------------------------------------------------- 1 | --- a/org-ref-ivy-cite.el 2 | +++ b/org-ref-ivy-cite.el 3 | @@ -30,6 +30,7 @@ 4 | 5 | ;;; Code: 6 | (require 'ivy) 7 | +(require 'org-ref-core) 8 | (require 'org-ref-bibtex) 9 | (require 'org-ref-citeproc) 10 | (require 'bibtex-completion) 11 | -------------------------------------------------------------------------------- /overlays/emacs/patches/pass.patch: -------------------------------------------------------------------------------- 1 | --- a/pass.el 2 | +++ b/pass.el 3 | @@ -216,7 +216,7 @@ When called with a prefix argument ARG, visit the entry file." 4 | It creates an empty entry file, and visit it." 5 | (let ((entry (format "%s.gpg" (read-string "Password entry: "))) 6 | (default-directory (password-store-dir))) 7 | - (make-directory (file-name-directory entry) t) 8 | + ;; (make-directory (file-name-directory entry) t) 9 | (find-file (expand-file-name entry (password-store-dir))))) 10 | 11 | (defun pass-insert-generated () 12 | @@ -665,7 +665,6 @@ 13 | 14 | \\{pass-view-mode-map}" 15 | (pass-view-toggle-password) 16 | - (pass-view--prepare-otp) 17 | (setq-local font-lock-defaults '(pass-view-font-lock-keywords t)) 18 | (font-lock-mode 1) 19 | (message 20 | -------------------------------------------------------------------------------- /overlays/emacs/patches/pdf-tools.patch: -------------------------------------------------------------------------------- 1 | diff --git a/server/poppler-hack.cc b/server/poppler-hack.cc 2 | index 427f9df..ca92716 100644 3 | --- a/server/poppler-hack.cc 4 | +++ b/server/poppler-hack.cc 5 | @@ -54,7 +54,7 @@ GType poppler_annot_markup_get_type (void) G_GNUC_CONST; 6 | // This function does not modify its argument s, but for 7 | // compatibility reasons (e.g. getLength in GooString.h before 2015) 8 | // with older poppler code, it can't be declared as such. 9 | - char *_xpoppler_goo_string_to_utf8(/* const */ GooString *s) 10 | + char *_xpoppler_goo_string_to_utf8(const GooString *s) 11 | { 12 | char *result; 13 | 14 | @@ -88,7 +88,7 @@ GType poppler_annot_markup_get_type (void) G_GNUC_CONST; 15 | // Set the rectangle of an annotation. It was first added in v0.26. 16 | void xpoppler_annot_set_rectangle (PopplerAnnot *a, PopplerRectangle *rectangle) 17 | { 18 | - GooString *state = (GooString*) a->annot->getAppearState (); 19 | + const GooString *state = (GooString*) a->annot->getAppearState (); 20 | char *ustate = _xpoppler_goo_string_to_utf8 (state); 21 | 22 | a->annot->setRect (rectangle->x1, rectangle->y1, 23 | -------------------------------------------------------------------------------- /overlays/emacs/patches/sky-color-clock.patch: -------------------------------------------------------------------------------- 1 | --- a/sky-color-clock.el 2 | +++ b/sky-color-clock.el 3 | @@ -192,7 +192,7 @@ 4 | (sunset (+ 12 sunset-time-from-noon))) 5 | (setq sky-color-clock--bg-color-gradient 6 | (sky-color-clock--make-gradient 7 | - (cons (- sunrise 2.0) "#111111") 8 | + (cons (- sunrise 2.0) "#999999") 9 | (cons (- sunrise 1.5) "#4d548a") 10 | (cons (- sunrise 1.0) "#c486b1") 11 | (cons (- sunrise 0.5) "#ee88a0") 12 | @@ -203,7 +203,7 @@ 13 | (cons (- sunset 1.0) "#f1e17c") 14 | (cons (- sunset 0.5) "#f86b10") 15 | (cons sunset "#100028") 16 | - (cons (+ sunset 0.5) "#111111"))))) 17 | + (cons (+ sunset 0.5) "#999999"))))) 18 | 19 | (defun sky-color-clock--pick-bg-color (time &optional cloudiness) 20 | "Pick a color from sky-color-clock--bg-color-gradient and 21 | -------------------------------------------------------------------------------- /overlays/emacs/rs-gnus-summary.el: -------------------------------------------------------------------------------- 1 | ;; rs-gnus-summary.el -- Auxiliary summary mode commands for Gnus 2 | ;; $Id: rs-gnus-summary.el,v 1.29 2007/10/20 15:00:06 ste Exp $ 3 | 4 | ;; Author: Reiner Steib 5 | ;; Keywords: news 6 | ;; X-URL: http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/gnus/rs-gnus-summary.el 7 | 8 | ;;; This program is free software; you can redistribute it and/or modify 9 | ;;; it under the terms of the GNU General Public License as published by 10 | ;;; the Free Software Foundation; either version 2 of the License, or 11 | ;;; (at your option) any later version. 12 | ;;; 13 | ;;; This program is distributed in the hope that it will be useful, 14 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ;;; GNU General Public License for more details. 17 | ;;; 18 | ;;; You should have received a copy of the GNU General Public License 19 | ;;; along with this program; if not, write to the Free Software 20 | ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 | 22 | ;;; Commentary: 23 | 24 | ;; Some additional summary mode commands for Gnus 25 | 26 | ;;; Installation: 27 | 28 | ;; Put this file in a directory that's in your `load-path', 29 | ;; e.g. ~/lisp: 30 | ;; (add-to-list 'load-path "~/lisp") 31 | ;; and load it with 32 | ;; (require 'rs-gnus-summary) 33 | 34 | ;; Usage: 35 | 36 | ;; Setup all: 37 | ;; (rs-gnus-summary-line-initialize) 38 | 39 | ;; Usage for the format functions: 40 | 41 | ;; ;; Alias for the content-type function: 42 | ;; (defalias 'gnus-user-format-function-ct 'rs-gnus-summary-line-content-type) 43 | ;; ;; Alias for the size function: 44 | ;; (defalias 'gnus-user-format-function-size 'rs-gnus-summary-line-message-size) 45 | ;; Usage for the summary tree functions: 46 | 47 | ;; (rs-gnus-summary-tree-arrows-rs) 48 | 49 | ;; Usage for the balloon face: 50 | 51 | ;; (setq gnus-balloon-face-0 'rs-gnus-balloon-0) 52 | ;; (setq gnus-balloon-face-1 'rs-gnus-balloon-1) 53 | 54 | ;;; Code: 55 | 56 | (eval-when-compile 57 | (require 'nnheader)) 58 | 59 | ;;;###autoload 60 | (defun rs-gnus-summary-tree-arrows-ascii-default () 61 | "Use default tree layout with ascii arrows." 62 | ;; See `gnus-sum.el'. Useful for restoring defaults. 63 | (interactive) 64 | (setq 65 | ;; Defaults from `gnus-sum.el' 66 | gnus-sum-thread-tree-false-root "> " 67 | gnus-sum-thread-tree-single-indent "" 68 | gnus-sum-thread-tree-root "> " 69 | gnus-sum-thread-tree-vertical "| " 70 | gnus-sum-thread-tree-leaf-with-other "+-> " 71 | gnus-sum-thread-tree-single-leaf " \\-> " 72 | gnus-sum-thread-tree-indent " ") 73 | (gnus-message 5 "Using default ascii tree layout.")) 74 | 75 | ;;;###autoload 76 | (defun rs-gnus-summary-tree-arrows-ascii () 77 | "Use tree layout with ascii arrows." 78 | ;; Slighlty modified from default values. 79 | (interactive) 80 | (setq 81 | gnus-sum-thread-tree-false-root "+ " 82 | gnus-sum-thread-tree-single-indent "" 83 | gnus-sum-thread-tree-root "> " 84 | gnus-sum-thread-tree-vertical "| " 85 | gnus-sum-thread-tree-leaf-with-other "+-> " 86 | gnus-sum-thread-tree-single-leaf "\\-> " ;; "\\" is _one_ char 87 | gnus-sum-thread-tree-indent " ") 88 | (gnus-message 5 "Using ascii tree layout.")) 89 | 90 | ;;;###autoload 91 | (defun rs-gnus-summary-tree-arrows-latin () 92 | "Use default tree layout with ascii arrows (RS)." 93 | (interactive) 94 | (setq ;; × 95 | gnus-sum-thread-tree-false-root "÷» " 96 | gnus-sum-thread-tree-single-indent "== " 97 | gnus-sum-thread-tree-root "×» " 98 | gnus-sum-thread-tree-vertical "|" 99 | gnus-sum-thread-tree-leaf-with-other "+-> " 100 | gnus-sum-thread-tree-single-leaf "\\-> " ;; "\\" is _one_ char 101 | gnus-sum-thread-tree-indent " ") 102 | (gnus-message 5 "Using tree layout with latin chars.")) 103 | 104 | ;;;###autoload 105 | (defalias 'rs-gnus-summary-tree-arrows 'rs-gnus-summary-tree-arrows-wide) 106 | 107 | ;;;###autoload 108 | (defun rs-gnus-summary-tree-arrows-wide () 109 | "Use tree layout with wide unicode arrows." 110 | (interactive) 111 | (setq 112 | gnus-sum-thread-tree-false-root "┈┬──▷ " 113 | gnus-sum-thread-tree-single-indent " ● " 114 | gnus-sum-thread-tree-root "┌─▶ " 115 | gnus-sum-thread-tree-vertical "│" 116 | gnus-sum-thread-tree-leaf-with-other "├┬─► " 117 | gnus-sum-thread-tree-single-leaf "╰┬─► " 118 | gnus-sum-thread-tree-indent " ") 119 | (gnus-message 5 "Using tree layout with wide unicode arrows.")) 120 | 121 | ;;;###autoload 122 | (defun rs-gnus-summary-tree-arrows-test () 123 | "Use tree layout with unicode arrows." 124 | (interactive) 125 | (setq 126 | gnus-sum-thread-tree-false-root " ╤═▷ " 127 | gnus-sum-thread-tree-single-indent "● " ;; " ▷ " 128 | gnus-sum-thread-tree-root "┌▶ " 129 | gnus-sum-thread-tree-vertical "│" 130 | gnus-sum-thread-tree-leaf-with-other "├┬► " 131 | gnus-sum-thread-tree-single-leaf "╰─► " 132 | gnus-sum-thread-tree-indent " ") 133 | (gnus-message 5 "Using tree layout with unicode arrows.")) 134 | 135 | ;;;###autoload 136 | (defun rs-gnus-summary-tree-arrows-01 () 137 | "Use tree layout with unicode arrows." 138 | ;; Suggested by Reiner Steib 139 | ;; 140 | (interactive) 141 | (setq 142 | gnus-sum-thread-tree-false-root "┌▷ " 143 | gnus-sum-thread-tree-single-indent " ▷ " 144 | gnus-sum-thread-tree-root "┌┬▶ " 145 | gnus-sum-thread-tree-vertical "│" 146 | gnus-sum-thread-tree-leaf-with-other "├┬► " 147 | gnus-sum-thread-tree-single-leaf "╰┬► " 148 | gnus-sum-thread-tree-indent " ") 149 | (gnus-message 5 "Using tree layout with arrows.")) 150 | 151 | ;;;###autoload 152 | (defun rs-gnus-summary-tree-lines-rs () 153 | "Use tree layout with unicode lines." 154 | ;; Suggested by Reiner Steib 155 | (interactive) 156 | (setq 157 | ;; gnus-summary-line-format "%«%U%R%z%u&ct; %4k: %B%»%(%-20,20f%) %s\n" 158 | ;; gnus-sum-thread-tree-false-root " " 159 | gnus-sum-thread-tree-single-indent " " 160 | gnus-sum-thread-tree-root "┌" 161 | gnus-sum-thread-tree-vertical "│" 162 | gnus-sum-thread-tree-leaf-with-other "├╮ " 163 | gnus-sum-thread-tree-single-leaf "╰─╮") 164 | (gnus-message 5 "Using tree layout with unicode arrows.")) 165 | 166 | ;;;###autoload 167 | (defun rs-gnus-summary-tree-arrows-mt () 168 | "Use tree layout with unicode arrows." 169 | ;; Suggested by Mark Trettin in 170 | ;; 171 | ;; gnus-summary-line-format "%U%R%z %B%-23,23n %s\n" 172 | (interactive) 173 | (setq 174 | gnus-sum-thread-tree-false-root " " 175 | gnus-sum-thread-tree-single-indent " ▷" 176 | gnus-sum-thread-tree-root "┌▶" 177 | gnus-sum-thread-tree-vertical "│" 178 | gnus-sum-thread-tree-leaf-with-other "├┬►" 179 | gnus-sum-thread-tree-single-leaf "╰─►" 180 | gnus-sum-thread-tree-indent " ") 181 | (gnus-message 5 "Using tree layout with unicode arrows.")) 182 | 183 | ;;;###autoload 184 | (defun rs-gnus-summary-tree-lines () 185 | "Use tree layout with unicode lines." 186 | ;; Suggested by Jesper Harder in " 187 | (interactive) 188 | (setq 189 | ;; gnus-sum-thread-tree-false-root "> " 190 | gnus-sum-thread-tree-single-indent "" 191 | gnus-sum-thread-tree-root "" 192 | gnus-sum-thread-tree-vertical "│" 193 | gnus-sum-thread-tree-leaf-with-other "├╮ " 194 | gnus-sum-thread-tree-single-leaf "╰─╮ ") 195 | (gnus-message 5 "Using tree layout with unicode lines.")) 196 | 197 | ;;;###autoload 198 | (defcustom rs-gnus-summary-line-content-type-alist 199 | '(("^text/plain" " ") 200 | ("^text/html" "h") 201 | ("^message/rfc822" "f") ;; forwarded 202 | ("^multipart/mixed" "m") 203 | ("^multipart/alternative" "a") 204 | ("^multipart/related" "r") 205 | ("^multipart/signed" "s") 206 | ("^multipart/encrypted" "e") 207 | ("^multipart/report" "t") 208 | ("^application/" "A") 209 | ("^image/" "I")) 210 | "Alist of regular expressions and summary line indicators." 211 | :group 'gnus-summary-format 212 | :type '(repeat (list (regexp :tag "Regexp") 213 | (string :tag "Indicator")))) 214 | 215 | ;;;###autoload 216 | (defun rs-gnus-summary-line-content-type (header) 217 | "Display content type of message in summary line. 218 | 219 | This function is intended to be used in `gnus-summary-line-format-alist', with 220 | \(defalias 'gnus-user-format-function-X 'rs-gnus-summary-line-content-type). 221 | See (info \"(gnus)Group Line Specification\"). 222 | 223 | You need to add `Content-Type' to `nnmail-extra-headers' and 224 | `gnus-extra-headers', see Info node `(gnus)To From Newsgroups'." 225 | (let ((case-fold-search t) 226 | (ctype (or (cdr (assq 'Content-Type (mail-header-extra header))) 227 | "text/plain")) 228 | indicator) 229 | (mapc (lambda (el) 230 | (when (string-match (car el) ctype) 231 | (setq indicator (cadr el)))) 232 | rs-gnus-summary-line-content-type-alist) 233 | (if indicator 234 | indicator 235 | "o"))) 236 | 237 | ;;;###autoload 238 | (defun rs-gnus-summary-line-message-size (head) 239 | "Return pretty-printed version of message size. 240 | 241 | Like `gnus-summary-line-message-size' but more verbose. This function is 242 | intended to be used in `gnus-summary-line-format-alist', with 243 | \(defalias 'gnus-user-format-function-X 'rs-gnus-summary-line-message-size). 244 | 245 | See (info \"(gnus)Group Line Specification\")." 246 | (let ((c (or (mail-header-chars head) -1))) 247 | (gnus-message 9 "c=%s chars in article %s" c (mail-header-number head)) 248 | (cond ((< c 0) "n/a") ;; chars not available 249 | ((< c (* 1000)) (format "%db" c)) 250 | ((< c (* 1000 10)) (format "%1.1fk" (/ c 1024.0))) 251 | ((< c (* 1000 1000)) (format "%dk" (/ c 1024.0))) 252 | ((< c (* 1000 10000)) (format "%1.1fM" (/ c (* 1024.0 1024)))) 253 | (t (format "%dM" (/ c (* 1024.0 1024))))))) 254 | 255 | ;;;###autoload 256 | (defun rs-gnus-summary-line-score (head) 257 | "Return pretty-printed version of article score. 258 | 259 | See (info \"(gnus)Group Line Specification\")." 260 | (let ((c (gnus-summary-article-score (mail-header-number head)))) 261 | ;; (gnus-message 9 "c=%s chars in article %s" c (mail-header-number head)) 262 | (cond ((< c -1000) "vv") 263 | ((< c -100) " v") 264 | ((< c -10) "--") 265 | ((< c 0) " -") 266 | ((= c 0) " ") 267 | ((< c 10) " +") 268 | ((< c 100) "++") 269 | ((< c 1000) " ^") 270 | (t "^^")))) 271 | 272 | (defcustom rs-gnus-summary-line-label-alist 273 | '(("Important" "Im") 274 | ("Work" "Wo") 275 | ("Personal" "Pe") 276 | ("To do" "TD") 277 | ("Later" "La") 278 | ("Need reply" "NR")) 279 | "Alist of regular expressions and summary line indicators." 280 | :group 'gnus-summary-format 281 | :type '(repeat (list (regexp :tag "Regexp") 282 | (string :tag "Indicator")))) 283 | 284 | ;; http://www.fas.harvard.edu/computing/kb/kb1059.html 285 | ;; http://ilias.ca/blog/2005/09/gmail-labels-in-thunderbird.html 286 | ;; http://thread.gmane.org/m2n05mr2iv.fsf%40catbert.dok.org 287 | 288 | ;;;###autoload 289 | (defun rs-gnus-summary-line-label (header) 290 | "Display label of message in summary line. 291 | 292 | This function is intended to be used in `gnus-summary-line-format-alist', with 293 | \(defalias 'gnus-user-format-function-X 'rs-gnus-summary-line-label). 294 | See (info \"(gnus)Group Line Specification\"). 295 | 296 | You need to add `X-Gnus-Label' to `nnmail-extra-headers' and 297 | `gnus-extra-headers', see Info node `(gnus)To From Newsgroups'." 298 | (let ((case-fold-search t) 299 | (label (or (cdr (assq 'X-Gnus-Label (mail-header-extra header))) 300 | "")) 301 | indicator) 302 | (mapc (lambda (el) 303 | (when (string-match (car el) label) 304 | (setq indicator (cadr el)))) 305 | rs-gnus-summary-line-label-alist) 306 | (if indicator 307 | indicator 308 | label))) 309 | 310 | ;;;###autoload 311 | (defun rs-gnus-summary-limit-to-label (regexp &optional not-matching) 312 | "Limit the summary buffer to articles that match a label." 313 | (interactive 314 | (list (read-string 315 | (format "%s label (regexp): " 316 | (if current-prefix-arg "Exclude" "Limit to"))) 317 | current-prefix-arg)) 318 | (gnus-summary-limit-to-extra 'X-Gnus-Label regexp not-matching)) 319 | 320 | ;;;###autoload 321 | (defun rs-gnus-summary-line-list-subject (head) 322 | "Return modified subject for mailing lists. 323 | 324 | This function is intended to be used in `gnus-summary-line-format-alist', with 325 | \(defalias 'gnus-user-format-function-X 'rs-gnus-summary-line-list-subject). 326 | 327 | See (info \"(gnus)Group Line Specification\")." 328 | (let ((subj (or (mail-header-subject head) "")) 329 | type title id) 330 | (when (string-match 331 | (concat ".* SUSE Security \\(Announcement\\|Summary Report\\)" 332 | "[ :]*" 333 | "\\(.*\\) ?(\\(SUSE-[-:SASR0-9:]*\\))") 334 | subj) 335 | (setq type (match-string 1 subj) 336 | title (match-string 2 subj) 337 | id (match-string 3 subj))) 338 | (if (and id type title) 339 | (format "[%s] %s" id (if (>= (length title) 1) 340 | title 341 | (format "*%s*" type))) 342 | subj))) 343 | 344 | 345 | (defalias 'gnus-user-format-function-list-subject 346 | 'rs-gnus-summary-line-list-subject) 347 | 348 | ;; Example... 349 | (defun rs-gnus-summary-line-sender (header) 350 | "Display sender of message in summary line. 351 | 352 | This function is intended to be used in `gnus-summary-line-format-alist', with 353 | \(defalias 'gnus-user-format-function-X 'rs-gnus-summary-line-sender). 354 | See (info \"(gnus)Group Line Specification\"). 355 | 356 | You need to add `Sender' to `nnmail-extra-headers' and 357 | `gnus-extra-headers', see Info node `(gnus)To From Newsgroups'." 358 | (let ((case-fold-search t)) 359 | (or (cdr (assq 'Sender (mail-header-extra header))) 360 | "no sender found"))) 361 | 362 | ;; An example for noffle: 363 | ;; (defun gnus-user-format-function-noffle (header) 364 | ;; "Display noffle status in summary line. 365 | ;; You need to add `X-NOFFLE-Status' to `nnmail-extra-headers' and 366 | ;; `gnus-extra-headers', see Info node `(gnus)To From Newsgroups'." 367 | ;; (let ((case-fold-search t) 368 | ;; (val (or (cdr (assq 'X-NOFFLE-Status (mail-header-extra header))) 369 | ;; "unknown"))) 370 | ;; (gnus-replace-in-string val "^\\(\\w\\).*$" "\\1"))) 371 | 372 | ;;;###autoload 373 | (defun rs-gnus-balloon-0 (window object position) 374 | "Show some informations about the current article. 375 | Informations include size, score, content type and number. 376 | Used as help echo for the summary buffer." 377 | ;; (gnus-message 10 "rs-gnus-balloon-0") 378 | (with-current-buffer object 379 | (let* ((article (get-text-property position 'gnus-number)) 380 | (head (gnus-data-header (gnus-data-find article))) 381 | (chars (mail-header-chars head)) 382 | (size (if (fboundp 'rs-gnus-summary-line-message-size) 383 | (rs-gnus-summary-line-message-size head) 384 | (gnus-summary-line-message-size head))) 385 | (score (gnus-summary-article-score article)) 386 | (ct (gnus-replace-in-string 387 | (or (cdr (assq 'Content-Type (mail-header-extra head))) 388 | "n/a") 389 | "[; ].*$" "")) 390 | (no (mail-header-number head))) 391 | (format "%-10s%s\n%-10s%s\n%-10s%s\n%-10s%s\n%-10s%s\n" 392 | "Size:" size 393 | "Chars:" chars 394 | "Score:" score 395 | "C-Type:" ct 396 | "Number:" no)))) 397 | 398 | ;;;###autoload 399 | (defun rs-gnus-balloon-1 (window object position) 400 | "Show full \"From\", \"Subject\", \"To\", and \"Date\" of the current article. 401 | Used as help echo for the summary buffer." 402 | ;; (gnus-message 10 "rs-gnus-balloon-1") 403 | (with-current-buffer object 404 | (let* ((article (get-text-property position 'gnus-number)) 405 | (head (gnus-data-header (gnus-data-find article))) 406 | (from (mail-header-from head)) 407 | (subject (mail-header-subject head)) 408 | (to (cdr (or (assq 'To (mail-header-extra head))))) 409 | (ng (cdr (or (assq 'Newsgroups (mail-header-extra head))))) 410 | (date (mail-header-date head))) 411 | (format "%-11s%s\n%-11s%s\n%-11s%s\n%-11s%s\n" 412 | "From:" from 413 | "Subject:" subject 414 | "Date:" date 415 | (cond (to "To:") 416 | (ng "Newsgroup:") 417 | (t "To/Ngrp:")) 418 | (or to ng "n/a"))))) 419 | 420 | ;;;###autoload 421 | (defun rs-gnus-summary-line-initialize () 422 | "Setup my summary line." 423 | (interactive) 424 | ;; Alias for the content-type function: 425 | (defalias 'gnus-user-format-function-ct 'rs-gnus-summary-line-content-type) 426 | ;; Alias for the size function: 427 | (defalias 'gnus-user-format-function-size 'rs-gnus-summary-line-message-size) 428 | ;; Alias for the score function: 429 | (defalias 'gnus-user-format-function-score 'rs-gnus-summary-line-score) 430 | ;; 431 | (defalias 'gnus-user-format-function-label 'rs-gnus-summary-line-label) 432 | ;; 433 | ;; Use them: 434 | (setq gnus-balloon-face-0 'rs-gnus-balloon-0) 435 | (setq gnus-balloon-face-1 'rs-gnus-balloon-1) 436 | ;; Unbold face for UTF arrows: (FIXME: Doesn't work on marauder.) 437 | (copy-face 'default 'rs-gnus-face-1) 438 | (setq gnus-face-1 'rs-gnus-face-1) 439 | ;; (set-face-italic-p 'rs-gnus-face-1 nil) 440 | ;; (dolist (el '(gnus-summary-low-ancient-face 441 | ;; gnus-summary-low-read-face 442 | ;; gnus-summary-low-ticked-face 443 | ;; gnus-summary-low-undownloaded-face 444 | ;; gnus-summary-low-unread-face)) 445 | ;; (message "%s" el) 446 | ;; (set-face-italic-p el nil) 447 | ;; (set-face-bold-p el nil) 448 | ;; (sit-for 1)) 449 | (if (or (not window-system) 450 | (string-match "marauder\\|siogo" system-name)) 451 | (rs-gnus-summary-tree-arrows-latin) 452 | (rs-gnus-summary-tree-arrows)) 453 | ;; Set line format: 454 | (setq gnus-summary-line-format 455 | "%«%U%R%u&score;%u&ct; %4u&size;%»%* %(%-20,20f%) %1«%1{%B %}%s%»\n")) 456 | 457 | (defcustom rs-gnus-expirable-authors nil 458 | "List of authors that are used in `rs-gnus-summary-mark-lists-expirable'." 459 | :group 'gnus-summary 460 | :type '(repeat (string :tag "Author"))) 461 | 462 | (defcustom rs-gnus-expirable-subjects nil 463 | "List of subjects that are used in `rs-gnus-summary-mark-lists-expirable'." 464 | :group 'gnus-summary 465 | :type '(repeat (string :tag "Subject"))) 466 | 467 | ;;;###autoload 468 | (defun rs-gnus-summary-mark-lists-expirable () 469 | "Mark some articles (lists, ...) as expirable." 470 | (interactive) 471 | (let ((gnus-summary-generate-hook nil) 472 | (subj (regexp-opt rs-gnus-expirable-subjects t)) 473 | (from (regexp-opt rs-gnus-expirable-authors t))) 474 | (gnus-uu-mark-by-regexp subj) 475 | (autoload 'ignore-errors "cl") 476 | (when (ignore-errors 477 | (progn 478 | (gnus-summary-limit-to-author from) 479 | t)) 480 | (gnus-uu-mark-buffer) 481 | (gnus-summary-pop-limit t)) 482 | (let ((articles (gnus-summary-work-articles nil)) 483 | article) 484 | (save-excursion 485 | (while articles 486 | (gnus-summary-goto-subject (setq article (pop articles))) 487 | (let (gnus-newsgroup-processable) 488 | (gnus-summary-mark-as-expirable 1)) 489 | (gnus-summary-remove-process-mark article))))) 490 | (when (y-or-n-p "Expire articles now? ") 491 | (gnus-summary-expire-articles 'now))) 492 | 493 | ;;;###autoload 494 | (defun rs-gnus-summary-more-headers () 495 | "Force redisplaying of the current article with ..." 496 | (interactive) 497 | (let ((gnus-visible-headers 498 | (concat gnus-visible-headers "\\|^X-\\|^NNTP"))) 499 | (gnus-summary-show-article))) 500 | 501 | ;;;###autoload 502 | (defun rs-gnus-summary-non-boring-headers () 503 | "Force redisplaying of the current article with ..." 504 | (interactive) 505 | (let ((gnus-visible-headers nil)) 506 | (gnus-summary-show-article))) 507 | 508 | ;;;###autoload 509 | (defun rs-gnus-summary-mark-as-expirable-and-next-line(n) 510 | "Mark N articles forward as expirable and go to next line. 511 | Useful in a summary buffer with read articles." 512 | (interactive "p") 513 | (gnus-summary-mark-as-expirable n) 514 | (next-line 1)) 515 | 516 | ;;;###autoload 517 | (defun rs-gnus-summary-mark-as-expirable-dont-move () 518 | "Mark this article expirable. Don't move point." 519 | (interactive) 520 | (gnus-summary-mark-article nil ?E nil)) 521 | 522 | ;;;###autoload 523 | (defun rs-gnus-summary-mark-as-expirable-next-article () 524 | "Mark this article expirable. Move to next article." 525 | (interactive) 526 | (gnus-summary-mark-article nil ?E nil) 527 | (gnus-summary-next-article)) 528 | 529 | ;; Suggested by David Mazieres in 530 | ;; in analogy to `rmail-summary-by-recipients'. Unlike 531 | ;; `rmail-summary-by-recipients', doesn't include From. 532 | 533 | ;;;###autoload 534 | (defun rs-gnus-summary-limit-to-recipient (recipient &optional not-matching) 535 | "Limit the summary buffer to articles with the given RECIPIENT. 536 | 537 | If NOT-MATCHING, exclude RECIPIENT. 538 | 539 | To and Cc headers are checked. You need to include them in 540 | `nnmail-extra-headers'." 541 | ;; Unlike `rmail-summary-by-recipients', doesn't include From. 542 | (interactive 543 | (list (read-string (format "%s recipient (regexp): " 544 | (if current-prefix-arg "Exclude" "Limit to"))) 545 | current-prefix-arg)) 546 | (when (not (equal "" recipient)) 547 | (prog1 (let* ((to 548 | (if (memq 'To nnmail-extra-headers) 549 | (gnus-summary-find-matching 550 | (cons 'extra 'To) recipient 'all nil nil 551 | not-matching) 552 | (gnus-message 553 | 1 "`To' isn't present in `nnmail-extra-headers'") 554 | (sit-for 1) 555 | nil)) 556 | (cc 557 | (if (memq 'Cc nnmail-extra-headers) 558 | (gnus-summary-find-matching 559 | (cons 'extra 'Cc) recipient 'all nil nil 560 | not-matching) 561 | (gnus-message 562 | 1 "`Cc' isn't present in `nnmail-extra-headers'") 563 | (sit-for 1) 564 | nil)) 565 | (articles 566 | (if not-matching 567 | ;; We need the numbers that are in both lists: 568 | (mapcar (lambda (a) 569 | (and (memq a to) a)) 570 | cc) 571 | (nconc to cc)))) 572 | (unless articles 573 | (error "Found no matches for \"%s\"" recipient)) 574 | (gnus-summary-limit articles)) 575 | (gnus-summary-position-point)))) 576 | 577 | ;;;###autoload 578 | (defun rs-gnus-summary-sort-by-recipient (&optional reverse) 579 | "Sort the summary buffer by recipient name alphabetically. 580 | If `case-fold-search' is non-nil, case of letters is ignored. 581 | Argument REVERSE means reverse order." 582 | (interactive "P") 583 | (gnus-summary-sort 'recipient reverse)) 584 | 585 | (defsubst rs-gnus-article-sort-by-recipient (h1 h2) 586 | "Sort articles by recipient." 587 | (string-lessp 588 | (let ((extract (funcall 589 | gnus-extract-address-components 590 | (or (cdr (assq 'To (mail-header-extra h1))) "")))) 591 | (or (car extract) (cadr extract))) 592 | (let ((extract (funcall 593 | gnus-extract-address-components 594 | (or (cdr (assq 'To (mail-header-extra h2))) "")))) 595 | (or (car extract) (cadr extract))))) 596 | 597 | (defun rs-gnus-thread-sort-by-recipient (h1 h2) 598 | "Sort threads by root recipient." 599 | (gnus-article-sort-by-recipient 600 | (gnus-thread-header h1) 601 | (gnus-thread-header h2))) 602 | 603 | ;; Not using my own namespace prefix because `gnus-summary-sort' wants 604 | ;; gnus-thread-sort-by-%s" and "gnus-article-sort-by-%s": 605 | (require 'gnus-sum) 606 | (unless (fboundp 'gnus-article-sort-by-recipient) 607 | (defalias 'gnus-article-sort-by-recipient 608 | 'rs-gnus-article-sort-by-recipient)) 609 | (unless (fboundp 'gnus-thread-sort-by-recipient) 610 | (defalias 'gnus-thread-sort-by-recipient 611 | 'rs-gnus-thread-sort-by-recipient)) 612 | 613 | ;;;###autoload 614 | (defun rs-gnus-summary-score-statistics (&optional ancient quiet) 615 | "Display score statistics for current summary buffer. 616 | 617 | If ANCIENT, also count ancient articles. Returns a list: (high 618 | default low)." 619 | (interactive) 620 | (let ((high 0) (dflt 0) (low 0)) 621 | (dolist (i gnus-newsgroup-scored) 622 | (cond 623 | ;; Ignore ancient articles 624 | ;; ((memq (car i) gnus-newsgroup-ancient) 'ancient) 625 | ;; ((not (memq (car i) gnus-newsgroup-unreads)) 'not-unread) 626 | ((and (not ancient) 627 | (not (memq (car i) gnus-newsgroup-articles))) 628 | 'not-art) 629 | ;; 630 | ((< (cdr i) gnus-summary-default-score) (setq low (1+ low))) 631 | ((> (cdr i) gnus-summary-default-score) (setq high (1+ high))))) 632 | (setq dflt (- (+ (length gnus-newsgroup-articles) 633 | (if ancient 634 | (length gnus-newsgroup-ancient) 635 | 0)) 636 | low high)) 637 | (unless quiet 638 | (gnus-message 1 "Score statistics: %s high, %s default, %s low." 639 | high dflt low)) 640 | (list high dflt low))) 641 | ;; (add-hook 'gnus-summary-prepared-hook 'rs-gnus-summary-score-statistics) 642 | 643 | (defcustom rs-gnus-leafnode-filter-file "/usr/local/etc/leafnode/filters" 644 | "Filter file for leafnode." 645 | ;; May be a tramp file name ("/su:/etc/leafnode/filters") if file is not 646 | ;; writable for the user. 647 | :group 'gnus-summary 648 | :type '(choice (const "/usr/local/etc/leafnode/filters") 649 | (const "/su:/usr/local/etc/leafnode/filters") 650 | (const "/su:/etc/leafnode/filters") 651 | (const "/root@localhost:/etc/leafnode/filters") 652 | file)) 653 | 654 | ;;;###autoload 655 | (defun rs-gnus-leafnode-kill-thread () 656 | "Kill thread from here using leafnode." 657 | (interactive) 658 | (let ((mid (gnus-with-article-buffer (gnus-fetch-field "Message-Id"))) 659 | (file rs-gnus-leafnode-filter-file) 660 | rule) 661 | (gnus-message 9 "Writing kill rule for MID `%s' to file `%s'" mid file) 662 | (with-temp-buffer 663 | (insert "\nnewsgroups = " 664 | (regexp-quote gnus-newsgroup-name) 665 | "\npattern = ^References:.*" 666 | (regexp-quote mid) 667 | "\naction = kill\n") 668 | (append-to-file (point-min) (point-max) file)))) 669 | ;; (define-key gnus-summary-mode-map (kbd "C-c k") 'rs-gnus-leafnode-kill-thread) 670 | 671 | ;; /var/spool/news$ find `ls -d|grep -v '\.'` -name '.overview' |xargs grep 'Postal Lottery:'|awk -F' ' '{print $5}'|xargs -n 1 /usr/local/sbin/applyfilter -n -C 672 | 673 | ;; FIXME: Only half finished! 674 | (defun rs-gnus-summary-applyfilter (subject &optional spoolbase overview) 675 | "Find articles with subject matching SUBJECT and delete them from the spool." 676 | (unless spoolbase 677 | (setq spoolbase "/var/spool/news/")) 678 | (unless overview 679 | (setq overview ".overview")) 680 | (dolist (ent gnus-newsrc-alist) 681 | (let ((full (car ent)) 682 | (level (nth 1 ent)) 683 | overfile) 684 | (unless (string-match "nn.*:" full) 685 | (setq overfile (concat spoolbase 686 | (subst-char-in-string ?. ?/ full) 687 | "/" overview)) 688 | (message overfile))))) 689 | 690 | ;;; provide ourself 691 | 692 | (provide 'rs-gnus-summary) 693 | 694 | ;;; rs-gnus-summary.el ends here 695 | 696 | ;; Local Variables: 697 | ;; coding: utf-8 698 | ;; End: 699 | -------------------------------------------------------------------------------- /overlays/emacs/site-start.el: -------------------------------------------------------------------------------- 1 | ;;; NixOS specific load-path 2 | (setq load-path 3 | (append (reverse (mapcar (lambda (x) (concat x "/share/emacs/site-lisp/")) 4 | (split-string (or (getenv "NIX_PROFILES") "")))) 5 | load-path)) 6 | 7 | ;;; Make `woman' find the man pages 8 | (eval-after-load 'woman 9 | '(setq woman-manpath 10 | (append (reverse (mapcar (lambda (x) (concat x "/share/man/")) 11 | (split-string (or (getenv "NIX_PROFILES") "")))) 12 | woman-manpath))) 13 | 14 | ;;; Make tramp work for remote NixOS machines 15 | (eval-after-load 'tramp 16 | '(add-to-list 'tramp-remote-path "/run/current-system/sw/bin")) 17 | 18 | ;;; C source directory 19 | ;;; 20 | ;;; Computes the location of the C source directory from the path of 21 | ;;; the current file: 22 | ;;; from: /nix/store/-emacs-/share/emacs/site-lisp/site-start.el 23 | ;;; to: /nix/store/-emacs-/share/emacs//src/ 24 | (let ((emacs 25 | (file-name-directory ;; .../emacs/ 26 | (directory-file-name ;; .../emacs/site-lisp 27 | (file-name-directory load-file-name)))) ;; .../emacs/site-lisp/ 28 | (version 29 | (file-name-as-directory 30 | (concat 31 | (number-to-string emacs-major-version) 32 | "." 33 | (number-to-string emacs-minor-version)))) 34 | (src (file-name-as-directory "src"))) 35 | (setq find-function-C-source-directory (concat emacs version src))) 36 | -------------------------------------------------------------------------------- /overlays/emacs/tramp-detect-wrapped-gvfsd.patch: -------------------------------------------------------------------------------- 1 | diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el 2 | index f370abba31..f2806263a9 100644 3 | --- a/lisp/net/tramp-gvfs.el 4 | +++ b/lisp/net/tramp-gvfs.el 5 | @@ -164,7 +164,8 @@ tramp-gvfs-enabled 6 | (and (featurep 'dbusbind) 7 | (tramp-compat-funcall 'dbus-get-unique-name :system) 8 | (tramp-compat-funcall 'dbus-get-unique-name :session) 9 | - (or (tramp-compat-process-running-p "gvfs-fuse-daemon") 10 | + (or (tramp-compat-process-running-p ".gvfsd-fuse-wrapped") 11 | + (tramp-compat-process-running-p "gvfs-fuse-daemon") 12 | (tramp-compat-process-running-p "gvfsd-fuse")))) 13 | "Non-nil when GVFS is available.") 14 | 15 | -------------------------------------------------------------------------------- /overlays/emacs/wrapper.nix: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | # Usage 4 | 5 | `emacs.pkgs.withPackages` takes a single argument: a function from a package 6 | set to a list of packages (the packages that will be available in 7 | Emacs). For example, 8 | ``` 9 | emacs.pkgs.withPackages (epkgs: [ epkgs.evil epkgs.magit ]) 10 | ``` 11 | All the packages in the list should come from the provided package 12 | set. It is possible to add any package to the list, but the provided 13 | set is guaranteed to have consistent dependencies and be built with 14 | the correct version of Emacs. 15 | 16 | # Overriding 17 | 18 | `emacs.pkgs.withPackages` inherits the package set which contains it, so the 19 | correct way to override the provided package set is to override the 20 | set which contains `emacs.pkgs.withPackages`. For example, to override 21 | `emacs.pkgs.emacs.pkgs.withPackages`, 22 | ``` 23 | let customEmacsPackages = 24 | emacs.pkgs.overrideScope (self: super: { 25 | # use a custom version of emacs 26 | emacs = ...; 27 | # use the unstable MELPA version of magit 28 | magit = self.melpaPackages.magit; 29 | }); 30 | in customEmacsPackages.withPackages (epkgs: [ epkgs.evil epkgs.magit ]) 31 | ``` 32 | 33 | */ 34 | 35 | { lib, lndir, makeBinaryWrapper, runCommand, gcc }: 36 | self: 37 | let 38 | inherit (self) emacs; 39 | withNativeCompilation = emacs.withNativeCompilation or false; 40 | withTreeSitter = emacs.withTreeSitter or false; 41 | in 42 | packagesFun: # packages explicitly requested by the user 43 | let 44 | explicitRequires = 45 | if lib.isFunction packagesFun 46 | then packagesFun self 47 | else packagesFun; 48 | 49 | appName = emacs.appName or "Emacs"; 50 | in 51 | runCommand 52 | (lib.appendToName "with-packages" emacs).name 53 | { 54 | inherit emacs explicitRequires; 55 | nativeBuildInputs = [ emacs lndir makeBinaryWrapper ]; 56 | 57 | preferLocalBuild = true; 58 | allowSubstitutes = false; 59 | 60 | # Store all paths we want to add to emacs here, so that we only need to add 61 | # one path to the load lists 62 | deps = runCommand "emacs-packages-deps" 63 | ({ 64 | inherit explicitRequires lndir emacs; 65 | nativeBuildInputs = lib.optional withNativeCompilation gcc; 66 | } // lib.optionalAttrs withNativeCompilation { 67 | inherit (emacs) LIBRARY_PATH; 68 | }) 69 | '' 70 | findInputsOld() { 71 | local pkg="$1"; shift 72 | local var="$1"; shift 73 | local propagatedBuildInputsFiles=("$@") 74 | 75 | # TODO(@Ericson2314): Restore using associative array once Darwin 76 | # nix-shell doesn't use impure bash. This should replace the O(n) 77 | # case with an O(1) hash map lookup, assuming bash is implemented 78 | # well :D. 79 | local varSlice="$var[*]" 80 | # ''${..-} to hack around old bash empty array problem 81 | case "''${!varSlice-}" in 82 | *" $pkg "*) return 0 ;; 83 | esac 84 | unset -v varSlice 85 | 86 | eval "$var"'+=("$pkg")' 87 | 88 | if ! [ -e "$pkg" ]; then 89 | echo "build input $pkg does not exist" >&2 90 | exit 1 91 | fi 92 | 93 | local file 94 | for file in "''${propagatedBuildInputsFiles[@]}"; do 95 | file="$pkg/nix-support/$file" 96 | [[ -f "$file" ]] || continue 97 | 98 | local pkgNext 99 | for pkgNext in $(< "$file"); do 100 | findInputsOld "$pkgNext" "$var" "''${propagatedBuildInputsFiles[@]}" 101 | done 102 | done 103 | } 104 | mkdir -p $out/bin 105 | mkdir -p $out/share/emacs/site-lisp 106 | ${lib.optionalString withNativeCompilation '' 107 | mkdir -p $out/share/emacs/native-lisp 108 | ''} 109 | ${lib.optionalString withTreeSitter '' 110 | mkdir -p $out/lib 111 | ''} 112 | 113 | local requires 114 | for pkg in $explicitRequires; do 115 | findInputsOld $pkg requires propagated-user-env-packages 116 | done 117 | # requires now holds all requested packages and their transitive dependencies 118 | 119 | linkPath() { 120 | local pkg=$1 121 | local origin_path=$2 122 | local dest_path=$3 123 | 124 | # Add the path to the search path list, but only if it exists 125 | if [[ -d "$pkg/$origin_path" ]]; then 126 | $lndir/bin/lndir -silent "$pkg/$origin_path" "$out/$dest_path" 127 | fi 128 | } 129 | 130 | linkEmacsPackage() { 131 | linkPath "$1" "bin" "bin" 132 | linkPath "$1" "share/emacs/site-lisp" "share/emacs/site-lisp" 133 | ${lib.optionalString withNativeCompilation '' 134 | linkPath "$1" "share/emacs/native-lisp" "share/emacs/native-lisp" 135 | ''} 136 | ${lib.optionalString withTreeSitter '' 137 | linkPath "$1" "lib" "lib" 138 | ''} 139 | } 140 | 141 | # Iterate over the array of inputs (avoiding nix's own interpolation) 142 | for pkg in "''${requires[@]}"; do 143 | linkEmacsPackage $pkg 144 | done 145 | 146 | siteStart="$out/share/emacs/site-lisp/site-start.el" 147 | siteStartByteCompiled="$siteStart"c 148 | subdirs="$out/share/emacs/site-lisp/subdirs.el" 149 | subdirsByteCompiled="$subdirs"c 150 | 151 | # A dependency may have brought the original siteStart or subdirs, delete 152 | # it and create our own 153 | # Begin the new site-start.el by loading the original, which sets some 154 | # NixOS-specific paths. Paths are searched in the reverse of the order 155 | # they are specified in, so user and system profile paths are searched last. 156 | # 157 | # NOTE: Avoid displaying messages early at startup by binding 158 | # inhibit-message to t. This would prevent the Emacs GUI from showing up 159 | # prematurely. The messages would still be logged to the *Messages* 160 | # buffer. 161 | rm -f $siteStart $siteStartByteCompiled $subdirs $subdirsByteCompiled 162 | cat >"$siteStart" < "$subdirs" 179 | 180 | # Byte-compiling improves start-up time only slightly, but costs nothing. 181 | $emacs/bin/emacs --batch -f batch-byte-compile "$siteStart" "$subdirs" 182 | 183 | ${lib.optionalString withNativeCompilation '' 184 | $emacs/bin/emacs --batch \ 185 | --eval "(add-to-list 'native-comp-eln-load-path \"$out/share/emacs/native-lisp/\")" \ 186 | -f batch-native-compile "$siteStart" "$subdirs" 187 | ''} 188 | ''; 189 | 190 | inherit (emacs) meta; 191 | } 192 | '' 193 | mkdir -p "$out/bin" 194 | 195 | # Wrap emacs and friends so they find our site-start.el before the original. 196 | for prog in $emacs/bin/*; do # */ 197 | local progname=$(basename "$prog") 198 | rm -f "$out/bin/$progname" 199 | 200 | substitute ${./wrapper.sh} $out/bin/$progname \ 201 | --subst-var-by bash ${emacs.stdenv.shell} \ 202 | --subst-var-by wrapperSiteLisp "$deps/share/emacs/site-lisp" \ 203 | --subst-var-by wrapperSiteLispNative "$deps/share/emacs/native-lisp" \ 204 | --subst-var prog 205 | chmod +x $out/bin/$progname 206 | # Create a “NOP” binary wrapper for the pure sake of it becoming a 207 | # non-shebang, actual binary. See the makeBinaryWrapper docs for rationale 208 | # (summary: it allows you to use emacs as a shebang itself on Darwin, 209 | # e.g. #!$ {emacs}/bin/emacs --script) 210 | wrapProgramBinary $out/bin/$progname 211 | done 212 | 213 | # Wrap MacOS app 214 | # this has to pick up resources and metadata 215 | # to recognize it as an "app" 216 | if [ -d "$emacs/Applications/${appName}.app" ]; then 217 | mkdir -p $out/Applications/${appName}.app/Contents/MacOS 218 | cp -r $emacs/Applications/${appName}.app/Contents/Info.plist \ 219 | $emacs/Applications/${appName}.app/Contents/PkgInfo \ 220 | $emacs/Applications/${appName}.app/Contents/Resources \ 221 | $out/Applications/${appName}.app/Contents 222 | 223 | 224 | substitute ${./wrapper.sh} $out/Applications/${appName}.app/Contents/MacOS/${appName} \ 225 | --subst-var-by bash ${emacs.stdenv.shell} \ 226 | --subst-var-by wrapperSiteLisp "$deps/share/emacs/site-lisp" \ 227 | --subst-var-by wrapperSiteLispNative "$deps/share/emacs/native-lisp" \ 228 | --subst-var-by prog "$emacs/Applications/${appName}.app/Contents/MacOS/${appName}" 229 | chmod +x $out/Applications/${appName}.app/Contents/MacOS/${appName} 230 | wrapProgramBinary $out/Applications/${appName}.app/Contents/MacOS/${appName} 231 | fi 232 | 233 | mkdir -p $out/share 234 | # Link icons and desktop files into place 235 | for dir in applications icons info man; do 236 | ln -s $emacs/share/$dir $out/share/$dir 237 | done 238 | '' 239 | -------------------------------------------------------------------------------- /overlays/emacs/wrapper.sh: -------------------------------------------------------------------------------- 1 | #!@bash@ 2 | 3 | IFS=: 4 | 5 | newLoadPath=() 6 | newNativeLoadPath=() 7 | addedNewLoadPath= 8 | addedNewNativeLoadPath= 9 | 10 | if [[ -n $EMACSLOADPATH ]] 11 | then 12 | while read -rd: entry 13 | do 14 | if [[ -z $entry && -z $addedNewLoadPath ]] 15 | then 16 | newLoadPath+=(@wrapperSiteLisp@) 17 | addedNewLoadPath=1 18 | fi 19 | newLoadPath+=("$entry") 20 | done <<< "$EMACSLOADPATH:" 21 | else 22 | newLoadPath+=(@wrapperSiteLisp@) 23 | newLoadPath+=("") 24 | fi 25 | 26 | # NOTE: Even though we treat EMACSNATIVELOADPATH like EMACSLOADPATH in 27 | # this wrapper, empty elements in EMACSNATIVELOADPATH have no special 28 | # meaning for Emacs. Only non-empty elements in EMACSNATIVELOADPATH 29 | # will be prepended to native-comp-eln-load-path. 30 | # https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/startup.el?id=3685387e609753293c4518be75e77c659c3b2d8d#n599 31 | if [[ -n $EMACSNATIVELOADPATH ]] 32 | then 33 | while read -rd: entry 34 | do 35 | if [[ -z $entry && -z $addedNewNativeLoadPath ]] 36 | then 37 | newNativeLoadPath+=(@wrapperSiteLispNative@) 38 | addedNewNativeLoadPath=1 39 | fi 40 | newNativeLoadPath+=("$entry") 41 | done <<< "$EMACSNATIVELOADPATH:" 42 | else 43 | newNativeLoadPath+=(@wrapperSiteLispNative@) 44 | newNativeLoadPath+=("") 45 | fi 46 | 47 | export EMACSLOADPATH="${newLoadPath[*]}" 48 | export emacsWithPackages_siteLisp=@wrapperSiteLisp@ 49 | 50 | export EMACSNATIVELOADPATH="${newNativeLoadPath[*]}" 51 | export emacsWithPackages_siteLispNative=@wrapperSiteLispNative@ 52 | 53 | exec @prog@ "$@" 54 | -------------------------------------------------------------------------------- /overlays/hyperorg.patch: -------------------------------------------------------------------------------- 1 | --- i/src/hyperorg/reader.py 2 | +++ w/src/hyperorg/reader.py 3 | @@ -120,6 +120,7 @@ class Reader: 4 | orgid = node.properties['ID'] 5 | 6 | # Create orgparse independent content object 7 | + _log.info(f'Parsing node: {orgid}') 8 | content, backlinks = self._content_from_orgparse_node(node) 9 | 10 | # stored it indexed by its orgid 11 | -------------------------------------------------------------------------------- /overlays/tests/llm-plugin.nix: -------------------------------------------------------------------------------- 1 | { 2 | runCommand, 3 | python, 4 | yq, 5 | }: 6 | let 7 | venv = python.withPackages (ps: [ 8 | ps.llm 9 | ps.llm-mlx 10 | ]); 11 | in 12 | runCommand "llm-mlx-test-llm-plugin" 13 | { 14 | nativeBuildInputs = [ 15 | venv 16 | yq 17 | ]; 18 | } 19 | '' 20 | llm plugins | yq --exit-status 'any(.name == "llm-mlx")' 21 | touch "$out" 22 | '' 23 | --------------------------------------------------------------------------------