├── .envrc ├── .gitattributes ├── .github └── workflows │ ├── flake-update.yml │ └── home.yml ├── .gitignore ├── LICENSE ├── README.md ├── alacritty └── .config │ └── alacritty │ └── alacritty.yml ├── emacs └── .emacs.d │ ├── early-init.el │ ├── init.el │ ├── modules │ ├── siraben-agda.el │ ├── siraben-arcadia.el │ ├── siraben-assembly.el │ ├── siraben-c.el │ ├── siraben-common-lisp.el │ ├── siraben-cool.el │ ├── siraben-coq.el │ ├── siraben-core.el │ ├── siraben-editor.el │ ├── siraben-fonts.el │ ├── siraben-formula.el │ ├── siraben-forth.el │ ├── siraben-haskell.el │ ├── siraben-js.el │ ├── siraben-keybindings.el │ ├── siraben-linux.el │ ├── siraben-lisp.el │ ├── siraben-macos.el │ ├── siraben-mdm.el │ ├── siraben-nix.el │ ├── siraben-ocaml.el │ ├── siraben-org.el │ ├── siraben-packages.el │ ├── siraben-programming.el │ ├── siraben-prolog.el │ ├── siraben-python.el │ ├── siraben-ruby.el │ ├── siraben-rust.el │ ├── siraben-shell.el │ ├── siraben-sml.el │ ├── siraben-tramp.el │ ├── siraben-typescript.el │ └── siraben-ui.el │ ├── snippets │ ├── coq-mode │ │ ├── DECL │ │ ├── MAIN │ │ └── PROP │ ├── nix-mode │ │ ├── cc │ │ ├── flake │ │ ├── go_github │ │ ├── install │ │ ├── meta │ │ ├── nativeBuildInputs │ │ ├── package_github │ │ ├── rust_github │ │ ├── stdenv_no_cc │ │ └── substituteInPlace │ ├── org-mode │ │ ├── .yas-parents │ │ ├── align │ │ ├── capt │ │ ├── header │ │ └── margin │ └── text-mode │ │ └── exp │ └── straight │ └── versions │ └── default.el ├── flake.lock ├── flake.nix ├── home-manager └── .config │ ├── nix │ ├── nix.conf │ └── registry.json │ └── nixpkgs │ ├── base.nix │ ├── circom-lsp │ └── default.nix │ ├── circom │ └── default.nix │ ├── config.nix │ ├── darwin-aliases.nix │ ├── haskell-packages.nix │ ├── home.nix │ ├── minimal.nix │ ├── overlay.nix │ ├── packages.nix │ ├── programs.nix │ ├── python-packages.nix │ ├── services.nix │ ├── texlive-packages.nix │ └── z3-tptp.nix ├── homebrew └── .Brewfile ├── i3 └── .config │ └── i3 │ ├── config │ └── lock.sh ├── i3status └── .config │ └── i3status │ └── config ├── kitty └── .config │ └── kitty │ └── kitty.conf ├── min-server └── configuration.nix ├── nixos ├── configuration.nix └── rescue_boot.nix ├── ranger └── .config │ └── ranger │ ├── commands.py │ ├── commands_full.py │ ├── rc.conf │ ├── rifle.conf │ └── scope.sh ├── rofi └── .config │ └── rofi │ ├── arthur.rasi │ └── config ├── server ├── anki-sync-server.nix ├── configuration.nix ├── flake.lock ├── flake.nix ├── hardware-configuration.nix ├── mailserver.nix ├── nextcloud.nix ├── nginx.nix └── postgresql.nix ├── sway └── .config │ └── sway │ ├── config │ ├── screenshot-region.sh │ ├── screenshot-window.sh │ └── wofi.sh ├── switch.sh └── x11 └── .Xresources /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/flake-update.yml: -------------------------------------------------------------------------------- 1 | name: Update Flakes 2 | on: 3 | workflow_dispatch: # allows manual triggering 4 | schedule: 5 | - cron: '0 0 * * 0' # runs weekly on Sunday at 00:00 6 | 7 | jobs: 8 | lockfile: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout repository 12 | uses: actions/checkout@v4.2.2 13 | - name: Install Nix 14 | uses: DeterminateSystems/nix-installer-action@main 15 | - name: Update flake.lock 16 | uses: DeterminateSystems/update-flake-lock@main 17 | with: 18 | token: ${{ secrets.GH_TOKEN }} 19 | pr-title: "Update flake.lock" # Title of PR to be created 20 | pr-labels: | # Labels to be set on the PR 21 | dependencies 22 | automated 23 | -------------------------------------------------------------------------------- /.github/workflows/home.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | pull_request: 7 | 8 | jobs: 9 | build: 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | os: [ubuntu-24.04, macos-15] 14 | runs-on: ${{ matrix.os }} 15 | 16 | permissions: 17 | contents: read 18 | 19 | steps: 20 | - uses: actions/checkout@v4.2.2 21 | 22 | - name: Install Nix with Flakes support 23 | uses: cachix/install-nix-action@v31.3.0 24 | 25 | - name: Configure Cachix 26 | uses: cachix/cachix-action@v16 27 | with: 28 | name: siraben 29 | authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} 30 | 31 | - name: Build home-manager flake configuration 32 | run: | 33 | set -euo pipefail 34 | echo "OS: ${{ matrix.os }}" 35 | if [[ "${{ matrix.os }}" == "ubuntu-24.04" ]]; then 36 | echo "Building for Linux (siraben@linux)" 37 | nix build .#homeConfigurations."siraben@linux".activationPackage -L 38 | elif [[ "${{ matrix.os }}" == "macos-15" ]]; then 39 | echo "Building for macOS x86_64 (siraben@macos-aarch64)" 40 | nix build .#homeConfigurations."siraben@macos-aarch64".activationPackage -L 41 | else 42 | echo "::error::Unsupported OS: ${{ matrix.os }}" 43 | exit 1 44 | fi 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.elc 3 | .DS_Store 4 | nixos/hardware-configuration.nix 5 | result 6 | 7 | 8 | emacs/.emacs.d/.dap-breakpoints 9 | emacs/.emacs.d/.lsp-session-v1 10 | emacs/.emacs.d/.mc-lists.el 11 | emacs/.emacs.d/custom.el 12 | emacs/.emacs.d/eln-cache/ 13 | emacs/.emacs.d/eshell/ 14 | emacs/.emacs.d/forge-database.sqlite 15 | emacs/.emacs.d/games/ 16 | emacs/.emacs.d/image-dired/ 17 | emacs/.emacs.d/multisession 18 | emacs/.emacs.d/org-roam.db 19 | emacs/.emacs.d/projectile-bookmarks.eld 20 | emacs/.emacs.d/projects 21 | emacs/.emacs.d/recentf 22 | emacs/.emacs.d/recentf.bak 23 | emacs/.emacs.d/straight/build-cache.el 24 | emacs/.emacs.d/straight/build/ 25 | emacs/.emacs.d/straight/repos/ 26 | emacs/.emacs.d/tramp 27 | emacs/.emacs.d/transient/ 28 | emacs/.emacs.d/url/ 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # siraben's dotfiles 2 | 3 | Configuration for my macOS and Linux systems using 4 | [Nix](https://nixos.org/) and [Home 5 | Manager](https://github.com/nix-community/home-manager). I mostly use 6 | macOS now, Linux minimal in server environments. 7 | 8 | ## Summary 9 | - OS: NixOS and macOS 10 | - Package manager: Nix 11 | - Shell: `zsh` with [pure prompt](https://github.com/sindresorhus/pure) 12 | - WM on NixOS: wayland 13 | - Filesystem: ZFS on NixOS, APFS on macOS 14 | - Editor: Emacs, `tomorrow-night` theme, [straight.el](https://github.com/raxod502/straight.el) 15 | - Custom package sets for 16 | - [LaTeX](./home-manager/.config/nixpkgs/texlive-packages.nix) 17 | - [Haskell](./home-manager/.config/nixpkgs/haskell-packages.nix) 18 | - [Python](./home-manager/.config/nixpkgs/python-packages.nix) 19 | 20 | ## Installation 21 | First, [install Home Manager](https://github.com/nix-community/home-manager#installation) on macOS or Linux, then run the following commands. 22 | 23 | ```shell-session 24 | $ git clone git@github.com:siraben/dotfiles.git 25 | $ cd dotfiles && stow home-manager 26 | $ home-manager switch 27 | ``` 28 | 29 | ## Notes 30 | Some configuration (e.g. Emacs, i3) has deliberately not been Nixified so that it works independently. In general, every folder except for `nixos` can be `stow`'d. Note that for some things like Emacs it assumes you have installed external dependencies such as fonts, interpreters and language servers for various programming languages. 31 | -------------------------------------------------------------------------------- /alacritty/.config/alacritty/alacritty.yml: -------------------------------------------------------------------------------- 1 | key_bindings: 2 | - { key: A, mods: Alt, chars: "\x1ba" } 3 | - { key: B, mods: Alt, chars: "\x1bb" } 4 | - { key: C, mods: Alt, chars: "\x1bc" } 5 | - { key: D, mods: Alt, chars: "\x1bd" } 6 | - { key: E, mods: Alt, chars: "\x1be" } 7 | - { key: F, mods: Alt, chars: "\x1bf" } 8 | - { key: G, mods: Alt, chars: "\x1bg" } 9 | - { key: H, mods: Alt, chars: "\x1bh" } 10 | - { key: I, mods: Alt, chars: "\x1bi" } 11 | - { key: J, mods: Alt, chars: "\x1bj" } 12 | - { key: K, mods: Alt, chars: "\x1bk" } 13 | - { key: L, mods: Alt, chars: "\x1bl" } 14 | - { key: M, mods: Alt, chars: "\x1bm" } 15 | - { key: N, mods: Alt, chars: "\x1bn" } 16 | - { key: O, mods: Alt, chars: "\x1bo" } 17 | - { key: P, mods: Alt, chars: "\x1bp" } 18 | - { key: Q, mods: Alt, chars: "\x1bq" } 19 | - { key: R, mods: Alt, chars: "\x1br" } 20 | - { key: S, mods: Alt, chars: "\x1bs" } 21 | - { key: T, mods: Alt, chars: "\x1bt" } 22 | - { key: U, mods: Alt, chars: "\x1bu" } 23 | - { key: V, mods: Alt, chars: "\x1bv" } 24 | - { key: W, mods: Alt, chars: "\x1bw" } 25 | - { key: X, mods: Alt, chars: "\x1bx" } 26 | - { key: Y, mods: Alt, chars: "\x1by" } 27 | - { key: Z, mods: Alt, chars: "\x1bz" } 28 | - { key: A, mods: Alt|Shift, chars: "\x1bA" } 29 | - { key: B, mods: Alt|Shift, chars: "\x1bB" } 30 | - { key: C, mods: Alt|Shift, chars: "\x1bC" } 31 | - { key: D, mods: Alt|Shift, chars: "\x1bD" } 32 | - { key: E, mods: Alt|Shift, chars: "\x1bE" } 33 | - { key: F, mods: Alt|Shift, chars: "\x1bF" } 34 | - { key: G, mods: Alt|Shift, chars: "\x1bG" } 35 | - { key: H, mods: Alt|Shift, chars: "\x1bH" } 36 | - { key: I, mods: Alt|Shift, chars: "\x1bI" } 37 | - { key: J, mods: Alt|Shift, chars: "\x1bJ" } 38 | - { key: K, mods: Alt|Shift, chars: "\x1bK" } 39 | - { key: L, mods: Alt|Shift, chars: "\x1bL" } 40 | - { key: M, mods: Alt|Shift, chars: "\x1bM" } 41 | - { key: N, mods: Alt|Shift, chars: "\x1bN" } 42 | - { key: O, mods: Alt|Shift, chars: "\x1bO" } 43 | - { key: P, mods: Alt|Shift, chars: "\x1bP" } 44 | - { key: Q, mods: Alt|Shift, chars: "\x1bQ" } 45 | - { key: R, mods: Alt|Shift, chars: "\x1bR" } 46 | - { key: S, mods: Alt|Shift, chars: "\x1bS" } 47 | - { key: T, mods: Alt|Shift, chars: "\x1bT" } 48 | - { key: U, mods: Alt|Shift, chars: "\x1bU" } 49 | - { key: V, mods: Alt|Shift, chars: "\x1bV" } 50 | - { key: W, mods: Alt|Shift, chars: "\x1bW" } 51 | - { key: X, mods: Alt|Shift, chars: "\x1bX" } 52 | - { key: Y, mods: Alt|Shift, chars: "\x1bY" } 53 | - { key: Z, mods: Alt|Shift, chars: "\x1bZ" } 54 | - { key: Key1, mods: Alt, chars: "\x1b1" } 55 | - { key: Key2, mods: Alt, chars: "\x1b2" } 56 | - { key: Key3, mods: Alt, chars: "\x1b3" } 57 | - { key: Key4, mods: Alt, chars: "\x1b4" } 58 | - { key: Key5, mods: Alt, chars: "\x1b5" } 59 | - { key: Key6, mods: Alt, chars: "\x1b6" } 60 | - { key: Key7, mods: Alt, chars: "\x1b7" } 61 | - { key: Key8, mods: Alt, chars: "\x1b8" } 62 | - { key: Key9, mods: Alt, chars: "\x1b9" } 63 | - { key: Key0, mods: Alt, chars: "\x1b0" } 64 | - { key: Apostrophe,mods: Control, chars: "\x18\x40\x63\x27" } # Ctrl + '' 65 | - { key: Semicolon, mods: Control, chars: "\x18\x40\x63\x3b" } # Ctrl + ; 66 | - { key: Slash, mods: Control, chars: "\x1f" } # Ctrl + / 67 | - { key: Space, mods: Control, chars: "\x00" } # Ctrl + Space 68 | - { key: Backslash, mods: Alt, chars: "\x1b\\" } # Alt + \ 69 | - { key: Grave, mods: Alt, chars: "\x1b`" } # Alt + ` 70 | - { key: Period, mods: Alt, chars: "\x1b." } # Alt + . 71 | - { key: Semicolon, mods: Alt, chars: "\x1b;" } # Alt + ; 72 | - { key: Backslash, mods: Alt|Shift, chars: "\x1b|" } # Alt + | 73 | - { key: Comma, mods: Alt|Shift, chars: "\x1b<" } # Alt + < 74 | - { key: Grave, mods: Alt|Shift, chars: "\x1b~" } # Alt + ~ 75 | - { key: Key3, mods: Alt|Shift, chars: "\x1b#" } # Alt + # 76 | - { key: Key5, mods: Alt|Shift, chars: "\x1b%" } # Alt + % 77 | - { key: Key6, mods: Alt|Shift, chars: "\x1b^" } # Alt + ^ 78 | - { key: Key8, mods: Alt|Shift, chars: "\x1b*" } # Alt + * 79 | - { key: Minus, mods: Alt|Shift, chars: "\x1b_" } # Alt + _ 80 | - { key: Period, mods: Alt|Shift, chars: "\x1b>" } # Alt + > 81 | # Base16 Bright 256 - alacritty color config 82 | # Chris Kempson (http://chriskempson.com) 83 | colors: 84 | # Default colors 85 | primary: 86 | background: '0x000000' 87 | foreground: '0xe0e0e0' 88 | 89 | # Colors the cursor will use if `custom_cursor_colors` is true 90 | cursor: 91 | text: '0x000000' 92 | cursor: '0xe0e0e0' 93 | 94 | # Normal colors 95 | normal: 96 | black: '0x000000' 97 | red: '0xfb0120' 98 | green: '0xa1c659' 99 | yellow: '0xfda331' 100 | blue: '0x6fb3d2' 101 | magenta: '0xd381c3' 102 | cyan: '0x76c7b7' 103 | white: '0xe0e0e0' 104 | 105 | # Bright colors 106 | bright: 107 | black: '0xb0b0b0' 108 | red: '0xfb0120' 109 | green: '0xa1c659' 110 | yellow: '0xfda331' 111 | blue: '0x6fb3d2' 112 | magenta: '0xd381c3' 113 | cyan: '0x76c7b7' 114 | white: '0xffffff' 115 | 116 | indexed_colors: 117 | - { index: 16, color: '0xfc6d24' } 118 | - { index: 17, color: '0xbe643c' } 119 | - { index: 18, color: '0x303030' } 120 | - { index: 19, color: '0x505050' } 121 | - { index: 20, color: '0xd0d0d0' } 122 | - { index: 21, color: '0xf5f5f5' } 123 | -------------------------------------------------------------------------------- /emacs/.emacs.d/early-init.el: -------------------------------------------------------------------------------- 1 | (setq package-enable-at-startup nil) 2 | -------------------------------------------------------------------------------- /emacs/.emacs.d/init.el: -------------------------------------------------------------------------------- 1 | ;;; init.el --- Entry point for siraben's Emacs 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Welcome to siraben's Emacs init file! 21 | ;; This is the first to be executed by Emacs. 22 | 23 | ;;; Code: 24 | 25 | ;; Always prefer the newest version of a file, even if the old one is 26 | ;; compiled. 27 | (setq load-prefer-newer t) 28 | 29 | (defvar file-name-handler-alist-old file-name-handler-alist) 30 | 31 | (setq file-name-handler-alist nil 32 | message-log-max 16384 33 | gc-cons-threshold (ash 1 25) 34 | gc-cons-percentage 0.6 35 | auto-window-vscroll nil) 36 | 37 | (add-hook 'after-init-hook 38 | `(lambda () 39 | (setq file-name-handler-alist file-name-handler-alist-old 40 | gc-cons-threshold 100000000 41 | gc-cons-percentage 0.1) 42 | (garbage-collect)) t) 43 | 44 | (setq byte-compile-warnings nil) 45 | 46 | (setq native-comp-async-report-warnings-errors nil) 47 | 48 | (setq read-process-output-max (* 1024 1024)) 49 | 50 | ;; At least remove the eyesores while we wait. 51 | (when (fboundp 'tool-bar-mode) 52 | (tool-bar-mode -1)) 53 | 54 | (menu-bar-mode -1) 55 | 56 | (add-hook 'after-init-hook 57 | #'(lambda () 58 | (when window-system 59 | (scroll-bar-mode -1) 60 | ;; And ensure the cursor is a box, and remove the fringe. 61 | (setq-default cursor-type 'box)))) 62 | 63 | (defvar siraben-root-dir 64 | "~/.emacs.d/" 65 | "The root directory of the Emacs configuration.") 66 | 67 | (setq custom-file (concat siraben-root-dir "/custom.el")) 68 | 69 | (defvar siraben-modules-dir 70 | (expand-file-name "modules/" siraben-root-dir) 71 | "The directory that contains all the modules for my configuration.") 72 | 73 | (add-to-list 'load-path siraben-modules-dir) 74 | 75 | (require 'siraben-core) 76 | (load "siraben-packages.el") 77 | (require 'siraben-ui) 78 | (require 'siraben-fonts) 79 | (require 'siraben-keybindings) 80 | (require 'siraben-editor) 81 | (require 'siraben-programming) 82 | (require 'siraben-shell) 83 | (require 'siraben-org) 84 | ;; (require 'siraben-tramp) 85 | 86 | ;; Load OS-specific configuration. 87 | (require 88 | (cl-case system-type 89 | (gnu/linux 'siraben-linux) 90 | (darwin 'siraben-macos))) 91 | 92 | ;; Initial scratch buffer message. 93 | (setq inhibit-startup-message t 94 | initial-scratch-message nil) 95 | 96 | (setq default-directory "~/") 97 | 98 | 99 | ;;; init.el ends here 100 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-agda.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-agda.el --- configures Emacs for Agda development 2 | 3 | ;;; License: 4 | ;; This program is free software: you can redistribute it and/or modify 5 | ;; it under the terms of the GNU General Public License as published by 6 | ;; the Free Software Foundation, either version 3 of the License, or 7 | ;; (at your option) any later version. 8 | 9 | ;; This program is distributed in the hope that it will be useful, 10 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ;; GNU General Public License for more details. 13 | 14 | ;; You should have received a copy of the GNU General Public License 15 | ;; along with this program. If not, see . 16 | 17 | ;;; Commentary: 18 | 19 | ;;; Code: 20 | (add-to-list 'auto-mode-alist 21 | '(("\\.agda\\'" . agda2-mode) 22 | ("\\.lagda.md\\'" . agda2-mode))) 23 | 24 | (when (locate-library "agda2-mode") 25 | (load-library "agda2-mode") 26 | (let ((base03 "#002b36") (base02 "#073642") 27 | (base01 "#586e75") (base00 "#657b83") 28 | (base0 "#839496") (base1 "#93a1a1") 29 | (base2 "#eee8d5") (base3 "#fdf6e3") 30 | (yellow "#b58900") (orange "#cb4b16") 31 | (red "#dc322f") (magenta "#d33682") 32 | (violet "#6c71c4") (blue "#268bd2") 33 | (cyan "#2aa198") (green "#859900")) 34 | (custom-set-faces 35 | `(agda2-highlight-keyword-face ((t (:foreground ,orange)))) 36 | `(agda2-highlight-string-face ((t (:foreground ,magenta)))) 37 | `(agda2-highlight-number-face ((t (:foreground ,violet)))) 38 | `(agda2-highlight-symbol-face ((((background ,base3)) (:foreground ,base01)))) 39 | `(agda2-highlight-primitive-type-face ((t (:foreground ,blue)))) 40 | `(agda2-highlight-bound-variable-face ((t nil))) 41 | `(agda2-highlight-inductive-constructor-face ((t (:foreground ,green)))) 42 | `(agda2-highlight-coinductive-constructor-face ((t (:foreground ,yellow)))) 43 | `(agda2-highlight-datatype-face ((t (:foreground ,blue)))) 44 | `(agda2-highlight-field-face ((t (:foreground ,red)))) 45 | `(agda2-highlight-function-face ((t (:foreground ,blue)))) 46 | `(agda2-highlight-module-face ((t (:foreground ,violet)))) 47 | `(agda2-highlight-postulate-face ((t (:foreground ,blue)))) 48 | `(agda2-highlight-primitive-face ((t (:foreground ,blue)))) 49 | `(agda2-highlight-record-face ((t (:foreground ,blue)))) 50 | `(agda2-highlight-dotted-face ((t nil))) 51 | `(agda2-highlight-operator-face ((t nil))) 52 | `(agda2-highlight-error-face ((t (:foreground ,red :underline t)))) 53 | `(agda2-highlight-unsolved-meta-face ((t (:background ,base03 :foreground ,yellow)))) 54 | `(agda2-highlight-unsolved-constraint-face ((t (:background ,base03 :foreground ,yellow)))) 55 | `(agda2-highlight-termination-problem-face ((t (:background ,orange :foreground ,base03)))) 56 | `(agda2-highlight-incomplete-pattern-face ((t (:background ,orange :foreground ,base03)))) 57 | `(agda2-highlight-typechecks-face ((t (:background ,cyan :foreground ,base03))))))) 58 | 59 | ;;; siraben-agda.el ends here 60 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-arcadia.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-arcadia.el --- provides integration with Arcadia. 2 | 3 | ;;; Commentary: 4 | 5 | ;; Emacs interoperability with the Clojure REPL in Arcadia. See 6 | ;; `https://github.com/arcadia-unity/Arcadia' for more information. 7 | 8 | ;;; License: 9 | 10 | ;; This program is free software: you can redistribute it and/or modify 11 | ;; it under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation, either version 3 of the License, or 13 | ;; (at your 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 this program. If not, see . 22 | 23 | ;;; Code: 24 | 25 | (defvar unity-repl-command "ruby repl-client.rb" 26 | "Command to use for arcadia-repl.") 27 | 28 | (defvar unity-repl-command-path "Assets/Arcadia/Editor" 29 | "Launch the REPL command in this relative path.") 30 | 31 | (defun unity-root-p (dir) 32 | "Is this DIR the root of a Unity project?" 33 | (-any? (lambda (f) 34 | ;; TODO: Maybe this could be better? 35 | (string-equal f "ProjectSettings")) 36 | (directory-files dir))) 37 | 38 | (defun unity-find-root (start levels) 39 | "Search from the START directory to find the Unity root dir. 40 | Returns its full path. Search for the number of LEVELS 41 | specified." 42 | (cond ((= levels 0) nil) 43 | ((unity-root-p start) start) 44 | (t (unity-find-root 45 | (expand-file-name ".." start) (- levels 1))))) 46 | 47 | (defun unity-jack-in () 48 | "Start the Arcadia REPL." 49 | (interactive) 50 | (let ((default-directory 51 | (concat (unity-find-root default-directory 10) "/" 52 | unity-repl-command-path "/"))) 53 | (run-lisp unity-repl-command))) 54 | 55 | (provide 'siraben-arcadia) 56 | ;;; siraben-arcadia.el ends here 57 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-assembly.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-assembly.el --- Specific modes and packages for assembly code. 2 | 3 | ;;; License: 4 | ;; This program is free software: you can redistribute it and/or modify 5 | ;; it under the terms of the GNU General Public License as published by 6 | ;; the Free Software Foundation, either version 3 of the License, or 7 | ;; (at your option) any later version. 8 | 9 | ;; This program is distributed in the hope that it will be useful, 10 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ;; GNU General Public License for more details. 13 | 14 | ;; You should have received a copy of the GNU General Public License 15 | ;; along with this program. If not, see . 16 | 17 | ;;; Commentary: 18 | 19 | ;;; Code: 20 | 21 | (add-hook 'asm-mode-hook 22 | (lambda () 23 | (undo-tree-mode +1) 24 | (setq asm-indent-level 8) 25 | (orgtbl-mode +1))) 26 | 27 | (provide 'siraben-assembly) 28 | ;;; siraben-assembly.el ends here 29 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-c.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-c.el --- configures Emacs for C development 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Configures packages and various modes for C programming. 21 | 22 | ;;; Code: 23 | 24 | ;; Code auto completion packages for C code. 25 | (use-package clang-format+) 26 | 27 | (require 'cc-mode) 28 | (defvar c-prettify-symbols-alist 29 | '(("->" . ?→) 30 | ("!" . ?¬) 31 | ("&&" . ?∧) 32 | ("||" . ?∨) 33 | ("!=" . ?≠) 34 | ("==" . ?≡) 35 | ("<=" . ?≤) 36 | (">=" . ?≥) 37 | ("<<" . ?≪) 38 | (">>" . ?≫) 39 | ("..." . ?…) 40 | ("*" . ?∗) 41 | ("=" . ?≔) 42 | ;; ("uint32_t" . (?ℕ (Br . Bl) ?₃ 43 | ;; (Br . Bl) ?₂)) 44 | ;; ("uint8_t" . (?ℕ (Br . Bl) ?₈)) 45 | ;; ("bool" . ?𝔹) 46 | ;; ("Uint32" . ,(string-to-symbols "ℕ₃₂")) 47 | ;; ("Uint8" . ,(string-to-symbols "ℕ₈")) 48 | ;; ("union" . ?∪) 49 | ("x_1" . (?x (Br . Bl) ?₁)) 50 | ("x_2" . (?x (Br . Bl) ?₂)) 51 | ("y_1" . (?y (Br . Bl) ?₁)) 52 | ("y_2" . (?y (Br . Bl) ?₂)) 53 | ;; ("NULL" . ?∅) 54 | )) 55 | 56 | (add-hook 'c-mode-hook (lambda () 57 | (electric-pair-local-mode t) 58 | (electric-indent-mode t) 59 | (clang-format+-mode t) 60 | (setq-local prettify-symbols-alist c-prettify-symbols-alist) 61 | (prettify-symbols-mode 1) 62 | (lsp))) 63 | 64 | (add-hook 'c++-mode-hook (lambda () 65 | (clang-format+-mode t) 66 | (electric-pair-local-mode t) 67 | (lsp))) 68 | 69 | (define-key c-mode-base-map (kbd "s-b") 'recompile) 70 | 71 | (provide 'siraben-c) 72 | ;;; siraben-c.el ends here 73 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-common-lisp.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-common-lisp.el --- configuration for programming in Common Lisp 2 | 3 | ;;; License: 4 | ;; This program is free software: you can redistribute it and/or modify 5 | ;; it under the terms of the GNU General Public License as published by 6 | ;; the Free Software Foundation, either version 3 of the License, or 7 | ;; (at your option) any later version. 8 | 9 | ;; This program is distributed in the hope that it will be useful, 10 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ;; GNU General Public License for more details. 13 | 14 | ;; You should have received a copy of the GNU General Public License 15 | ;; along with this program. If not, see . 16 | 17 | ;;; Commentary: 18 | 19 | ;; Common Lisp stuff. 20 | 21 | ;;; Code: 22 | 23 | (use-package slime) 24 | 25 | (require 'slime) 26 | 27 | ;; the SBCL configuration file is in Common Lisp 28 | (add-to-list 'auto-mode-alist '("\\.sbclrc\\'" . lisp-mode)) 29 | 30 | ;; Open files with .cl extension in lisp-mode 31 | (add-to-list 'auto-mode-alist '("\\.cl\\'" . lisp-mode)) 32 | (setq slime-lisp-implementations 33 | '((ccl ("ccl")) 34 | (clisp ("clisp" "-q")) 35 | (cmucl ("cmucl" "-quiet")) 36 | (sbcl ("sbcl" "--noinform") :coding-system utf-8-unix))) 37 | 38 | ;; select the default value from slime-lisp-implementations 39 | (if (and (eq system-type 'darwin) 40 | (executable-find "ccl")) 41 | ;; default to Clozure CL on macOS 42 | (setq slime-default-lisp 'ccl) 43 | ;; default to SBCL on Linux and Windows 44 | (setq slime-default-lisp 'sbcl)) 45 | 46 | ;; Add fancy slime contribs 47 | (setq slime-contribs '(slime-fancy slime-cl-indent)) 48 | 49 | (eval-after-load "slime" 50 | '(progn 51 | (setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol 52 | slime-fuzzy-completion-in-place t 53 | slime-enable-evaluate-in-emacs t 54 | slime-autodoc-use-multiline-p t 55 | slime-auto-start 'always) 56 | (define-key slime-mode-map (kbd "C-c C-s") 'slime-selector))) 57 | 58 | ;; rainbow-delimeters messes up colors in slime-repl 59 | 60 | (add-hook 'comint-mode-hook 61 | (lambda () 62 | (siraben-enable-lisp-editing-modes) 63 | (undo-tree-mode -1) 64 | (aggressive-indent-mode -1) 65 | (rainbow-delimiters-mode -1))) 66 | 67 | (add-hook 'slime-repl-mode-hook (lambda () 68 | (paredit-mode +1))) 69 | 70 | (provide 'siraben-common-lisp) 71 | ;;; siraben-common-lisp.el ends here 72 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-cool.el: -------------------------------------------------------------------------------- 1 | (defun cool-mode () 2 | (interactive) 3 | (kill-all-local-variables) 4 | (setq mode-name "Cool") 5 | (setq major-mode 'cool-mode) 6 | (electric-pair-mode t) 7 | (run-hooks 'cool-mode-hook)) 8 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-coq.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-coq.el --- Coq programming customizations. 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; This file has Coq and Proof General specific customizations. 21 | 22 | ;;; Code: 23 | 24 | (use-package proof-general 25 | :init 26 | (setq proof-splash-enable nil) 27 | (setq proof-three-window-mode-policy 'hybrid)) 28 | 29 | (use-package company-coq 30 | :after coq 31 | :commands company-coq-mode 32 | :bind ("C-M-h" . company-coq-toggle-definition-overlay) 33 | :config 34 | (setq company-coq-live-on-the-edge t) 35 | (setq company-coq-disabled-features '(spinner))) 36 | 37 | (add-hook 'coq-mode-hook 38 | (lambda () 39 | (siraben-prog-mode-defaults) 40 | (company-coq-mode t) 41 | (undo-tree-mode t) 42 | (electric-indent-mode t))) 43 | 44 | 45 | (provide 'siraben-coq) 46 | ;;; siraben-coq.el ends here 47 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-core.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-core.el --- This file contains the core functions I wrote. 2 | 3 | ;;; License: 4 | ;; This program is free software: you can redistribute it and/or modify 5 | ;; it under the terms of the GNU General Public License as published by 6 | ;; the Free Software Foundation, either version 3 of the License, or 7 | ;; (at your option) any later version. 8 | 9 | ;; This program is distributed in the hope that it will be useful, 10 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ;; GNU General Public License for more details. 13 | 14 | ;; You should have received a copy of the GNU General Public License 15 | ;; along with this program. If not, see . 16 | 17 | ;;; Commentary: 18 | 19 | ;;; Code: 20 | 21 | (defun siraben-insert-time () 22 | "Insert the date and time into the current buffer." 23 | (interactive) 24 | (shell-command "date '+%A, %B %d, %Y at %R'" 1)) 25 | 26 | (defun siraben-new-diary-entry () 27 | "Create a new buffer with a new diary entry with Org mode." 28 | (interactive) 29 | (pop-to-buffer (generate-new-buffer-name "diary-")) 30 | (org-mode) 31 | (insert "* ") 32 | (siraben-insert-time) 33 | (goto-char (point-max))) 34 | 35 | (defun siraben-reset-packages () 36 | "Deletes all packages from the directory `siraben-root-dir'." 37 | (interactive) 38 | (when (y-or-n-p "Really reset packages?") 39 | (message "Removing installed package directory...") 40 | (delete-directory (concat siraben-root-dir "elpa/") t t) 41 | (when (y-or-n-p "Packages deleted. Quit Emacs?") 42 | (save-buffers-kill-emacs)))) 43 | 44 | (defmacro set-if-exists (sym str) 45 | "Set SYM TO STR if STR exists as a file." 46 | `(if (file-exists-p ,str) 47 | (setq ,sym ,str))) 48 | 49 | (defun enable-all-commands () 50 | "Enable all commands, reporting on which were disabled." 51 | (interactive) 52 | (with-output-to-temp-buffer "*Commands that were disabled*" 53 | (mapatoms 54 | (function 55 | (lambda (symbol) 56 | (when (get symbol 'disabled) 57 | (put symbol 'disabled nil) 58 | (prin1 symbol) 59 | (princ "\n"))))))) 60 | 61 | (defun enable-me (&rest args) 62 | "Called when a disabled command is executed. 63 | Enable it and reexecute it." 64 | (put this-command 'disabled nil) 65 | (message "You typed %s. %s was disabled. It ain't no more." 66 | (key-description (this-command-keys)) this-command) 67 | (sit-for 0) 68 | (call-interactively this-command)) 69 | 70 | (setq disabled-command-hook 'enable-me) 71 | 72 | (provide 'siraben-core) 73 | ;;; siraben-core.el ends here 74 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-editor.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-editor.el --- make Emacs a great editor. 2 | 3 | ;;; License: 4 | ;; This program is free software: you can redistribute it and/or modify 5 | ;; it under the terms of the GNU General Public License as published by 6 | ;; the Free Software Foundation, either version 3 of the License, or 7 | ;; (at your option) any later version. 8 | 9 | ;; This program is distributed in the hope that it will be useful, 10 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ;; GNU General Public License for more details. 13 | 14 | ;; You should have received a copy of the GNU General Public License 15 | ;; along with this program. If not, see . 16 | 17 | ;;; Commentary: 18 | 19 | ;;; Code: 20 | 21 | (add-hook 'after-init-hook #'(lambda () (global-auto-revert-mode t) (global-so-long-mode t))) 22 | 23 | ;; Don't use tabs to indent but maintain correct appearance. 24 | (setq-default indent-tabs-mode nil 25 | tab-width 4) 26 | (setq tab-always-indent 'complete) 27 | 28 | ;; Require newline at end of file. 29 | (setq require-final-newline t) 30 | 31 | ;; Delete the selection with a keypress. 32 | (delete-selection-mode t) 33 | 34 | ;; Store all backup and autosave files in the tmp dir. 35 | (setq backup-directory-alist 36 | `((".*" . ,temporary-file-directory))) 37 | (setq auto-save-file-name-transforms 38 | `((".*" ,temporary-file-directory t))) 39 | 40 | ;; Blinking parens are ugly. 41 | (setq blink-matching-paren nil) 42 | 43 | (require 'windmove) 44 | (windmove-default-keybindings) 45 | 46 | (use-package flyspell 47 | :config 48 | (setq flyspell-issue-message-flag nil)) 49 | 50 | (defun siraben-enable-writing-modes () 51 | "Enables writing modes for writing prose. 52 | Enables auto-fill mode, spell checking and disables company mode." 53 | (interactive) 54 | (auto-fill-mode 1) 55 | (undo-tree-mode 1) 56 | (flyspell-mode 1) 57 | (electric-pair-mode 1) 58 | (setq electric-pair-inhibit-predicate 59 | `(lambda (c) 60 | (if (char-equal c ?<) t (,electric-pair-inhibit-predicate c)))) 61 | (visual-line-mode 1) ;; Org mode headings don't wrap. 62 | (company-mode -1) 63 | (flyspell-mode 1)) 64 | 65 | (add-hook 'after-init-hook (lambda () (diminish 'visual-line-mode "vl"))) 66 | 67 | (add-hook 'text-mode-hook #'siraben-enable-writing-modes) 68 | (add-hook 'markdown-mode-hook #'siraben-enable-writing-modes) 69 | (add-hook 'org-mode-hook #'siraben-enable-writing-modes) 70 | 71 | (require 'siraben-mdm) 72 | 73 | (add-hook 'sgml-mode-hook 74 | (lambda () 75 | (require 'rename-sgml-tag) 76 | (define-key sgml-mode-map (kbd "C-c C-r") 'rename-sgml-tag))) 77 | 78 | ;; De-duplicate kill ring entries. 79 | (setq kill-do-not-save-duplicates t) 80 | 81 | ;; Save the system clipboard when we put something in the kill ring in 82 | ;; Emacs. 83 | (setq save-interprogram-paste-before-kill t) 84 | 85 | ;;; Dired stuff 86 | ;; In case we want to restore the file we deleted.. 87 | (setq delete-by-moving-to-trash t) 88 | (use-package async 89 | :hook (after-init . dired-async-mode)) 90 | 91 | (eval-after-load 'dired 92 | '(define-key dired-mode-map (kbd "M-G") nil)) 93 | 94 | (setq ffap-machine-p-known 'reject) 95 | 96 | (use-package dashboard 97 | :commands (dashboard-mode) 98 | :hook (after-init . (lambda () (dashboard-mode) (dashboard-refresh-buffer))) 99 | :config 100 | (setq dashboard-set-footer nil) 101 | (setq dashboard-startup-banner 'logo) 102 | (setq dashboard-items '((recents . 10))) 103 | (setq dashboard-center-content t) 104 | (dashboard-setup-startup-hook)) 105 | 106 | ;;; Stefan Monnier . It is the opposite of fill-paragraph 107 | (defun unfill-paragraph (&optional region) 108 | "Takes a multi-line paragraph and makes it into a single line of text." 109 | (interactive (progn (barf-if-buffer-read-only) '(t))) 110 | (let ((fill-column (point-max)) 111 | ;; This would override `fill-column' if it's an integer. 112 | (emacs-lisp-docstring-fill-column t)) 113 | (fill-paragraph nil region))) 114 | 115 | ;; By MysteriousSilver on #emacs, Friday, June 18, 2021 at 07:34 UTC 116 | 117 | (defun anon-new-empty-buffer () 118 | "Create a new empty buffer." 119 | (interactive) 120 | (let (($buf (generate-new-buffer "untitled"))) 121 | (switch-to-buffer $buf) 122 | (text-mode) 123 | (setq buffer-offer-save t) 124 | $buf)) 125 | 126 | (global-set-key (kbd "M-p") #'backward-paragraph) 127 | (global-set-key (kbd "M-n") #'forward-paragraph) 128 | (global-set-key (kbd "M-N") #'anon-new-empty-buffer) 129 | 130 | (setq auto-save-interval 100) 131 | (setq kept-new-versions 10 132 | kept-old-verisons 0) 133 | 134 | ;; No backups 135 | (setq backup-inhibited 1) 136 | (setq delete-old-versions t) 137 | 138 | (setq recentf-max-saved-items 10000 139 | recentf-keep nil) 140 | 141 | (show-paren-mode 1) 142 | (setq show-paren-delay 0) 143 | 144 | (require 'paren) 145 | (set-face-background 'show-paren-match nil) 146 | (set-face-background 'show-paren-mismatch nil) 147 | (set-face-foreground 'show-paren-match "#ff0") 148 | (set-face-foreground 'show-paren-mismatch "#f00") 149 | (set-face-attribute 'show-paren-match nil :weight 'extra-bold) 150 | 151 | (use-package helm-swoop 152 | :commands (helm-swoop-without-pre-input helm-swoop) 153 | :bind 154 | (("C-S-s" . helm-swoop))) 155 | 156 | (provide 'siraben-editor) 157 | ;;; siraben-editor.el ends here 158 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-fonts.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-fonts.el --- Setup fonts 2 | 3 | ;;; Commentary: 4 | 5 | ;; This file sets up the use of the Hack font and various functions 6 | ;; that allow fonts to be resized. The font settings were inspired by 7 | ;; hrs's dotfiles repository at 8 | ;; `https://github.com/hrs/dotfiles/blob/master/emacs/.emacs.d/configuration.org' 9 | 10 | ;;; License: 11 | 12 | ;; This program is free software: you can redistribute it and/or modify 13 | ;; it under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation, either version 3 of the License, or 15 | ;; (at your option) any later version. 16 | 17 | ;; This program is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with this program. If not, see . 24 | 25 | ;;; Code: 26 | 27 | (defvar siraben-default-font "DejaVu Sans Mono" "The default font type.") 28 | (defvar siraben-default-font-size 29 | (cond 30 | ((eq system-type 'darwin) 13) 31 | ((eq system-type 'gnu/linux) 10)) 32 | "The default font size.") 33 | 34 | (defvar siraben-font-change-increment 1.1 35 | "The multipler to the font size when `siraben-increase-font-size' is invoked.") 36 | 37 | (defun siraben-font-code () 38 | "Return a string representing the current font (like \"Hack-13\")." 39 | (concat siraben-default-font "-" 40 | (number-to-string siraben-current-font-size))) 41 | 42 | (defun siraben-set-font-size () 43 | "Set the font to `siraben-default-font' at `siraben-current-font-size'. 44 | Set that for the current frame, and also make it the default for 45 | other, future frames." 46 | (let ((font-code (siraben-font-code))) 47 | (add-to-list 'default-frame-alist (cons 'font font-code)) 48 | (set-frame-font font-code))) 49 | 50 | (defun siraben-reset-font-size () 51 | "Change font size back to `siraben-default-font-size'." 52 | (interactive) 53 | (setq siraben-current-font-size siraben-default-font-size) 54 | (siraben-set-font-size)) 55 | 56 | (defun siraben-increase-font-size () 57 | "Increase current font size by a factor of `siraben-font-change-increment'." 58 | (interactive) 59 | (setq siraben-current-font-size 60 | (ceiling (* siraben-current-font-size 61 | siraben-font-change-increment))) 62 | 63 | (siraben-set-font-size)) 64 | 65 | (defun siraben-decrease-font-size () 66 | "Decrease current font size by a factor of `siraben-font-change-increment', down to a minimum size of 1." 67 | (interactive) 68 | (setq siraben-current-font-size 69 | (max 1 70 | (floor (/ siraben-current-font-size 71 | siraben-font-change-increment)))) 72 | (siraben-set-font-size)) 73 | 74 | (add-hook 'after-init-hook 'siraben-reset-font-size) 75 | 76 | (provide 'siraben-fonts) 77 | ;;; siraben-fonts.el ends here 78 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-formula.el: -------------------------------------------------------------------------------- 1 | (defun formula-mode () 2 | (interactive) 3 | (kill-all-local-variables) 4 | (setq mode-name "Formula") 5 | (setq major-mode 'formula-mode) 6 | (run-hooks 'formula-mode-hook)) 7 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-forth.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-forth.el --- Specific modes and packages for Forth code. 2 | 3 | ;;; License: 4 | ;; This program is free software: you can redistribute it and/or modify 5 | ;; it under the terms of the GNU General Public License as published by 6 | ;; the Free Software Foundation, either version 3 of the License, or 7 | ;; (at your option) any later version. 8 | 9 | ;; This program is distributed in the hope that it will be useful, 10 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ;; GNU General Public License for more details. 13 | 14 | ;; You should have received a copy of the GNU General Public License 15 | ;; along with this program. If not, see . 16 | 17 | ;;; Commentary: 18 | 19 | ;;; Code: 20 | 21 | (use-package forth-mode) 22 | 23 | (provide 'siraben-forth) 24 | ;;; siraben-forth.el ends here 25 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-haskell.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-haskell.el -- Haskell programming customizations. 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Configures packages and various modes for Haskell programming. 21 | 22 | ;;; Code: 23 | 24 | (use-package flycheck-haskell) 25 | 26 | (use-package haskell-mode 27 | :mode "\\.hs" 28 | :config 29 | (setq haskell-process-suggest-add-package nil) 30 | (defvar haskell-prettify-symbols-alist 31 | '(("::" . ?∷) 32 | ("forall" . ?∀) 33 | ;; ("exists" . ?∃) 34 | ("->" . ?→) 35 | ("<-" . ?←) 36 | ("=>" . ?⇒) 37 | ("~>" . ?⇝) 38 | ("<~" . ?⇜) 39 | ("<>" . ?⨂) 40 | ("msum" . ?⨁) 41 | ("\\" . ?λ) 42 | ("not" . ?¬) 43 | ("&&" . ?∧) 44 | ("||" . ?∨) 45 | ("/=" . ?≠) 46 | ("<=" . ?≤) 47 | (">=" . ?≥) 48 | ("<<<" . ?⋘) 49 | (">>>" . ?⋙) 50 | 51 | ("`elem`" . ?∈) 52 | ("`notElem`" . ?∉) 53 | ("`member`" . ?∈) 54 | ("`notMember`" . ?∉) 55 | ("`union`" . ?∪) 56 | ("`intersection`" . ?∩) 57 | ("`isSubsetOf`" . ?⊆) 58 | ("`isProperSubsetOf`" . ?⊂) 59 | ("undefined" . ?⊥))) 60 | 61 | (defun my-haskell-mode-hook () 62 | (subword-mode t) 63 | (interactive-haskell-mode t) 64 | (diminish 'interactive-haskell-mode) 65 | (flycheck-haskell-setup) 66 | (setq-local prettify-symbols-alist haskell-prettify-symbols-alist) 67 | (prettify-symbols-mode 1) 68 | (haskell-indentation-mode t)) 69 | 70 | (add-hook 'haskell-mode-hook #'my-haskell-mode-hook) 71 | (add-hook 'inferior-haskell-mode-hook (lambda () (paredit-mode -1))) 72 | ) 73 | 74 | (use-package lsp-haskell) 75 | 76 | 77 | (provide 'siraben-haskell) 78 | ;;; siraben-haskell.el ends here 79 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-js.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-js.el --- Javascript mode customizations 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Configures packages and various modes for JavaScript programming. 21 | 22 | ;;; Code: 23 | 24 | (use-package js2-mode 25 | :disabled 26 | :config 27 | (setq js-indent-level 2) 28 | (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) 29 | (add-to-list 'auto-mode-alist '("\\.pac\\'" . js2-mode)) 30 | (add-to-list 'interpreter-mode-alist '("node" . js2-mode))) 31 | 32 | 33 | (add-hook 'js2-mode-hook 34 | #'(lambda () 35 | (setq-local electric-layout-rules '((?\; . after))))) 36 | 37 | (provide 'siraben-js) 38 | ;;; siraben-js.el ends here 39 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-keybindings.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-keybindings.el -- Customize keybindings 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;; This file sets up global keybindings. These keybindings are those 19 | ;; that weren't set up in `use-package' declarations. 20 | 21 | ;;; Commentary: 22 | 23 | ;; Customization of global keybindings. 24 | 25 | ;;; Code: 26 | 27 | ;; Custom functions 28 | (global-set-key (kbd "M-T") 'siraben-insert-time) 29 | 30 | ;; Fullscreen behavior like iTerm2. 31 | (global-set-key (kbd "") 'toggle-frame-fullscreen) 32 | 33 | (global-set-key (kbd "M-B") #'list-bookmarks) 34 | 35 | (global-set-key (kbd "M-Q") #'unfill-paragraph) 36 | 37 | ;; (require 'inline-string-rectangle) 38 | 39 | ;; (require 'mark-more-like-this) 40 | 41 | (global-set-key (kbd "C-x r t") 'string-rectangle) 42 | (global-set-key (kbd "C-x \\") 'align-regexp) 43 | 44 | (global-set-key (kbd "C-:") 'eval-print-last-sexp) 45 | 46 | (global-set-key (kbd "M-W") 'whitespace-cleanup) 47 | 48 | (global-unset-key (kbd "C-")) 49 | (global-unset-key (kbd "C-")) 50 | 51 | (provide 'siraben-keybindings) 52 | ;;; siraben-keybindings.el ends here 53 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-linux.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-linux.el --- This file runs when the host OS is gnu/linux. 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Currently only simple customizations. 21 | 22 | ;;; Code: 23 | 24 | (require 'scheme) 25 | (require 'ispell) 26 | 27 | (setq ispell-program-name "aspell") 28 | (setq scheme-program-name "guile") 29 | 30 | (provide 'siraben-linux) 31 | 32 | ;;; siraben-linux.el ends here 33 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-lisp.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-lisp.el --- Specific modes and packages for Lisp code. 2 | 3 | ;;; License: 4 | ;; This program is free software: you can redistribute it and/or modify 5 | ;; it under the terms of the GNU General Public License as published by 6 | ;; the Free Software Foundation, either version 3 of the License, or 7 | ;; (at your option) any later version. 8 | 9 | ;; This program is distributed in the hope that it will be useful, 10 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ;; GNU General Public License for more details. 13 | 14 | ;; You should have received a copy of the GNU General Public License 15 | ;; along with this program. If not, see . 16 | 17 | ;;; Commentary: 18 | 19 | ;;; Code: 20 | 21 | (require 'paren) 22 | 23 | (defun siraben-enable-lisp-editing-modes () 24 | "Enables a collection of modes for editing Lisp code." 25 | (interactive) 26 | (progn (setq show-paren-style 'mixed) 27 | (electric-pair-mode -1) 28 | (paredit-mode t) 29 | (rainbow-delimiters-mode t) 30 | (aggressive-indent-mode t) 31 | (show-paren-mode t) 32 | (undo-tree-mode t) 33 | (company-mode t))) 34 | 35 | (defvar siraben-lispy-mode-hooks 36 | '(clojure-mode-hook 37 | emacs-lisp-mode-hook 38 | lisp-mode-hook 39 | scheme-mode-hook 40 | racket-mode-hook)) 41 | 42 | (dolist (hook siraben-lispy-mode-hooks) 43 | (add-hook hook #'(lambda () 44 | (siraben-enable-lisp-editing-modes)))) 45 | 46 | (use-package scheme 47 | :config 48 | (setq scheme-program-name "guile") 49 | :hook (scheme-mode . (lambda () (flycheck-mode -1)))) 50 | 51 | (use-package geiser 52 | :disabled 53 | :defer 10 54 | :config 55 | (setq geiser-default-implementation 'guile) 56 | ;; Enable some Lisp modes like paredit and rainbow delimiters, but no 57 | ;; need to undo and auto complete. 58 | :hook (geiser-repl-mode . 59 | (lambda () 60 | (siraben-enable-lisp-editing-modes) 61 | (undo-tree-mode -1) 62 | (paredit-mode +1) 63 | (aggressive-indent-mode -1)))) 64 | 65 | (add-hook 'ielm-mode-hook 66 | (lambda () 67 | (siraben-enable-lisp-editing-modes) 68 | (undo-tree-mode -1) 69 | (paredit-mode +1) 70 | (aggressive-indent-mode -1))) 71 | 72 | (add-hook 'emacs-lisp-mode-hook 73 | (lambda () 74 | (flycheck-mode t))) 75 | 76 | (use-package racket-mode 77 | :config 78 | (add-to-list 'auto-mode-alist '("\\.rkt\\'" . racket-mode)) 79 | :hook (racket-mode . racket-xp-mode)) 80 | 81 | (provide 'siraben-lisp) 82 | ;;; siraben-lisp.el ends here 83 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-macos.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-macos.el --- This files runs when the host OS is macOS. 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Currently only simple customizations are being made. 21 | 22 | ;;; Code: 23 | 24 | (setq system-uses-terminfo nil) 25 | 26 | (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)) 27 | (add-to-list 'default-frame-alist '(ns-appearance . dark)) 28 | 29 | (set-fontset-font t 'unicode "Apple Color Emoji" nil 'append) 30 | 31 | (global-unset-key (kbd "s-t")) 32 | 33 | (provide 'siraben-macos) 34 | 35 | ;;; siraben-macos.el ends here 36 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-mdm.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-mdm.el -- emulating The Most Dangerous Writing App 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;; This mode was written from scratch by me after being inspired by 19 | ;; The Most Dangerous Writing App which can be found at 20 | ;; `https://www.themostdangerouswritingapp.com/' 21 | 22 | ;;; Commentary: 23 | ;; There's no guarantee that this code is up to style. It's very 24 | ;; hacky as it is, but it works good enough for my purposes. I'll 25 | ;; read the Emacs Lisp manual later. 26 | 27 | ;;; Code: 28 | (defvar siraben-mdt-grace 5) 29 | (defvar siraben-mdt-restore nil) 30 | (defvar siraben-mdm-timer nil) 31 | 32 | (defun siraben-mdm-timer-reset () 33 | "Reset the Most Dangerous Mode timer." 34 | (setq siraben-mdt-grace 5)) 35 | 36 | (defvar siraben-mdm-end-time 0) 37 | 38 | (defun most-dangerous-mode (&optional duration) 39 | "Activate the Most Dangerous Mode lasting DURATION minutes." 40 | (interactive "p") 41 | (siraben-mdm-timer-reset) 42 | (setq siraben-mdm-end-time (+ (or current-prefix-arg duration 300) (cadr (current-time))) 43 | siraben-mdm-timer 44 | (run-with-timer 1 1 #'(lambda () 45 | (unless (> siraben-mdm-grace 0) 46 | (backward-kill-word 1)) 47 | (setq mode-line-format 48 | (format "Siraben-Mdm-Grace: %d Time left: %d" 49 | (setq siraben-mdm-grace 50 | (- siraben-mdm-grace 1)) 51 | (- siraben-mdm-end-time 52 | (cadr (current-time))))) 53 | (force-mode-line-update))) 54 | siraben-mdm-restore mode-line-format) 55 | (add-hook 'post-self-insert-hook #'siraben-mdm-timer-reset) 56 | (run-at-time (- siraben-mdm-end-time (cadr (current-time))) 57 | nil 58 | (lambda () 59 | (cancel-timer siraben-mdm-timer) 60 | (remove-hook 'post-self-insert-hook #'siraben-mdm-timer-reset) 61 | (setq mode-line-format siraben-mdm-restore)))) 62 | 63 | (provide 'siraben-mdm) 64 | ;;; siraben-mdm.el ends here 65 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-nix.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-nix.el --- Nix programming customizations. 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; This file has Nix specific customizations. 21 | 22 | ;;; Code: 23 | 24 | 25 | (use-package nix-mode 26 | :after lsp-mode 27 | :hook (nix-mode . subword-mode)) 28 | 29 | (use-package nixpkgs-fmt 30 | :after nix-mode) 31 | 32 | (provide 'siraben-nix) 33 | ;;; siraben-nix.el ends here 34 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-ocaml.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-ocaml.el --- configures Emacs for OCaml development 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;;; Code: 21 | 22 | (use-package flycheck-ocaml) 23 | (use-package tuareg 24 | :hook ((tuareg-mode . 25 | (lambda () 26 | (add-function :before-while (local 'tree-sitter-hl-face-mapping-function) 27 | (lambda (capture-name) 28 | (not (string= capture-name "variable")))))))) 29 | 30 | 31 | (provide 'siraben-ocaml) 32 | ;;; siraben-ocaml.el ends here 33 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-org.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-org.el --- Org Mode customizations 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; This file configure Org mode, especially its agenda and notes 21 | ;; features. 22 | 23 | ;;; Code: 24 | 25 | (use-package org 26 | :bind 27 | (("C-c c" . org-capture) ("C-c l" . org-store-link) ("C-c a" . org-agenda)) 28 | :config 29 | (setq org-hide-emphasis-markers t 30 | org-fontify-emphasized-text t 31 | ;; org-image-actual-width nil 32 | org-src-fontify-natively t 33 | org-startup-with-inline-images t 34 | org-startup-truncated t 35 | org-adapt-indentation nil 36 | org-edit-src-content-indentation 0 37 | org-src-preserve-indentation nil 38 | org-agenda-diary-file nil 39 | org-habit-graph-column 50 40 | org-habit-preceding-days 20 41 | org-habit-following-days 4 42 | org-habit-show-habits-only-for-today t 43 | org-log-done 'time) 44 | 45 | ;; Org mode code block languages 46 | (org-babel-do-load-languages 47 | 'org-babel-load-languages 48 | `((emacs-lisp . t) 49 | (gnuplot . t) 50 | (,(if (version< emacs-version "26") 'sh 'shell) . t) 51 | (calc . t) 52 | (python . t) 53 | (scheme . t) 54 | (dot . t) 55 | (octave . t) 56 | (latex . t))) 57 | ;; I want to have source code syntax highlighting for LaTeX export as well. 58 | (setq org-latex-listings 'minted) 59 | (setq org-latex-packages-alist '(("" "minted"))) 60 | (setq org-latex-pdf-process 61 | '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" 62 | "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" 63 | "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) 64 | ;; These are code blocks that are "safe" to evaluate. 65 | (defun my-org-confirm-babel-evaluate (lang body) 66 | (not (or (string= lang "dot") 67 | (string= lang "gnuplot") 68 | (string= lang "octave")))) 69 | 70 | (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate) 71 | (setq org-modules '(org-mu4e 72 | org-habit 73 | org-crypt 74 | org-bbdb 75 | org-bibtex 76 | org-docview 77 | org-gnus 78 | org-info 79 | org-irc 80 | org-mhe 81 | org-rmail)) 82 | 83 | (setq org-export-backends '(ascii beamer html icalendar latex odt)) 84 | (setq org-list-allow-alphabetical t) 85 | (defvar org-electric-pairs '((?$ . ?$))) 86 | (defun org-add-electric-pairs () 87 | (setq-local electric-pair-pairs (append electric-pair-pairs org-electric-pairs)) 88 | (setq-local electric-pair-text-pairs electric-pair-pairs)) 89 | (add-hook 'org-mode-hook 'org-add-electric-pairs) 90 | 91 | (require 'ox-latex) 92 | (add-to-list 'org-latex-classes '("journal" "\\documentclass[11pt]{journal}" 93 | ("\\section{%s}" . "\\section*{%s}") 94 | ("\\subsection{%s}" . "\\subsection*{%s}") 95 | ("\\subsubsection{%s}" . "\\subsubsection*{%s}") 96 | ("\\paragraph{%s}" . "\\paragraph*{%s}") 97 | ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) 98 | (add-to-list 'org-latex-classes '("scrartcl" "\\documentclass[11pt]{scrartcl}" 99 | ("\\section{%s}" . "\\section*{%s}") 100 | ("\\subsection{%s}" . "\\subsection*{%s}") 101 | ("\\subsubsection{%s}" . "\\subsubsection*{%s}") 102 | ("\\paragraph{%s}" . "\\paragraph*{%s}") 103 | ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) 104 | ) 105 | 106 | (use-package gnuplot) 107 | (use-package htmlize) 108 | (use-package edit-indirect) 109 | (use-package org-wc) 110 | 111 | (use-package laas 112 | :hook ((LaTeX-mode org-mode) . laas-mode) 113 | :config ; do whatever here 114 | (aas-set-snippets 'laas-mode 115 | :cond #'laas-org-mathp 116 | "supp" "\\supp" 117 | "On" "O(n)" 118 | "O1" "O(1)" 119 | "Olog" "O(\\log n)" 120 | "Olon" "O(n \\log n)" 121 | ;; bind to functions! 122 | "Sum" (lambda () (interactive) 123 | (yas-expand-snippet "\\sum_{$1}^{$2} $0")) 124 | ) 125 | (aas-set-snippets 'laas-mode 126 | :cond #'texmathp 127 | "supp" "\\supp" 128 | "On" "O(n)" 129 | "O1" "O(1)" 130 | "Olog" "O(\\log n)" 131 | "Olon" "O(n \\log n)" 132 | ;; bind to functions! 133 | "Sum" (lambda () (interactive) 134 | (yas-expand-snippet "\\sum_{$1}^{$2} $0")) 135 | "lr" (lambda () (interactive) 136 | (yas-expand-snippet "\\left($0\\right)")) 137 | ) 138 | (apply #'aas-set-snippets 'laas-mode laas-basic-snippets) 139 | ) 140 | 141 | (provide 'siraben-org) 142 | ;;; siraben-org.el ends here 143 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-packages.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-packages.el --- Set up MELPA packages 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; This file sets up `use-package', which handles the installation of 21 | ;; most packages. 22 | 23 | ;;; Code: 24 | 25 | (defvar bootstrap-version) 26 | ;; (setq straight-check-for-modifications nil) 27 | (let ((bootstrap-file 28 | (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) 29 | (bootstrap-version 5)) 30 | (unless (file-exists-p bootstrap-file) 31 | (with-current-buffer 32 | (url-retrieve-synchronously 33 | "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 34 | 'silent 'inhibit-cookies) 35 | (goto-char (point-max)) 36 | (eval-print-last-sexp))) 37 | (load bootstrap-file nil 'nomessage)) 38 | 39 | ;; Ensure `use-package' is installed. 40 | (straight-use-package 'use-package) 41 | 42 | (setq straight-use-package-by-default t 43 | straight-vc-git-default-clone-depth 1) 44 | 45 | (require 'use-package) 46 | 47 | (setq use-package-compute-statistics t) 48 | 49 | ;; Ensure that all packages are downloaded to their latest version, 50 | ;; but also defer them to speed up init. 51 | (setq use-package-always-defer t) 52 | (setq use-package-verbose t) 53 | 54 | (use-package diminish 55 | :hook 56 | ((after-init . (lambda () 57 | (diminish 'auto-revert-mode) 58 | (diminish 'visual-line-mode "Visual Line") 59 | (diminish 'auto-fill-function "Auto Fill") 60 | (diminish 'eldoc-mode) 61 | (diminish 'lisp-interaction-mode))))) 62 | (use-package multiple-cursors 63 | :defer 3 64 | :commands (mc/mark-previous-like-this mc/mark-next-like mc/edit-lines mc/mark-more-like-this mc/mark-all-like-this) 65 | :bind (("C-<" . mc/mark-previous-like-this) 66 | ("C->" . mc/mark-next-like-this) 67 | ("C-S-c C-S-c" . mc/edit-lines) 68 | ("C-M-m" . mc/mark-more-like-this) 69 | ("s-G" . mc/mark-all-like-this))) 70 | 71 | (use-package rainbow-delimiters 72 | :hook 73 | ((racket-mode . rainbow-delimiters-mode))) 74 | 75 | (use-package markdown-mode 76 | :hook 77 | (markdown-mode . (lambda () 78 | (markdown-toggle-wiki-links t))) 79 | :config 80 | (setq markdown-link-space-sub-char " " 81 | markdown-wiki-link-alias-first nil 82 | markdown-enable-math t 83 | markdown-fontify-code-blocks-natively t)) 84 | 85 | (use-package magit 86 | :commands (magit-dispatch magit-blame) 87 | :bind 88 | (("C-x g" . magit-dispatch) 89 | ("M-L" . magit-blame))) 90 | 91 | (use-package free-keys 92 | :commands free-keys) 93 | 94 | (use-package yasnippet 95 | :diminish yas-minor-mode 96 | :hook (after-init . yas-global-mode) 97 | :config 98 | (setq yas-snippet-dirs `(,(concat siraben-root-dir "snippets")))) 99 | 100 | (use-package yasnippet-snippets) 101 | 102 | (use-package paredit 103 | :diminish paredit-mode 104 | :hook ((racket-repl-mode . paredit-mode))) 105 | 106 | (use-package undo-tree 107 | :diminish undo-tree-mode 108 | :commands (global-undo-tree-mode) 109 | :hook ((after-init . global-undo-tree-mode)) 110 | :config 111 | (defadvice undo-tree-make-history-save-file-name 112 | (after undo-tree activate) 113 | (setq ad-return-value (concat ad-return-value ".gz"))) 114 | (setq undo-tree-history-directory-alist 115 | `((".*" . ,temporary-file-directory))) 116 | (setq undo-tree-auto-save-history t)) 117 | 118 | (use-package aggressive-indent 119 | :diminish aggressive-indent-mode) 120 | 121 | (use-package company 122 | :diminish company-mode 123 | :config (global-company-mode t)) 124 | 125 | (use-package which-key 126 | :diminish 127 | :commands (which-key-mode) 128 | :hook (after-init . which-key-mode)) 129 | 130 | (when (memq window-system '(mac ns)) 131 | (use-package exec-path-from-shell 132 | :defer 3 133 | :hook 134 | (after-init . (lambda () 135 | (exec-path-from-shell-initialize) 136 | (exec-path-from-shell-copy-envs 137 | '("PATH" "NIX_PATH" "NIX_SSL_CERT_FILE" "COQPATH")))))) 138 | 139 | (use-package helm 140 | :diminish (helm-mode) 141 | :commands (helm-mode helm-resume) 142 | :config 143 | (setq helm-split-window-in-side-p t 144 | helm-buffers-fuzzy-matching t 145 | helm-move-to-line-cycle-in-source t 146 | helm-ff-search-library-in-sexp t 147 | helm-ff-file-name-history-use-recentf t 148 | helm-autoresize-max-height 0 149 | helm-autoresize-min-height 40 150 | helm-autoresize-mode t) 151 | :bind (("C-h a" . helm-apropos) 152 | ("C-h f" . helm-apropos) 153 | ("C-h r" . helm-info-emacs) 154 | ("C-x C-f" . helm-find-files) 155 | ("M-x" . helm-M-x) 156 | ("C-x b" . helm-mini) 157 | ("C-x C-b" . helm-resume)) 158 | :hook 159 | (after-init . helm-mode)) 160 | 161 | (use-package helm-rg 162 | :commands (helm-rg) 163 | :bind (("M-G" . helm-rg))) 164 | 165 | ;; Enable my favorite color scheme. 166 | (use-package color-theme-sanityinc-tomorrow 167 | :demand 168 | :config (load-theme 'sanityinc-tomorrow-night t)) 169 | 170 | (use-package spaceline 171 | :commands (spaceline-emacs-theme spaceline-helm-mode) 172 | :config (setq powerline-default-separator 'arrow) 173 | :hook 174 | (after-init . (lambda () 175 | (spaceline-emacs-theme) 176 | (spaceline-helm-mode)))) 177 | 178 | (use-package webpaste 179 | :config 180 | (setq webpaste-provider-priority '("dpaste.de" "ix.io")) 181 | (setq webpaste-paste-raw-text t)) 182 | 183 | (use-package auctex 184 | :config 185 | (setq TeX-auto-save t 186 | TeX-parse-self t 187 | TeX-master nil 188 | TeX-PDF-mode t) 189 | :hook 190 | (LaTeX-mode . (lambda () 191 | (siraben-enable-writing-modes) 192 | (company-auctex-init) 193 | (setq TeX-command-extra-options "-shell-escape") 194 | (auto-fill-mode 1) 195 | (flyspell-mode t)))) 196 | 197 | (use-package lsp-mode 198 | :config 199 | (require 'lsp-mode) 200 | ;; (advice-add 'lsp :before #'direnv-update-environment) 201 | (setq lsp-clients-clangd-args '("-j=4" "-log=error")) 202 | (setq lsp-auto-guess-root t) 203 | (setq lsp-log-io nil) 204 | (setq lsp-restart 'interactive) 205 | (setq lsp-enable-symbol-highlighting nil) 206 | (setq lsp-enable-on-type-formatting nil) 207 | (setq lsp-signature-auto-activate nil) 208 | (setq lsp-signature-render-documentation nil) 209 | (setq lsp-eldoc-hook nil) 210 | (setq lsp-modeline-code-actions-enable nil) 211 | (setq lsp-modeline-diagnostics-enable nil) 212 | (setq lsp-headerline-breadcrumb-enable nil) 213 | (setq lsp-semantic-tokens-enable nil) 214 | (setq lsp-enable-folding nil) 215 | (setq lsp-enable-imenu nil) 216 | (setq lsp-enable-snippet nil) 217 | (setq lsp-idle-delay 0.5) 218 | (setq lsp-file-watch-threshold 500) 219 | (setq lsp-enable-dap-auto-configure nil) 220 | ;; append "^~" to lsp-file-watch-ignored to ignore files in home directory 221 | (setq lsp-file-watch-ignored 222 | (append lsp-file-watch-ignored '("^~"))) 223 | ;; (lsp-register-client 224 | ;; (make-lsp-client :new-connection (lsp-stdio-connection "ruff") 225 | ;; :major-modes '(python-mode) 226 | ;; :server-id 'ruff)) 227 | ) 228 | 229 | (use-package lsp-ui) 230 | 231 | (use-package helm-lsp :commands helm-lsp-workspace-symbol) 232 | 233 | (use-package company-auctex) 234 | 235 | (use-package flycheck 236 | :diminish) 237 | 238 | (use-package direnv 239 | :disabled 240 | :config (direnv-mode)) 241 | 242 | (use-package envrc 243 | ;; add hook after init 244 | :hook (after-init . envrc-global-mode) 245 | ) 246 | 247 | (use-package esup 248 | :commands (esup) 249 | :config 250 | (setq esup-user-init-file (file-truename "~/.emacs.d/init.el"))) 251 | 252 | (use-package yaml-mode) 253 | (use-package build-farm) 254 | 255 | (use-package editorconfig 256 | :config 257 | (editorconfig-mode 1)) 258 | 259 | (use-package graphviz-dot-mode) 260 | 261 | (use-package tree-sitter-langs 262 | :defer 3 263 | :demand 264 | :config 265 | (setq tree-sitter-load-path `(,(expand-file-name "~/.tree-sitter/bin")))) 266 | 267 | (use-package promela-mode 268 | :commands (promela-mode) 269 | :after tree-sitter-langs 270 | :mode (("\\.pml\\'" . promela-mode)) 271 | :config 272 | (add-to-list 'auto-mode-alist '("\\.pml\\'" . promela-mode)) 273 | (defun promela-tree-sitter-setup () 274 | (interactive) 275 | (setq tree-sitter-hl-default-patterns " 276 | (number) @number 277 | (comment) @comment 278 | (uname) @variable.builtin 279 | (varref) @variable.builtin 280 | [\"bit\" \"bool\" \"byte\" \"chan\" \"int\" \"mtype\" \"pid\" \"short\"] @type 281 | [ 282 | \"active\" 283 | \"assert\" 284 | \"atomic\" 285 | (break) 286 | \"d_step\" 287 | \"do\" 288 | \"else\" 289 | \"enabled\" 290 | \"fi\" 291 | \"hidden\" 292 | \"if\" 293 | \"init\" 294 | \"len\" 295 | \"never\" 296 | \"od\" 297 | \"of\" 298 | \"pc_value\" 299 | \"printf\" 300 | \"priority\" 301 | \"proctype\" 302 | \"provided\" 303 | \"run\" 304 | (skip) 305 | \"timeout\" 306 | \"typedef\" 307 | \"unless\" 308 | \"xr\" 309 | \"xs\" 310 | ] @keyword") 311 | (tree-sitter-require 'promela)) 312 | (add-hook 'promela-mode-hook 313 | (lambda () 314 | (promela-tree-sitter-setup) 315 | (font-lock-fontify-buffer))) 316 | ;; :hook (promela-mode . promela-tree-sitter-setup) 317 | :straight (promela-mode :type git :host github 318 | :repo "g15ecb/promela-mode")) 319 | 320 | (load "siraben-formula.el") 321 | (add-to-list 'auto-mode-alist '("\\.4ml\\'" . formula-mode)) 322 | (defun formula-tree-sitter-setup () 323 | (interactive) 324 | (setq tree-sitter-hl-default-patterns 325 | "[ 326 | \"domain\" 327 | \"model\" 328 | \"transform\" 329 | \"system\" 330 | \"machine\" 331 | \"partial\" 332 | \"ensures\" 333 | \"requires\" 334 | \"conforms\" 335 | \"includes\" 336 | \"extends\" 337 | \"of\" 338 | \"returns\" 339 | \"at\" 340 | \"some\" 341 | \"atleast\" 342 | \"atmost\" 343 | \"initially\" 344 | \"next\" 345 | \"property\" 346 | \"boot\" 347 | \"no\" 348 | \"is\" 349 | \"new\" 350 | \"inj\" 351 | \"bij\" 352 | \"sur\" 353 | \"fun\" 354 | \"any\" 355 | ] @keyword 356 | 357 | (comment) @comment 358 | 359 | [ 360 | (digits) 361 | (real) 362 | (frac) 363 | ] @number 364 | 365 | (string) @string 366 | 367 | (type_decl type: _ @type) 368 | (typeid) @type 369 | (func_term name: (_) @function.call) 370 | 371 | [ \"+\" \"-\" \"*\" \"/\" \":-\" \"::=\" \"::\" \"=>\" \"->\" \"=\" ] @operator 372 | 373 | [ \".\" \"|\" \",\" ] @punctuation.delimiter 374 | 375 | [ \"(\" \")\" \"{\" \"}\" \"[\" \"]\" ] @punctuation.bracket 376 | 377 | (id) @variable.builtin 378 | 379 | (enum_cnst) @constant.builtin 380 | 381 | (field name: _ @property.definition) 382 | (val_or_model_program name: _ @property) 383 | 384 | (domain_sig name: _ @type) 385 | (mod_ref_rename name: _ @property (bareid) @type) 386 | (mod_ref_no_rename (bareid) @type) 387 | 388 | (transform name: (bareid) @function) 389 | 390 | (model_intro (bareid) @constructor) 391 | (model_fact (bareid) @variable) 392 | 393 | (constraint (id) (func_term (atom (id))) @type) 394 | ") 395 | (tree-sitter-require 'formula) 396 | ) 397 | (add-hook 'formula-mode-hook 398 | (lambda () 399 | (formula-tree-sitter-setup) 400 | (font-lock-fontify-buffer))) 401 | 402 | (load "siraben-cool.el") 403 | (add-to-list 'auto-mode-alist '("\\.cl\\'" . cool-mode)) 404 | (defun cool-tree-sitter-setup () 405 | (interactive) 406 | (setq tree-sitter-hl-default-patterns 407 | "[ 408 | \"if\" 409 | \"then\" 410 | \"else\" 411 | \"fi\" 412 | \"while\" 413 | \"loop\" 414 | \"pool\" 415 | \"case\" 416 | \"esac\" 417 | \"new\" 418 | \"isvoid\" 419 | \"not\" 420 | \"true\" 421 | \"false\" 422 | \"class\" 423 | \"inherits\" 424 | \"of\" 425 | \"let\" 426 | \"in\" 427 | ] @keyword 428 | 429 | (comment) @comment 430 | 431 | (string) @string 432 | 433 | (type) @type 434 | 435 | (id) @variable.builtin 436 | 437 | (int) @number 438 | 439 | [ \"(\" \")\" \"{\" \"}\" ] @punctuation.bracket 440 | 441 | [ \"+\" \"-\" \"*\" \"/\" \"=>\" \"<-\" \"=\" \"<=\" \"<\" \"~\" ] @operator 442 | 443 | (functionCall name: (_) @function.call) 444 | 445 | (dispatch name: (_) @method.call) 446 | 447 | (feature (method name: (_) @method)) 448 | ") 449 | 450 | (tree-sitter-require 'cool) 451 | ) 452 | (add-hook 'cool-mode-hook 453 | (lambda () 454 | (cool-tree-sitter-setup) 455 | (font-lock-fontify-buffer))) 456 | 457 | (use-package solidity-mode) 458 | 459 | (use-package tree-sitter 460 | :demand 461 | :diminish "ts" 462 | :hook (tree-sitter-after-on . tree-sitter-hl-mode) 463 | :config 464 | (setq tree-sitter-load-path `(,(expand-file-name "~/.tree-sitter/bin"))) 465 | (require 'tree-sitter-langs) 466 | (global-tree-sitter-mode) 467 | (setq tree-sitter-major-mode-language-alist 468 | `((nix-mode . nix) 469 | (markdown-mode . markdown) 470 | (latex-mode . latex) 471 | (yaml-mode . yaml) 472 | (typescript-mode . tsx) 473 | (conf-toml-mode . toml) 474 | (graphviz-dot-mode . dot) 475 | (makefile-bsdmake-mode . make) 476 | (sml-mode . sml) 477 | (solidity-mode . solidity) 478 | (promela-mode . promela) 479 | (formula-mode . formula) 480 | (cool-mode . cool) 481 | (kotlin-mode . kotlin) 482 | ,@tree-sitter-major-mode-language-alist)) 483 | ;; remove haskell-mode 484 | (setq tree-sitter-major-mode-language-alist 485 | (assq-delete-all 'haskell-mode tree-sitter-major-mode-language-alist)) 486 | ) 487 | 488 | 489 | (use-package vterm 490 | :if (require 'vterm-module nil t) 491 | :config 492 | (setq vterm-timer-delay nil)) 493 | 494 | (use-package multi-vterm 495 | :commands (multi-vterm) 496 | :bind ("" . multi-vterm)) 497 | 498 | (use-package projectile 499 | :commands (projectile-mode) 500 | :config 501 | (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)) 502 | 503 | (use-package kotlin-mode 504 | :hook (kotlin-mode . lsp-deferred)) 505 | 506 | (use-package writeroom-mode) 507 | 508 | (use-package copilot 509 | :disabled 510 | :straight (:host github :repo "zerolfx/copilot.el" :files ("dist" "*.el")) 511 | :ensure t 512 | :hook (prog-mode . copilot-mode) 513 | :bind (:map copilot-completion-map 514 | ("" . copilot-accept-completion) 515 | ("TAB" . copilot-accept-completion)) 516 | :config 517 | (setq copilot-indent-offset-warning-disable t) 518 | ) 519 | 520 | ;; (use-package gptel) 521 | 522 | (use-package boogie-friends) 523 | 524 | (provide 'siraben-packages) 525 | ;;; siraben-packages.el ends here 526 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-programming.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-programming.el -- siraben's programming configuration 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; This file makes managing the different programming modes that 21 | ;; need to be loaded easier. 22 | 23 | ;;; Code: 24 | 25 | (global-set-key (kbd "M-C") 'comment-or-uncomment-region) 26 | 27 | (defun siraben-prog-mode-defaults () 28 | "Default programming mode hook, useful with any programming language." 29 | (flyspell-prog-mode) 30 | (diminish 'flyspell-mode) 31 | 32 | (electric-pair-mode +1) 33 | 34 | (set (make-local-variable 'comment-auto-fill-only-comments) t) 35 | 36 | (font-lock-add-keywords 37 | nil '(("\\<\\(\\(FIX\\(ME\\)?\\|TODO\\|REFACTOR\\):\\)" 38 | 1 font-lock-warning-face t)))) 39 | 40 | (add-hook 'prog-mode-hook #'(lambda () 41 | (siraben-prog-mode-defaults))) 42 | 43 | ;; https://emacs.stackexchange.com/questions/8135/why-does-compilation-buffer-show-control-characters 44 | (require 'ansi-color) 45 | 46 | (defun siraben-ansi-colorize-buffer () 47 | "Colorize the buffer with ANSI color." 48 | (let ((buffer-read-only nil)) 49 | (ansi-color-apply-on-region (point-min) (point-max)))) 50 | (add-hook 'compilation-filter-hook 'siraben-ansi-colorize-buffer) 51 | 52 | (add-hook 'after-init-hook #'(lambda () (require 'siraben-c))) 53 | ;; (require 'siraben-common-lisp) 54 | (require 'siraben-coq) 55 | (require 'siraben-forth) 56 | (require 'siraben-haskell) 57 | (require 'siraben-js) 58 | (require 'siraben-lisp) 59 | (require 'siraben-nix) 60 | (require 'siraben-prolog) 61 | (require 'siraben-python) 62 | (require 'siraben-rust) 63 | (require 'siraben-sml) 64 | (require 'siraben-typescript) 65 | (require 'siraben-ocaml) 66 | ;; (require 'siraben-ruby) 67 | 68 | (provide 'siraben-programming) 69 | ;;; siraben-programming.el ends here 70 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-prolog.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-prolog.el --- Prolog programming customizations. 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Configures packages and various modes for Prolog programming. 21 | 22 | ;;; Code: 23 | 24 | (use-package prolog) 25 | 26 | (use-package ediprolog 27 | :commands (ediprolog-dwim) 28 | :after prolog 29 | :bind (:map prolog-mode-map 30 | ("C-c C-c" . ediprolog-dwim) 31 | ("C-c M-o" . ediprolog-remove-interactions)) 32 | :config 33 | (setq ediprolog-system 'swi)) 34 | 35 | (add-hook 'after-init-hook 36 | (lambda () 37 | (autoload 'prolog-mode "prolog" "Major mode for editing Prolog programs." t) 38 | (add-to-list 'auto-mode-alist '("\\.pl\\'" . prolog-mode)) 39 | (add-to-list 'auto-mode-alist '("\\.plt\\'" . prolog-mode)))) 40 | 41 | (provide 'siraben-prolog) 42 | ;;; siraben-prolog.el ends here 43 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-python.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-python.el --- Python programming customizations. 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Configures packages and various modes for Python programming. 21 | 22 | ;;; Code: 23 | 24 | (require 'use-package) 25 | 26 | (use-package lsp-pyright 27 | :hook (python-mode . (lambda () 28 | (require 'lsp-pyright) 29 | (lsp)))) 30 | 31 | (use-package pyvenv) 32 | 33 | (provide 'siraben-python) 34 | ;;; siraben-python.el ends here 35 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-ruby.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-ruby.el --- Ruby programming customizations. 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Configures packages and various modes for Ruby programming. 21 | 22 | ;;; Code: 23 | 24 | (use-package lsp-ruby) 25 | 26 | (use-package ruby-mode 27 | :hook (ruby-mode . (lambda () 28 | (lsp-deferred)))) 29 | 30 | (provide 'siraben-ruby) 31 | ;;; siraben-ruby.el ends here 32 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-rust.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-rust.el --- Rust programming customizations. 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Configures packages and various modes for Rust programming. 21 | 22 | ;;; Code: 23 | 24 | (use-package flycheck-rust) 25 | (use-package rustic) 26 | 27 | (use-package rust-mode 28 | :config 29 | (require 'rust-mode) 30 | (setq rust-format-on-save t) 31 | (defun my-rust-mode-hook () 32 | (rustic-mode) 33 | (flycheck-rust-setup) 34 | (local-set-key (kbd "s-b") 'recompile) 35 | (subword-mode t) 36 | (lsp)) 37 | (add-hook 'rust-mode-hook #'my-rust-mode-hook)) 38 | 39 | (provide 'siraben-rust) 40 | ;;; siraben-rust.el ends here 41 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-shell.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-shell.el --- Configures Emacs Shell and Terminal modes. 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Make some shell customizations. 21 | 22 | ;;; Code: 23 | 24 | (when-let ((n (executable-find "zsh"))) 25 | (setq-default shell-file-name n)) 26 | 27 | (provide 'siraben-shell) 28 | ;;; siraben-shell.el ends here 29 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-sml.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-sml.el --- Specific modes and packages for Standard ML code. 2 | 3 | ;;; License: 4 | ;; This program is free software: you can redistribute it and/or modify 5 | ;; it under the terms of the GNU General Public License as published by 6 | ;; the Free Software Foundation, either version 3 of the License, or 7 | ;; (at your option) any later version. 8 | 9 | ;; This program is distributed in the hope that it will be useful, 10 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ;; GNU General Public License for more details. 13 | 14 | ;; You should have received a copy of the GNU General Public License 15 | ;; along with this program. If not, see . 16 | 17 | ;;; Commentary: 18 | 19 | ;; Configures packages and various modes for Standard ML programming. 20 | 21 | ;;; Code: 22 | 23 | (use-package sml-mode 24 | :hook ((sml-mode-hook inferior-sml-mode-hook) . (lambda () 25 | (paredit-mode -1) 26 | (electric-indent-mode -1)))) 27 | 28 | (use-package ob-sml) 29 | 30 | (provide 'siraben-sml) 31 | ;;; siraben-sml.el ends here 32 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-tramp.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-tramp.el -- siraben's TRAMP configuration 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; This file makes managing the different programming modes that 21 | ;; need to be loaded easier. 22 | 23 | ;;; Code: 24 | 25 | (setq tramp-default-method "ssh") 26 | (setq password-cache-expiry nil) 27 | (setq tramp-histfile-override t) 28 | 29 | (defun remote-ansi-term (&optional path name) 30 | "Opens an ansi terminal at PATH. If no PATH is given, it uses 31 | the value of `default-directory'. PATH may be a tramp remote path. 32 | The ansi-term buffer is named based on `name' " 33 | (interactive) 34 | (unless path (setq path default-directory)) 35 | (unless name (setq name "ansi-term")) 36 | (ansi-term "/bin/sh" name) 37 | (let ((path (replace-regexp-in-string "^file:" "" path)) 38 | (cd-str 39 | "fn=%s; if test ! -d $fn; then fn=$(dirname $fn); fi; cd $fn;") 40 | (bufname (concat "*" name "*" ))) 41 | (if (tramp-tramp-file-p path) 42 | (let ((tstruct (tramp-dissect-file-name path))) 43 | (cond 44 | ((equal (tramp-file-name-method tstruct) "ssh") 45 | (process-send-string bufname (format 46 | (concat "ssh -t %s '" 47 | cd-str 48 | "exec sh'; exec sh; clear\n") 49 | (tramp-file-name-host tstruct) 50 | (tramp-file-name-localname tstruct)))) 51 | (t (error "not implemented for method %s" 52 | (tramp-file-name-method tstruct))))) 53 | (process-send-string bufname (format (concat cd-str " exec sh;clear\n") 54 | path))))) 55 | 56 | (provide 'siraben-tramp) 57 | ;;; siraben-tramp.el ends here 58 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-typescript.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-typescript.el --- Typescript programming customizations. 2 | 3 | ;;; License: 4 | 5 | ;; This program is free software: you can redistribute it and/or modify 6 | ;; it under the terms of the GNU General Public License as published by 7 | ;; the Free Software Foundation, either version 3 of the License, or 8 | ;; (at your option) any later version. 9 | 10 | ;; This program is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;; GNU General Public License for more details. 14 | 15 | ;; You should have received a copy of the GNU General Public License 16 | ;; along with this program. If not, see . 17 | 18 | ;;; Commentary: 19 | 20 | ;; Configures packages and various modes for TypeScript programming. 21 | 22 | ;;; Code: 23 | 24 | (use-package typescript-mode 25 | :hook (typescript-mode . (lambda () 26 | (setq typescript-indent-level 2) 27 | (lsp-deferred))) 28 | :mode (("\\.ts\\'" . typescript-mode) 29 | ("\\.tsx\\'" . typescript-mode))) 30 | 31 | 32 | (provide 'siraben-typescript) 33 | ;;; siraben-typescript.el ends here 34 | -------------------------------------------------------------------------------- /emacs/.emacs.d/modules/siraben-ui.el: -------------------------------------------------------------------------------- 1 | ;;; siraben-ui.el -- configure Emacs' visual appearance. 2 | 3 | ;; This program is free software: you can redistribute it and/or modify 4 | ;; it under the terms of the GNU General Public License as published by 5 | ;; the Free Software Foundation, either version 3 of the License, or 6 | ;; (at your option) any later version. 7 | 8 | ;; This program is distributed in the hope that it will be useful, 9 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | ;; GNU General Public License for more details. 12 | 13 | ;; You should have received a copy of the GNU General Public License 14 | ;; along with this program. If not, see . 15 | 16 | ;;; Commentary: 17 | ;; This file configures the visual appearance of Emacs, loads 18 | ;; my favorite theme, and adds a smart mode line. 19 | 20 | ;;; Code: 21 | 22 | ;; Remove the annoying blinking cursor and bell ring. 23 | (blink-cursor-mode -1) 24 | (setq ring-bell-function 'ignore) 25 | 26 | ;; Disable startup screen. 27 | (setq inhibit-startup-screen t) 28 | 29 | ;; Nice scrolling. 30 | (setq scroll-margin 0 31 | scroll-conservatively 100000 32 | scroll-preserve-screen-position 1) 33 | 34 | (add-hook 'after-init-hook 35 | #'(lambda () 36 | (scroll-bar-mode -1) 37 | (display-time-mode t) 38 | (winner-mode t))) 39 | 40 | ;; Warn when opening files bigger than 100MB. 41 | (setq large-file-warning-threshold 100000000) 42 | 43 | ;; Enable short answers 44 | (fset 'yes-or-no-p 'y-or-n-p) 45 | 46 | ;; Extra mode line modes. 47 | (use-package fancy-battery 48 | :config (setq fancy-battery-show-percentage t) 49 | :hook (after-init . fancy-battery-mode)) 50 | 51 | ;; Make viewing PDFs better on HiDPI displays 52 | (setq doc-view-resolution 230) 53 | 54 | (when (fboundp 'pixel-scroll-precision-mode) 55 | (pixel-scroll-precision-mode)) 56 | 57 | (provide 'siraben-ui) 58 | ;;; siraben-ui.el ends here 59 | -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/coq-mode/DECL: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: DECL 3 | # expand-env: ((yas-indent-line 'fixed)) 4 | # key: DECL 5 | # -- 6 | Definition $1_spec : ident * funspec := 7 | DECLARE _$1 8 | WITH $2 9 | PRE [ $3 ] 10 | PROP ($4) 11 | PARAMS ($5) 12 | SEP ($6) 13 | POST [ $7 ] 14 | PROP ($8) 15 | RETURN ($9) 16 | SEP ($10). 17 | -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/coq-mode/MAIN: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: MAIN 3 | # expand-env: ((yas-indent-line 'fixed)) 4 | # key: MAIN 5 | # -- 6 | Definition main_spec := 7 | DECLARE _main 8 | WITH gv : globals 9 | PRE [] main_pre prog tt gv 10 | POST [ tint ] 11 | PROP() 12 | RETURN ($1) 13 | SEP(TT). -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/coq-mode/PROP: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: PROP 3 | # expand-env: ((yas-indent-line 'fixed)) 4 | # key: PROP 5 | # -- 6 | (PROP ($1) 7 | LOCAL ($2) 8 | SEP ($3)) -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/nix-mode/cc: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: C compiler 3 | # key: cc 4 | # -- 5 | \${stdenv.cc.targetPrefix}cc -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/nix-mode/flake: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: flake 3 | # key: flake 4 | # -- 5 | { 6 | description = "$1"; 7 | inputs = { 8 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 9 | utils.url = "github:numtide/flake-utils"; 10 | }; 11 | 12 | outputs = { self, nixpkgs, utils }: 13 | utils.lib.eachDefaultSystem (system: 14 | with import nixpkgs { inherit system; }; { 15 | defaultPackage = stdenv.mkDerivation { 16 | name = "$2"; 17 | nativeBuildInputs = [ $3 ]; 18 | buildInputs = [ $4 ]; 19 | src = ./.; 20 | }; 21 | } 22 | ); 23 | } -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/nix-mode/go_github: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: go github 3 | # key: gg 4 | # -- 5 | { lib, buildGoModule, fetchFromGitHub }: 6 | 7 | buildGoModule rec { 8 | pname = "$1"; 9 | version = "$2"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "$3"; 13 | repo = "$1"; 14 | rev = "${4:v\$\{version\}}"; 15 | sha256 = lib.fakeSha256; 16 | }; 17 | 18 | vendorSha256 = lib.fakeSha256; 19 | 20 | meta = with lib; { 21 | description = "$5"; 22 | homepage = "https://${6:github.com/$3/$1}"; 23 | license = licenses.${7:$$ 24 | (yas-choose-value '( 25 | "asl20" 26 | "bsd2" 27 | "bsd3" 28 | "free" 29 | "gpl2Only" 30 | "gpl2Plus" 31 | "gpl3Only" 32 | "gpl3Plus" 33 | "isc" 34 | "lgpl21Only" 35 | "lgpl21Plus" 36 | "lgpl2Only" 37 | "lgpl2Plus" 38 | "lgpl3Only" 39 | "mit" 40 | "mpl20" 41 | "ofl" 42 | "unfree" 43 | ))}; 44 | maintainers = with maintainers; [ $10 ]; 45 | }; 46 | } -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/nix-mode/install: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: install 3 | # key: install 4 | # -- 5 | install -Dm755 -t $out/bin $1 -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/nix-mode/meta: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: meta 3 | # key: meta 4 | # -- 5 | meta = with lib; { 6 | description = "$1"; 7 | homepage = "https://${2:github.com/$3/$4}"; 8 | license = licenses.${5:$$ 9 | (yas-choose-value '( 10 | "asl20" 11 | "bsd2" 12 | "bsd3" 13 | "free" 14 | "gpl2Only" 15 | "gpl2Plus" 16 | "gpl3Only" 17 | "gpl3Plus" 18 | "isc" 19 | "lgpl21Only" 20 | "lgpl21Plus" 21 | "lgpl2Only" 22 | "lgpl2Plus" 23 | "lgpl3Only" 24 | "mit" 25 | "mpl20" 26 | "ofl" 27 | "unfree" 28 | ))}; 29 | maintainers = with maintainers; [ $6 ]; 30 | platforms = platforms.${7:$$ 31 | (yas-choose-value '( 32 | "linux" 33 | "unix" 34 | "all" 35 | "darwin" 36 | "gnu" 37 | "freebsd" 38 | "openbsd" 39 | "netbsd" 40 | "cygwin" 41 | "illumos" 42 | "none" 43 | "allBut" 44 | "mesaPlatforms" 45 | "x86" 46 | "i686" 47 | "arm" 48 | "mips" 49 | ))}; 50 | }; 51 | -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/nix-mode/nativeBuildInputs: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: nativeBuildInputs 3 | # key: nbi 4 | # -- 5 | nativeBuildInputs = [ $1 ]; -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/nix-mode/package_github: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: package github 3 | # key: pg 4 | # -- 5 | { lib, stdenv, fetchFromGitHub$1 }: 6 | 7 | stdenv.mkDerivation rec { 8 | pname = "$2"; 9 | version = "$3"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "$4"; 13 | repo = "$2"; 14 | rev = "${5:v\$\{version\}}"; 15 | sha256 = lib.fakeSha256; 16 | }; 17 | 18 | buildInputs = [ $1 ]; 19 | 20 | meta = with lib; { 21 | description = "$6"; 22 | homepage = "https://${7:github.com/$4/$2}"; 23 | 24 | license = licenses.${8:$$ 25 | (yas-choose-value '( 26 | "asl20" 27 | "bsd2" 28 | "bsd3" 29 | "free" 30 | "gpl2Only" 31 | "gpl2Plus" 32 | "gpl3Only" 33 | "gpl3Plus" 34 | "isc" 35 | "lgpl21Only" 36 | "lgpl21Plus" 37 | "lgpl2Only" 38 | "lgpl2Plus" 39 | "lgpl3Only" 40 | "mit" 41 | "mpl20" 42 | "ofl" 43 | "unfree" 44 | ))}; 45 | maintainers = with maintainers; [ $9 ]; 46 | platforms = platforms.${10:$$ 47 | (yas-choose-value '( 48 | "linux" 49 | "unix" 50 | "all" 51 | "darwin" 52 | "gnu" 53 | "freebsd" 54 | "openbsd" 55 | "netbsd" 56 | "cygwin" 57 | "illumos" 58 | "none" 59 | "allBut" 60 | "mesaPlatforms" 61 | "x86" 62 | "i686" 63 | "arm" 64 | "mips" 65 | ))}; 66 | }; 67 | } 68 | -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/nix-mode/rust_github: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: rust github 3 | # key: rg 4 | # -- 5 | { lib, stdenv, fetchFromGitHub, rustPlatform, Security }: 6 | 7 | rustPlatform.buildRustPackage rec { 8 | pname = "$1"; 9 | version = "$2"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "$3"; 13 | repo = "$1"; 14 | rev = "${4:v\$\{version\}}"; 15 | sha256 = lib.fakeSha256; 16 | }; 17 | 18 | cargoSha256 = lib.fakeSha256; 19 | 20 | buildInputs = lib.optionals stdenv.isDarwin [ Security ]; 21 | 22 | meta = with lib; { 23 | description = "$5"; 24 | homepage = "https://${6:github.com/$3/$1}"; 25 | license = licenses.${7:$$ 26 | (yas-choose-value '( 27 | "asl20" 28 | "bsd2" 29 | "bsd3" 30 | "free" 31 | "gpl2Only" 32 | "gpl2Plus" 33 | "gpl3Only" 34 | "gpl3Plus" 35 | "isc" 36 | "lgpl21Only" 37 | "lgpl21Plus" 38 | "lgpl2Only" 39 | "lgpl2Plus" 40 | "lgpl3Only" 41 | "mit" 42 | "mpl20" 43 | "ofl" 44 | "unfree" 45 | ))}; 46 | maintainers = with maintainers; [ $10 ]; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/nix-mode/stdenv_no_cc: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: stdenv no cc 3 | # key: nocc 4 | # -- 5 | stdenvNoCC -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/nix-mode/substituteInPlace: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: substituteInPlace 3 | # key: sip 4 | # -- 5 | substituteInPlace $1 --replace "$2" "$3" -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/org-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | latex-mode -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/org-mode/align: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: align 3 | # key: ali 4 | # -- 5 | \begin{align*} 6 | $0 7 | \end{align*} 8 | -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/org-mode/capt: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: caption 3 | # key: cap 4 | # -- 5 | #+CAPTION: $0 -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/org-mode/header: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: header 3 | # key: header 4 | # -- 5 | #+TITLE: $1 6 | #+AUTHOR: Siraphob (Ben) Phipathananunth 7 | #+OPTIONS: toc:nil num:nil 8 | #+LATEX_CLASS: scrartcl 9 | #+LATEX_HEADER: \usepackage[margin=1in]{geometry} 10 | 11 | $2 -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/org-mode/margin: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: margin 3 | # key: margin 4 | # -- 5 | #+LATEX_HEADER: \usepackage[margin=1in]{geometry} -------------------------------------------------------------------------------- /emacs/.emacs.d/snippets/text-mode/exp: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: expand platforms 3 | # key: exp 4 | # -- 5 | $1: expand platforms to ${2:unix} -------------------------------------------------------------------------------- /emacs/.emacs.d/straight/versions/default.el: -------------------------------------------------------------------------------- 1 | (("LaTeX-auto-activating-snippets" . "f5fb180ab23b7eb0695ade84c9077aa701f47bbf") 2 | ("PG" . "af2e7b9a4e938ec485915b8a4d1ea918438758a0") 3 | ("aggressive-indent-mode" . "a437a45868f94b77362c6b913c5ee8e67b273c42") 4 | ("auctex" . "e06a5fd871df71b959adb0909d2f9e0ed8d1387b") 5 | ("auto-activating-snippets" . "ddc2b7a58a2234477006af348b30e970f73bc2c1") 6 | ("bind-key" . "aa22c8c3c740c2f306509b9c37d9511cfa41b612") 7 | ("boogie-friends" . "54905dab2944e7e808aa9445727646d7a3855174") 8 | ("bui.el" . "f3a137628e112a91910fd33c0cff0948fa58d470") 9 | ("build-farm.el" . "5c268a3c235ace0d79ef1ec82c440120317e06f5") 10 | ("caml-mode" . "744333dc4c4bd8b93e037efa8f7362b0903b96a2") 11 | ("clang-format" . "a099177b5cd5060597d454e4c1ffdc96b92ba985") 12 | ("color-theme-sanityinc-tomorrow" . "f3a993da26b3b6f778f5943e095e8b2816a6475c") 13 | ("company-auctex" . "9400a2ec7459dde8cbf1a5d50dfee4e300ed7e18") 14 | ("company-coq" . "5affe7a96a25df9101f9e44bac8a828d8292c2fa") 15 | ("company-math" . "3eb006874e309ff4076d947fcbd61bb6806aa508") 16 | ("company-mode" . "41f07c7d401c1374a76f3004a3448d3d36bdf347") 17 | ("compat" . "2aee8353772745bb18db1ca63729a7f5ea572a74") 18 | ("dash.el" . "fcb5d831fc08a43f984242c7509870f30983c27c") 19 | ("diminish.el" . "fbd5d846611bad828e336b25d2e131d1bc06b83d") 20 | ("ediprolog" . "de0ca05024c4dc6af9f3863a5c3eb06beec6de82") 21 | ("edit-indirect" . "82a28d8a85277cfe453af464603ea330eae41c05") 22 | ("editorconfig-emacs" . "d2beb3ec2e7f84505818594124a7202d5d6d0185") 23 | ("el-get" . "ec5cba8d965980b2c47a8a11dce30dd5e845ed2a") 24 | ("eldoc" . "1d11743436e9ce0d11529bfdf1e548e64f31a92e") 25 | ("elisp-tree-sitter" . "3cfab8a0e945db9b3df84437f27945746a43cc71") 26 | ("emacs-async" . "bb3f31966ed65a76abe6fa4f80a960a2917f554e") 27 | ("emacs-clang-format-plus" . "ddd4bfe1a13c2fd494ce339a320a51124c1d2f68") 28 | ("emacs-dashboard" . "300f87567df7b177bb5a2f2b757983e80c596547") 29 | ("emacs-htmlize" . "8e3841c837b4b78bd72ad7f0436e919f39315a46") 30 | ("emacs-libvterm" . "056ad74653704bc353d8ec8ab52ac75267b7d373") 31 | ("emacs-nixpkgs-fmt" . "1f6fb42a5439589c44d99c661cc76958520323cc") 32 | ("emacs-reformatter" . "6ac08cebafb9e04b825ed22d82269ff69cc5f87f") 33 | ("emacs-request" . "c22e3c23a6dd90f64be536e176ea0ed6113a5ba6") 34 | ("emacs-solidity" . "8ba549e429e86778a0e079648f3bc3463fcb15f6") 35 | ("emacs-which-key" . "38d4308d1143b61e4004b6e7a940686784e51500") 36 | ("emacsmirror-mirror" . "270993a5378150a29e22d3a46bfce36645c9a600") 37 | ("envrc" . "4ca2166ac72e756d314fc2348ce1c93d807c1a14") 38 | ("esup" . "4b49c8d599d4cc0fbf994e9e54a9c78e5ab62a5f") 39 | ("exec-path-from-shell" . "4896a797252fbfdac32fb77508500ac7d220f717") 40 | ("f.el" . "931b6d0667fe03e7bf1c6c282d6d8d7006143c52") 41 | ("fancy-battery" . "9b88ae77a01aa3edc529840338bcb2db7f445822") 42 | ("flycheck" . "16b536b031cbfb5e95a3914ea1e6c1bcadb4d0ad") 43 | ("flycheck-haskell" . "0977232112d02b9515e272ab85fe0eb9e07bbc50") 44 | ("flycheck-ocaml" . "77f8ddbd9bfc3a11957ac7ec7e45d5fa9179b192") 45 | ("flycheck-rust" . "6c41144940a2d90c1b54979e8f00fbb4a59add7e") 46 | ("forth-mode" . "59c5ea89ca7593bd49cdde6caefa0893a8780105") 47 | ("free-keys" . "7348ce68192871b8a69b687ec124d9f816d493ca") 48 | ("gnu-elpa-mirror" . "f0d83858f9d1b250f788c2228214f2a7ef8b1a66") 49 | ("gnuplot" . "d2c035592568f08a58eff2391903bfeffa9f7733") 50 | ("graphviz-dot-mode" . "8ff793b13707cb511875f56e167ff7f980a31136") 51 | ("haskell-mode" . "e9c356739310332afe59b10ffa2e6c3e76f124e3") 52 | ("helm" . "fbea333386579497405d98d67ec2d76a4ac4985a") 53 | ("helm-lsp" . "54926afd10da52039f8858a99d426cae2aa4c07d") 54 | ("helm-rg" . "ee0a3c09da0c843715344919400ab0a0190cc9dc") 55 | ("helm-swoop" . "df90efd4476dec61186d80cace69276a95b834d2") 56 | ("ht.el" . "1c49aad1c820c86f7ee35bf9fff8429502f60fef") 57 | ("hydra" . "59a2a45a35027948476d1d7751b0f0215b1e61aa") 58 | ("inheritenv" . "b9e67cc20c069539698a9ac54d0e6cc11e616c6f") 59 | ("kotlin-mode" . "fddd747e5b4736e8b27a147960f369b86179ddff") 60 | ("let-alist" . "35a1dae3c540705433a510c13c8af80206b29b5f") 61 | ("llama" . "7de288e79329bfb3e2b4a2f9b574cf834bd371dd") 62 | ("lsp-haskell" . "081d5115ceb1f1647497a8a3de4ca0702aaadb48") 63 | ("lsp-mode" . "a0455e13208193b74cd71ff304a628f199e83d44") 64 | ("lsp-pyright" . "73377169beff8fe22cc6d52d65099db88bf49679") 65 | ("lsp-ui" . "a0dde8b52b4411cbac2eb053ef1515635ea0b7ed") 66 | ("magit" . "5876192dc6e048ba2ad5576e7a4789e22beb9877") 67 | ("magit-popup" . "d8585fa39f88956963d877b921322530257ba9f5") 68 | ("markdown-mode" . "90ad4af79a8bb65a3a5cdd6314be44abd9517cfc") 69 | ("math-symbol-lists" . "ac3eb053d3b576fcdd192b0ac6ad5090ea3a7079") 70 | ("melpa" . "6eb7943a6bc2593130db5f1faef404044714a894") 71 | ("merlin" . "018ad037e4646efe0fc3f091463ebbdb2947516a") 72 | ("multi-vterm" . "36746d85870dac5aaee6b9af4aa1c3c0ef21a905") 73 | ("multiple-cursors.el" . "89f1a8df9b1fc721b1672b4c7b6d3ab451e7e3ef") 74 | ("nix-mode" . "719feb7868fb567ecfe5578f6119892c771ac5e5") 75 | ("nongnu-elpa" . "0ef91e3285d0a55b9783ee12c7d346d99aa4af56") 76 | ("ob-sml" . "958165c92b6cff6cada5c85c8ae5887806b8451b") 77 | ("org" . "6d51edc0f938b6a049c1e23c0d1b24bd27cb5833") 78 | ("org-wc" . "dbbf794e4ec6c4080d945f43338185e34a4a582d") 79 | ("paredit" . "af075775af91f2dbc63b915d762b4aec092946c4") 80 | ("powerline" . "c35c35bdf5ce2d992882c1f06f0f078058870d4a") 81 | ("project" . "27c6b049145e5d382579bcf1e3e2ea96c6abd3c9") 82 | ("projectile" . "4dd84b02c9cd7b04616dc2d01ba7bc87f0d15be8") 83 | ("promela-mode" . "53863e62cfedcd0466e1e19b1ca7b5786cb7a576") 84 | ("pyvenv" . "31ea715f2164dd611e7fc77b26390ef3ca93509b") 85 | ("queue" . "8df1334d54d4735d2f821790422a850dfaaa08ef") 86 | ("racket-mode" . "a23104e156af6503893081b562274fa8e4d51b7d") 87 | ("rainbow-delimiters" . "f40ece58df8b2f0fb6c8576b527755a552a5e763") 88 | ("rust-mode" . "25d91cff281909e9b7cb84e31211c4e7b0480f94") 89 | ("rustic" . "29f912c7505e0c5a4f52122d67ae4259af90937e") 90 | ("s.el" . "dda84d38fffdaf0c9b12837b504b402af910d01d") 91 | ("seq" . "da86da9bf111f68fb81efd466d76d53af5aebc00") 92 | ("sml-mode" . "c33659fd9b62fab436366f731daa4339691dd6bf") 93 | ("spaceline" . "086420d16e526c79b67fc1edec4c2ae1e699f372") 94 | ("spinner" . "fa117f0893788f3fe24673715a6b83bb34d238dd") 95 | ("straight.el" . "483b205efb2eaa6be7c0dc7078b8c9dafcffb318") 96 | ("transient" . "902121268d72045da53c711932ff72017a33ce6c") 97 | ("tree-sitter-langs" . "b39071e6005750f7fcf40fc0d6be16c31fc794dc") 98 | ("tuareg" . "1600fdad28bdd2c55e52a87e7987713c6d5d1718") 99 | ("typescript.el" . "481df3ad2cdf569d8e6697679669ff6206fbd2f9") 100 | ("undo-tree" . "d8f72bbe7d3c3a2808986febd3bb1a46d4da7f51") 101 | ("use-package" . "bbfe01bdf15eeb61babffd1c5b6facd3d2ce3630") 102 | ("visual-fill-column" . "e391b52922086ac38397a3325933900b6d90f9f0") 103 | ("webpaste.el" . "e2a41530257f04b7ad2198d333adcf247a05277c") 104 | ("wfnames" . "164e4efa2a96bed201a0a5402e137ebeef15bcc6") 105 | ("with-editor" . "cc86ac08bdea5bbe2503ac1df3506b5e81330e16") 106 | ("writeroom-mode" . "cca2b4b3cfcfea1919e1870519d79ed1a69aa5e2") 107 | ("xref" . "412a91fa6d0187824886ef68303269d8b50d1687") 108 | ("xterm-color" . "2ad407c651e90fff2ea85d17bf074cee2c022912") 109 | ("yaml-mode" . "d91f878729312a6beed77e6637c60497c5786efa") 110 | ("yasnippet" . "2384fe1655c60e803521ba59a34c0a7e48a25d06") 111 | ("yasnippet-snippets" . "48e968d555afe8bf64829da364d5c8915980cc32")) 112 | :gamma 113 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "home-manager": { 4 | "inputs": { 5 | "nixpkgs": [ 6 | "nixpkgs" 7 | ] 8 | }, 9 | "locked": { 10 | "lastModified": 1748134483, 11 | "narHash": "sha256-5PBK1nV8X39K3qUj8B477Aa2RdbLq3m7wRxUKRtggX4=", 12 | "owner": "nix-community", 13 | "repo": "home-manager", 14 | "rev": "c1e671036224089937e111e32ea899f59181c383", 15 | "type": "github" 16 | }, 17 | "original": { 18 | "owner": "nix-community", 19 | "repo": "home-manager", 20 | "type": "github" 21 | } 22 | }, 23 | "nixpkgs": { 24 | "locked": { 25 | "lastModified": 1748134661, 26 | "narHash": "sha256-p4cM3XaeN7YLMw4dSRCIZwXPxOS1SelqxPBUNs0IF6A=", 27 | "owner": "NixOS", 28 | "repo": "nixpkgs", 29 | "rev": "81e63461fb905af981fcb99057a845a930999eaa", 30 | "type": "github" 31 | }, 32 | "original": { 33 | "owner": "NixOS", 34 | "repo": "nixpkgs", 35 | "type": "github" 36 | } 37 | }, 38 | "root": { 39 | "inputs": { 40 | "home-manager": "home-manager", 41 | "nixpkgs": "nixpkgs", 42 | "tree-sitter-cool": "tree-sitter-cool", 43 | "tree-sitter-formula": "tree-sitter-formula", 44 | "tree-sitter-promela": "tree-sitter-promela", 45 | "tree-sitter-sml": "tree-sitter-sml" 46 | } 47 | }, 48 | "tree-sitter-cool": { 49 | "flake": false, 50 | "locked": { 51 | "lastModified": 1662648268, 52 | "narHash": "sha256-jZrX86qKu5j47BAnbFNhuGmwOEL0/jdxozg5GNFyOHc=", 53 | "owner": "siraben", 54 | "repo": "tree-sitter-cool", 55 | "rev": "3bd8f928527c61575de056cf62b4fa0f79bd1fb6", 56 | "type": "github" 57 | }, 58 | "original": { 59 | "owner": "siraben", 60 | "repo": "tree-sitter-cool", 61 | "type": "github" 62 | } 63 | }, 64 | "tree-sitter-formula": { 65 | "flake": false, 66 | "locked": { 67 | "lastModified": 1651735475, 68 | "narHash": "sha256-ALQ/Hf5b/yYO8J0uFNaf5Rh98oKTUPY/F8xCZDWHmWw=", 69 | "owner": "siraben", 70 | "repo": "tree-sitter-formula", 71 | "rev": "351159cf66f0e7f8d86fa06fc44ab3c2055082df", 72 | "type": "github" 73 | }, 74 | "original": { 75 | "owner": "siraben", 76 | "repo": "tree-sitter-formula", 77 | "type": "github" 78 | } 79 | }, 80 | "tree-sitter-promela": { 81 | "flake": false, 82 | "locked": { 83 | "lastModified": 1644607664, 84 | "narHash": "sha256-JK7+ZfR6uHdhDlnVJLwNtu5UbruClaIqlaRREG1iVG0=", 85 | "owner": "siraben", 86 | "repo": "tree-sitter-promela", 87 | "rev": "91da8f141c3c4c695eb71018c8a7b2e7ea39c167", 88 | "type": "github" 89 | }, 90 | "original": { 91 | "owner": "siraben", 92 | "repo": "tree-sitter-promela", 93 | "type": "github" 94 | } 95 | }, 96 | "tree-sitter-sml": { 97 | "flake": false, 98 | "locked": { 99 | "lastModified": 1642159426, 100 | "narHash": "sha256-bp7Rmrk7iqgBsLBYTDc28T+A6mcSD/Z+0SywzAmeJhw=", 101 | "owner": "siraben", 102 | "repo": "tree-sitter-sml", 103 | "rev": "ec1d78668f160731a818f9b6c75c41ad5fd4e67c", 104 | "type": "github" 105 | }, 106 | "original": { 107 | "owner": "siraben", 108 | "repo": "tree-sitter-sml", 109 | "type": "github" 110 | } 111 | } 112 | }, 113 | "root": "root", 114 | "version": 7 115 | } 116 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Siraben's dotfiles"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:NixOS/nixpkgs"; 6 | 7 | home-manager = { 8 | url = "github:nix-community/home-manager"; 9 | inputs.nixpkgs.follows = "nixpkgs"; 10 | }; 11 | 12 | tree-sitter-cool = { 13 | url = "github:siraben/tree-sitter-cool"; 14 | flake = false; 15 | }; 16 | tree-sitter-formula = { 17 | url = "github:siraben/tree-sitter-formula"; 18 | flake = false; 19 | }; 20 | tree-sitter-promela = { 21 | url = "github:siraben/tree-sitter-promela"; 22 | flake = false; 23 | }; 24 | tree-sitter-sml = { 25 | url = "github:siraben/tree-sitter-sml"; 26 | flake = false; 27 | }; 28 | }; 29 | 30 | outputs = { self, nixpkgs, home-manager, ... /* Capture all inputs */ }@allInputs: 31 | let 32 | username = "siraben"; 33 | # 'allInputs' is the attribute set of all defined flake inputs. 34 | # We will pass this set as 'inputs' within extraSpecialArgs. 35 | in 36 | { 37 | homeConfigurations = { 38 | "${username}@macos-x86_64" = home-manager.lib.homeManagerConfiguration { 39 | pkgs = nixpkgs.legacyPackages.x86_64-darwin; # nixpkgs from output function args 40 | extraSpecialArgs = { inherit username; inputs = allInputs; minimal = false; }; 41 | modules = [ ./home-manager/.config/nixpkgs/home.nix ]; 42 | }; 43 | "${username}@macos-aarch64" = home-manager.lib.homeManagerConfiguration { 44 | pkgs = nixpkgs.legacyPackages.aarch64-darwin; 45 | extraSpecialArgs = { inherit username; inputs = allInputs; minimal = false; }; 46 | modules = [ ./home-manager/.config/nixpkgs/home.nix ]; 47 | }; 48 | "${username}@linux" = home-manager.lib.homeManagerConfiguration { 49 | pkgs = nixpkgs.legacyPackages.x86_64-linux; 50 | extraSpecialArgs = { inherit username; inputs = allInputs; minimal = false; }; 51 | modules = [ ./home-manager/.config/nixpkgs/home.nix ]; 52 | }; 53 | "${username}@minimal" = home-manager.lib.homeManagerConfiguration { 54 | pkgs = nixpkgs.legacyPackages.x86_64-linux; 55 | extraSpecialArgs = { inherit username; inputs = allInputs; minimal = true; }; 56 | modules = [ ./home-manager/.config/nixpkgs/home.nix ]; 57 | }; 58 | }; 59 | 60 | devShells = nixpkgs.lib.genAttrs [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ] (system: 61 | let 62 | pkgs = nixpkgs.legacyPackages.${system}; # nixpkgs from output function args 63 | in 64 | { 65 | default = pkgs.mkShell { 66 | name = "home-manager-dotfiles-shell"; 67 | packages = [ 68 | allInputs.home-manager.packages.${system}.default # Use allInputs here 69 | pkgs.git 70 | # Add other common dev tools here if needed 71 | ]; 72 | # shellHook for nix develop if required, but usually not for simple flake usage 73 | # For example, to make git aware of the .git-blame-ignore-revs file: 74 | # shellHook = '' 75 | # git config blame.ignoreRevsFile .git-blame-ignore-revs 76 | # ''; 77 | }; 78 | }); 79 | }; 80 | } 81 | -------------------------------------------------------------------------------- /home-manager/.config/nix/nix.conf: -------------------------------------------------------------------------------- 1 | experimental-features = nix-command flakes 2 | keep-derivations = true 3 | keep-outputs = true 4 | builders-use-substitutes = true 5 | substituters = https://cache.nixos.org https://nix-community.cachix.org https://siraben.cachix.org 6 | trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= siraben.cachix.org-1:/zSVUB18DWcjQF52VMh0v7MzjI+pdevnWOa01koPoYc= 7 | -------------------------------------------------------------------------------- /home-manager/.config/nix/registry.json: -------------------------------------------------------------------------------- 1 | { 2 | "flakes": [ 3 | { 4 | "from": { 5 | "id": "stable", 6 | "type": "indirect" 7 | }, 8 | "to": { 9 | "owner": "NixOS", 10 | "ref": "nixos-20.09", 11 | "repo": "nixpkgs", 12 | "type": "github" 13 | } 14 | }, 15 | { 16 | "from": { 17 | "id": "nixpkgs", 18 | "type": "indirect" 19 | }, 20 | "to": { 21 | "__final": true, 22 | "lastModified": 1746576598, 23 | "owner": "NixOS", 24 | "repo": "nixpkgs", 25 | "rev": "b3582c75c7f21ce0b429898980eddbbf05c68e55", 26 | "type": "github" 27 | } 28 | } 29 | ], 30 | "version": 2 31 | } -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/base.nix: -------------------------------------------------------------------------------- 1 | { config, lib, currentSystem, minimal, inputs, ... }: 2 | 3 | let 4 | inherit (lib.systems.elaborate { system = currentSystem; }) isLinux isDarwin; 5 | unfreePackages = [ 6 | "discord" 7 | "slack" 8 | "spotify" 9 | "spotify-unwrapped" 10 | "zoom" 11 | "aspell-dict-en-science" 12 | ]; 13 | pkgsOptions = { 14 | overlays = [ 15 | (import ./overlay.nix) 16 | ]; 17 | config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) unfreePackages; 18 | }; 19 | pkgs = import inputs.nixpkgs { 20 | system = currentSystem; 21 | inherit (pkgsOptions) overlays config; 22 | }; 23 | grammars = (pkgs.tree-sitter.override (with pkgs; { 24 | extraGrammars = { 25 | tree-sitter-promela = { src = inputs.tree-sitter-promela; }; 26 | tree-sitter-formula = { src = inputs.tree-sitter-formula; }; 27 | tree-sitter-sml = { src = inputs.tree-sitter-sml; }; 28 | tree-sitter-cool = { src = inputs.tree-sitter-cool; }; 29 | }; 30 | })).builtGrammars; 31 | in 32 | lib.recursiveUpdate (rec { 33 | home.username = "siraben"; 34 | home.homeDirectory = if isDarwin then "/Users/${home.username}" else "/home/${home.username}"; 35 | home.packages = import ./packages.nix { inherit lib pkgs isDarwin isLinux minimal; }; 36 | 37 | home.sessionVariables = { 38 | EDITOR = "emacsclient"; 39 | } // (lib.optionalAttrs isLinux { 40 | XDG_CURRENT_DESKTOP = "sway"; 41 | MOZ_ENABLE_WAYLAND = 1; 42 | }) // (lib.optionalAttrs isDarwin { 43 | HOMEBREW_NO_AUTO_UPDATE = 1; 44 | HOMEBREW_NO_ANALYTICS = 1; 45 | }); 46 | 47 | home.language = { 48 | ctype = "en_US.UTF-8"; 49 | base = "en_US.UTF-8"; 50 | }; 51 | 52 | programs = import ./programs.nix { inherit lib pkgs isDarwin isLinux; }; 53 | fonts.fontconfig.enable = true; 54 | services = lib.optionalAttrs isLinux (import ./services.nix { inherit lib pkgs; }); 55 | home.stateVersion = "25.05"; 56 | home.enableNixpkgsReleaseCheck = false; 57 | }) 58 | (lib.optionalAttrs (!minimal) { 59 | home.file.".tree-sitter".source = (pkgs.runCommand "grammars" {} '' 60 | mkdir -p $out/bin 61 | ${lib.concatStringsSep "\n" 62 | (lib.mapAttrsToList (name: src: '' 63 | name=${name} 64 | ln -s ${src}/parser $out/bin/''${name#tree-sitter-}.so 65 | '') 66 | grammars)} 67 | ''); 68 | }) 69 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/circom-lsp/default.nix: -------------------------------------------------------------------------------- 1 | { lib, fetchFromGitHub, rustPlatform, openssl, pkg-config, libxkbcommon }: 2 | 3 | rustPlatform.buildRustPackage rec { 4 | pname = "circom-lsp"; 5 | version = "0.1.3"; 6 | 7 | src = "${fetchFromGitHub { 8 | owner = "rubydusa"; 9 | repo = pname; 10 | rev = "refs/tags/v${version}"; 11 | sha256 = "sha256-Y71qmeDUh6MwSlFrSnG+Nr/un5szTUo27+J/HphGr7M="; 12 | }}/server"; 13 | 14 | cargoSha256 = "sha256-Lq8SpzkUqYgayQTApNngOlhceAQAPG9Rwg1pmGvyxnM="; 15 | 16 | nativeBuildInputs = [ 17 | pkg-config 18 | ]; 19 | 20 | buildInputs = [ ]; 21 | 22 | PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig"; 23 | LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs; 24 | 25 | doCheck = false; 26 | 27 | meta = with lib; { 28 | description = "A Language Server Protocol Implementation for Circom"; 29 | homepage = "https://github.com/rubydusa/circom-lsp"; 30 | license = licenses.isc; 31 | maintainers = with maintainers; [ reo101 ]; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/circom/default.nix: -------------------------------------------------------------------------------- 1 | { lib, fetchFromGitHub, rustPlatform, openssl, pkg-config, libxkbcommon }: 2 | 3 | rustPlatform.buildRustPackage rec { 4 | pname = "circom"; 5 | version = "2.1.6"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "iden3"; 9 | repo = pname; 10 | rev = "refs/tags/v${version}"; 11 | sha256 = "sha256-2YusBWAYDrTvFHYIjKpALphhmtsec7jjKHb1sc9lt3Q="; 12 | }; 13 | 14 | cargoSha256 = "sha256-G6z+DxIhmm1Kzv8EQCqvfGAhQn5Vrx9LXrl+bWBVKaM="; 15 | 16 | nativeBuildInputs = [ 17 | pkg-config 18 | ]; 19 | 20 | buildInputs = [ ]; 21 | 22 | PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig"; 23 | LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs; 24 | 25 | doCheck = false; 26 | 27 | meta = with lib; { 28 | description = "zkSnark circuit compiler"; 29 | homepage = "https://github.com/iden3/circom"; 30 | license = licenses.isc; 31 | maintainers = with maintainers; [ reo101 ]; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/config.nix: -------------------------------------------------------------------------------- 1 | { allowAliases = false; } 2 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/darwin-aliases.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | { 4 | # useful command to run sequenced after a long command, `nix build; sd` 5 | sd = "say done"; 6 | # brew bundle, but make it like home manager 7 | bb-check = "brew bundle check --global --verbose"; 8 | bb-gc = "brew bundle cleanup --global --force"; 9 | bb-switch = "brew bundle install --global --verbose"; 10 | bb-upgrade = "brew bundle install --global --verbose --upgrade"; 11 | linuxShell = ''docker run --rm -it lnl7/nix nix-shell -p nixFlakes --run "nix --experimental-features 'nix-command flakes' shell nixpkgs#nixUnstable"''; 12 | } 13 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/haskell-packages.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | 3 | pkgs.haskellPackages.ghcWithHoogle (h: with h; [ 4 | QuickCheck # property based testing 5 | vector # efficient arrays 6 | criterion # benchmarking 7 | aeson # JSON 8 | recursion-schemes # recursion schemes 9 | ]) 10 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/home.nix: -------------------------------------------------------------------------------- 1 | args@{ config, lib, pkgs, minimal ? false, ... }: 2 | let 3 | currentSystem = pkgs.system; 4 | in 5 | import ./base.nix (args // { inherit minimal currentSystem; }) 6 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/minimal.nix: -------------------------------------------------------------------------------- 1 | args@{ config, lib, currentSystem, ... }: 2 | 3 | import ./base.nix (args // { minimal = true; }) 4 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/overlay.nix: -------------------------------------------------------------------------------- 1 | final: prev: 2 | 3 | { 4 | z3-tptp = prev.z3-tptp.overrideAttrs (oA: { 5 | installPhase = oA.installPhase + '' 6 | ln -s "z3_tptp5" "$out/bin/z3_tptp" 7 | ''; 8 | }); 9 | circom = prev.callPackage ./circom { }; 10 | circom-lsp = prev.callPackage ./circom-lsp { }; 11 | } 12 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/packages.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs, isDarwin, isLinux, minimal }: 2 | let 3 | whenNotMinimal = lib.optionals (!minimal); 4 | my-emacs = with pkgs; emacs.pkgs.withPackages (p: [ p.vterm ]); 5 | wayland-packages = whenNotMinimal (with pkgs; [ 6 | firefox-wayland 7 | ]); 8 | linuxPackages = whenNotMinimal (with pkgs; [ 9 | keepassxc 10 | kitty 11 | nix-update 12 | vlc 13 | whois 14 | ]) ++ wayland-packages; 15 | darwinPackages = with pkgs; [ 16 | coreutils 17 | gnused 18 | pinentry_mac 19 | ]; 20 | languageServers = with pkgs; [ 21 | haskellPackages.haskell-language-server 22 | nodePackages.bash-language-server 23 | nodePackages.typescript-language-server 24 | pyright 25 | ]; 26 | sharedPackages = with pkgs; [ 27 | bash 28 | curl 29 | htop 30 | vim 31 | watch 32 | wget 33 | mosh 34 | nixpkgs-review 35 | ] ++ (whenNotMinimal ([ 36 | (aspellWithDicts (d: with d; [ en en-computers en-science ])) 37 | bat 38 | btop 39 | borgbackup 40 | cabal-install 41 | cachix 42 | cmake 43 | dejavu_fonts 44 | ffmpeg 45 | github-cli 46 | gnumake 47 | (import ./haskell-packages.nix { inherit pkgs; }) 48 | hlint 49 | imagemagick 50 | jq 51 | killall 52 | ledger 53 | mpv 54 | my-emacs 55 | niv 56 | nodejs 57 | ollama 58 | (import ./python-packages.nix { inherit pkgs; }) 59 | ranger 60 | ripgrep 61 | rust-analyzer 62 | shellcheck 63 | stow 64 | (import ./texlive-packages.nix { inherit pkgs; }) 65 | tldr 66 | tree 67 | (tree-sitter.overrideAttrs (oA: { webUISupport = true; })) 68 | typst 69 | unzip 70 | yt-dlp 71 | zip 72 | ] ++ languageServers)); 73 | in 74 | sharedPackages ++ (lib.optionals isLinux linuxPackages) ++ (lib.optionals isDarwin darwinPackages) 75 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/programs.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs, isDarwin, isLinux }: 2 | 3 | let 4 | darwinShellExtra = '' 5 | if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix.sh' ]; then . '/nix/var/nix/profiles/default/etc/profile.d/nix.sh'; fi 6 | if [ -e "$HOME/.nix/remote-build-env" ]; then . "$HOME/.nix/remote-build-env"; fi 7 | if [ -d "/opt/homebrew/bin" ]; then 8 | export PATH=/opt/homebrew/bin:$PATH 9 | fi 10 | ''; 11 | linuxShellExtra = '' 12 | export NIX_PATH=$HOME/.nix-defexpr/channels:$NIX_PATH 13 | ''; 14 | sharedShellExtra = '' 15 | fpath+=("${pkgs.pure-prompt}/share/zsh/site-functions") 16 | if [ "$TERM" != dumb ]; then 17 | autoload -U promptinit && promptinit && prompt pure 18 | vterm_printf(){ 19 | if [ -n "$TMUX" ] && ([ "''${TERM%%-*}" = "tmux" ] || [ "''${TERM%%-*}" = "screen" ] ); then 20 | # Tell tmux to pass the escape sequences through 21 | printf "\ePtmux;\e\e]%s\007\e\\" "$1" 22 | elif [ "''${TERM%%-*}" = "screen" ]; then 23 | # GNU screen (screen, screen-256color, screen-256color-bce) 24 | printf "\eP\e]%s\007\e\\" "$1" 25 | else 26 | printf "\e]%s\e\\" "$1" 27 | fi 28 | } 29 | vterm_prompt_end() { 30 | vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"; 31 | } 32 | setopt PROMPT_SUBST 33 | PROMPT=$PROMPT'%{$(vterm_prompt_end)%}' 34 | else 35 | unsetopt zle 36 | PS1='$ ' 37 | fi 38 | ''; 39 | in 40 | 41 | { 42 | direnv = { 43 | enable = true; 44 | stdlib = '' 45 | : ''${XDG_CACHE_HOME:=$HOME/.cache} 46 | declare -A direnv_layout_dirs 47 | direnv_layout_dir() { 48 | echo "''${direnv_layout_dirs[$PWD]:=$( 49 | echo -n "$XDG_CACHE_HOME"/direnv/layouts/ 50 | echo -n "$PWD" | shasum | cut -d ' ' -f 1 51 | )}" 52 | } 53 | ''; 54 | nix-direnv.enable = true; 55 | enableZshIntegration = true; 56 | enableBashIntegration = true; 57 | }; 58 | gpg.enable = true; 59 | git = { 60 | enable = true; 61 | lfs.enable = true; 62 | userName = "Ben Siraphob"; 63 | userEmail = "bensiraphob@gmail.com"; 64 | signing = { 65 | key = "45F0E5D788143267"; 66 | signByDefault = true; 67 | }; 68 | extraConfig = { 69 | pull.rebase = true; 70 | github.user = "siraben"; 71 | advice.detachedHead = false; 72 | }; 73 | }; 74 | autojump.enable = true; 75 | mcfly.enable = true; 76 | tmux = { 77 | enable = true; 78 | clock24 = true; 79 | baseIndex = 1; 80 | # open new windows in the same cwd 81 | extraConfig = '' 82 | bind c new-window -c "#{pane_current_path}" 83 | ''; 84 | }; 85 | zsh = { 86 | enable = true; 87 | oh-my-zsh = { 88 | enable = true; 89 | theme = lib.mkForce ""; 90 | extraConfig = '' 91 | ZSH_THEME="" 92 | ''; 93 | plugins = [ "git" ]; 94 | }; 95 | history = { 96 | size = 100000; 97 | save = 100000; 98 | extended = true; 99 | }; 100 | shellAliases = { 101 | hm = "home-manager"; 102 | hms = "home-manager switch"; 103 | httpcode = ''curl -o /dev/null -s -w "%{http_code}\n"''; 104 | nb = "nix build"; 105 | nbi = "nix build --impure"; 106 | ncg = "nix-collect-garbage"; 107 | nd = "nix develop"; 108 | ne = "nix edit"; 109 | nr = "nix repl"; 110 | nreps = "nix-review pr --post-result"; 111 | nrep = "nix-review pr --post-result --no-shell"; 112 | nrp = "nix repl ''"; 113 | ns = "nix-shell"; 114 | tb = "tput bel"; 115 | ix = ''curl -n -F 'f:1=<-' http://ix.io''; 116 | } // (lib.optionalAttrs isDarwin (import ./darwin-aliases.nix {})); 117 | initContent = lib.concatStringsSep "\n" 118 | [ 119 | (lib.optionalString isDarwin darwinShellExtra) 120 | (lib.optionalString isLinux linuxShellExtra) 121 | sharedShellExtra 122 | ]; 123 | envExtra = '' 124 | if [ -d "/opt/homebrew/bin" ]; then 125 | export PATH=$HOME/.nix-profile/bin:$PATH 126 | fi 127 | export PATH=$HOME/.nix-profile/bin:$PATH 128 | ''; 129 | }; 130 | } 131 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/python-packages.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | 3 | pkgs.python313.withPackages (p: with p; [ 4 | aiohttp # async HTTP 5 | beautifulsoup4 # web scraping 6 | ipython # interactive shell 7 | matplotlib # plots 8 | numpy # numerical computation 9 | pandas # data analysis 10 | pylint # static checking 11 | requests # HTTP library 12 | setuptools # setup.py 13 | scipy 14 | scikit-learn 15 | z3 # Z3 theorem prover 16 | ]) 17 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/services.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs }: 2 | 3 | { 4 | wlsunset = { 5 | enable = false; 6 | latitude = "36"; 7 | longitude = "-86"; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/texlive-packages.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | 3 | pkgs.texlive.combine { 4 | inherit (pkgs.texlive) 5 | scheme-medium # base 6 | amsmath # math symbols 7 | beamer # beamer 8 | biblatex # citations 9 | capt-of 10 | catchfile 11 | cm-super # vectorized fonts 12 | collection-latex # pdflatex 13 | csquotes 14 | dvipng 15 | framed 16 | fvextra 17 | latexmk 18 | lkproof # proof rules 19 | minted # source code 20 | float # minted depends on float 21 | preprint 22 | rotfloat 23 | ulem 24 | upquote 25 | wrapfig 26 | xstring 27 | endnotes 28 | caption 29 | subfigure # nested figures 30 | biber 31 | parskip 32 | enumitem 33 | # Paper stuff 34 | paper 35 | fancyvrb 36 | lineno 37 | algpseudocodex 38 | algorithms 39 | algorithmicx 40 | koma-script 41 | xpatch # needed for thesis 42 | # new environments 43 | environ 44 | filecontents 45 | # PL 46 | semantic 47 | # quantum 48 | braket 49 | qcircuit 50 | xypic 51 | ; 52 | } 53 | -------------------------------------------------------------------------------- /home-manager/.config/nixpkgs/z3-tptp.nix: -------------------------------------------------------------------------------- 1 | { z3-tptp }: 2 | 3 | z3-tptp.overrideAttrs (oA: { 4 | installPhase = oA.installPhase + '' 5 | ln -s "z3_tptp5" "$out/bin/z3_tptp" 6 | ''; 7 | }) 8 | -------------------------------------------------------------------------------- /homebrew/.Brewfile: -------------------------------------------------------------------------------- 1 | tap "acrogenesis/macchanger" 2 | tap "beeftornado/rmtree" 3 | tap "cvc4/cvc4" 4 | tap "dopplerhq/cli" 5 | tap "homebrew/bundle" 6 | tap "homebrew/services" 7 | tap "mistertea/et" 8 | cask "anki" 9 | cask "appcleaner" 10 | cask "audacity" 11 | cask "coconutbattery" 12 | cask "discord" 13 | cask "element" 14 | cask "eloston-chromium" 15 | cask "firefox@beta" 16 | cask "google-chrome" 17 | cask "grandperspective" 18 | cask "imageoptim" 19 | cask "keepassxc" 20 | cask "kitty" 21 | cask "kiwix" 22 | cask "libreoffice" 23 | cask "macfuse" 24 | cask "miniconda" 25 | cask "mullvad-browser" 26 | cask "mullvadvpn" 27 | cask "nextcloud" 28 | cask "obs" 29 | cask "remarkable" 30 | cask "signal" 31 | cask "skim" 32 | cask "slack" 33 | cask "spotify" 34 | cask "standard-notes" 35 | cask "stats" 36 | cask "steam" 37 | cask "telegram" 38 | cask "thunderbird" 39 | cask "tor-browser" 40 | cask "tradingview" 41 | cask "transmission" 42 | cask "trezor-suite" 43 | cask "utm" 44 | cask "visual-studio-code" 45 | cask "vlc" 46 | cask "webtorrent" 47 | cask "wireshark" 48 | cask "xquartz" 49 | cask "zoom" 50 | vscode "github.copilot" 51 | vscode "github.copilot-chat" 52 | vscode "ms-python.debugpy" 53 | vscode "ms-python.python" 54 | vscode "ms-python.vscode-pylance" 55 | vscode "ms-toolsai.jupyter" 56 | vscode "ms-toolsai.jupyter-keymap" 57 | vscode "ms-toolsai.jupyter-renderers" 58 | vscode "ms-toolsai.vscode-jupyter-cell-tags" 59 | vscode "ms-toolsai.vscode-jupyter-slideshow" 60 | vscode "ms-vscode-remote.remote-ssh" 61 | vscode "ms-vscode-remote.remote-ssh-edit" 62 | vscode "ms-vscode.remote-explorer" 63 | vscode "tomoki1207.pdf" 64 | -------------------------------------------------------------------------------- /i3/.config/i3/config: -------------------------------------------------------------------------------- 1 | # This file has been auto-generated by i3-config-wizard(1). 2 | # It will not be overwritten, so edit it as you like. 3 | # 4 | # Should you change your keyboard layout some time, delete 5 | # this file and re-run i3-config-wizard(1). 6 | # 7 | 8 | # i3 config file (v4) 9 | # 10 | # Please see https://i3wm.org/docs/userguide.html for a complete reference! 11 | 12 | set $mod Mod4 13 | 14 | # Font for window titles. Will also be used by the bar unless a different font 15 | # is used in the bar {} block below. 16 | font pango:monospace 8 17 | 18 | # This font is widely installed, provides lots of unicode glyphs, right-to-left 19 | # text rendering and scalability on retina/hidpi displays (thanks to pango). 20 | font pango:DejaVu Sans Mono 8 21 | 22 | # Before i3 v4.8, we used to recommend this one as the default: 23 | # font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 24 | # The font above is very space-efficient, that is, it looks good, sharp and 25 | # clear in small sizes. However, its unicode glyph coverage is limited, the old 26 | # X core fonts rendering does not support right-to-left and this being a bitmap 27 | # font, it doesn’t scale on retina/hidpi displays. 28 | 29 | # Use Mouse+$mod to drag floating windows to their wanted position 30 | floating_modifier $mod 31 | 32 | # start a terminal 33 | bindsym $mod+Return exec kitty 34 | # bindsym $mod+Return exec terminator 35 | # bindsym $mod+Return exec WINIT_HIDPI_FACTOR=1 alacritty 36 | 37 | # kill focused window 38 | bindsym $mod+Shift+q kill 39 | 40 | # rofi for window switching binding to mod + space disables switching 41 | # between floating and tiling windows, but in practice I hardly ever 42 | # use that key combination anyway. 43 | bindsym $mod+Tab exec rofi -dpi 1 -show window 44 | 45 | # start dmenu (a program launcher) 46 | bindsym $mod+d exec --no-startup-id exe=`dmenu_path | dmenu -b -nb '#000000' -sb '#ffffff' -sf '#000000' -fn Hack-11X -nf '#888888' -p '>'` && "${exe}" 47 | 48 | # There also is the (new) i3-dmenu-desktop which only displays applications 49 | # shipping a .desktop file. It is a wrapper around dmenu, so you need that 50 | # installed. 51 | # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop 52 | 53 | # change focus 54 | bindsym $mod+h focus left 55 | bindsym $mod+j focus down 56 | bindsym $mod+k focus up 57 | bindsym $mod+l focus right 58 | 59 | bindsym $mod+Left focus left 60 | bindsym $mod+Down focus down 61 | bindsym $mod+Up focus up 62 | bindsym $mod+Right focus right 63 | 64 | # move focused window 65 | bindsym $mod+Shift+h move left 66 | bindsym $mod+Shift+j move down 67 | bindsym $mod+Shift+k move up 68 | bindsym $mod+Shift+l move right 69 | 70 | bindsym $mod+Shift+Left move left 71 | bindsym $mod+Shift+Down move down 72 | bindsym $mod+Shift+Up move up 73 | bindsym $mod+Shift+Right move right 74 | 75 | # split in horizontal orientation 76 | bindsym $mod+Shift+v split h 77 | 78 | # split in vertical orientation 79 | bindsym $mod+v split v 80 | 81 | # enter fullscreen mode for the focused container 82 | bindsym $mod+f fullscreen toggle 83 | 84 | # change container layout (stacked, tabbed, toggle split) 85 | bindsym $mod+s layout stacking 86 | bindsym $mod+w layout tabbed 87 | bindsym $mod+e layout toggle split 88 | 89 | # toggle tiling / floating 90 | bindsym $mod+Shift+space floating toggle 91 | 92 | # change focus between tiling / floating windows 93 | # bindsym $mod+space focus mode_toggle 94 | 95 | # focus the parent container 96 | bindsym $mod+a focus parent 97 | 98 | # focus the child container 99 | bindsym $mod+z focus child 100 | 101 | # Define names for default workspaces for which we configure key bindings later on. 102 | # We use variables to avoid repeating the names in multiple places. 103 | set $ws1 "1" 104 | set $ws2 "2" 105 | set $ws3 "3" 106 | set $ws4 "4" 107 | set $ws5 "5" 108 | set $ws6 "6" 109 | set $ws7 "7" 110 | set $ws8 "8" 111 | set $ws9 "9" 112 | set $ws10 "10" 113 | 114 | # switch to workspace 115 | bindsym $mod+1 workspace $ws1 116 | bindsym $mod+2 workspace $ws2 117 | bindsym $mod+3 workspace $ws3 118 | bindsym $mod+4 workspace $ws4 119 | bindsym $mod+5 workspace $ws5 120 | bindsym $mod+6 workspace $ws6 121 | bindsym $mod+7 workspace $ws7 122 | bindsym $mod+8 workspace $ws8 123 | bindsym $mod+9 workspace $ws9 124 | bindsym $mod+0 workspace $ws10 125 | 126 | # move focused container to workspace 127 | bindsym $mod+Shift+1 move container to workspace $ws1 128 | bindsym $mod+Shift+2 move container to workspace $ws2 129 | bindsym $mod+Shift+3 move container to workspace $ws3 130 | bindsym $mod+Shift+4 move container to workspace $ws4 131 | bindsym $mod+Shift+5 move container to workspace $ws5 132 | bindsym $mod+Shift+6 move container to workspace $ws6 133 | bindsym $mod+Shift+7 move container to workspace $ws7 134 | bindsym $mod+Shift+8 move container to workspace $ws8 135 | bindsym $mod+Shift+9 move container to workspace $ws9 136 | bindsym $mod+Shift+0 move container to workspace $ws10 137 | 138 | # move focused workspace between monitors 139 | bindsym $mod+Shift+greater move workspace to output right 140 | bindsym $mod+Shift+less move workspace to output left 141 | 142 | bindsym $mod+Shift+p exec "xflock4" 143 | 144 | # reload the configuration file 145 | bindsym $mod+Shift+c reload 146 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 147 | bindsym $mod+Shift+r restart 148 | # exit i3 (logs you out of your X session) 149 | bindsym $mod+Shift+e exec 'xfce4-session-logout' 150 | 151 | # resize window (you can also use the mouse for that) 152 | mode "resize" { 153 | # These bindings trigger as soon as you enter the resize mode 154 | bindsym h resize shrink width 10 px or 10 ppt 155 | bindsym j resize grow height 10 px or 10 ppt 156 | bindsym k resize shrink height 10 px or 10 ppt 157 | bindsym l resize grow width 10 px or 10 ppt 158 | 159 | # same bindings, but for the arrow keys 160 | bindsym Left resize shrink width 10 px or 10 ppt 161 | bindsym Down resize grow height 10 px or 10 ppt 162 | bindsym Up resize shrink height 10 px or 10 ppt 163 | bindsym Right resize grow width 10 px or 10 ppt 164 | 165 | # back to normal: Enter or Escape or $mod+r 166 | bindsym Return mode "default" 167 | bindsym Escape mode "default" 168 | bindsym $mod+r mode "default" 169 | } 170 | 171 | bindsym $mod+r mode "resize" 172 | 173 | set $white #ffffff 174 | set $black #000000 175 | set $gray #cccccc 176 | set $red #900000 177 | # Start i3bar to display a workspace bar (plus the system information i3status 178 | # finds out, if available) 179 | bar { 180 | status_command i3status 181 | strip_workspace_numbers yes 182 | colors { 183 | active_workspace $black $black $white 184 | inactive_workspace $black $black $white 185 | focused_workspace $gray $gray $black 186 | urgent_workspace $red $red $white 187 | } 188 | } 189 | 190 | set $mode_launcher Launch [d]iscord [e]lement e[f]irefox [k]eepassxc [r]anger 191 | bindsym $mod+o mode "$mode_launcher" 192 | 193 | mode "$mode_launcher" { 194 | bindsym d exec Discord 195 | bindsym f exec firefox 196 | bindsym k exec keepassxc 197 | bindsym t exec thunderbird 198 | bindsym r exec kitty ranger 199 | bindsym e exec element 200 | bindsym Escape mode "default" 201 | bindsym Return mode "default" 202 | bindsym q mode "default" 203 | } 204 | 205 | for_window [class="^.*"] border pixel 1 206 | 207 | exec --no-startup-id nitrogen --restore 208 | exec --no-startup-id xfce4-panel --disable-wm-check 209 | exec --no-startup-id emacs --daemon 210 | -------------------------------------------------------------------------------- /i3/.config/i3/lock.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | scrot /tmp/screen.png 3 | convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png 4 | # [[ -f $1 ]] && convert /tmp/screen.png $1 -gravity center -composite -matte /tmp/screen.png 5 | convert /tmp/screen.png -gravity center -composite -matte /tmp/screen.png 6 | i3lock -f -i /tmp/screen.png 7 | rm /tmp/screen.png 8 | -------------------------------------------------------------------------------- /i3status/.config/i3status/config: -------------------------------------------------------------------------------- 1 | # i3status configuration file. 2 | # see "man i3status" for documentation. 3 | 4 | # It is important that this file is edited as UTF-8. 5 | # The following line should contain a sharp s: 6 | # ß 7 | # If the above line is not correctly displayed, fix your editor first! 8 | general { 9 | output_format = "i3bar" 10 | markup = pango 11 | interval = 5 12 | } 13 | 14 | order += "cpu_temperature all" 15 | order += "disk /" 16 | order += "volume master" 17 | order += "battery all" 18 | order += "tztime local" 19 | order += "wireless _first_" 20 | 21 | wireless _first_ { 22 | format_up = "%quality %essid (%frequency)" 23 | format_down = "offline" 24 | } 25 | 26 | ethernet _first_ { 27 | format_up = "E: %ip (%speed)" 28 | format_down = "E: down" 29 | } 30 | 31 | cpu_temperature all { 32 | format = "" 33 | max_threshold = 50 34 | format_above_threshold = "%degrees°C" 35 | } 36 | 37 | battery all { 38 | format = "%status %percentage" 39 | format_down = "No battery" 40 | status_chr = "/" 41 | status_bat = "\\" 42 | status_unk = "? " 43 | status_full = "-" 44 | low_threshold = 30 45 | threshold_type = time 46 | # last_full_capacity = true 47 | integer_battery_capacity = true 48 | } 49 | 50 | tztime local { 51 | format = "%a, %F %R" 52 | } 53 | 54 | volume master { 55 | format = "| %volume" 56 | format_muted = "O %volume" 57 | device = "default" 58 | mixer = "Master" 59 | mixer_idx = 0 60 | } 61 | 62 | disk "/" { 63 | format = "%avail" 64 | low_threshold = 5 65 | } 66 | -------------------------------------------------------------------------------- /min-server/configuration.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | imports = [ ./hardware-configuration.nix ]; 3 | 4 | boot.cleanTmpDir = true; 5 | networking.hostName = "ecs-1fc0"; 6 | networking.firewall.allowPing = true; 7 | services.openssh.enable = true; 8 | 9 | environment.systemPackages = with pkgs; [ vim git tmux htop nixpkgs-review ]; 10 | 11 | nix = { 12 | trustedUsers = [ "root" "siraben" ]; 13 | package = pkgs.nixFlakes; 14 | extraOptions = '' 15 | experimental-features = nix-command flakes 16 | ''; 17 | }; 18 | 19 | programs.zsh.enable = true; 20 | 21 | users = { 22 | users.siraben = { 23 | shell = pkgs.zsh; 24 | isNormalUser = true; 25 | home = "/home/siraben"; 26 | description = "Ben Siraphob"; 27 | extraGroups = [ "wheel" ]; 28 | openssh.authorizedKeys.keys = [ 29 | "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDGSUM4kaMhd0SaR7qXXbdUtTRy4uC9cPqbpfJ3QP+zZZfeU/rMg4Gv8w10JmFfvrPWFCRgZ3su7ewN+We3rbmN2qDxArOPdzjBfQ/N33epz1Th3fpswdoLmyYtUxeugqGo9TM2e4K4OwJwJnrOvfbfqqhkwvCYgcHzjsA2I1tEThI6eKcYInhq8IOSmwtnGNvl77HrH6cnXcrX3OK9XVSeHVzJKVwzb0IDsdr2fUdwCQZnlfeVj/LuXlDn5hueLQbi5qzyMdI+KeQA3i2iu+aq35Yn7ubOZjQ0kM0uCcm6nhWp4bXtSFGA4Kj4GwOvpTVULSdIW7mu6f37/OTW9MyuJnsFYxJgDUMB8giH4LHEOI9ZhYpkrvO01Lh2igCCVe8GGqDkpu9OQEzWRnFdE3oFH9QbPSWtniX2ZWH/zkoxP2iVGxJkcOiOZGAEsF19skyaCDyu0ZwC8xGzu8S6ZZic+BHeeXXstiquMuTemlU8dqxtmo+cw2xo7JqSZu20EPKjlXz/V6cVTfPQXeH+ANRz4bihdTfHEIEmAXH9PU4vni63loJvSdGqTITUtmQDpeSu+e5qF48IX+Hu+x+Hr/1HhGVn1o2G1DjutM+9BobHiMAq+rh/tPMc1zGlsdCyXf3121WBOrFG4fD/ZCdJoMAZzKaqmaIrcLvQbEVCrRHXNw== bensiraphob@gmail.com" 30 | ]; 31 | }; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /nixos/configuration.nix: -------------------------------------------------------------------------------- 1 | let 2 | sources = import ../nix/sources.nix; 3 | pkgs = import sources.nixpkgs { }; 4 | lib = pkgs.lib; 5 | in 6 | 7 | { 8 | imports = [ ./hardware-configuration.nix ]; 9 | 10 | # Make unfree software explicit 11 | nixpkgs.config.allowUnfreePredicate = pkg: 12 | builtins.elem (lib.getName pkg) [ 13 | "broadcom-sta" 14 | "facetimehd-firmware" 15 | ]; 16 | boot.loader.systemd-boot.enable = true; 17 | boot.loader.efi.canTouchEfiVariables = true; 18 | boot.supportedFilesystems = [ "zfs" ]; 19 | boot.zfs.requestEncryptionCredentials = true; 20 | 21 | time.timeZone = "America/Chicago"; 22 | 23 | networking.hostId = "e6ff0de6"; 24 | networking.hostName = "siraben-nixos"; 25 | services.zfs.autoSnapshot.enable = true; 26 | services.zfs.autoScrub.enable = true; 27 | 28 | networking.networkmanager.enable = true; 29 | networking.nameservers = [ "1.0.0.1" "1.1.1.1" ]; 30 | 31 | fonts = { 32 | fontDir.enable = true; 33 | enableGhostscriptFonts = true; 34 | 35 | fonts = with pkgs; [ 36 | emojione 37 | noto-fonts 38 | noto-fonts-cjk 39 | noto-fonts-extra 40 | inconsolata 41 | material-icons 42 | liberation_ttf 43 | dejavu_fonts 44 | terminus_font 45 | siji 46 | unifont 47 | ]; 48 | fontconfig.defaultFonts = { 49 | monospace = [ 50 | "DejaVu Sans Mono" 51 | ]; 52 | sansSerif = [ 53 | "DejaVu Sans" 54 | "Noto Sans" 55 | ]; 56 | serif = [ 57 | "DejaVu Serif" 58 | "Noto Serif" 59 | ]; 60 | }; 61 | }; 62 | # Enable the X11 windowing system. 63 | services.xserver.enable = true; 64 | 65 | # KDE 66 | services.xserver.desktopManager.plasma5.enable = true; 67 | 68 | services.printing.enable = true; 69 | 70 | sound.enable = true; 71 | hardware.pulseaudio.enable = true; 72 | 73 | nix = { 74 | trustedUsers = [ "root" "siraben" ]; 75 | package = pkgs.nixFlakes; 76 | extraOptions = '' 77 | experimental-features = nix-command flakes 78 | ''; 79 | }; 80 | 81 | services.xserver.libinput.enable = true; 82 | services.tailscale.enable = true; 83 | services.openssh.enable = true; 84 | programs.mosh.enable = true; 85 | environment.systemPackages = with pkgs; [ bpftrace ]; 86 | 87 | environment.pathsToLink = [ "/share/zsh" ]; 88 | environment.shells = with pkgs; [ bashInteractive zsh ]; 89 | 90 | users = { 91 | users.siraben = { 92 | shell = pkgs.zsh; 93 | useDefaultShell = false; 94 | isNormalUser = true; 95 | home = "/home/siraben"; 96 | description = "Ben Siraphob"; 97 | extraGroups = [ "wheel" "networkmanager" "dialout" ]; 98 | }; 99 | }; 100 | 101 | system.stateVersion = "21.11"; 102 | 103 | } 104 | 105 | -------------------------------------------------------------------------------- /nixos/rescue_boot.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | let 3 | netboot = import (pkgs.path + "/nixos/lib/eval-config.nix") { 4 | modules = [ 5 | (pkgs.path + "/nixos/modules/installer/netboot/netboot-minimal.nix") 6 | module 7 | ]; 8 | }; 9 | module = { 10 | # you will want to add options here to support your filesystem 11 | # and also maybe ssh to let you in 12 | boot.supportedFilesystems = [ "zfs" ]; 13 | }; 14 | in { 15 | boot.loader.grub.extraEntries = '' 16 | menuentry "Nixos Installer" { 17 | linux ($drive1)/rescue-kernel init=${netboot.config.system.build.toplevel}/init ${toString netboot.config.boot.kernelParams} 18 | initrd ($drive1)/rescue-initrd 19 | } 20 | ''; 21 | boot.loader.grub.extraFiles = { 22 | "rescue-kernel" = "${netboot.config.system.build.kernel}/bzImage"; 23 | "rescue-initrd" = "${netboot.config.system.build.netbootRamdisk}/initrd"; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /ranger/.config/ranger/commands.py: -------------------------------------------------------------------------------- 1 | # This is a sample commands.py. You can add your own commands here. 2 | # 3 | # Please refer to commands_full.py for all the default commands and a complete 4 | # documentation. Do NOT add them all here, or you may end up with defunct 5 | # commands when upgrading ranger. 6 | 7 | # A simple command for demonstration purposes follows. 8 | # ----------------------------------------------------------------------------- 9 | 10 | from __future__ import (absolute_import, division, print_function) 11 | 12 | # You can import any python module as needed. 13 | import os 14 | 15 | # You always need to import ranger.api.commands here to get the Command class: 16 | from ranger.api.commands import Command 17 | 18 | 19 | # Any class that is a subclass of "Command" will be integrated into ranger as a 20 | # command. Try typing ":my_edit" in ranger! 21 | class my_edit(Command): 22 | # The so-called doc-string of the class will be visible in the built-in 23 | # help that is accessible by typing "?c" inside ranger. 24 | """:my_edit 25 | 26 | A sample command for demonstration purposes that opens a file in an editor. 27 | """ 28 | 29 | # The execute method is called when you run this command in ranger. 30 | def execute(self): 31 | # self.arg(1) is the first (space-separated) argument to the function. 32 | # This way you can write ":my_edit somefilename". 33 | if self.arg(1): 34 | # self.rest(1) contains self.arg(1) and everything that follows 35 | target_filename = self.rest(1) 36 | else: 37 | # self.fm is a ranger.core.filemanager.FileManager object and gives 38 | # you access to internals of ranger. 39 | # self.fm.thisfile is a ranger.container.file.File object and is a 40 | # reference to the currently selected file. 41 | target_filename = self.fm.thisfile.path 42 | 43 | # This is a generic function to print text in ranger. 44 | self.fm.notify("Let's edit the file " + target_filename + "!") 45 | 46 | # Using bad=True in fm.notify allows you to print error messages: 47 | if not os.path.exists(target_filename): 48 | self.fm.notify("The given file does not exist!", bad=True) 49 | return 50 | 51 | # This executes a function from ranger.core.acitons, a module with a 52 | # variety of subroutines that can help you construct commands. 53 | # Check out the source, or run "pydoc ranger.core.actions" for a list. 54 | self.fm.edit_file(target_filename) 55 | 56 | # The tab method is called when you press tab, and should return a list of 57 | # suggestions that the user will tab through. 58 | # tabnum is 1 for and -1 for by default 59 | def tab(self, tabnum): 60 | # This is a generic tab-completion function that iterates through the 61 | # content of the current directory. 62 | return self._tab_directory_content() 63 | -------------------------------------------------------------------------------- /ranger/.config/ranger/rifle.conf: -------------------------------------------------------------------------------- 1 | # vim: ft=cfg 2 | # 3 | # This is the configuration file of "rifle", ranger's file executor/opener. 4 | # Each line consists of conditions and a command. For each line the conditions 5 | # are checked and if they are met, the respective command is run. 6 | # 7 | # Syntax: 8 | # , , ... = command 9 | # 10 | # The command can contain these environment variables: 11 | # $1-$9 | The n-th selected file 12 | # $@ | All selected files 13 | # 14 | # If you use the special command "ask", rifle will ask you what program to run. 15 | # 16 | # Prefixing a condition with "!" will negate its result. 17 | # These conditions are currently supported: 18 | # match | The regexp matches $1 19 | # ext | The regexp matches the extension of $1 20 | # mime | The regexp matches the mime type of $1 21 | # name | The regexp matches the basename of $1 22 | # path | The regexp matches the absolute path of $1 23 | # has | The program is installed (i.e. located in $PATH) 24 | # env | The environment variable "variable" is non-empty 25 | # file | $1 is a file 26 | # directory | $1 is a directory 27 | # number | change the number of this command to n 28 | # terminal | stdin, stderr and stdout are connected to a terminal 29 | # X | A graphical environment is available (darwin, Xorg, or Wayland) 30 | # 31 | # There are also pseudo-conditions which have a "side effect": 32 | # flag | Change how the program is run. See below. 33 | # label