diff --git a/.lua-format b/.lua-format deleted file mode 100644 index 50bb10d..0000000 --- a/.lua-format +++ /dev/null @@ -1,5 +0,0 @@ -indent_width: 2 -column_limit: 100 -keep_simple_function_one_line: false -spaces_inside_table_braces: true -chop_down_table: true diff --git a/LICENSE b/LICENSE deleted file mode 100644 index f676eb4..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Joe Martella - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index a9cdb3c..0000000 --- a/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Nixos-config - -My flake based nixos configuration. To use this, just rebuild your system using `sudo nixos-rebuild switch --flake .` while in the project directory. - -## Neovim config - -Check out my neovim config in [this directory](./dotfiles/neovim) - - diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index 33ed5ea..0000000 --- a/configuration.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ pkgs, lib, ... }: -let - theme = pkgs.myThemes.current; -in -{ - imports = [ ./modules ]; - - boot.tmpOnTmpfs = false; - - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - boot.kernelPackages = pkgs.linuxPackages_latest; - - services.xserver.videoDrivers = [ - # "displaylink" - "modesetting" - ]; - - hardware.pulseaudio.enable = lib.mkForce false; - - # rtkit is optional but recommended - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; - - boot.loader = { - # systemd-boot.enable = true; - efi = { - canTouchEfiVariables = true; - # assuming /boot is the mount point of the EFI partition in NixOS (as the installation section recommends). - efiSysMountPoint = "/boot"; - }; - grub = { - # despite what the configuration.nix manpage seems to indicate, - # as of release 17.09, setting device to "nodev" will still call - # `grub-install` if efiSupport is true - # (the devices list is not used by the EFI grub install, - # but must be set to some value in order to pass an assert in grub.nix) - devices = [ "nodev" ]; - efiSupport = true; - enable = true; - # set $FS_UUID to the UUID of the EFI partition - extraEntries = '' - menuentry "Windows" { - insmod part_gpt - insmod fat - insmod search_fs_uuid - insmod chain - search --fs-uuid --set=root $FS_UUID - chainloader /EFI/Microsoft/Boot/bootmgfw.efi - } - ''; - # theme = theme.grub.path; - - version = 2; - }; - }; - - # Enable the OpenSSH daemon. - services.openssh.enable = true; - - # Enable sound. - sound.enable = true; - - system.stateVersion = "19.03"; - home-manager.users.adrielus.home.stateVersion = "19.03"; - - # TODO: put nixpkgs stuff inside their own file - nixpkgs.config.allowUnfree = true; - nixpkgs.config.allowBroken = true; -} - diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish deleted file mode 100644 index 60f1fec..0000000 --- a/dotfiles/fish/config.fish +++ /dev/null @@ -1,28 +0,0 @@ -if status is-interactive -and not set -q TMUX - exec tmux attach -t Welcome || tmux || echo "Something went wrong trying to start tmux" -end - -set fish_cursor_default block # Set the normal and visual mode cursors to a block -set fish_cursor_insert line # Set the insert mode cursor to a line -set fish_cursor_replace_one underscore # Set the replace mode cursor to an underscore - -# Force fish to skip some checks (I think) -set fish_vi_force_cursor - -function fish_user_key_bindings - # Use the vim keybinds - fish_vi_key_bindings - - # Use jj to exit insert mode - bind -e -M insert \e # unbinds esc - bind -M insert -m default jk 'commandline -f repaint' - bind -M insert -m default kj 'commandline -f repaint' -end - -# direnv hook, aparently -# https://direnv.net/docs/hook.html -direnv hook fish | source - -# allow using packages installed by pnpm -fish_add_path $HOME/.PNPM_HOME diff --git a/dotfiles/kmonad/README.md b/dotfiles/kmonad/README.md deleted file mode 100644 index 747719c..0000000 --- a/dotfiles/kmonad/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# KMonad config - -## Useful links - -- [Config tutorial](https://github.com/kmonad/kmonad/blob/master/keymap/tutorial.kbd) -- [Homerow mod stuff](https://precondition.github.io/home-row-mods#using-home-row-mods-with-kmonad) diff --git a/dotfiles/kmonad/keymap.kbd b/dotfiles/kmonad/keymap.kbd deleted file mode 100644 index 52ae49d..0000000 --- a/dotfiles/kmonad/keymap.kbd +++ /dev/null @@ -1,155 +0,0 @@ -(defcfg - ;; For Linux - ;; input (device-file "$DEVICE") ;; gets dynamically replaced by nix - ;; input (device-file "/dev/input/by-path/pci-0000:00:14.0-usb-0:5:1.0-event-kbd") - input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd") - output (uinput-sink "My KMonad output" - ;; To understand the importance of the following line, see the section on - ;; Compose-key sequences at the near-bottom of this file. - "/run/current-system/sw/bin/sleep 1 && /run/current-system/sw/bin/setxkbmap -option compose:ralt") - cmp-seq ralt ;; Set the compose key to `RightAlt' - cmp-seq-delay 5 ;; 5ms delay between each compose-key sequence press - - ;; Comment this is you want unhandled events not to be emitted - fallthrough true - - ;; Set this to false to disable any command-execution in KMonad - allow-cmd false -) - -;; Layer template: -#| -(deflayer qwerty - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ -) -|# - -(defalias - ga #(ralt a h) ;; alpha - gb #(ralt b h) ;; beta - gg #(ralt g h) ;; gamma - ge #(ralt e h) ;; epsilon - gt #(ralt t h) ;; tau - gl #(ralt l h) ;; lambda - gm #(ralt m h) ;; miu - gp #(ralt p h) ;; pi - gx #(ralt x h) ;; xi - gs #(ralt s h) ;; sigma - go #(ralt o h) ;; omega - gu #(ralt u h) ;; uspilon - gd #(ralt d h) ;; delta - - gph #(ralt l p h h) ;; phi - gth #(ralt l t h h) ;; theta - gps #(ralt l p s h) ;; psi - - Gu #(ralt u j) ;; UPSILON - Gg #(ralt g j) ;; GAMMA - Gd #(ralt d j) ;; DELTAJ - Gp #(ralt p j) ;; PI - Gs #(ralt s j) ;; SIGMA - Go #(ralt o j) ;; OMEGA - Gx #(ralt x j) ;; XI - - neg #(ralt l -) ;; ¬ - fal #(ralt l v) ;; ∀ - ex #(ralt l e) ;; ∃ - lar #(ralt < -) ;; ← - rar #(ralt - >) ;; → - and #(ralt l c) ;; and symbol - or #(ralt l d) ;; or symbol - eq #(ralt e q) ;; Equivalence - - alp #(ralt f \( ) ;; angled left parenthesis - arp #(ralt f \) ) ;; angled right parenthesis - - shrugFace #(ralt l s h r) ;; shrug face - topBar #(ralt t -) ;; ¯ -) - -;; layers -(defalias - mth (layer-toggle math) - Mth (layer-toggle capital-math) - mov (layer-toggle movement) - mathExtra (layer-toggle math-extra) - sft (tap-macro lsft (layer-toggle shiftedQwerty)) ;; make this work differently based on the next key pressed - j (tap-macro 7 lsft) - ;; spc (spc) ;; (tap-hold-next-release 130 spc lsft) - tab (tap-hold-next 150 tab rctl) -) - -;; more "special" stuff -(defalias - shr #(@topBar \ \_ \_ \( @shrugFace \) \_ / @topBar) ;; ¯\_(ツ)_/¯ - - ml @gl -) - -(defsrc - esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del - grv 1 2 3 4 5 6 7 8 9 0 - = bspc - tab q w e r t y u i o p [ ] \ - caps a s d f g h j k l ; ' ret - lsft z x c v b n m , . / rsft - lctl lsgt lmet lalt spc ralt rctl -) - -(deflayer qwerty - esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del - grv 1 2 3 4 5 6 7 8 9 0 - = bspc - @tab q w e r t y u i o p [ ] \ - @mth a s d f g h j k l ; ' ret - @sft z x c v b n m , . / rsft - @mov lsgt lmet lalt spc ralt rctl -) - -(deflayer shiftedQwerty - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ ! @ # $ % ^ & 8 \( \) _ + S-bspc - S-tab Q W E R T Y U I O P { } | - @Mth A S D F G H J K L : " S-ret - XX Z X C V B N M < > ? _ - _ _ _ _ spc S-ralt S-rctl -) - -(deflayer movement - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ lft down up rght _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ -) - -(deflayer math-extra - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ @eq _ _ _ _ _ @or _ _ _ _ - _ @and _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ -) - -(deflayer math - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ @ex _ _ _ _ _ @alp @arp @neg _ _ - _ @shr @go @ge _ @gt _ @gu _ @go @gp _ _ _ - _ @ga @gs @gd _ @gg @gth @gps @gph @ml _ _ _ - @Mth _ @gx _ @fal @gb _ @gm @lar @rar _ _ - _ _ _ _ @mathExtra _ _ -) - -(deflayer capital-math - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ @Gu _ @Go @Gp _ _ _ - _ _ @Gs @Gd _ @Gg _ _ _ _ _ _ _ - _ _ @Gx _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ -) diff --git a/dotfiles/kmonad/test.sh b/dotfiles/kmonad/test.sh deleted file mode 100755 index c3067a7..0000000 --- a/dotfiles/kmonad/test.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/run/current-system/sw/bin/bash -kmonad -d "`dirname "$0"`/keymap.kbd" diff --git a/dotfiles/kmonad/xcompose b/dotfiles/kmonad/xcompose deleted file mode 100644 index 94bf7a7..0000000 --- a/dotfiles/kmonad/xcompose +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8; mode: conf -*- include "%L" - - : "ɑ" U0251 # LATIN SMALL LETTER ALPHA - : "β" U0252 # LATIN SMALL LETTER BETA - : "γ" U0253 # LATIN SMALL LETTER GAMMA - : "ϵ" U0254 # LATIN SMALL LETTER EPSILON - : "λ" U0255 # LATIN SMALL LETTER LAMBDA - : "μ" U0256 # LATIN SMALL LETTER MU -

: "π" U0257 # LATIN SMALL LETTER PI - : "τ" U0258 # LATIN SMALL LETTER TAU - : "ξ" U0259 # LATIN SMALL LETTER XI - : "σ" U0260 # LATIN SMALL LETTER SIGMA - : "ω" U0261 # LATIN SMALL LETTER OMEGA - : "υ" U0262 # LATIN SMALL LETTER UPSILON - : "δ" U0263 # LATIN SMALL LETTER DELTA - -

: "ϕ" U0270 # LATIN SMALL LETTER PHI - : "θ" U0271 # LATIN SMALL LETTER THETA -

: "ψ" U0272 # LATIN SMALL LETTER PSI - - : "ϒ" U0280 # LATIN CAPITAL LETTER UPSILON - : "Γ" U0281 # LATIN CAPITAL LETTER GAMMA - : "Δ" U0282 # LATIN CAPITAL LETTER DELTA -

: "Π" U0283 # LATIN CAPITAL LETTER PI - : "Σ" U0284 # LATIN CAPITAL LETTER SIGMA - : "Ω" U0285 # LATIN CAPITAL LETTER OMEGA - : "Ξ" U0286 # LATIN CAPITAL LETTER XI - - : "Θ" U0300 # LATIN CAPITAL LETTER OMEGA - - : "ツ" U0350 # SHRUG FACE - : "¯" U0351 # TOP BAR - : "¬" U0352 # LOGICAL NEGATION - : "→" U0353 # ARROW RIGHT - : "←" U0354 # ARROW LEFT - : "∀" U0355 # LOGICAL FORALL - : "∃" U0356 # LOGICAL EXISTS - - : "⟨" U0357 # FANCY LEFT PAREN - : "⟩" U0358 # FANCY RIGHT PAREN - - : "⟷" U0359 # LOGICAL EQUIVALENCE - : "∧" U0360 # LOGICAL CONJUNCTION - : "∨" U0361 # LOGICAL DISJUNCTION - - diff --git a/dotfiles/neovim/.neoconf.json b/dotfiles/neovim/.neoconf.json deleted file mode 100644 index a0d5a68..0000000 --- a/dotfiles/neovim/.neoconf.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "neoconf": { - "plugins": { - "sumneko_lua": { - "enabled": true - } - } - }, - "neodev": { - "library": { - "enabled": true, - "types": true, - "plugins": false, - "runtime": true - } - } -} diff --git a/dotfiles/neovim/README.md b/dotfiles/neovim/README.md deleted file mode 100644 index 818970d..0000000 --- a/dotfiles/neovim/README.md +++ /dev/null @@ -1,128 +0,0 @@ -# Neovim config - -## Articles - -- [Textobjects](https://blog.carbonfive.com/vim-text-objects-the-definitive-guide/) -- [Registers](https://www.brianstorti.com/vim-registers/) -- [Markers](https://vim.fandom.com/wiki/Using_marks) - -## Keybinds - -Table of my own keybinds. Here as documentation for myself. I am yet to include any of the keybinds for cmp here. - -> Things written using italics are chords -> (aka all the keys need to be pressed at the same time) - -| Keybind | Description | Plugins | -| ------------ | ----------------------------------- | ------------------ | -| _vs_ | Create vertical split | | -| _cp_ | Use system clipboard | | -| _jl_ | Save | | -| _jk_ | Exit insert mode | | -| _rw_ | Rename word under cursor | | -| _\k_ | Insert digraph | | -| _\a_ | Swap last 2 used buffers | | -| C-n | Open tree | nvim-tree | -| _vc_ | Clear vimux window | vimux | -| _vl_ | Rerun last vimux command | vimux | -| _vp_ | Run command in another tmux pane | vimux | -| C-hjkl | Navigation between vim & tmux panes | vim-tmux-navigator | -| J | Show line diagnostics | lspconfig | -| K | Show hover info | lspconfig | -| L | Signature help (?) | lspconfig | -| gD | Go to declaration | lspconfig | -| gd | Go to definition | lspconfig | -| gi | Go to implementation | lspconfig | -| \rn | Rename | lspconfig | -| \f | format | lspconfig | -| \ca | code actions | lspconfig | - -### Telescope - -| Keybind | Description | Plugins | -| ----------- | ------------------------------ | ---------------------- | -| Ctrl-P | Find files | | -| Ctrl-F | Grep in project | | -| \d | Diagnostics | lspconfig | -| \ca | Code actions | lspconfig | -| \t | Show builtin pickers | | -| \s | Show symbols using tree-sitter | | -| \gj | List git commits | | -| \gk | List git branches | | -| _jp_ | Interactive file broswer | telescope-file-browser | -| _ui_ | Insert unicode char | | - -### Idris - -> The idris and arpeggio plugins are implicit here - -| Keybind | Description | -| ------- | ------------------- | -| _isc_ | Case split | -| _imc_ | Make case | -| _iml_ | Make lemma | -| _ies_ | Expression search | -| _igd_ | Generate definition | -| _irh_ | Refine hole | -| _iac_ | Add clause | - -### Purescript - -| Keybind | Description | -| ------- | ------------------------------------------- | -| _vb_ | Make tmux run spago build in sepearate pane | -| _vt_ | Make tmux run spago test in separate pane | - -### Nix - -| Keybind | Description | -| ------- | ------------------------------------ | -| _ug_ | Run nix-fetchgit on the current file | - -### Lean - -- Extra brackets: ⟨⟩ - -## Some cool vim keybinds I sometimes forget about - -Documentation for myself - -| Keybind | Description | Plugins | -| ------- | ----------------------- | ------- | -| zz | Center the current line | | - -## Important plugins I use the default mappins of - -- paperplanes - -| Keybind | Description | -| ------- | ------------------------- | -| :PP | Create pastebin-like link | - -- nvim-comment - -| Keybind | Description | -| ------- | ----------------- | -| gcc | Comment line | -| gc | Comment selection | - -- neogit - -| Keybind | Description | -| ------- | ----------- | -| C-g | Open neogit | - -- gitlinker - -| Keybind | Description | -| ---------- | ------------------ | -| gy | Create remote link | - -- nvim-surround - -| Keybind | Description | Mode | -| -------- | ----------------------------------- | ---- | -| cs[a][b] | Change surrounding pair from a to b | n | -| ds[a] | Delete surrounding pair of a | n | -| ys[m][a] | Surround the motion m with a | n | -| S[a] | Surround selected code with a | v | diff --git a/dotfiles/neovim/ftdetect/hkf.lua b/dotfiles/neovim/ftdetect/hkf.lua deleted file mode 100644 index fdca1d4..0000000 --- a/dotfiles/neovim/ftdetect/hkf.lua +++ /dev/null @@ -1,7 +0,0 @@ -vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { - group = vim.api.nvim_create_augroup("Detect hkf", {}), - pattern = "*.hkf", - callback = function() - vim.opt.filetype = "hkf" - end -}) diff --git a/dotfiles/neovim/ftplugin/hkf.lua b/dotfiles/neovim/ftplugin/hkf.lua deleted file mode 100644 index c8e8ccc..0000000 --- a/dotfiles/neovim/ftplugin/hkf.lua +++ /dev/null @@ -1 +0,0 @@ -vim.api.nvim_buf_set_option(0, "commentstring", "-- %s") diff --git a/dotfiles/neovim/ftplugin/lua.lua b/dotfiles/neovim/ftplugin/lua.lua deleted file mode 100644 index b8b77cb..0000000 --- a/dotfiles/neovim/ftplugin/lua.lua +++ /dev/null @@ -1,25 +0,0 @@ -local opts = function(desc) - return { desc = desc, buffer = true } -end - -vim.keymap.set("n", "lf", ":source %", opts("Run [l]ua [f]ile ")) -vim.keymap.set("n", "ls", function() - local path = vim.api.nvim_buf_get_name(0) - local status, M = pcall(dofile, path) - - if status then - if M ~= nil then - if type(M.setup) == "function" then - M.setup() - print("M.setup() executed succesfully!") - else - print("Module does not return a setup function") - end - else - print("Module returned nil") - end - else - print("Cannot import current file :(") - end -end, opts("Run .setup() in current file")) - diff --git a/dotfiles/neovim/ftplugin/nix.lua b/dotfiles/neovim/ftplugin/nix.lua deleted file mode 100644 index 991dbac..0000000 --- a/dotfiles/neovim/ftplugin/nix.lua +++ /dev/null @@ -1,9 +0,0 @@ --- Use _lg_ to fetchgit stuff -vim.keymap.set("n", "lg", function() - require("my.helpers").saveCursor(function() - vim.cmd(":%!update-nix-fetchgit") - end) -end, { buffer = true, desc = "Update all fetchgit calls" }) - --- Idk why this isn't here by default -vim.api.nvim_buf_set_option(0, "commentstring", "# %s") diff --git a/dotfiles/neovim/ftplugin/purescript.lua b/dotfiles/neovim/ftplugin/purescript.lua deleted file mode 100644 index 04e24c2..0000000 --- a/dotfiles/neovim/ftplugin/purescript.lua +++ /dev/null @@ -1,32 +0,0 @@ -local A = require("my.abbreviations") - --- Use vt to test -vim.keymap.set( - "n", - "vt", - ':VimuxRunCommand "clear && spago test"', - { desc = "[V]imtex run [t]ests", buffer = true } -) - --- Use vb to build -vim.keymap.set( - "n", - "vb", - ':VimuxRunCommand "clear && spago build"', - { desc = "[V]imtex [b]uild", buffer = true } -) - -vim.opt.expandtab = true -- Use spaces for the tab char - -local abbreviations = { - { "land", "/\\" }, - { "lor", "\\/" }, - { "tto", "->" }, - { "iip", "=>" }, - { "frl", "forall" }, - { "ott", "<-" }, -- opposite of tto -} - -A.manyLocalAbbr(abbreviations) - - diff --git a/dotfiles/neovim/ftplugin/tex.lua b/dotfiles/neovim/ftplugin/tex.lua deleted file mode 100644 index cdf74f0..0000000 --- a/dotfiles/neovim/ftplugin/tex.lua +++ /dev/null @@ -1,170 +0,0 @@ -local A = require("my.abbreviations") -local scrap = require("scrap") - -require("my.helpers.wrapMovement").setup() - -vim.opt.conceallevel = 0 -vim.opt.wrap = true - -vim.keymap.set("n", "lg", function() - if not pcall(function() - local a = tonumber(vim.fn.input("A: ")) - local b = tonumber(vim.fn.input("B: ")) - - local g, x, y = require("my.helpers.math.mod").gcd(a, b) - - vim.fn.input("Result: " .. g .. " " .. x .. " " .. y) - end) then vim.fn.input("No results exist") end -end, { buffer = true, desc = "Gcd calculator" }) - -vim.keymap.set("n", "li", function() - if not pcall(function() - local class = tonumber(vim.fn.input("Mod class: ")) - local num = tonumber(vim.fn.input("Number: ")) - - vim.fn.input("Result: " .. require("my.helpers.math.mod").modinverse(num, class)) - end) then vim.fn.input("No results exist") end -end, { buffer = true, desc = "Mod inverse calculator" }) - -local abbreviations = { - -- Greek chars - { "eps", "\\epsilon" }, - { "delta", "\\delta" }, - { "Delta", "\\Delta" }, - { "pi", "\\pi" }, - { "psi", "\\psi" }, - { "alpha", "\\alpha" }, - { "beta", "\\beta" }, - { "theta", "\\theta" }, - { "gamma", "\\gamma" }, - { "lam", "\\lambda" }, - { "nuls", "\\varnothing" }, -- Other fancy symvols - - { "tmat", "^T" }, -- Tranpose of a matrix - { "cmat", "^*" }, -- Conjugate of a matrix - { "ortco", "^{\\bot}" }, -- Orthogonal complement - { "sinter", "^{\\circ}" }, -- Interior of a set - - -- Basic commands - { "mangle", "\\measuredangle" }, - { "aangle", "\\angle" }, - - { "sdiff", "\\setminus" }, - { "sst", "\\subset" }, - { "sseq", "\\subseteq" }, - { "nin", "\\not\\in" }, - { "iin", "\\in" }, - { "tto", "\\to" }, - { "iip", "\\implies" }, - { "iff", "\\iff" }, - { "land", "\\land" }, - { "lor", "\\lor" }, - { "ssin", "\\sin" }, - { "ccos", "\\cos" }, - { "ttan", "\\ttan" }, - { "ssec", "\\sec" }, - { "lln", "\\ln" }, - { "frl", "\\forall" }, - { "exs", "\\exists" }, - { "iinf", "\\infty" }, - { "ninf", "-\\infty" }, - { "nlnl", "\\pm" }, -- had this as npnp first but it was hard-ish to type - { "ccup", "\\cup" }, - { "ccap", "\\cap" }, - { "nope", "\\bot" }, - { "yee", "\\top" }, - { "ccan", "\\cancel" }, - { "comp", "\\circ" }, - { "mul", "\\cdot" }, - { "smul", "\\times" }, - { "card", "\\#" }, - { "div", "\\|" }, - { "ndiv", "\\not\\|\\:" }, - - -- words - { "rref", "reduced row echalon form" } -} - ----@type ExpansionOptions -local no_capitalization = { capitalized = false } - --- Todo: convert exponents and subscripts --- to use this more concise notation. ----@type ExpansionInput[] -local abolishAbbreviations = { - -- General phrases - { "thrf", "therefore" }, - { "bcla", "by contradiction let's assume" }, - { "wlg", "without loss of generality" }, - - -- Calculus - { "ib{p,s}", "integration by {parts,substitution}" }, - - -- Linear algebra - { "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" }, - { "mx{,s}", "matri{x,ces}" }, - { "dete{,s}", "determinant{}" }, - { "ort{n,g}", "orto{normal,gonal}" }, - { "l{in,de}", "linearly {independent,dependent}" }, - - -- My own operator syntax: - -- - Any operator can be prefixed with "a" to - -- align in aligned mode - -- - Any operator can be prefixed with cr to - -- start a new line and align in aligned mode - { - "{cr,a,}{eq,neq,leq,geq,lt,gt}", - "{\\\\\\&,&,}{=,\\neq,\\leq,\\geq,<,>}", - options = no_capitalization - }, - - -- Exponents and subscripts: - -- {operation}{argument} - -- - operation = e (exponent) | s (subscript) - -- - argument = t{special} | {basic} - -- - basic = 0-9|n|i|t|k - -- - special = - -- - "p" => + - -- - "m" => - - -- - "i" => -1 - { - "{e,s}{{0,1,2,3,4,5,6,7,8,9,n,i,t,k},t{i,m,p}}", - "{^,_}{{},{\\{-1\\},-,+}}", - options = no_capitalization - }, - - -- Set symbols - -- - nats => naturals - -- - ints => integers - -- - rats => rationals - -- - irats => irationals - -- - rrea => reals - -- - comp => complex - -- - ppri => primes - -- - ffie => fields - { - "{nats,ints,rats,irats,rrea,comp,ppri,ffie}", - "\\mathbb\\{{N,Z,Q,I,R,C,P,F}\\}", - options = no_capitalization - }, - - -- Function calls: - -- {function-name}{modifier?}{argument} - -- - -- - function-name = f/g/h/P - -- - modifier: - -- - d => derivative - -- - 2 => squared - -- - 3 => cubed - -- - i => inverse - -- - argument = x/a/t/i/n/k - { "{f,g,h,P}{d,2,3,i,}{x,a,t,i,n,k}", "{}{',^2,^3,^\\{-1\\},}({})" } -} - -local expanded = scrap.expand_many(abolishAbbreviations) - -A.manyLocalAbbr(abbreviations) -A.manyLocalAbbr(expanded) - -vim.keymap.set("n", "lc", "VimtexCompile", - { desc = "Compile current buffer using vimtex", buffer = true }) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua deleted file mode 100644 index eb17373..0000000 --- a/dotfiles/neovim/init.lua +++ /dev/null @@ -1,17 +0,0 @@ --- bootstrap from github -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" - -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "--single-branch", - "git@github.com:folke/lazy.nvim.git", - lazypath, - }) -end - -vim.opt.runtimepath:prepend(lazypath) - -require("my.init").setup() diff --git a/dotfiles/neovim/lazy-lock.json b/dotfiles/neovim/lazy-lock.json deleted file mode 100644 index 6382756..0000000 --- a/dotfiles/neovim/lazy-lock.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "LuaSnip": { "branch": "master", "commit": "5570fd797eae0790affb54ea669a150cad76db5d" }, - "abbreinder.nvim": { "branch": "main", "commit": "5b2b5ff08a9ada42238d733aeebc6d3d96314d77" }, - "abbremand.nvim": { "branch": "main", "commit": "d633341f632b0b2666dfc6dfe6b9842ba1610a1d" }, - "catppuccin": { "branch": "main", "commit": "55f43a952856bc0029e6cef066297c6cfab3451d" }, - "clipboard-image.nvim": { "branch": "main", "commit": "d1550dc26729b7954f95269952e90471b838fa25" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, - "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "dashboard-nvim": { "branch": "master", "commit": "115b9f9cec10e31aff39c077bf5a4881bc840916" }, - "dhall-vim": { "branch": "master", "commit": "68500ef46ff3706f46c99db3be7a0c8abcf6a3ae" }, - "dressing.nvim": { "branch": "master", "commit": "4436d6f41e2f6b8ada57588acd1a9f8b3d21453c" }, - "fidget.nvim": { "branch": "main", "commit": "44585a0c0085765195e6961c15529ba6c5a2a13b" }, - "firenvim": { "branch": "master", "commit": "17a189f0f1e2d4197e00cd56dbeaed8c268bac8c" }, - "gitlinker.nvim": { "branch": "master", "commit": "c68d4873a14d2ae614875685ccca2e49472989e8" }, - "glow.nvim": { "branch": "main", "commit": "20d1cd087f8728f21a048a3b6259f6177237b39e" }, - "hydra.nvim": { "branch": "master", "commit": "7e2aa29f88d534371c6b0263d3abbfac7c2376ce" }, - "idris2-nvim": { "branch": "main", "commit": "dd850c1c67bcacd2395121b0898374fe9cdd228f" }, - "inc-rename.nvim": { "branch": "main", "commit": "48c4aa2be19f79e79b465a9bb37ee9fbe6c606f5" }, - "iron.nvim": { "branch": "master", "commit": "bd5ad2a04195fb7a739eb973fa2d9f7ccc35ab4b" }, - "kmonad-vim": { "branch": "master", "commit": "37978445197ab00edeb5b731e9ca90c2b141723f" }, - "knap": { "branch": "main", "commit": "62eae7803d9d87d33513b3b565c6f5791f1de1ea" }, - "kotlin-vim": { "branch": "master", "commit": "1261f851e5fb2192b3a5e1691650597c71dfce2f" }, - "lazy.nvim": { "branch": "main", "commit": "0d0d11acb2547ea65e0eba4fb6855f0954ed0239" }, - "leap": { "branch": "main", "commit": "a5c9504290832e6bdbbb6265fd1ff02fc6485d20" }, - "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, - "lualine.nvim": { "branch": "master", "commit": "fffbcb829288c3ca366f17cdb8d46aefb5c1d6f3" }, - "mind.nvim": { "branch": "master", "commit": "5aa39d57d1091999ca5bdcdd056a27a032156c2d" }, - "neoconf.nvim": { "branch": "main", "commit": "71e86dc9324069807c1135c46c0c9f6eb793966b" }, - "neodev.nvim": { "branch": "main", "commit": "f6ee1a7651280ac476403c0b70bbfb419fa720ab" }, - "neogit": { "branch": "master", "commit": "0d6002c6af432343937283fb70791fc76fa7227c" }, - "nui.nvim": { "branch": "main", "commit": "4939282919885e1c83aff68ecb35b3cadf6015a9" }, - "null-ls.nvim": { "branch": "main", "commit": "eaacba0b93c416252894f8bdc68e6b50b4e4c3b4" }, - "nvim-autopairs": { "branch": "master", "commit": "03580d758231956d33c8dd91e2be195106a79fa4" }, - "nvim-cmp": { "branch": "main", "commit": "e55033fce468c9c578b946948807f2ac48a6ee08" }, - "nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" }, - "nvim-lspconfig": { "branch": "master", "commit": "42ca8ce0f2252be795da4789fadfa91f6c3f7464" }, - "nvim-tree.lua": { "branch": "master", "commit": "9e4c39572f631bb60ee15cb9d46e1daa9927a45e" }, - "nvim-treesitter": { "branch": "master", "commit": "fb36ed4c9e962d9fbfa608cd4a5d9313b1e8a8b1" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "83a494a6f93675beff7bbd320c04c87433b1462f" }, - "nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" }, - "nvim_context_vt": { "branch": "master", "commit": "31436f34f3f95e4e70853cd653fdf78246cb0e85" }, - "paperplanes.nvim": { "branch": "master", "commit": "d704b2e1e594b32d454cc7e0c5f2cf9b391e3cc1" }, - "plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" }, - "presence.nvim": { "branch": "main", "commit": "c1c54758824cbecd4e18065d37191f7666fdd097" }, - "purescript-vim": { "branch": "main", "commit": "7af25a840d38dc6767c85edd1f35c1f835618071" }, - "scrap.nvim": { "branch": "main", "commit": "16db44ae9403ec9c4b140394f294475d1af80a18" }, - "smart-splits.nvim": { "branch": "master", "commit": "fdd158ce7554dc830fb86e0fe952cd9476cdf726" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "b8581d00afa02c6bb4c947348e3cee62db65b119" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "fab3e2212e206f4f8b3bbaa656e129443c9b802e" }, - "telescope.nvim": { "branch": "master", "commit": "e960efa60e97df58e089b00270f09d60f27202c8" }, - "venn.nvim": { "branch": "main", "commit": "c114563960b8fb1197695d42798d1f3e7190b798" }, - "vim-abolish": { "branch": "master", "commit": "3f0c8faadf0c5b68bcf40785c1c42e3731bfa522" }, - "vim-arpeggio": { "branch": "master", "commit": "01c8fc1a72ef58e490ee0490c65ee313b1b6e843" }, - "vim-sleuth": { "branch": "master", "commit": "8332f123a63c739c870c96907d987cc3ff719d24" }, - "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, - "vim-teal": { "branch": "master", "commit": "d2aa107b257879e774680792a2aebaf9cd5742e0" }, - "vim-tmux-navigator": { "branch": "master", "commit": "41ea9d23b814014c8d8daf8b44fa0cd827a0e5f4" }, - "vim-wakatime": { "branch": "master", "commit": "8c7f33b43a56f89285de0da77ee6ec7e4af1f835" }, - "vimtex": { "branch": "master", "commit": "5e03d9052de30c8e4c2f4907600783112454028a" }, - "vimux": { "branch": "master", "commit": "616fcb4799674a7a809b14ca2dc155bb6ba25788" }, - "which-key.nvim": { "branch": "main", "commit": "8682d3003595017cd8ffb4c860a07576647cc6f8" } -} \ No newline at end of file diff --git a/dotfiles/neovim/lua/.luarc.json b/dotfiles/neovim/lua/.luarc.json deleted file mode 100644 index e1b9d70..0000000 --- a/dotfiles/neovim/lua/.luarc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", - "Lua.workspace.checkThirdParty": false -} \ No newline at end of file diff --git a/dotfiles/neovim/lua/my/abbreviations.lua b/dotfiles/neovim/lua/my/abbreviations.lua deleted file mode 100644 index 919c6fe..0000000 --- a/dotfiles/neovim/lua/my/abbreviations.lua +++ /dev/null @@ -1,19 +0,0 @@ -local M = {} - -function M.localAbbr(lhs, rhs) - -- Create abbreviation - vim.cmd(":iabbrev " .. lhs .. " " .. rhs) -end - -function M.manyLocalAbbr(abbreviations) - for _, value in pairs(abbreviations) do - M.localAbbr(value[1], value[2]) - end -end - -function M.abbr(lhs, rhs) - -- Create abbreviation - vim.cmd(":iabbrev " .. lhs .. " " .. rhs) -end - -return M diff --git a/dotfiles/neovim/lua/my/helpers.lua b/dotfiles/neovim/lua/my/helpers.lua deleted file mode 100644 index e9158b5..0000000 --- a/dotfiles/neovim/lua/my/helpers.lua +++ /dev/null @@ -1,19 +0,0 @@ -local M = {} - -function M.mergeTables(t1, t2) - local t3 = {} - - if t1 ~= nil then for k, v in pairs(t1) do t3[k] = v end end - - if t2 ~= nil then for k, v in pairs(t2) do t3[k] = v end end - - return t3 -end - -function M.saveCursor(callback) - local cursor = vim.api.nvim_win_get_cursor(0) - callback() - vim.api.nvim_win_set_cursor(0, cursor) -end - -return M diff --git a/dotfiles/neovim/lua/my/helpers/env.lua b/dotfiles/neovim/lua/my/helpers/env.lua deleted file mode 100644 index 5c6d32a..0000000 --- a/dotfiles/neovim/lua/my/helpers/env.lua +++ /dev/null @@ -1,40 +0,0 @@ -local function makeEnv(cond) - return { - active = cond, - not_active = function() - return not cond() - end, - unless = function(f) - if not cond() then - f() - end - end, - when = function(f) - if cond() then - f() - end - end, - } -end - -return { - vscode = makeEnv(function() - return vim.g.vscode ~= nil - end), - neovide = makeEnv(function() - return vim.g.neovide ~= nil or os.getenv("INSIDE_NEOVIDE") == "1" - end), - firenvim = makeEnv(function() - return vim.g.started_by_firenvim ~= nil - end), - _and = function(a, b) - return makeEnv(function() - return a.active() and b.active() - end) - end, - _or = function(a, b) - return makeEnv(function() - return a.active() or b.active() - end) - end -} diff --git a/dotfiles/neovim/lua/my/helpers/math/mod.lua b/dotfiles/neovim/lua/my/helpers/math/mod.lua deleted file mode 100644 index 50de361..0000000 --- a/dotfiles/neovim/lua/my/helpers/math/mod.lua +++ /dev/null @@ -1,15 +0,0 @@ -local M = {} - -function M.modinverse(b, m) - local g, x, _ = M.gcd(b, m) - if g ~= 1 then return nil end - return x % m -end - -function M.gcd(a, b) - if a == 0 then return b, 0, 1 end - local g, x1, y1 = M.gcd(b % a, a) - return g, y1 - (math.floor(b / a)) * x1, x1 -end - -return M diff --git a/dotfiles/neovim/lua/my/helpers/wrapMovement.lua b/dotfiles/neovim/lua/my/helpers/wrapMovement.lua deleted file mode 100644 index 726726b..0000000 --- a/dotfiles/neovim/lua/my/helpers/wrapMovement.lua +++ /dev/null @@ -1,22 +0,0 @@ -local M = {} - -local function swap(key) - vim.keymap.set({ "n", "v" }, key, "g" .. key, { buffer = true }) - vim.keymap.set({ "n", "v" }, "g" .. key, key, { buffer = true }) -end - --- Same as swap, but the key is aprt of an arpeggio chord -local function swapArpeggio(key) - vim.keymap.set({ "n", "v" }, "(arpeggio-default:" .. key .. ")", "g" .. key, - { buffer = true }) - vim.keymap.set({ "n", "v" }, "g" .. key, key, { buffer = true }) -end - -function M.setup() - swapArpeggio("j") - swap("k") - swap("0") - swap("$") -end - -return M diff --git a/dotfiles/neovim/lua/my/init.lua b/dotfiles/neovim/lua/my/init.lua deleted file mode 100644 index 3886f9b..0000000 --- a/dotfiles/neovim/lua/my/init.lua +++ /dev/null @@ -1,10 +0,0 @@ -local M = {} - -function M.setup() - -- Import my other files - require("my.options").setup() - require('my.keymaps').setup() - require('my.lazy').setup() -end - -return M diff --git a/dotfiles/neovim/lua/my/keymaps.lua b/dotfiles/neovim/lua/my/keymaps.lua deleted file mode 100644 index 7731d7b..0000000 --- a/dotfiles/neovim/lua/my/keymaps.lua +++ /dev/null @@ -1,98 +0,0 @@ -local helpers = require("my.helpers") - -local M = {} - --- {{{ Helpers ----Performs a basic move operation ----Moves a keybind to a different set of keys. ----Useful for moving built in keybinds out of the way. ----@param from string ----@param to string ----@param opts table|nil -function M.move(from, to, opts) - vim.keymap.set("n", to, from, opts) - vim.keymap.set("n", from, "") -end - ----Create a textobject defined by some delimiters ----@param from string ----@param to string ----@param name string ----@param perhapsOpts table|nil -function M.delimitedTextobject(from, to, name, perhapsOpts) - local opts = helpers.mergeTables(perhapsOpts or {}, { desc = name }) - - vim.keymap.set({ "v", "o" }, "i" .. from, "i" .. to, opts) - vim.keymap.set({ "v", "o" }, "a" .. from, "a" .. to, opts) -end - ----Helper to create a normal mode mapping and give it some description. ----@param from string ----@param to string|function ----@param desc string ----@param silent boolean|nil -function M.nmap(from, to, desc, silent) - if silent == nil then - silent = true - end - vim.keymap.set("n", from, to, { desc = desc }) -end - --- }}} - -function M.setup() - -- {{{ Free up q and Q - M.move("q", "yq", { desc = "Record macro" }) - M.move("Q", "yQ") - -- }}} - -- {{{ Easier access to - M.move("", "a", { desc = "[A]lternate file" }) - -- }}} - -- {{{ Quit current buffer / all buffers - vim.keymap.set({ "n", "v" }, "q", function() - local buf = vim.api.nvim_win_get_buf(0) - - -- Only save if file is writable - if vim.bo[buf].modifiable and not vim.bo[buf].readonly then - vim.cmd([[write]]) - end - - vim.cmd("q") - end, { desc = "[Q]uit current buffer" }) - - M.nmap("Q", ":wqa", "Save all files and [q]uit") - -- }}} - -- {{{ Replace word in file - M.nmap("rw", ":%s//", "[R]eplace [w]ord in file") - -- }}} - -- {{{ Text objects - M.delimitedTextobject("q", '"', "[q]uotes") - M.delimitedTextobject("a", "'", "[a]postrophes") - M.delimitedTextobject("r", "[", "squa[r]e brackets") - -- }}} - -- {{{Diagnostic keymaps - M.nmap("[d", vim.diagnostic.goto_prev, "Goto previous [d]iagnostic") - M.nmap("]d", vim.diagnostic.goto_next, "Goto next [d]iagnostic") - M.nmap("J", vim.diagnostic.open_float, "Open current diagnostic") - M.nmap("D", vim.diagnostic.setloclist, "[D]iagnostic loclist") - -- }}} - -- {{{ Chords (exit insert mode, save, clipboard) - -- }}} - -- {{{ Allow quiting basic buffers with "q" - vim.api.nvim_create_autocmd("FileType", { - pattern = { "help" }, - callback = function(event) - vim.keymap.set( - "n", - "q", - "close", - { buffer = event.buf, silent = true, desc = "[q]uit current buffer" } - ) - end, - }) - -- }}} - - return M -end - -return M diff --git a/dotfiles/neovim/lua/my/lazy.lua b/dotfiles/neovim/lua/my/lazy.lua deleted file mode 100644 index ff9ea90..0000000 --- a/dotfiles/neovim/lua/my/lazy.lua +++ /dev/null @@ -1,31 +0,0 @@ -local M = {} - -function M.setup() - require("lazy").setup("my.plugins", { - defaults = { lazy = true }, - disabled_plugins = { - "gzip", - "matchit", - "matchparen", - "netrwPlugin", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - install = { - -- install missing plugins on startup. This doesn't increase startup time. - missing = true, - -- try to load one of these colorschemes when starting an installation during startup - colorscheme = { "catpuccin" }, - }, - change_detection = { - enabled = false, - notify = false, - }, - }) -end - -vim.keymap.set("n", "L", "Lazy", { desc = "[L]azy ui" }) - -return M diff --git a/dotfiles/neovim/lua/my/neovide.lua b/dotfiles/neovim/lua/my/neovide.lua deleted file mode 100644 index 3d7adf7..0000000 --- a/dotfiles/neovim/lua/my/neovide.lua +++ /dev/null @@ -1,22 +0,0 @@ -local M = {} - -function M.setup() - local default_length = 0.04 - vim.g.neovide_floating_blur_amount_x = 3.0 - vim.g.neovide_floating_blur_amount_y = 3.0 - vim.g.neovide_transparency = 1.0 - vim.g.pumblend = 30 - vim.g.neovide_cursor_animation_length = default_length - - vim.api.nvim_create_autocmd("WinEnter", { - group = vim.api.nvim_create_augroup("Setup transparency", {}), - pattern = "*", - callback = function() - vim.wo.winblend = 30 - end, - }) - - vim.g.neovide_cursor_animate_in_insert_mode = false -end - -return M diff --git a/dotfiles/neovim/lua/my/options.lua b/dotfiles/neovim/lua/my/options.lua deleted file mode 100644 index e942f14..0000000 --- a/dotfiles/neovim/lua/my/options.lua +++ /dev/null @@ -1,44 +0,0 @@ -local M = {} - -function M.setup() - -- Disable filetype.vim - vim.g.do_filetype_lua = true - vim.g.did_load_filetypes = false - - -- Basic options - vim.opt.joinspaces = false -- No double spaces with join - vim.opt.list = true -- Show some invisible characters - vim.opt.cmdheight = 0 -- Hide command line when it's not getting used - - -- Line numbers - vim.opt.number = true -- Show line numbers - vim.opt.relativenumber = true -- Relative line numbers - - -- TODO: only do this for specific filestypes - vim.opt.expandtab = true -- Use spaces for the tab char - - vim.opt.scrolloff = 4 -- Lines of context - vim.opt.shiftround = true -- Round indent - vim.opt.shiftwidth = 2 -- Size of an indent - vim.opt.termguicolors = true -- True color support - - vim.opt.ignorecase = true -- Ignore case - vim.opt.smartcase = true -- Do not ignore case with capitals - - vim.opt.smartindent = true -- Insert indents automatically - - vim.opt.splitbelow = true -- Put new windows below current - vim.opt.splitright = true -- Put new windows right of current - - vim.opt.wrap = false -- Disable line wrap (by default) - vim.opt.wildmode = { 'list', 'longest' } -- Command-line completion mode - vim.opt.completeopt = { "menu", "menuone", "noselect" } - - -- Set leader - vim.g.mapleader = " " - - -- Folding - vim.o.foldmethod = "marker" -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/arpeggio.lua b/dotfiles/neovim/lua/my/plugins/arpeggio.lua deleted file mode 100644 index 8a3fbee..0000000 --- a/dotfiles/neovim/lua/my/plugins/arpeggio.lua +++ /dev/null @@ -1,50 +0,0 @@ -local helpers = require("my.helpers") - -local M = { - -- chord support, let"s fucking goooo - "kana/vim-arpeggio", - event = "VeryLazy", -} - ----Create an arpeggio mapping ----@param mode string ----@param lhs string ----@param rhs string ----@param opts table|nil -local function chord(mode, lhs, rhs, opts) - local arpeggio = vim.fn["arpeggio#map"] - - if string.len(mode) > 1 then - for i = 1, #mode do - local c = mode:sub(i, i) - chord(c, lhs, rhs, opts) - end - else - local options = helpers.mergeTables(opts or {}, { noremap = true }) - local settings = options.settings or "" - - if options.silent then - settings = settings .. "s" - end - - arpeggio(mode, settings, not options.noremap, lhs, rhs) - end -end - ----Create a silent arpeggio mapping ----@param mode string ----@param lhs string ----@param rhs string ----@param opts table|nil -local function chordSilent(mode, lhs, rhs, opts) - local options = helpers.mergeTables(opts or {}, { silent = true }) - chord(mode, lhs, rhs, options) -end - -function M.config() - chordSilent("n", "ji", ":silent :write") -- Saving - chord("i", "jk", "") -- Remap Esc to jk - chord("nv", "cp", '"+') -- Press cp to use the global clipboard -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/catpuccin.lua b/dotfiles/neovim/lua/my/plugins/catpuccin.lua deleted file mode 100644 index 8171318..0000000 --- a/dotfiles/neovim/lua/my/plugins/catpuccin.lua +++ /dev/null @@ -1,18 +0,0 @@ -local M = { - "catppuccin/nvim", name = "catppuccin", - lazy = false -} - -function M.config() - local catppuccin = require("catppuccin") - vim.g.catppuccin_flavour = os.getenv("CATPPUCCIN_FLAVOUR") - - catppuccin.setup({ transparent_background = false, integrations = { nvimtree = true } }) - - vim.cmd [[highlight NotifyINFOIcon guifg=#d6b20f]] - vim.cmd [[highlight NotifyINFOTitle guifg=#d6b20f]] - - vim.cmd [[colorscheme catppuccin]] -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/clipboard-image.lua b/dotfiles/neovim/lua/my/plugins/clipboard-image.lua deleted file mode 100644 index b09fb82..0000000 --- a/dotfiles/neovim/lua/my/plugins/clipboard-image.lua +++ /dev/null @@ -1,39 +0,0 @@ -local M = { - -- paste images from clipbaord - "ekickx/clipboard-image.nvim", - cmd = "PasteImg", -} - -local function img_name() - vim.fn.inputsave() - local name = vim.fn.input("Name: ") - vim.fn.inputrestore() - - if name == nil or name == "" then - return os.date("%y-%m-%d-%H-%M-%S") - end - return name -end - -function M.init() - vim.keymap.set( - "n", - "p", - ":PasteImg", - { desc = "[P]aste image from clipboard" } - ) -end - -function M.config() - require("clipboard-image").setup({ - default = { - img_name = img_name, - }, - tex = { - img_dir = { "%:p:h", "img" }, - affix = "\\includegraphics[width=\\textwidth]{%s}", - }, - }) -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/cmp.lua b/dotfiles/neovim/lua/my/plugins/cmp.lua deleted file mode 100644 index b99b5a8..0000000 --- a/dotfiles/neovim/lua/my/plugins/cmp.lua +++ /dev/null @@ -1,112 +0,0 @@ -local env = require("my.helpers.env") - -local M = { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - "onsails/lspkind.nvim", -- show icons in lsp completion menus - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-emoji", - "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-path", - "saadparwaiz1/cmp_luasnip", - }, - cond = env.vscode.not_active() -} - -local function has_words_before() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and - vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, - col) - :match('%s') == nil -end - -function M.config() - vim.o.completeopt = "menuone,noselect" - - local cmp = require("cmp") - local lspkind = require('lspkind') - - local options = { - window = { - completion = { - winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None", - col_offset = -3, - side_padding = 0, - completeopt = "menu,menuone,noinsert", - }, - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - local kind = lspkind.cmp_format({ mode = "symbol", maxwidth = 50 - , symbol_map = { - Text = "." - } - })(entry, vim_item) - local strings = vim.split(kind.kind, "%s", { trimempty = true }) - - kind.kind = " " .. strings[1] .. " " - kind.menu = "" - - return kind - end, - }, - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - require('luasnip').lsp_expand(args.body) - end - }, - mapping = { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { "i", "s" }), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }, - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'buffers' }, - { name = 'emoji' }, - { name = 'path' }, - -- { name = 'omni' }, - }) - } - - cmp.setup(options) - - -- Use buffer source for `/` - cmp.setup.cmdline('/', { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } - }) - - -- Use cmdline & path source for ':' - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' }, - { name = 'cmdline' } - }) - }) -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/dashboard.lua b/dotfiles/neovim/lua/my/plugins/dashboard.lua deleted file mode 100644 index 85b3535..0000000 --- a/dotfiles/neovim/lua/my/plugins/dashboard.lua +++ /dev/null @@ -1,14 +0,0 @@ -local env = require("my.helpers.env") - -local M = { - "glepnir/dashboard-nvim", - lazy = false, - cond = env.vscode.not_active() and env.firenvim.not_active(), -} - -function M.config() - local db = require("dashboard") - db.custom_header = {} -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/firenvim.lua b/dotfiles/neovim/lua/my/plugins/firenvim.lua deleted file mode 100644 index 8192c83..0000000 --- a/dotfiles/neovim/lua/my/plugins/firenvim.lua +++ /dev/null @@ -1,19 +0,0 @@ -local env = require("my.helpers.env") - -local M = { - "glacambre/firenvim", -- vim inside chrome - lazy = false, - cond = env.firenvim.active(), -} - -function M.setup() - vim.g.firenvim_config = { - localSettings = { - [".*"] = { - filename = "/tmp/firenvim_{hostname}_{pathname%10}_{timestamp%32}.{extension}", - }, - }, - } -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/hydra.lua b/dotfiles/neovim/lua/my/plugins/hydra.lua deleted file mode 100644 index 151df7d..0000000 --- a/dotfiles/neovim/lua/my/plugins/hydra.lua +++ /dev/null @@ -1,127 +0,0 @@ -local M = { - -- keybinds where you only hit the head once - "anuvyklack/hydra.nvim", - dependencies = { - "jbyuki/venn.nvim", -- draw ascii diagrams - "mrjones2014/smart-splits.nvim", -- the name says it all - }, - keys = { "", "v" }, -} - -local venn_hint = [[ - Arrow^^^^^^ Select region with - ^ ^ _K_ ^ ^ _f_: surround it with box - _H_ ^ ^ _L_ - ^ ^ _J_ ^ ^ __ -]] - -local window_hint = [[ - ^^^^^^^^^^^^ Move ^^ Size ^^ ^^ Split - ^^^^^^^^^^^^------------- ^^-----------^^ ^^--------------- - ^ ^ _k_ ^ ^ ^ ^ _K_ ^ ^ ^ __ ^ _s_: horizontally - _h_ ^ ^ _l_ _H_ ^ ^ _L_ __ __ _v_: vertically - ^ ^ _j_ ^ ^ ^ ^ _J_ ^ ^ ^ __ ^ _q_: close - focus^^^^^^ window^^^^^^ ^_=_: equalize^ _o_: close remaining -]] - -function M.config() - local Hydra = require("hydra") - local pcmd = require("hydra.keymap-util").pcmd - local splits = require("smart-splits") - - Hydra({ - name = "Draw Diagram", - hint = venn_hint, - config = { - color = "pink", - invoke_on_body = true, - hint = { - border = "rounded", - }, - on_enter = function() - vim.o.virtualedit = "all" - end, - }, - mode = "n", - body = "v", - heads = { - { "H", "h:VBox" }, - { "J", "j:VBox" }, - { "K", "k:VBox" }, - { "L", "l:VBox" }, - { "f", ":VBox", { mode = "v" } }, - { "", nil, { exit = true } }, - }, - }) - - vim.keymap.set("n", "", "") - - Hydra({ - name = "Windows", - hint = window_hint, - config = { - invoke_on_body = true, - hint = { - border = "rounded", - offset = -1, - }, - }, - mode = "n", - body = "", - heads = { - { "h", "h" }, - { "j", "j" }, - { "k", "k" }, - { "l", "l" }, - - { "H", "H" }, - { "J", "J" }, - { "K", "K" }, - { "L", "L" }, - - { - "", - function() - splits.resize_left(2) - end, - }, - { - "", - function() - splits.resize_down(2) - end, - }, - { - "", - function() - splits.resize_up(2) - end, - }, - { - "", - function() - splits.resize_right(2) - end, - }, - { "=", "=", { desc = "equalize" } }, - - { "s", pcmd("split", "E36") }, - { "", pcmd("split", "E36"), { desc = false } }, - { "v", pcmd("vsplit", "E36") }, - { "", pcmd("vsplit", "E36"), { desc = false } }, - - { "w", "w", { exit = true, desc = false } }, - { "", "w", { exit = true, desc = false } }, - - { "o", "o", { exit = true, desc = "remain only" } }, - { "", "o", { exit = true, desc = false } }, - - { "q", pcmd("close", "E444"), { desc = "close window" } }, - { "", pcmd("close", "E444"), { desc = false } }, - - { "", nil, { exit = true, desc = false } }, - }, - }) -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/idris.lua b/dotfiles/neovim/lua/my/plugins/idris.lua deleted file mode 100644 index ad566e6..0000000 --- a/dotfiles/neovim/lua/my/plugins/idris.lua +++ /dev/null @@ -1,44 +0,0 @@ -local env = require("my.helpers.env") -local lspconfig = require("my.plugins.lspconfig") - -local M = { - "ShinKage/idris2-nvim", - dependencies = {"nui.nvim", "nvim-lspconfig"}, - ft = { "idris2", "lidris2", "ipkg" }, - cond = env.vscode.not_active(), -} - -function M.config() - local idris2 = require("idris2") - - idris2.setup({ - server = { - on_attach = function(client, bufnr) - lspconfig.on_attach(client, bufnr) - - local function nmap(from, to, desc) - vim.keymap.set("n", "I" .. from, function() - require("idris2.code_action")[to]() - end, { desc = desc, bufnr = true }) - end - - nmap("C", "make_case", "Make [c]plit") - nmap("L", "make_lemma", "Make [l]emma") - nmap("c", "add_clause", "Add [c]lause") - nmap("s", "expr_search", "Expression [s]earch") - nmap("d", "generate_def", "Generate [d]efinition") - nmap("s", "case_split", "Case [s]plit") - nmap("h", "refine_hole", "Refine [h]ole") - - local status, wk = pcall(require, "which-key") - - if status then - wk.register({ ["I"] = { name = "[I]dris", buffer = bufnr } }) - end - end, - }, - client = { hover = { use_split = true } }, - }) -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/init.lua b/dotfiles/neovim/lua/my/plugins/init.lua deleted file mode 100644 index 734300d..0000000 --- a/dotfiles/neovim/lua/my/plugins/init.lua +++ /dev/null @@ -1,204 +0,0 @@ -local env = require("my.helpers.env") - -if env.neovide.active() then - require("my.neovide").setup() -end - -return { - --{{{ Language support - { - "purescript-contrib/purescript-vim", - ft = "purescript", - cond = env.vscode.not_active(), - }, - - { - "teal-language/vim-teal", - ft = "teal", - cond = env.vscode.not_active(), - }, - - { - "udalov/kotlin-vim", - ft = "kotlin", - cond = env.vscode.not_active(), - }, - - { - "kmonad/kmonad-vim", - ft = "kbd", - cond = env.vscode.not_active(), - }, - - { - "vmchale/dhall-vim", - ft = "dhall", - cond = env.vscode.not_active(), - }, - --}}} - - { - -- Better ui for inputs/selects - "stevearc/dressing.nvim", - config = true, - -- https://github.com/folke/dot/blob/master/config/nvim/lua/config/plugins/init.lua - init = function() - ---@diagnostic disable-next-line: duplicate-set-field - vim.ui.select = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) - return vim.ui.select(...) - end - ---@diagnostic disable-next-line: duplicate-set-field - vim.ui.input = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) - return vim.ui.input(...) - end - end, - cond = env.vscode.not_active(), - }, - - { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = function () - require("nvim-autopairs").setup() - end, - }, - - -- Helper libs - { - "nvim-lua/plenary.nvim", - }, - - "MunifTanjim/nui.nvim", - - { - "terrortylor/nvim-comment", - keys = { "gc", "gcc", { "gc", mode = "v" } }, - config = function() - require("nvim_comment").setup() - end, - }, - - -- nice looking icons - "kyazdani42/nvim-web-devicons", - - { - -- easly switch between tmux and vim panes - "christoomey/vim-tmux-navigator", - keys = { "", "", "", "" }, - cond = env.vscode.not_active() - and env.neovide.not_active() - and env.firenvim.not_active(), - }, - - { - -- track time usage - "wakatime/vim-wakatime", - event = "VeryLazy", - cond = env.vscode.not_active() and env.firenvim.not_active(), - }, - - { - -- smooth scrolling - "psliwka/vim-smoothie", - -- enabled = env.neovide.not_active(), - enabled = false, - event = "VeryLazy", - }, - - { - -- show context on closing parenthesis - -- TODO: move this to treesitter file - "haringsrob/nvim_context_vt", - event = "BufReadPost", - cond = env.vscode.not_active(), - }, - - { - -- show progress for lsp stuff - "j-hui/fidget.nvim", - event = "BufReadPre", - cond = env.vscode.not_active(), - config = true, - }, - - { - -- export to pastebin like services - "rktjmp/paperplanes.nvim", - config = { - provider = "paste.rs", - }, - keys = { "PP" }, - }, - - { - -- case switching + the subvert command - "tpope/vim-abolish", - event = "VeryLazy", - }, - - { - -- reminds you of abbreviations - "0styx0/abbreinder.nvim", - dependencies = "0styx0/abbremand.nvim", - event = "InsertEnter", - }, - - { - -- md preview (in terminal) - "ellisonleao/glow.nvim", - cmd = "Glow", - cond = env.vscode.not_active(), - }, - - { - "frabjous/knap", -- md preview - cond = env.vscode.not_active(), - }, - - { - -- automatically set options based on current file - "tpope/vim-sleuth", - event = "BufRead", - cond = env.vscode.not_active(), - }, - - -- vim-abolish rewrite - "mateiadrielrafael/scrap.nvim", - - { - "ruifm/gitlinker.nvim", -- generate permalinks for code - -- dependencies = { "plenary.nvim" }, - config = true, - cond = env.firenvim.not_active(), - keys = "gy", - }, - - { - -- magit clone - "TimUntersberger/neogit", - -- dependencies = { "plenary.nvim" }, - cmd = "Neogit", - enabled = env.firenvim.not_active() and env.vscode.not_active(), - init = function() - vim.keymap.set( - "n", - "", - "Neogit", - { desc = "Open neo[g]it" } - ) - end, - config = true, - }, - - { - -- discord rich presence - "andweeb/presence.nvim", - cond = env.vscode.not_active() and env.firenvim.not_active(), - config = function() - require("presence"):setup() - end, - lazy = false - }, -} diff --git a/dotfiles/neovim/lua/my/plugins/iron.lua b/dotfiles/neovim/lua/my/plugins/iron.lua deleted file mode 100644 index 2ea9b72..0000000 --- a/dotfiles/neovim/lua/my/plugins/iron.lua +++ /dev/null @@ -1,63 +0,0 @@ -local env = require("my.helpers.env") - -local M = { - "hkupty/iron.nvim", -- repl support - cond = env.vscode.not_active(), - cmd = "IronRepl", -} - -function M.init() - -- iron also has a list of commands, see :h iron-commands for all available commands - vim.keymap.set("n", "iss", "IronRepl") - vim.keymap.set("n", "ir", "IronRestart") - vim.keymap.set("n", "if", "IronFocus") - vim.keymap.set("n", "ih", "IronHide") - - local status, wk = pcall(require, "which-key") - - if status then - wk.register({ - ["i"] = { - name = "[I]ron repl", - s = { name = "[s]end" }, - m = "[m]ark", - }, - }) - end -end - -function M.config() - local iron = require("iron.core") - - iron.setup({ - config = { - -- Your repl definitions come here - repl_definition = {}, - -- How the repl window will be displayed - -- See below for more information - repl_open_cmd = require("iron.view").right(40), - }, - -- Iron doesn't set keymaps by default anymore. - -- You can set them here or manually add keymaps to the functions in iron.core - keymaps = { - send_motion = "isc", - visual_send = "is", - send_file = "isf", - send_line = "isl", - send_mark = "ism", - mark_motion = "imc", - mark_visual = "imc", - remove_mark = "imd", - cr = "is", - interrupt = "is", - exit = "isq", - clear = "isr", - }, - -- If the highlight is on, you can change how it looks - -- For the available options, check nvim_set_hl - highlight = { italic = true }, - ignore_blank_lines = true, -- ignore blank lines when sending visual select lines - }) -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/lean.lua b/dotfiles/neovim/lua/my/plugins/lean.lua deleted file mode 100644 index cc2a850..0000000 --- a/dotfiles/neovim/lua/my/plugins/lean.lua +++ /dev/null @@ -1,22 +0,0 @@ -local env = require("my.helpers.env") -local lspconfig = require("my.plugins.lspconfig") - -local M = { - "Julian/lean.nvim", -- lean support - dependencies = { "neovim/nvim-lspconfig", "nvim-lua/plenary.nvim", "hrsh7th/nvim-cmp" }, - ft = "lean", - config = function() - require("lean").setup({ - abbreviations = { builtin = true, cmp = true }, - lsp = { - on_attach = lspconfig.on_attach, - capabilities = lspconfig.capabilities(), - }, - lsp3 = false, - mappings = true, - }) - end, - cond = env.vscode.not_active(), -} - -return {} diff --git a/dotfiles/neovim/lua/my/plugins/leap.lua b/dotfiles/neovim/lua/my/plugins/leap.lua deleted file mode 100644 index ca6c8af..0000000 --- a/dotfiles/neovim/lua/my/plugins/leap.lua +++ /dev/null @@ -1,15 +0,0 @@ -local M = { - -- removes the need for spamming w or e - "ggandor/leap.nvim", - name = "leap", - event = "VeryLazy" -} - -function M.config() - require("leap").add_default_mappings() -end - --- (something) --- something - -return M diff --git a/dotfiles/neovim/lua/my/plugins/lspconfig.lua b/dotfiles/neovim/lua/my/plugins/lspconfig.lua deleted file mode 100644 index 4997634..0000000 --- a/dotfiles/neovim/lua/my/plugins/lspconfig.lua +++ /dev/null @@ -1,191 +0,0 @@ -local helpers = require("my.helpers") -local env = require("my.helpers.env") - -local lspconfig = { - "neovim/nvim-lspconfig", - event = "BufReadPre", - dependencies = { - "folke/neoconf.nvim", - { - "folke/neodev.nvim", - config = true, - }, - "hrsh7th/cmp-nvim-lsp", - }, - cond = env.vscode.not_active(), -} - -local M = { - lspconfig, - { - "smjonas/inc-rename.nvim", - cmd = "IncRename", - config = { - input_buffer_type = "dressing", - }, - dependencies = { - "dressing.nvim", - }, - cond = env.vscode.not_active(), - }, -} - -function M.on_attach(client, bufnr) - -- {{{ Auto format - local function format() - vim.lsp.buf.format({ async = false, bufnr = bufnr }) - end - - if false and client.supports_method("textDocument/formatting") then - vim.api.nvim_create_autocmd("BufWritePre", { - group = vim.api.nvim_create_augroup("LspFormatting", { clear = false }), - buffer = bufnr, - callback = format, - }) - end - -- }}} - -- {{{ Keymap helpers - local opts = function(desc) - return { noremap = true, silent = true, desc = desc, buffer = bufnr } - end - - local nmap = function(from, to, desc) - vim.keymap.set("n", from, to, opts(desc)) - end - -- }}} - -- {{{ Go to declaration / definition / implementation - nmap("gd", vim.lsp.buf.definition, "[G]o to [d]efinition") - nmap("gi", vim.lsp.buf.implementation, "[G]o to [i]mplementation") - nmap("gr", vim.lsp.buf.references, "[G]o to [r]eferences") - -- }}} - -- {{{ Hover - -- Note: diagnostics are already covered in keymaps.lua - nmap("K", vim.lsp.buf.hover, "Hover") - nmap("L", vim.lsp.buf.signature_help, "Signature help") - -- }}} - -- {{{ Code actions - nmap("c", vim.lsp.buf.code_action, "[C]ode actions") - nmap("F", format, "[F]ormat") - nmap("li", "LspInfo", "[L]sp [i]nfo") - - vim.keymap.set("n", "rn", function() - return ":IncRename " .. vim.fn.expand("") - end, helpers.mergeTables(opts("[R]e[n]ame"), { expr = true })) - - vim.keymap.set( - "v", - "c", - ":'<,'> lua vim.lsp.buf.range_code_action()", - opts("[C]ode actions") - ) - -- }}} - -- {{{ Workspace stuff - nmap( - "wa", - vim.lsp.buf.add_workspace_folder, - "[W]orkspace [A]dd Folder" - ) - nmap( - "wr", - vim.lsp.buf.remove_workspace_folder, - "[W]orkspace [R]emove Folder" - ) - nmap("wl", function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, "[W]orkspace [L]ist Folders") - -- }}} -end - --- {{{ General server config ----@type lspconfig.options -local servers = { - tsserver = { - on_attach = function(client, bufnr) - -- We handle formatting using null-ls and prettierd - client.server_capabilities.documentFormattingProvider = false - M.on_attach(client, bufnr) - end, - }, - dhall_lsp_server = {}, - purescriptls = { - settings = { - purescript = { - censorWarnings = { "UnusedName", "ShadowedName", "UserDefinedWarning" }, - formatter = "purs-tidy", - }, - }, - }, - hls = { - haskell = { - -- set formatter - formattingProvider = "ormolu", - }, - }, - rnix = {}, - cssls = {}, - jsonls = {}, - rust_analyzer = {}, - -- teal_ls = {}, - sumneko_lua = { - cmd = { - "lua-language-server", - "--logpath=/home/adrielus/.local/share/lua-language-server/log", - }, - }, -} --- }}} --- {{{ Capabilities -M.capabilities = function() - -- require("lazy").load({ plugins = "hrsh7th/cmp-nvim-lsp" }) - local c = require("cmp_nvim_lsp").default_capabilities() - -- Add folding capabilities - c.textDocument.foldingRange = - { dynamicRegistration = false, lineFoldingOnly = true } - return c -end --- }}} --- {{{ Nice diagnostic icons --- See https://github.com/folke/dot/blob/master/config/nvim/lua/config/plugins/lsp/diagnostics.lua -local function diagnostics_icons() - local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } - - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) - end -end - ---}}} --- {{{ Main config function -function lspconfig.config() - diagnostics_icons() - -- {{{ Change on-hover borders - vim.lsp.handlers["textDocument/hover"] = - vim.lsp.with(vim.lsp.handlers.hover, { border = "single" }) - vim.lsp.handlers["textDocument/signatureHelp"] = - vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" }) - -- }}} - - local capabilities = M.capabilities() - -- Setup basic language servers - for lsp, details in pairs(servers) do - if details.on_attach == nil then - -- Default setting for on_attach - details.on_attach = M.on_attach - end - - require("lspconfig")[lsp].setup({ - on_attach = details.on_attach, - settings = details.settings, -- Specific per-language settings - flags = { - debounce_text_changes = 150, -- This will be the default in neovim 0.7+ - }, - cmd = details.cmd, - capabilities = capabilities, - }) - end -end - ---}}} - -return M diff --git a/dotfiles/neovim/lua/my/plugins/lualine.lua b/dotfiles/neovim/lua/my/plugins/lualine.lua deleted file mode 100644 index a6c225b..0000000 --- a/dotfiles/neovim/lua/my/plugins/lualine.lua +++ /dev/null @@ -1,29 +0,0 @@ -local env = require("my.helpers.env") - -local M = { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - cond = env.vscode.not_active() and env.neovide.not_active(), -} - -function M.config() - require("lualine").setup({ - theme = "auto", - options = { - component_separators = "", - section_separators = { left = "", right = "" }, - }, - sections = { - lualine_a = { "branch" }, - lualine_b = { "filename" }, - lualine_c = { "filetype" }, - lualine_x = { "diagnostics" }, - lualine_y = {}, - lualine_z = {}, - }, - -- Integration with other plugins - extensions = { "nvim-tree" }, - }) -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/luasnip.lua b/dotfiles/neovim/lua/my/plugins/luasnip.lua deleted file mode 100644 index 56b243f..0000000 --- a/dotfiles/neovim/lua/my/plugins/luasnip.lua +++ /dev/null @@ -1,35 +0,0 @@ -local env = require("my.helpers.env") - -local M = { - "L3MON4D3/LuaSnip", -- snippeting engine - event = "InsertEnter", - cond = env.vscode.not_active() -} - -local function reload() - require("luasnip.loaders.from_vscode").lazy_load() -end - -function M.config() - local luasnip = require("luasnip") - - vim.keymap.set("i", "", function() - if luasnip.jumpable(1) then - return "lua require('luasnip').jump(1)" - else - return "" - end - end, { expr = true }) - - vim.keymap.set("i", "", function() - luasnip.jump(-1) - end) - - vim.keymap.set("n", "rs", reload, { - desc = "[R]eload [s]nippets", - }) - - reload() -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/mind.lua b/dotfiles/neovim/lua/my/plugins/mind.lua deleted file mode 100644 index 0cd84f1..0000000 --- a/dotfiles/neovim/lua/my/plugins/mind.lua +++ /dev/null @@ -1,40 +0,0 @@ -local M = { - "phaazon/mind.nvim", -- Organize shit as trees - keys = "m", -} - -function M.init() - vim.keymap.set("n", "m", function() - local mind = require("mind") - - local buffers = vim.api.nvim_list_bufs() - local should_open = true - - for _, buf in pairs(buffers) do - if vim.api.nvim_buf_is_loaded(buf) and vim.bo[buf].filetype == "mind" then - should_open = false - vim.cmd("bd " .. buf) - end - end - - if should_open then - mind.open_main() - end - end, { desc = "[M]ind panel" }) -end - -function M.config() - local mind = require("mind") - - mind.setup({ - persistence = { - state_path = "~/Mind/mind.json", - data_dir = "~/Mind/data", - }, - ui = { - width = 50, - }, - }) -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/moonwalk.lua b/dotfiles/neovim/lua/my/plugins/moonwalk.lua deleted file mode 100644 index d98a6ff..0000000 --- a/dotfiles/neovim/lua/my/plugins/moonwalk.lua +++ /dev/null @@ -1,20 +0,0 @@ -local M = {} - --- function M.setup() - -- require("moonwalk").add_loader("tl", function(src, path) - -- local tl = require("tl") - -- local errs = {} - -- local _, program = tl.parse_program(tl.lex(src), errs) - -- - -- if #errs > 0 then - -- error( - -- path .. ":" .. errs[1].y .. ":" .. errs[1].x .. ": " .. errs[1].msg, - -- 0 - -- ) - -- end - -- - -- return tl.pretty_print_ast(program) - -- end) --- end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/neoconf.lua b/dotfiles/neovim/lua/my/plugins/neoconf.lua deleted file mode 100644 index 49dfbf0..0000000 --- a/dotfiles/neovim/lua/my/plugins/neoconf.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "folke/neoconf.nvim", - cmd = "Neoconf", - config = { - -- import existing settings from other plugins - import = { - vscode = true, -- local .vscode/settings.json - coc = false, -- global/local coc-settings.json - nlsp = false, -- global/local nlsp-settings.nvim json settings - }, - }, -} diff --git a/dotfiles/neovim/lua/my/plugins/null-ls.lua b/dotfiles/neovim/lua/my/plugins/null-ls.lua deleted file mode 100644 index 6254a40..0000000 --- a/dotfiles/neovim/lua/my/plugins/null-ls.lua +++ /dev/null @@ -1,27 +0,0 @@ -local env = require("my.helpers.env") - -local M = { - "jose-elias-alvarez/null-ls.nvim", -- generic language server - event = "BufReadPre", - dependencies = "neovim/nvim-lspconfig", - cond = env.vscode.not_active(), -} - -function M.config() - local lspconfig = require("my.plugins.lspconfig") - local null_ls = require("null-ls") - - local sources = { - null_ls.builtins.formatting.prettierd.with({ extra_filetypes = {} }), -- format ts files - null_ls.builtins.formatting.stylua.with({}), -- format lua code - -- null_ls.builtins.formatting.lua_format.with({}), -- format lua code - } - - null_ls.setup({ - sources = sources, - on_attach = lspconfig.on_attach, - debug = true, - }) -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/nvim-tree.lua b/dotfiles/neovim/lua/my/plugins/nvim-tree.lua deleted file mode 100644 index 5849055..0000000 --- a/dotfiles/neovim/lua/my/plugins/nvim-tree.lua +++ /dev/null @@ -1,20 +0,0 @@ -local env = require("my.helpers.env") - -local M = { - "kyazdani42/nvim-tree.lua", - cmd = "NvimTreeToggle", - config = true, - cond = env.vscode.not_active() and env.firenvim.not_active(), -} - -function M.init() - -- Toggle nerdtree with Control-n - vim.keymap.set( - "n", - "", - ":NvimTreeToggle", - { desc = "Toggle [n]vim-tree" } - ) -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/surround.lua b/dotfiles/neovim/lua/my/plugins/surround.lua deleted file mode 100644 index b32b42d..0000000 --- a/dotfiles/neovim/lua/my/plugins/surround.lua +++ /dev/null @@ -1,12 +0,0 @@ -local M = { - -- work with brackets, quotes, tags, etc - "tpope/vim-surround", - event = "VeryLazy", -} - -function M.config() - vim.g.surround_113 = '"\r"' - vim.g.surround_97 = "'\r'" -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/telescope.lua b/dotfiles/neovim/lua/my/plugins/telescope.lua deleted file mode 100644 index 1b55872..0000000 --- a/dotfiles/neovim/lua/my/plugins/telescope.lua +++ /dev/null @@ -1,76 +0,0 @@ -local env = require("my.helpers.env") - -local telescope = { - "nvim-telescope/telescope.nvim", - cmd = "Telescope", - dependencies = { - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - "nvim-telescope/telescope-file-browser.nvim", - "nvim-lua/plenary.nvim" - }, - version = "0.1.x", - pin = true, - cond = env.vscode.not_active(), -} - -local M = telescope - -local function find_files_by_extension(extension) - return "find_files find_command=rg,--files,--glob=**/*." .. extension -end - -local function with_theme(base, theme) - return base .. " theme=" .. theme -end - -local defaultTheme = "ivy" - -local keybinds = { - { "", "find_files", "Find files" }, - { "ft", find_files_by_extension("tex"), "[F]ind [t]ex files" }, - { "fl", find_files_by_extension("lua"), "[F]ind [l]ua files" }, - { - "fp", - find_files_by_extension("purs"), - "[F]ind [p]urescript files", - }, - { "d", "diagnostics", "[D]iagnostics" }, - { "", "live_grep", "[F]ind in project" }, - { "", "file_browser", "[F]ile browser" }, - { "t", "builtin", "[T]elescope pickers" }, -} - -local function mkAction(action) - if not string.find(action, "theme=") then - action = with_theme(action, defaultTheme) - end - - return "Telescope " .. action .. "" -end - -function telescope.init() - for _, mapping in pairs(keybinds) do - vim.keymap.set("n", mapping[1], mkAction(mapping[2]), { desc = mapping[3] }) - end -end - -function telescope.config() - local settings = { - defaults = { mappings = { i = { [""] = "which_key" } } }, - pickers = { find_files = { hidden = true } }, - extensions = { - file_browser = { path = "%:p:h" }, - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - }, - }, - } - - require("telescope").setup(settings) - require("telescope").load_extension("fzf") - require("telescope").load_extension("file_browser") -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/treesitter.lua b/dotfiles/neovim/lua/my/plugins/treesitter.lua deleted file mode 100644 index c0dd295..0000000 --- a/dotfiles/neovim/lua/my/plugins/treesitter.lua +++ /dev/null @@ -1,105 +0,0 @@ -local M = { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - event = "BufReadPost", - dependencies = { - "nvim-treesitter/nvim-treesitter-textobjects", - }, - config = function() - require("nvim-treesitter.configs").setup({ - --{{{Languages - ensure_installed = { - "bash", - "javascript", - "typescript", - "c", - "cpp", - "css", - "dockerfile", - "elixir", - "fish", - "html", - "json", - "jsonc", - "latex", - "python", - "rust", - "scss", - "toml", - "tsx", - "vim", - "yaml", - "nix", - }, - sync_install = false, - --}}} - --{{{ Highlighting - highlight = { - enable = true, - disable = { "kotlin", "tex", "latex" }, - additional_vim_regex_highlighting = false, - }, - --}}} - --{{{ Incremental selection - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = "", - node_decremental = "", - }, - }, - --}}} - --{{{ Textsubjects - textsubjects = { - enable = true, - keymaps = { - ["."] = "textsubjects-smart", - [";"] = "textsubjects-container-outer", - }, - }, - --}}} - textobjects = { - --{{{ Select - select = { - enable = false, - lookahead = true, - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, - }, - --}}} - --{{{ Move - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - ["]f"] = "@function.outer", - ["]c"] = "@class.outer", - }, - goto_next_end = { - ["]F"] = "@function.outer", - ["]C"] = "@class.outer", - }, - goto_previous_start = { - ["[f"] = "@function.outer", - ["[c"] = "@class.outer", - }, - goto_previous_end = { - ["[F"] = "@function.outer", - ["[C"] = "@class.outer", - }, - }, - --}}} - }, - indent = { enable = true }, - }) - end, -} - -return M diff --git a/dotfiles/neovim/lua/my/plugins/vimtex.lua b/dotfiles/neovim/lua/my/plugins/vimtex.lua deleted file mode 100644 index e98f0e1..0000000 --- a/dotfiles/neovim/lua/my/plugins/vimtex.lua +++ /dev/null @@ -1,24 +0,0 @@ -local M = { - "lervag/vimtex", -- latex support - ft = "tex", -} - -function M.config() - vim.g.vimtex_view_method = "zathura" - vim.g.Tex_DefaultTargetFormat = "pdf" - vim.g.vimtex_fold_enabled = 0 - vim.g.vimtex_imaps_enabled = 0 - vim.g.vimtex_syntax_conceal_disable = 1 - vim.g.vimtex_compiler_latexmk = { - options = { - "-pdf", - "-shell-escape", - "-verbose", - "-file-line-error", - "-synctex=1", - "-interaction=nonstopmode", - }, - } -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/vimux.lua b/dotfiles/neovim/lua/my/plugins/vimux.lua deleted file mode 100644 index fd6e7d2..0000000 --- a/dotfiles/neovim/lua/my/plugins/vimux.lua +++ /dev/null @@ -1,40 +0,0 @@ -local K = require("my.keymaps") -local env = require("my.helpers.env") - -local M = { - "preservim/vimux", -- interact with tmux from within vim - cmd = { "VimuxPromptCommand", "VimuxRunCommand", "VimuxRunLastCommand" }, - -- TODO: only enable when actually inside tmux - cond = env.vscode.not_active() - and env.neovide.not_active() - and env.firenvim.not_active(), -} - -function M.init() - --{{{ Register keybinds - K.nmap( - "vp", - ":VimuxPromptCommand", - "[V]imux: [p]rompt for command" - ) - K.nmap("vc", ':VimuxRunCommand "clear"', "[V]imux: [c]lear pane") - K.nmap( - "vl", - ":VimuxRunLastCommand", - "[V]imux: rerun [l]ast command" - ) - --}}} - --{{{ Register which-key docs - local status, wk = pcall(require, "which-key") - - if status then - wk.register({ - ["v"] = { - name = "[V]imux", - }, - }) - end - --}}} -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/whichkey.lua b/dotfiles/neovim/lua/my/plugins/whichkey.lua deleted file mode 100644 index 89d3333..0000000 --- a/dotfiles/neovim/lua/my/plugins/whichkey.lua +++ /dev/null @@ -1,27 +0,0 @@ -local M = { - "folke/which-key.nvim", - event = "VeryLazy", -} - -function M.config() - local wk = require("which-key") - - wk.setup({ - triggers = { "", "d", "y", "q", "z", "g", "c" }, - show_help = true, - show_keys = true, - }) - - wk.register({ - [""] = { - f = { name = "[F]iles" }, - g = { name = "[G]o to" }, - r = { name = "[R]ename / [R]eplace / [R]eload" }, - l = { name = "[L]ocal" }, - w = { name = "[W]orkspace" }, - v = "which_key_ignore", - }, - }) -end - -return M diff --git a/dotfiles/neovim/lua/telescope/extensions/unicode.lua b/dotfiles/neovim/lua/telescope/extensions/unicode.lua deleted file mode 100644 index 10f15a4..0000000 --- a/dotfiles/neovim/lua/telescope/extensions/unicode.lua +++ /dev/null @@ -1,92 +0,0 @@ -local M = {} -local pickers = require "telescope.pickers" -local finders = require "telescope.finders" -local conf = require("telescope.config").values -local actions = require "telescope.actions" -local action_state = require "telescope.actions.state" -local previewers = require "telescope.previewers" -local utils = require "telescope.utils" - -local add_abbreviations = false - -local unicodeChars = { - nats = "ℕ", - rationals = "ℚ", - reals = "ℝ", - integers = "ℤ", - forall = "∀", - lambda = "λ", - arrow = "→", - compose = "∘", - inverse = "⁻¹", - dots = "…", - alpha = "ɑ", - beta = "β", - pi = "π", - Pi = 'Π', - sigma = "σ", - Sigma = "Σ", - tau = "τ", - theta = "θ", - gamma = "γ", - Gamma = "Γ", - context = "Γ" -} - --- our picker function for unicode chars -function M.picker(opts) - opts = opts or {} - local results = {} - - for key, value in pairs(unicodeChars) do - -- Name: char pair - table.insert(results, { key, value }) - end - - print(results) - - pickers.new(opts, { - prompt_title = "Unicode characters", - finder = finders.new_table { - results = results, - entry_maker = function(entry) - return { value = entry, display = entry[1], ordinal = entry[1] } - end - }, - sorter = conf.generic_sorter(opts), - previewer = previewers.new { - preview_fn = function(_, entry) return entry.value[2] end - }, - attach_mappings = function(prompt_bufnr) - actions.select_default:replace(function() - actions.close(prompt_bufnr) - local selection = action_state.get_selected_entry() - - if selection == nil then - utils.__warn_no_selection "my.abbreviations" - return - end - - vim.api.nvim_put({ selection.value[2] }, "", false, true) - vim.cmd("startinsert") - end) - return true - end - }):find() -end - -function M.setupAbbreviations(prefix, ending) - prefix = prefix or "" - ending = ending or "" - - if not add_abbreviations then return end - - local abbreviate = require("my.abbreviations").abbr - - for key, value in pairs(unicodeChars) do - -- By default abbreviations are triggered using "_" - abbreviate(prefix .. key .. ending, value) - end -end - -return M diff --git a/dotfiles/neovim/neoconf.json b/dotfiles/neovim/neoconf.json deleted file mode 100644 index 0967ef4..0000000 --- a/dotfiles/neovim/neoconf.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/dotfiles/neovim/syntax/hkf.vim b/dotfiles/neovim/syntax/hkf.vim deleted file mode 100644 index 8ed4297..0000000 --- a/dotfiles/neovim/syntax/hkf.vim +++ /dev/null @@ -1,32 +0,0 @@ -if exists("b:current_syntax") - finish -endif - -syntax keyword kfKeyword alias template layer using path name input output assume fun as import exporting module unsafe def -syntax keyword kfFunction LayerTemplate Sequence Chord Keycode Layer Broken - -syntax match kfComment "\v--.*$" - -syntax match kfOperator "\v_" -syntax match kfOperator "\v\," -syntax match kfOperator "\v\." -syntax match kfOperator "\v\:" -syntax match kfOperator "\v\|" -syntax match kfOperator "\v\=" -syntax match kfOperator "\v\=\>" -syntax match kfOperator "\v\-\>" -syntax match kfOperator "\v→" -syntax match kfOperator "\v\*" -syntax match kfOperator "\v\(" -syntax match kfOperator "\v\)" -syntax match kfOperator "\vλ" - -syntax region kfString start=/\v"/ skip=/\v\\./ end=/\v"/ - -highlight link kfKeyword Keyword -highlight link kfFunction Function -highlight link kfComment Comment -highlight link kfOperator Operator -highlight link kfString String - -let b:current_syntax = "hkf" diff --git a/dotfiles/neovim/tl/my/plugins/chunk.tl b/dotfiles/neovim/tl/my/plugins/chunk.tl deleted file mode 100644 index 20b638e..0000000 --- a/dotfiles/neovim/tl/my/plugins/chunk.tl +++ /dev/null @@ -1,3 +0,0 @@ -function hi() - print("Hello world!") -end diff --git a/dotfiles/polybar/README.md b/dotfiles/polybar/README.md deleted file mode 100644 index 40df621..0000000 --- a/dotfiles/polybar/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Polybar config - -## Useful links: - -- [Home manager polybar docs](https://rycee.gitlab.io/home-manager/options.html#opt-services.polybar.enable) -- [General config](https://github.com/polybar/polybar/wiki/Configuration) diff --git a/dotfiles/polybar/config.ini b/dotfiles/polybar/config.ini deleted file mode 100644 index c17bcb6..0000000 --- a/dotfiles/polybar/config.ini +++ /dev/null @@ -1,110 +0,0 @@ -[module/battery] -type = internal/battery - -; Use the following command to list batteries and adapters: -; $ ls -1 /sys/class/power_supply/ -battery = BAT0 -adapter = AC - -format-charging = -format-discharging = -format-low = - -; Only applies if is used -animation-charging-0 =  -animation-charging-1 =  -animation-charging-2 =  -animation-charging-3 =  -animation-charging-4 =  -; Framerate in milliseconds -animation-charging-framerate = 750 - -; Only applies if is used -animation-discharging-0 =  -animation-discharging-1 =  -animation-discharging-2 =  -animation-discharging-3 =  -animation-discharging-4 =  -; Framerate in milliseconds -animation-discharging-framerate = 500 - -; Only applies if is used -; New in version 3.6.0 -animation-low-0 = ! -animation-low-1 = -animation-low-framerate = 200 - -[module/cpu] -type = internal/cpu - -[module/date] -type = internal/date -date = %d-%m-%Y% -time = %H:%M -label =  %date%  %time% - -[module/wireless-network] -type = internal/network -interface = wlp0s20f3 - -format-connected = -format-packetloss = -format-disconnected = - -label-connected =  %essid%  %downspeed%  %upspeed% -label-disconnected = 睊 -label-packetloss = %essid% - -animation-packetloss-0 = ⚠ -animation-packetloss-0-foreground = #ffa64c -animation-packetloss-1 = 📶 -animation-packetloss-1-foreground = #000000 -animation-packetloss-framerate = 500 - -[module/ewmh] -type = internal/xworkspaces -icon-0 = 1:dev; -icon-1 = 2:browser; -icon-2 = 3:chat;ﭮ -icon-3 = 4:reading; -icon-default =  - -format = - -label-active = %icon% -label-active-background = ${colors.text} -label-active-foreground = ${colors.base} -label-active-padding = 2 - -label-urgent = %icon% -label-urgent-background = ${colors.peach} -label-urgent-foreground = ${colors.base} -label-urgent-padding = 2 - -label-occupied = %icon% -label-occupied-padding = 2 - -label-empty = - -[bar/main] -font-0 = FiraCode Nerd Font:style=Regular -font-1 = Source Code Pro Nerd Font:style=Regular - -modules-left = date battery -modules-center = ewmh -modules-right = wireless-network - -padding-right = 2 -padding-left = 2 -padding-top = 4 -module-margin = 2 - -height=4% - -border-top-size = 1 -border-top-color = ${colors.text} - -background = ${colors.base} -foreground = ${colors.text} - -bottom = true diff --git a/dotfiles/tmux/tmux.conf b/dotfiles/tmux/tmux.conf deleted file mode 100644 index 00d25bd..0000000 --- a/dotfiles/tmux/tmux.conf +++ /dev/null @@ -1,85 +0,0 @@ -# remap prefix to Control + a -set -g prefix C-a -unbind C-b -bind C-a send-prefix - -# Hide status bar -set -g status off - -# don't rename windows automatically -set-option -g allow-rename off - -# Fix slow esc -set -sg escape-time 10 - -# Visual stuff -set -g default-terminal "screen-256color" -# set -ga terminal-overrides ",screen-256color:Tc" -set -ga terminal-overrides ",xterm-256color:Tc" -# set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q' # Supposedly helps with cursor shapes under vim (spoiler: it does not) - -# Split panes with \ and - -bind \\ split-window -h -bind - split-window -v -unbind '"' -unbind % - -# Zooming -unbind C-z -bind -n C-z resize-pane -Z - -# Vim-mode -set-window-option -g mode-keys vi - -# Vim like mode for leaving insert mode -unbind [ # unbind the default way to copy text -bind -T prefix j copy-mode # allow exiting insert mode with C-a j - -# Vim like keybinds for copying and pasting -bind -T copy-mode-vi p paste-buffer -bind -T copy-mode-vi V send-keys -X rectangle-toggle # Check if this works -bind -T copy-mode-vi v send-keys -X begin-selection -bind -T copy-mode-vi y send-keys -X copy-selection - -# Pane navigation with vim support -# cmd="$(tmux display -p '#{pane_current_command}')" -# cmd="$(basename "$cmd" | tr A-Z a-z)" -# pane_count="$(tmux list-panes | wc -l)" -# -# if [ "${cmd%m}" = "vi" ] || [ "$pane_count" -eq 1 ]; then -# direction="$(echo "${1#-}" | tr 'lLDUR' '\\hjkl')" -# # forward the keystroke to Vim -# tmux send-keys "C-$direction" -# else -# tmux select-pane "$@" -# fi - -# Smart pane switching with awareness of Vim splits. -# See: https://github.com/christoomey/vim-tmux-navigator -# Also see: https://github.com/christoomey/vim-tmux-navigator/issues/264 -is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ - | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|\.?n?vim?x?(-wrapped)?)(diff)?$'" -bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' -bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' -bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' -bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' -tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' -if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ - "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" -if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ - "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" - -bind-key -T copy-mode-vi 'C-h' select-pane -L -bind-key -T copy-mode-vi 'C-j' select-pane -D -bind-key -T copy-mode-vi 'C-k' select-pane -U -bind-key -T copy-mode-vi 'C-l' select-pane -R -bind-key -T copy-mode-vi 'C-\' select-pane -l - -# Copy to clipboard using fastcopy -# set-option -g set-clipboard on -# set-option -g @fastcopy-action 'tmux load-buffer -w -' -# set-option -g @fastcopy-key a - -# Keep state around using resurrect -# set -g @resurrect-processes '"~python3"' -# Restore on tmux start diff --git a/dotfiles/vieb/.viebrc b/dotfiles/vieb/.viebrc deleted file mode 100644 index 76bdbb5..0000000 --- a/dotfiles/vieb/.viebrc +++ /dev/null @@ -1,22 +0,0 @@ -" Options -set adblocker=update -set downloadmethod=confirm -set mintabwidth=250 -set redirecttohttp -set tabreopenposition=previous -set windowtitle=title -set search=https://google.com/search?q= -set searchwords=w~https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s - -" Mappings -nmap yy -nmap v -nmap O -nmap T buffer -nmap x -nmap yt -nmap ? <:help> - -vmap c - -" extensions diff --git a/dotfiles/vscode-snippets/README.md b/dotfiles/vscode-snippets/README.md deleted file mode 100644 index 0028aa9..0000000 --- a/dotfiles/vscode-snippets/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Vscode snippets - -These are snippets usable both in vscode and neovim, defined in vscode format. diff --git a/dotfiles/vscode-snippets/package.json b/dotfiles/vscode-snippets/package.json deleted file mode 100644 index 7735f3c..0000000 --- a/dotfiles/vscode-snippets/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "adriels-snippets", - "engines": { - "vscode": "^1.11.0" - }, - "contributes": { - "snippets": [ - { - "language": [ - "purs", - "purescript" - ], - "path": "./snippets/purescript/other.json" - }, - { - "language": [ - "purs", - "purescript" - ], - "path": "./snippets/purescript/imports.json" - }, - { - "language": [ - "purs", - "purescript" - ], - "path": "./snippets/purescript/deriving.json" - }, - { - "language": [ - "tex" - ], - "path": "./snippets/latex/core.json" - }, - { - "language": [ - "tex" - ], - "path": "./snippets/latex/explain.json" - }, - { - "language": [ - "lua" - ], - "path": "./snippets/lua/core.json" - } - ] - } -} diff --git a/dotfiles/vscode-snippets/snippets/latex/core.json b/dotfiles/vscode-snippets/snippets/latex/core.json deleted file mode 100644 index 07d494c..0000000 --- a/dotfiles/vscode-snippets/snippets/latex/core.json +++ /dev/null @@ -1,300 +0,0 @@ -{ - "Begin": { - "prefix": "begin", - "description": "Begin anything", - "body": ["\\begin{$1}", "\t$0", "\\end{$1}"] - }, - "Set": { - "prefix": "set", - "description": "Set I guess", - "body": "\\{$1\\\\}$0" - }, - "Absolute value": { - "prefix": "abs", - "description": "Absolute values", - "body": "\\abs{$1}$0" - }, - "Lemma": { - "prefix": "lemma", - "description": "Create a lemma", - "body": ["\\begin{lemma}[$1] \\label{lem:$1}", "\t$0", "\\end{lemma}"] - }, - "Example*": { - "prefix": "example*", - "description": "Create an example*", - "body": ["\\begin{example*}", "\t$0", "\\end{example*}"] - }, - "Example": { - "prefix": "example", - "description": "Create an example", - "body": ["\\begin{example}[$1] \\label{exp:$1}", "\t$0", "\\end{example}"] - }, - "Theorem": { - "prefix": "theorem", - "description": "Create a theorem", - "body": ["\\begin{theorem}[$1] \\label{thm:$1}", "\t$0", "\\end{theorem}"] - }, - "Exercise": { - "prefix": "exercise", - "description": "Create a exercise", - "body": ["\\begin{exercise}[$1] \\label{exe:$1}", "\t$0", "\\end{exercise}"] - }, - "Definition": { - "prefix": "definition", - "description": "Create a definition", - "body": [ - "\\begin{definition}[$1] \\label{def:$1}", - "\t$0", - "\\end{definition}" - ] - }, - "Display math": { - "prefix": "dm", - "description": "Display math section", - "body": ["\\[", "$0", "\\]"] - }, - "Subscript": { - "prefix": "ss", - "description": "Subscript", - "body": "_{$1}$0" - }, - "Exponent": { - "prefix": "ee", - "description": "Exponent", - "body": "^{$1}$0" - }, - "Nth derivative": { - "prefix": "dd", - "description": "Nth derivative", - "body": "^{($1)}$0" - }, - "Overline": { - "prefix": "ol", - "description": "Overline", - "body": "\\overline{$1}$0" - }, - "Z Mod": { - "prefix": "zmod", - "description": "The set of Z/nZ", - "body": "\\mathbb{Z}/$1\\mathbb{Z}$0" - }, - "Section": { - "prefix": "section", - "description": "Add section", - "body": ["\\section{$1}", "$0"] - }, - "Subsection": { - "prefix": "subsection", - "description": "Add subsection", - "body": ["\\subsection{$1}", "$0"] - }, - "Subsubsection": { - "prefix": "subsubsection", - "description": "Add subsubsection", - "body": ["\\subsubsection{$1}", "$0"] - }, - "Chapter": { - "prefix": "chapter", - "description": "Add chapter", - "body": ["\\chapter{$1}", "$0"] - }, - "Proof": { - "prefix": "proof", - "description": "Create proof", - "body": ["\\begin{proof}", "\t$0", "\\end{proof}"] - }, - "Itemize": { - "prefix": "item", - "body": ["\\\\begin{itemize}", "\t\\item $0", "\\\\end{itemize}"], - "description": "Itemize env" - }, - "Enumerate": { - "prefix": "enum", - "body": ["\\\\begin{enumerate}", "\t\\item $0", "\\\\end{enumerate}"], - "description": "Enumerate env" - }, - "Reference definition": { - "prefix": "rdef", - "description": "Reference a definition", - "body": "\\ref{def:$1}$0" - }, - "Reference lemma": { - "prefix": "rlemma", - "description": "Reference a lemma", - "body": "\\ref{lem:$1}$0" - }, - "Reference theorem": { - "prefix": "rtheorem", - "description": "Reference a theorem", - "body": "\\ref{thm:$1}$0" - }, - "Sigma sum": { - "prefix": "bsum", - "description": "Create a sum using sigma notation", - "body": "\\sum_{$1 = $2}^{$3}$0" - }, - "Pi product": { - "prefix": "bproduct", - "description": "Create a produt using pi notation", - "body": "\\prod_{$1 = $2}^{$3}$0" - }, - "Fraction": { - "prefix": "frac", - "description": "Create a fraction", - "body": "\\frac{$1}{$2}$0" - }, - "Choose": { - "prefix": "binom", - "description": "Create a (n choose k) thingy", - "body": "\\binom{$1}{$2}$0" - }, - "Limit": { - "prefix": "lim", - "description": "Create a limit", - "body": "\\lim _{$1 \\to $2}$0" - }, - "Limit to infinity": { - "prefix": "ilim", - "description": "Create a limit as a variable goes to infinity", - "body": "\\lim _{$1 \\to \\infty}$0" - }, - "Limit to negative infinity": { - "prefix": "nlim", - "description": "Create a limit as a variable goes to negative infinity", - "body": "\\lim _{$1 \\to -\\infty}$0" - }, - "Limit to zero": { - "prefix": "zlim", - "description": "Create a limit as a variable goes to 0", - "body": "\\lim _{$1 \\to 0}$0" - }, - "Sqrt": { - "prefix": "sqrt", - "description": "Create a sqrt", - "body": "\\sqrt[$1]{$2}$0" - }, - "Sin": { - "prefix": "sin", - "description": "Create a sin call", - "body": "\\sin($1)$0" - }, - "Cos": { - "prefix": "cos", - "description": "Create a cos call", - "body": "\\cos($1)$0" - }, - "Ln": { - "prefix": "ln", - "description": "Create a ln call", - "body": "\\ln($1)$0" - }, - "Aligned": { - "prefix": "aligned", - "description": "Create an aligned environment", - "body": ["\\begin{aligned}", "\t$0", "\\end{aligned}"] - }, - "Text explanation in math mode": { - "prefix": "texpl", - "description": "Explain a step using text in math mode", - "body": "&& \\text{($1)}$0" - }, - "Explanation in math mode": { - "prefix": "expl", - "description": "Explain a step in math mode", - "body": "&& ($1) $0" - }, - "Let": { - "prefix": "let", - "description": "Let something equal something else", - "body": "Let $$1 = $2$. $0" - }, - "Force newline": { - "prefix": "cr", - "description": "Force newline in math mode", - "body": "{\\ \\\\\\\\}" - }, - "Aligned display math": { - "prefix": "maligned", - "description": "Create an aligned display math environment", - "body": ["\\[", "\t\\begin{aligned}", "\t\t$0", "\t\\end{aligned}", "\\]"] - }, - "System of equations": { - "prefix": "eqsystem", - "description": "Create a system of equations", - "body": [ - "\\left\\{", - "\t\\begin{array}{rl}", - "\t\t$0", - "\t\\end{array}", - "\\right\\\\\\}" - ] - }, - "Aligned equation": { - "prefix": "aleq", - "description": "Aligned equation", - "body": ["\\\\\\ $1 &= $2", "$0"] - }, - "2x2 matrices": { - "prefix": "mat22", - "description": "Create a 2x2 matrix", - "body": [ - "\\begin{bmatrix}", - " ${1:1} & ${2:0}", - "\\\\\\ ${3:0} & ${4:1}", - "\\end{bmatrix}$0" - ] - }, - "3x3 matrices": { - "prefix": "mat33", - "description": "Create a 3x3 matrix", - "body": [ - "\\begin{bmatrix}", - " ${1:1} & ${2:0} & ${3:0}", - "\\\\\\ ${4:0} & ${5:1} & ${6:0}", - "\\\\\\ ${7:0} & ${8:0} & ${9:1}", - "\\end{bmatrix}$0" - ] - }, - "3x3 determinants": { - "prefix": "det33", - "description": "Create a 3x3 determinant", - "body": [ - "\\begin{vmatrix}", - " $1 & $2 & $3", - "\\\\\\ $4 & $5 & $6", - "\\\\\\ $7 & $8 & $9", - "\\end{vmatrix}$0" - ] - }, - "2x2 determinants": { - "prefix": "det22", - "description": "Create a 2x2 determinant", - "body": [ - "\\begin{vmatrix}", - " $1 & $2", - "\\\\\\ $3 & $4", - "\\end{vmatrix}$0" - ] - }, - "Definite integral": { - "prefix": "dintegral", - "description": "Definite integral", - "body": "\\int_{$1}^{$2} $3 d${4:x}$0" - }, - "Indefinite integral": { - "prefix": "integral", - "description": "Integral", - "body": "\\int $1 d${2:x}$0" - }, - "Iff cases": { - "prefix": "ciff", - "description": "Prove an equivalence in both directions", - "body": [ - "\\begin{enumerate}", - "\t\\item[$\\implies$]$1", - "\t\\item[$\\impliedby$]$2", - "\\end{enumerate}", - "$0" - ] - } -} diff --git a/dotfiles/vscode-snippets/snippets/latex/explain.json b/dotfiles/vscode-snippets/snippets/latex/explain.json deleted file mode 100644 index 0f0582a..0000000 --- a/dotfiles/vscode-snippets/snippets/latex/explain.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "Text explanation in math mode": { - "prefix": "texpl", - "description": "Explain a step using text in math mode", - "body": "&& \\text{($1)}$0" - }, - "Explanation in math mode": { - "prefix": "expl", - "description": "Explain a step in math mode", - "body": "&& ($1) $0" - }, - "Explain division": { - "prefix": "exdiv", - "description": "Explain a division inside an equation", - "body": "&& \\left(\\frac{\\square}{$1}\\right)$0" - }, - "Explain fraction": { - "prefix": "exfract", - "description": "Explain a step which wraps both sides of an equation by a fraction", - "body": "&& \\left(\\frac{$1}{$2} \\right)$0" - }, - "Explain right multiplication": { - "prefix": "exmul", - "description": "Explain a right multiplication inside an equation", - "body": "&& \\left(\\square \\cdot $1 \\right)$0" - }, - "Explain left multiplication": { - "prefix": "exlmul", - "description": "Explain a left multiplication inside an equation", - "body": "&& \\left($1 \\cdot \\square\\right)$0" - }, - "Explain differentiation": { - "prefix": "exdiff", - "description": "Explain a step which differentiates both sides of an equation", - "body": "&& \\left( \\frac{d \\square} {d $1} \\right)$0" - }, - "Explain integration": { - "prefix": "exint", - "description": "Explain a step which integrates both sides of an equation", - "body": "&& \\left(\\int \\square d$1 \\right)$0" - }, - "Explain definite integration": { - "prefix": "exdint", - "description": "Explain a step which applies a definite integral to both sides of an equation", - "body": "&& \\left(\\int _{$1} ^{$2} \\square d$3 \\right)$0" - }, - "Explain addition": { - "prefix": "exadd", - "description": "Explain a step which adds to both sides of an equation", - "body": "&& \\left( \\square + $1 \\right)$0" - }, - "Explain subtraction": { - "prefix": "exsub", - "description": "Explain a step which subtracts from both sides of an equation", - "body": "&& \\left( \\square - $1 \\right)$0" - }, - "Explain negation": { - "prefix": "exneg", - "description": "Explain a step which negates both sides of an equation", - "body": "&& (- \\square )$0" - }, - "Explain power": { - "prefix": "expow", - "description": "Explain a step which raises both sides of an equation to a given power", - "body": "&& \\left( \\square ^{$1} \\right)$0" - }, - "Explain exponentiation": { - "prefix": "exexp", - "description": "Explain a step which raises a given value to both sides of an equation", - "body": "&& \\left( $1 ^{\\square} \\right)$0" - }, - "Explain natural logarithm": { - "prefix": "exln", - "description": "Explain a step which applies the ln function to both sides of an equation", - "body": "&& \\left( \\ln $1 \\right)$0" - } -} diff --git a/dotfiles/vscode-snippets/snippets/lua/core.json b/dotfiles/vscode-snippets/snippets/lua/core.json deleted file mode 100644 index ab3c56f..0000000 --- a/dotfiles/vscode-snippets/snippets/lua/core.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "Lua setup-module": { - "prefix": "msetup", - "description": "Create lua module with setup function inside", - "body": [ - "local M = {}", - "", - "function M.setup()", - " $0", - "end", - "", - "return M" - ] - }, - "Busted describe": { - "prefix": "describe", - "description": "Create a describe call for a busted test", - "body": [ - "describe(\"$1\", function ()", - "\t$0", - "end)" - ] - }, - "Busted it": { - "prefix": "it", - "description": "Create an it call for a busted test", - "body": [ - "it(\"$1\", function ()", - "\t$0", - "end)" - ] - } -} diff --git a/dotfiles/vscode-snippets/snippets/purescript/deriving.json b/dotfiles/vscode-snippets/snippets/purescript/deriving.json deleted file mode 100644 index 0154d85..0000000 --- a/dotfiles/vscode-snippets/snippets/purescript/deriving.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "Derive newtype instance": { - "prefix": "gnderive", - "description": "Use newtype deriving on any typeclass", - "body": "derive newtype instance $0 $3 $2" - }, - "Generate json instances": { - "prefix": "json", - "description": "Generate the deriving of the EncodeJson and DecodeJson typeclasses", - "body": [ - "derive newtype instance EncodeJson $1", - "derive newtype instance DecodeJson $1" - ] - }, - "Generic": { - "prefix": "dgeneric", - "description": "Generate the generic instance for a type", - "body": "derive instance Generic $1 _" - }, - "Generic Show": { - "prefix": "gshow", - "description": "Generate generic show instances", - "body": [ - "instance Show $1 where", - " show = genericShow" - ] - }, - "Generic Debug": { - "prefix": "gdebug", - "description": "Generate generic debug instances", - "body": [ - "instance Debug $1 where", - " debug = genericDebug" - ] - }, - "Generic json": { - "prefix": "gjson", - "description": "Generate generic json instances", - "body": [ - "instance EncodeJson $1 where", - " encodeJson = genericEncodeJson", - "instance DecodeJson $1 where", - " decodeJson = genericDecodeJson" - ] - }, - "Instance": { - "prefix": "instance", - "description": "Declare typeclass instance", - "body": [ - "instance $2 $3 where", - " $0" - ] - }, - "Functor": { - "prefix": "dfunctor", - "description": "Derive a Functor instance", - "body": "derive instance Functor $1$0" - }, - "Eq": { - "prefix": "deq", - "description": "Derive an Eq instance", - "body": "derive instance Eq $1$0" - }, - "Ord": { - "prefix": "dord", - "description": "Derive an Ord instance", - "body": "derive instance Ord $1$0" - }, - "Eq & Ord": { - "prefix": "deqord", - "description": "Derive an Eq and an Ord instance", - "body": [ - "derive instance Eq $1", - "derive instance Ord $1$0" - ] - } -} diff --git a/dotfiles/vscode-snippets/snippets/purescript/imports.json b/dotfiles/vscode-snippets/snippets/purescript/imports.json deleted file mode 100644 index 896b018..0000000 --- a/dotfiles/vscode-snippets/snippets/purescript/imports.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "Tuple constructors": { - "prefix": "imptuple", - "description": "Import tuple constructors", - "body": "import Data.Tuple.Nested (type (/\\), (/\\))" - }, - "Map": { - "prefix": "impmap", - "description": "Import Map module", - "body": "import Data.Map as Map" - }, - "HashMap": { - "prefix": "imphashmap", - "description": "Import HashMap module", - "body": "import Data.HashMap as HashMap" - }, - "FRP Event": { - "prefix": "impevent", - "description": "Import FRP.Event module", - "body": "import FRP.Event as E" - }, - "List": { - "prefix": "implist", - "description": "Import List module", - "body": "import Data.List as List" - }, - "Array": { - "prefix": "imparray", - "description": "import Array module", - "body": "import Data.Array as Array" - }, - "AVar": { - "prefix": "impavar", - "description": "import AVar module", - "body": "import Effect.Aff.AVar as AV" - }, - "Object": { - "prefix": "impobject", - "description": "import Foreign.Object module", - "body": "import Foreign.Object as Object" - }, - "STObject": { - "prefix": "impstobject", - "description": "import STObject module", - "body": "import Foreign.Object.ST as STObject" - }, - "Ref": { - "prefix": "impref", - "description": "import Effect.Ref module", - "body": "import Effect.Ref as Ref" - }, - "Int": { - "prefix": "impint", - "description": "import Data.Int module", - "body": "import Data.Int as Int" - }, - "Number": { - "prefix": "impnumber", - "description": "import Data.Number module", - "body": "import Data.Number as Number" - } -} diff --git a/dotfiles/vscode-snippets/snippets/purescript/other.json b/dotfiles/vscode-snippets/snippets/purescript/other.json deleted file mode 100644 index e382243..0000000 --- a/dotfiles/vscode-snippets/snippets/purescript/other.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "Definition": { - "prefix": "definition", - "description": "Basic purescript definition", - "body": ["$1 :: $2", "$1 = $3"] - }, - "SProxy": { - "prefix": "sproxy", - "description": "Generate a proxy constant", - "body": ["_$1 :: Proxy \"$1\"", "_$1 = Proxy"] - }, - "Proxy": { - "prefix": "proxy", - "description": "Generate a proxy constant", - "body": ["_$1 :: Proxy $1", "_$1 = Proxy"] - }, - "Prop": { - "prefix": "prop", - "description": "Prop lens", - "body": ["_$1 :: Lens' $2 $3", "_$1 = prop (Proxy :: _ \"$1\")"] - }, - "Variant constructor": { - "prefix": "inj", - "description": "Generate a constructor for a variant an inline sproxy", - "body": [ - "$1 :: forall r a. a -> Variant ( $1 :: a | r)", - "$1 = inj (SProxy :: SProxy \"$1\")" - ] - }, - "Full variant constructor": { - "prefix": "injf", - "description": "Generate a constructor for a variant with an external sproxy definition", - "body": [ - "$1 :: forall r a. a -> Variant ( $1 :: a | r)", - "$1 = inj _$1", - "", - "_$1 :: Proxy \"$1\"", - "_$1 = Proxy" - ] - }, - "Example code": { - "prefix": "ex", - "description": "Provide example usage for some piece of code", - "body": ["-- |", "-- | Ex:", "-- | ```purs", "-- | $0", "-- | ```"] - }, - "Section": { - "prefix": "section", - "description": "Delimit a section using 10 dashes", - "body": "---------- $0" - }, - "Typeclass instances": { - "prefix": "sinstances", - "description": "Delimit a section which declares typeclass instances", - "body": ["---------- Typeclass instances", "$0"] - }, - "If": { - "prefix": "if", - "description": "If then else expression", - "body": ["if $1", "\tthen $2", "\telse $3"] - } -} diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 95ea0b1..0000000 --- a/flake.lock +++ /dev/null @@ -1,831 +0,0 @@ -{ - "nodes": { - "Prettier": { - "flake": false, - "locked": { - "lastModified": 1639310097, - "narHash": "sha256-+eSLEJDuy2ZRkh1h0Y5IF6RUeHEcWhAHpWhwdwW65f0=", - "owner": "Z-snails", - "repo": "prettier", - "rev": "4a90663b1d586f6d6fce25873aa0f0d7bc633b89", - "type": "github" - }, - "original": { - "owner": "Z-snails", - "repo": "prettier", - "type": "github" - } - }, - "base16": { - "inputs": { - "nixpkgs": [ - "stylix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1658847131, - "narHash": "sha256-X6Mml7cT0YR3WCD5fkUhpRVV5ZPcwdcDsND8r8xMqTE=", - "owner": "SenchoPens", - "repo": "base16.nix", - "rev": "6b404cda2e04ca3cf5ca7b877af9c469e1386acb", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "repo": "base16.nix", - "type": "github" - } - }, - "collie": { - "flake": false, - "locked": { - "lastModified": 1631011321, - "narHash": "sha256-goYctB+WBoLgsbjA0DlqGjD8i9wr1K0lv0agqpuwflU=", - "owner": "ohad", - "repo": "collie", - "rev": "ed2eda5e04fbd02a7728e915d396e14cc7ec298e", - "type": "github" - }, - "original": { - "owner": "ohad", - "repo": "collie", - "type": "github" - } - }, - "comonad": { - "flake": false, - "locked": { - "lastModified": 1638093386, - "narHash": "sha256-kxmN6XuszFLK2i76C6LSGHe5XxAURFu9NpzJbi3nodk=", - "owner": "stefan-hoeck", - "repo": "idris2-comonad", - "rev": "06d6b551db20f1f940eb24c1dae051c957de97ad", - "type": "github" - }, - "original": { - "owner": "stefan-hoeck", - "repo": "idris2-comonad", - "type": "github" - } - }, - "coricamu": { - "inputs": { - "nixpkgs": [ - "stylix", - "nixpkgs" - ], - "utils": "utils_2" - }, - "locked": { - "lastModified": 1659649195, - "narHash": "sha256-wRpMO4Mm4uizR5M71iipdi8ssSYMEPPAIwWyFYnhnco=", - "owner": "danth", - "repo": "coricamu", - "rev": "cdd2f7326efd91509caf84e69b669a7f9e6782bc", - "type": "github" - }, - "original": { - "owner": "danth", - "repo": "coricamu", - "type": "github" - } - }, - "dom": { - "flake": false, - "locked": { - "lastModified": 1639041519, - "narHash": "sha256-4ZYc0qaUEVARxhWuH3JgejIeT+GEDNxdS6zIGhBCk34=", - "owner": "stefan-hoeck", - "repo": "idris2-dom", - "rev": "01ab52d0ffdb3b47481413a949b8f0c0688c97e4", - "type": "github" - }, - "original": { - "owner": "stefan-hoeck", - "repo": "idris2-dom", - "type": "github" - } - }, - "dot-parse": { - "flake": false, - "locked": { - "lastModified": 1638264571, - "narHash": "sha256-VJQITz+vuQgl5HwR5QdUGwN8SRtGcb2/lJaAVfFbiSk=", - "owner": "CodingCellist", - "repo": "idris2-dot-parse", - "rev": "48fbda8bf8adbaf9e8ebd6ea740228e4394154d9", - "type": "github" - }, - "original": { - "owner": "CodingCellist", - "repo": "idris2-dot-parse", - "type": "github" - } - }, - "effect": { - "flake": false, - "locked": { - "lastModified": 1637477153, - "narHash": "sha256-Ta2Vogg/IiSBkfhhD57jjPTEf3S4DOiVRmof38hmwlM=", - "owner": "russoul", - "repo": "idris2-effect", - "rev": "ea1daf53b2d7e52f9917409f5653adc557f0ee1a", - "type": "github" - }, - "original": { - "owner": "russoul", - "repo": "idris2-effect", - "type": "github" - } - }, - "elab-util": { - "flake": false, - "locked": { - "lastModified": 1639041013, - "narHash": "sha256-K61s/xifFiTDXJTak5NZmZL6757CTYCY+TGywRZMD7M=", - "owner": "stefan-hoeck", - "repo": "idris2-elab-util", - "rev": "7a381c7c5dc3adb7b97c8b8be17e4fb4cc63027d", - "type": "github" - }, - "original": { - "owner": "stefan-hoeck", - "repo": "idris2-elab-util", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1668681692, - "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "009399224d5e398d03b22badca40a37ac85412a1", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "locked": { - "lastModified": 1638122382, - "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "locked": { - "lastModified": 1631561581, - "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "frex": { - "flake": false, - "locked": { - "lastModified": 1637410704, - "narHash": "sha256-BthU1t++n0ZvS76p0fCHsE33QSoXYxf0hMUSKajDY8w=", - "owner": "frex-project", - "repo": "idris-frex", - "rev": "22c480e879c757a5cebca7bb555ec3d21ae3ac28", - "type": "github" - }, - "original": { - "owner": "frex-project", - "repo": "idris-frex", - "type": "github" - } - }, - "fvect": { - "flake": false, - "locked": { - "lastModified": 1633247988, - "narHash": "sha256-zElIze03XpcrYL4H5Aj0ZGNplJGbtOx+iWnivJMzHm0=", - "owner": "mattpolzin", - "repo": "idris-fvect", - "rev": "1c5e3761e0cd83e711a3535ef9051bea45e6db3f", - "type": "github" - }, - "original": { - "owner": "mattpolzin", - "repo": "idris-fvect", - "type": "github" - } - }, - "hashable": { - "flake": false, - "locked": { - "lastModified": 1633965157, - "narHash": "sha256-Dggf5K//RCZ7uvtCyeiLNJS6mm+8/n0RFW3zAc7XqPg=", - "owner": "z-snails", - "repo": "idris2-hashable", - "rev": "d6fec8c878057909b67f3d4da334155de4f37907", - "type": "github" - }, - "original": { - "owner": "z-snails", - "repo": "idris2-hashable", - "type": "github" - } - }, - "hedgehog": { - "flake": false, - "locked": { - "lastModified": 1639041435, - "narHash": "sha256-893cPy7gGSQpVmm9co3QCpWsgjukafZHy8YFk9xts30=", - "owner": "stefan-hoeck", - "repo": "idris2-hedgehog", - "rev": "a66b1eb0bf84c4a7b743cfb217be69866bc49ad8", - "type": "github" - }, - "original": { - "owner": "stefan-hoeck", - "repo": "idris2-hedgehog", - "type": "github" - } - }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "utils": "utils" - }, - "locked": { - "lastModified": 1670253003, - "narHash": "sha256-/tJIy4+FbsQyslq1ipyicZ2psOEd8dvl4OJ9lfisjd0=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "0e8125916b420e41bf0d23a0aa33fadd0328beb3", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-22.11", - "repo": "home-manager", - "type": "github" - } - }, - "idrall": { - "flake": false, - "locked": { - "lastModified": 1636495701, - "narHash": "sha256-aOdCRd4XsSxwqVGta1adlZBy8TVTxTwFDnJ1dyMZK8M=", - "owner": "alexhumphreys", - "repo": "idrall", - "rev": "13ef174290169d05c9e9abcd77c53412e3e0c944", - "type": "github" - }, - "original": { - "owner": "alexhumphreys", - "ref": "13ef174", - "repo": "idrall", - "type": "github" - } - }, - "idris-server": { - "flake": false, - "locked": { - "lastModified": 1634507315, - "narHash": "sha256-ulo23yLJXsvImoMB/1C6yRRTqmn/Odo+aUaVi+tUhJo=", - "owner": "avidela", - "repo": "idris-server", - "rev": "661a4ecf0fadaa2bd79c8e922c2d4f79b0b7a445", - "type": "gitlab" - }, - "original": { - "owner": "avidela", - "repo": "idris-server", - "type": "gitlab" - } - }, - "idris2": { - "flake": false, - "locked": { - "lastModified": 1639427352, - "narHash": "sha256-C1K2FM1Kio8vi9FTrivdacYCX4cywIsLBeNCsZ6ft4g=", - "owner": "idris-lang", - "repo": "idris2", - "rev": "36918e618646177b1e0c2fd01f21cc8d04d9da30", - "type": "github" - }, - "original": { - "owner": "idris-lang", - "repo": "idris2", - "type": "github" - } - }, - "idris2-pkgs": { - "inputs": { - "Prettier": "Prettier", - "collie": "collie", - "comonad": "comonad", - "dom": "dom", - "dot-parse": "dot-parse", - "effect": "effect", - "elab-util": "elab-util", - "flake-utils": "flake-utils", - "frex": "frex", - "fvect": "fvect", - "hashable": "hashable", - "hedgehog": "hedgehog", - "idrall": "idrall", - "idris-server": "idris-server", - "idris2": "idris2", - "indexed": "indexed", - "inigo": "inigo", - "ipkg-to-json": "ipkg-to-json", - "json": "json", - "katla": "katla", - "lsp": "lsp", - "nixpkgs": [ - "nixpkgs" - ], - "odf": "odf", - "pretty-show": "pretty-show", - "python": "python", - "rhone": "rhone", - "rhone-js": "rhone-js", - "snocvect": "snocvect", - "sop": "sop", - "tailrec": "tailrec", - "xml": "xml" - }, - "locked": { - "lastModified": 1642030375, - "narHash": "sha256-J1uXnpPR72mjFjLBuYcvDHStBxVya6/MjBNNwqxGeD0=", - "owner": "claymager", - "repo": "idris2-pkgs", - "rev": "ac33a49d4d4bd2b50fddb040cd889733a02c8f09", - "type": "github" - }, - "original": { - "owner": "claymager", - "repo": "idris2-pkgs", - "type": "github" - } - }, - "indexed": { - "flake": false, - "locked": { - "lastModified": 1638685238, - "narHash": "sha256-FceB7o88yKYzjTfRC6yfhOL6oDPMmCQAsJZu/pjE2uA=", - "owner": "mattpolzin", - "repo": "idris-indexed", - "rev": "ff3ba99b0063da6a74c96178e7f3c58a4ac1693e", - "type": "github" - }, - "original": { - "owner": "mattpolzin", - "repo": "idris-indexed", - "type": "github" - } - }, - "inigo": { - "flake": false, - "locked": { - "lastModified": 1637596767, - "narHash": "sha256-LNx30LO0YWDVSPTxRLWGTFL4f3d5ANG6c60WPdmiYdY=", - "owner": "idris-community", - "repo": "Inigo", - "rev": "57f5b5c051222d8c630010a0a3cf7d7138910127", - "type": "github" - }, - "original": { - "owner": "idris-community", - "repo": "Inigo", - "type": "github" - } - }, - "ipkg-to-json": { - "flake": false, - "locked": { - "lastModified": 1634937414, - "narHash": "sha256-LhSmWRpI7vyIQE7QTo38ZTjlqYPVSvV/DIpIxzPmqS0=", - "owner": "claymager", - "repo": "ipkg-to-json", - "rev": "2969b6b83714eeddc31e41577a565778ee5922e6", - "type": "github" - }, - "original": { - "owner": "claymager", - "repo": "ipkg-to-json", - "type": "github" - } - }, - "json": { - "flake": false, - "locked": { - "lastModified": 1639041459, - "narHash": "sha256-TP/V1jBBP1hFPm/cJ5O2EJiaNoZ19KvBOAI0S9lvAR4=", - "owner": "stefan-hoeck", - "repo": "idris2-json", - "rev": "7c0c028acad0ba0b63b37b92199f37e6ec73864a", - "type": "github" - }, - "original": { - "owner": "stefan-hoeck", - "repo": "idris2-json", - "type": "github" - } - }, - "katla": { - "flake": false, - "locked": { - "lastModified": 1636542431, - "narHash": "sha256-X83NA/P3k1iPcBa8g5z8JldEmFEz/jxVeViJX0/FikY=", - "owner": "idris-community", - "repo": "katla", - "rev": "d841ec243f96b4762074211ee81033e28884c858", - "type": "github" - }, - "original": { - "owner": "idris-community", - "repo": "katla", - "type": "github" - } - }, - "kmonad": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "dir": "nix", - "lastModified": 1651937557, - "narHash": "sha256-gvQsenQrEsLxLFgUGJhJBIx3+t1dtLMMTVEO/yZ8nRg=", - "owner": "kmonad", - "repo": "kmonad", - "rev": "c43a0180a3b9ca9c4ff4a283b17369fc4e8e46e2", - "type": "github" - }, - "original": { - "dir": "nix", - "owner": "kmonad", - "repo": "kmonad", - "type": "github" - } - }, - "lsp": { - "flake": false, - "locked": { - "lastModified": 1639486283, - "narHash": "sha256-po396FnUu8iqiipwPxqpFZEU4rtpX3jnt3cySwjLsH8=", - "owner": "idris-community", - "repo": "idris2-lsp", - "rev": "7ebb6caf6bb4b57c5107579aba2b871408e6f183", - "type": "github" - }, - "original": { - "owner": "idris-community", - "repo": "idris2-lsp", - "type": "github" - } - }, - "neovim-flake": { - "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": [ - "neovim-nightly-overlay", - "nixpkgs" - ] - }, - "locked": { - "dir": "contrib", - "lastModified": 1670899659, - "narHash": "sha256-HrEXh9qSkOb5Ke7IRoEs90lgLiUOTNWrfKJ9OLgk0uY=", - "owner": "neovim", - "repo": "neovim", - "rev": "a6b05cb75d330dd995d3ad21ee08bb0a2cfcae74", - "type": "github" - }, - "original": { - "dir": "contrib", - "owner": "neovim", - "repo": "neovim", - "type": "github" - } - }, - "neovim-nightly-overlay": { - "inputs": { - "flake-compat": "flake-compat", - "neovim-flake": "neovim-flake", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1670919334, - "narHash": "sha256-gLno1vCJ9zpSTeCLOP12Ja+dFu9yNTbS87ZC04H8Y9Q=", - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "rev": "b68451b57ce944623a6c16547bb88e3c349b6754", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "type": "github" - } - }, - "nixos-unstable": { - "locked": { - "lastModified": 1669791787, - "narHash": "sha256-KBfoA2fOI5+wCrm7PR+j7jHqXeTkVRPQ0m5fcKchyuU=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e76c78d20685a043d23f5f9e0ccd2203997f1fb1", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1670263920, - "narHash": "sha256-oR1rtMcWCvpGa81vvaHpONLFfZJpq1ijnHypujGA/lw=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "29423d0cfac3baa05f804c399f1b043068b531f8", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "release-22.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1669867399, - "narHash": "sha256-Z8RXSFYOsIsTG96ROKtV0eZ8Q7u4irFWm6ELqfw7mT8=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "38e591dd05ffc8bdf79dc752ba78b05e370416fa", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "odf": { - "flake": false, - "locked": { - "lastModified": 1638184051, - "narHash": "sha256-usSdPx+UqOGImHHdHcrytdzi2LXtIRZuUW0fkD/Wwnk=", - "owner": "madman-bob", - "repo": "idris2-odf", - "rev": "d2f532437321c8336f1ca786b44b6ebef4117126", - "type": "github" - }, - "original": { - "owner": "madman-bob", - "repo": "idris2-odf", - "type": "github" - } - }, - "pretty-show": { - "flake": false, - "locked": { - "lastModified": 1639041411, - "narHash": "sha256-BzEe1fpX+lqGEk8b1JZoQT1db5I7s7SZnLCttRVGXdY=", - "owner": "stefan-hoeck", - "repo": "idris2-pretty-show", - "rev": "a4bc6156b9dac43699f87504cbdb8dada5627863", - "type": "github" - }, - "original": { - "owner": "stefan-hoeck", - "repo": "idris2-pretty-show", - "type": "github" - } - }, - "python": { - "flake": false, - "locked": { - "lastModified": 1635936936, - "narHash": "sha256-c9mcMApN0qgu0AXQVu0V+NXt2poP258wCPkyvtQvv4I=", - "owner": "madman-bob", - "repo": "idris2-python", - "rev": "0eab028933c65bebe744e879881416f5136d6943", - "type": "github" - }, - "original": { - "owner": "madman-bob", - "repo": "idris2-python", - "type": "github" - } - }, - "rhone": { - "flake": false, - "locked": { - "lastModified": 1639041532, - "narHash": "sha256-2g43shlWQIT/1ogesUBUBV9N8YiD3RwaCbbhdKLVp1s=", - "owner": "stefan-hoeck", - "repo": "idris2-rhone", - "rev": "c4d828b0b8efea495d9a5f1e842a9c67cad57724", - "type": "github" - }, - "original": { - "owner": "stefan-hoeck", - "repo": "idris2-rhone", - "type": "github" - } - }, - "rhone-js": { - "flake": false, - "locked": { - "lastModified": 1639041546, - "narHash": "sha256-ddWVsSRbfA6ghmwiRMzDpHBPM+esGdutuqm1qQZgs88=", - "owner": "stefan-hoeck", - "repo": "idris2-rhone-js", - "rev": "520dd59549f5b14075045314b6805c7492ed636e", - "type": "github" - }, - "original": { - "owner": "stefan-hoeck", - "repo": "idris2-rhone-js", - "type": "github" - } - }, - "root": { - "inputs": { - "home-manager": "home-manager", - "idris2-pkgs": "idris2-pkgs", - "kmonad": "kmonad", - "neovim-nightly-overlay": "neovim-nightly-overlay", - "nixos-unstable": "nixos-unstable", - "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable", - "stylix": "stylix" - } - }, - "snocvect": { - "flake": false, - "locked": { - "lastModified": 1641633224, - "narHash": "sha256-6zTU4sDzd/R/dFCTNZaX41H4L3/USGLFghMS0Oc9liY=", - "owner": "mattpolzin", - "repo": "idris-snocvect", - "rev": "ff1e7afba360a62f7e522e9bbb856096a79702c4", - "type": "github" - }, - "original": { - "owner": "mattpolzin", - "repo": "idris-snocvect", - "type": "github" - } - }, - "sop": { - "flake": false, - "locked": { - "lastModified": 1639041379, - "narHash": "sha256-PDTf1Wx6EygiWszguvoVPiqIISYFLabI4e0lXHlrjcA=", - "owner": "stefan-hoeck", - "repo": "idris2-sop", - "rev": "e4354d1883cd73616019457cb9ebf864d99df6a0", - "type": "github" - }, - "original": { - "owner": "stefan-hoeck", - "repo": "idris2-sop", - "type": "github" - } - }, - "stylix": { - "inputs": { - "base16": "base16", - "coricamu": "coricamu", - "home-manager": [ - "home-manager" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660382154, - "narHash": "sha256-OMh2cBIm8C/rVVgSuD9Tz0+04N98u1FsGNJMuYCIMDc=", - "owner": "danth", - "repo": "stylix", - "rev": "9185529e3dbededab5f13e5305667a705ee85528", - "type": "github" - }, - "original": { - "owner": "danth", - "repo": "stylix", - "type": "github" - } - }, - "tailrec": { - "flake": false, - "locked": { - "lastModified": 1637146655, - "narHash": "sha256-0yi7MQIrISPvAwkgDC1M5PHDEeVyIaISF0HjKDaT0Rw=", - "owner": "stefan-hoeck", - "repo": "idris2-tailrec", - "rev": "dd0bc6381b3a2e69aa37f9a8c1b165d4b1516ad7", - "type": "github" - }, - "original": { - "owner": "stefan-hoeck", - "repo": "idris2-tailrec", - "type": "github" - } - }, - "utils": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "utils_2": { - "locked": { - "lastModified": 1642700792, - "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "xml": { - "flake": false, - "locked": { - "lastModified": 1637939752, - "narHash": "sha256-yYJBhPfwYoi7amlHmeNGrVCOAc3BjZpKTCd9wDs3XEM=", - "owner": "madman-bob", - "repo": "idris2-xml", - "rev": "1292ccfcd58c551089ef699e4560343d5c473d64", - "type": "github" - }, - "original": { - "owner": "madman-bob", - "repo": "idris2-xml", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix index 7ca3797..a4a319a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,72 +1,70 @@ { - description = "NixOS configuration"; + description = "Satellite"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/release-22.11"; - nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + # Nixpkgs + nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; - home-manager = { - url = "github:nix-community/home-manager/release-22.11"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - stylix = { - url = "github:danth/stylix"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.home-manager.follows = "home-manager"; - }; - - # keyboard layout configuration - kmonad = { - url = "github:kmonad/kmonad?dir=nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - idris2-pkgs = { - url = "github:claymager/idris2-pkgs"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - #### Nvim stuff - neovim-nightly-overlay = { - url = "github:nix-community/neovim-nightly-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + # Home manager + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = inputs@{ self, stylix, nixpkgs, ... }: + outputs = { self, nixpkgs, home-manager, ... }@inputs: let - system = "x86_64-linux"; - provideInputs = - import ./modules/overlays/flakes.nix { inherit system; } inputs; - - overlays = { ... }: { - nix.registry.nixpkgs.flake = nixpkgs; - nixpkgs.overlays = [ - inputs.neovim-nightly-overlay.overlay - inputs.idris2-pkgs.overlay - provideInputs - ]; - }; + inherit (self) outputs; + forAllSystems = nixpkgs.lib.genAttrs [ + "aarch64-linux" + "i686-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; in - { - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { - inherit system; + rec { + # Acessible through 'nix build', 'nix shell', etc + packages = forAllSystems (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in import ./pkgs { inherit pkgs; } + ); - specialArgs = { - paths = import ./paths.nix; - inherit inputs; + # Devshell for bootstrapping + # Acessible through 'nix develop' + devShells = forAllSystems (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in import ./shell.nix { inherit pkgs; } + ); + + # Custom packages and modifications, exported as overlays + overlays = import ./overlays; + + # Reusable nixos modules + nixosModules = import ./modules/nixos; + + # Reusable home-manager modules + homeManagerModules = import ./modules/home-manager; + + # NixOS configuration entrypoint + # Available through 'nixos-rebuild --flake .#... + nixosConfigurations = { + tethys = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; + modules = [ + ./hosts/tethys + ]; }; + }; - modules = [ - inputs.home-manager.nixosModules.home-manager - inputs.kmonad.nixosModule - stylix.nixosModules.stylix - overlays - ./hardware/laptop.nix - ./configuration.nix - ]; + # Standalone home-manager configuration entrypoint + # Available through 'home-manager --flake .#... + homeConfigurations = { + "adrielus@tethys" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { inherit inputs outputs; }; + modules = [ + ./home/adrielus/tethys.nix + ]; + }; }; }; } diff --git a/hardware/laptop.nix b/hardware/laptop.nix deleted file mode 100644 index 3207b2c..0000000 --- a/hardware/laptop.nix +++ /dev/null @@ -1,34 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, ... }: - -{ - # imports = - # [ - # ]; - - # Basically the content of the import above - hardware.enableRedistributableFirmware = lib.mkDefault true; - - boot.initrd.availableKernelModules = - [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/57846041-f177-45eb-aff3-503006bac638"; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/01E6-A013"; - fsType = "vfat"; - }; - - swapDevices = [ ]; - - nix.settings.max-jobs = lib.mkDefault 8; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; -} diff --git a/home/adrielus/tethys.nix b/home/adrielus/tethys.nix new file mode 100644 index 0000000..8327fda --- /dev/null +++ b/home/adrielus/tethys.nix @@ -0,0 +1,32 @@ +{ inputs, outputs, lib, config, pkgs, ... }: { + imports = [ + + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + ]; + + # Configure your nixpkgs instance + config = { + allowUnfree = true; + allowUnfreePredicate = (_: true); + }; + }; + + home = { + username = "rafael"; + homeDirectory = "/home/rafael"; + }; + + # Enable home-manager and git + programs.home-manager.enable = true; + programs.git.enable = true; + + # Nicely reload system units when changing configs + systemd.user.startServices = "sd-switch"; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + home.stateVersion = "22.11"; +} diff --git a/hosts/tethys/default.nix b/hosts/tethys/default.nix new file mode 100644 index 0000000..32e84c8 --- /dev/null +++ b/hosts/tethys/default.nix @@ -0,0 +1 @@ +{ pkgs, ... }: { } diff --git a/img/22-10-19-16-13-24.png b/img/22-10-19-16-13-24.png deleted file mode 100644 index 9273abf..0000000 Binary files a/img/22-10-19-16-13-24.png and /dev/null differ diff --git a/img/22-11-06-21-35-08.png b/img/22-11-06-21-35-08.png deleted file mode 100644 index d16f94c..0000000 Binary files a/img/22-11-06-21-35-08.png and /dev/null differ diff --git a/modules/applications/alacritty.nix b/modules/applications/alacritty.nix deleted file mode 100644 index 2656e7c..0000000 --- a/modules/applications/alacritty.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ pkgs, lib, ... }: -let - theme = pkgs.myThemes.current; -in -{ - imports = [ - { - # Load theme - home-manager.users.adrielus.programs.alacritty.settings = theme.alacritty.settings; - } - ]; - - - - home-manager.users.adrielus = { - xdg.configFile."alacritty/extraConfig.yml".text = theme.alacritty.extraConfig or ""; - programs.alacritty = { - enable = true; - - settings = { - import = [ "~/.config/alacritty/extraConfig.yml" ]; - - window.decorations = "none"; - fonts.normal.family = "Nerd Font Source Code Pro"; - - env = { TERM = "xterm-256color"; }; - working_directory = "/home/adrielus/Projects/"; - }; - }; - }; -} diff --git a/modules/applications/chromium.nix b/modules/applications/chromium.nix deleted file mode 100644 index dd0567d..0000000 --- a/modules/applications/chromium.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, lib, ... }: -let - theme = pkgs.myThemes.current; - extensions = theme.chromium.extensions or [ ]; -in -{ - home-manager.users.adrielus.programs.chromium = { - enable = true; - extensions = lib.lists.map (id: { inherit id; }) extensions; - }; -} diff --git a/modules/applications/default.nix b/modules/applications/default.nix deleted file mode 100644 index 981f4ba..0000000 --- a/modules/applications/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ ... }: { - imports = [ - ./git - ./shells - # ./wakatime - ./rofi - # ./xmodmap - - # ./wine.nix - ./kdeconnect.nix - ./steam.nix - ./docker.nix - ./misc.nix - ./zathura.nix - ./discord.nix - ./locale.nix - # ./memes.nix - ./alacritty.nix - # ./postgres.nix - ./neovim.nix - ./tmux.nix - ./kmonad.nix - ./direnv.nix - # ./chromium.nix - ./vieb.nix - ./polybar.nix - ./hamachi.nix - ]; -} - diff --git a/modules/applications/direnv.nix b/modules/applications/direnv.nix deleted file mode 100644 index 911b6ab..0000000 --- a/modules/applications/direnv.nix +++ /dev/null @@ -1,7 +0,0 @@ -# https://github.com/nix-community/nix-direnv -{ pkgs, ... }: { - home-manager.users.adrielus = { - programs.direnv.enable = true; - programs.direnv.nix-direnv.enable = true; - }; -} diff --git a/modules/applications/discord.nix b/modules/applications/discord.nix deleted file mode 100644 index 810e8d2..0000000 --- a/modules/applications/discord.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus = { - xdg.configFile."discord/settings.json".text = '' - { - "BACKGROUND_COLOR": "#ffffff", - "SKIP_HOST_UPDATE": true - } - ''; - home.packages = with pkgs; [ - unstable.discord - ]; - }; -} diff --git a/modules/applications/docker.nix b/modules/applications/docker.nix deleted file mode 100644 index fe9bfa7..0000000 --- a/modules/applications/docker.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs, ... }: { - virtualisation.docker = { - enable = true; - liveRestore = false; - extraOptions = '' - --default-address-pool "base=192.168.100.0/20,size=24" - ''; - }; - home-manager.users.adrielus.home.packages = with pkgs; [ - docker - docker-compose - docker-machine - ]; -} diff --git a/modules/applications/edopro.nix b/modules/applications/edopro.nix deleted file mode 100644 index 198836a..0000000 --- a/modules/applications/edopro.nix +++ /dev/null @@ -1,41 +0,0 @@ -# TODO: make this actually build -{ pkgs, stdenv, ... }: -let - # It's considered good practice to specify the version in the derivation name - version = "38.1.1"; - # In case the name they build it into changes I can just modify this - execName = "EDOPro"; - edopro = stdenv.mkDerivation rec { - name = "edopro-${version}"; - - src = builtins.path { - path = pkgs.fetchurl { - url = - "https://mega.nz/file/pfglCAyK#IlqEOy1kBLmFiIDu4z6afbj1wTcWTFTyvYzPW0D2m24"; - sha256 = - "99be240086ccae834998b821df5abb17f7d22d26fb757fc5106b4812ca4b3f36"; - }; - name = "edopro-source"; - }; - - # Add the derivation to the PATH - buildInputs = with pkgs; [ - mono # this is needed for the ai support - freetype # font rendering engine - ]; - - # This just moves the bin over and calls it a day - installPhase = '' - # Make the output directory - mkdir -p $out/bin - - # Copy the script there and make it executable - cp ${execName} $out/bin/ - chmod +x $out/bin/${execName} - ''; - }; - -in stdenv.mkDerivation { - name = "edopro-environment"; - buildInputs = [ edopro ]; -} diff --git a/modules/applications/git/aliases.nix b/modules/applications/git/aliases.nix deleted file mode 100644 index 7d6b587..0000000 --- a/modules/applications/git/aliases.nix +++ /dev/null @@ -1,39 +0,0 @@ -# Most of these are copied from: https://github.com/Brettm12345/nixos-config/blob/1400c71bce/modules/applications/git/aliases.nix - -let - git = text: ''"!git ${text}"''; - f = text: ''"!f(){ ${text} };f"''; -in { - # Unstage all changes - unstage = "reset HEAD --"; - - # Ammend to the last commit - amend = "commit --amend -C HEAD"; - - # List branches sorted by last modified - b = git - "for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"; - - # Test merge for conflicts before merging - mergetest = f '' - git merge --no-commit --no-ff "$1"; git merge --abort; echo "Merge aborted";''; - - # Get description of current repo - description = git - ''config --get "branch.$(git rev-parse --abbrev-ref HEAD).description"''; - - # Show authors - authors = '' - "!f() { git log --no-merges --pretty='format:%<(26)%an <%ae>' --author "$*" | sort | uniq# }# f"''; - - a = "add"; - cm = "commit --message"; - caa = "commit --ammend"; - cl = "clone"; - co = "checkout"; - col = "checkout @{-1}"; - cob = "checkout -b"; - st = "stash"; - pop = "stash pop"; - t = "tag"; -} diff --git a/modules/applications/git/default.nix b/modules/applications/git/default.nix deleted file mode 100644 index d8ef898..0000000 --- a/modules/applications/git/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus = { - home.packages = with pkgs; - with gitAndTools; [ - # Render a git repo - gource - # Store secrets in github repos - git-secret - git-crypt - # Both of these are github clis - gh - hub - ]; - programs.git = { - enable = true; - - userName = "Matei Adriel"; - userEmail = "rafaeladriel11@gmail.com"; - extraConfig.core.editor = "nvim"; - - aliases = import ./aliases.nix; - - extraConfig = { - github.user = "Mateiadrielrafael"; - hub.protocol = "ssh"; - - rebase.autoStash = true; - }; - }; - }; -} diff --git a/modules/applications/hamachi.nix b/modules/applications/hamachi.nix deleted file mode 100644 index 2630524..0000000 --- a/modules/applications/hamachi.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: { - services.logmein-hamachi.enable = true; - home-manager.users.adrielus.home.packages = [ - pkgs.logmein-hamachi - pkgs.unstable.haguichi - ]; -} diff --git a/modules/applications/kdeconnect.nix b/modules/applications/kdeconnect.nix deleted file mode 100644 index 2905466..0000000 --- a/modules/applications/kdeconnect.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus = { - services.kdeconnect.enable = true; - }; - - # Open port for kdeconnect - networking.firewall.allowedTCPPortRanges = [{ from = 1714; to = 1764; }]; - networking.firewall.allowedUDPPortRanges = [{ from = 1714; to = 1764; }]; -} diff --git a/modules/applications/kmonad.nix b/modules/applications/kmonad.nix deleted file mode 100644 index 5da3c98..0000000 --- a/modules/applications/kmonad.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ pkgs, lib, ... }: -let - kmonadRoot = ../../dotfiles/kmonad; - kmonadInstances = [{ - config = kmonadRoot + "/keymap.kbd"; - inputDevices = [ - "/dev/input/by-path/platform-i8042-serio-0-event-kbd" - ]; - }]; - - createKmonadInstances = ({ config, inputDevices }: - let - configContent = builtins.readFile config; - in - lib.lists.map - (device: - "${pkgs.writeTextDir "configs/kmonad.kbd" (builtins.replaceStrings [ "$DEVICE" ] [ device ] configContent)}/kmonad.kbd" - ) - inputDevices - - ); -in -{ - users.extraUsers.adrielus.extraGroups = [ "input" "uinput" ]; - - services = { - kmonad = { - enable = true; - # configfiles = lib.lists.concatMap createKmonadInstances kmonadInstances; - configfiles = lib.lists.map ({ config, ... }: config) kmonadInstances; - }; - - xserver = { - xkbOptions = "compose:ralt"; - layout = "us"; - }; - - }; - - home-manager.users.adrielus = { - home.file.".XCompose".source = kmonadRoot + "/xcompose"; - }; -} diff --git a/modules/applications/locale.nix b/modules/applications/locale.nix deleted file mode 100644 index 4437f8c..0000000 --- a/modules/applications/locale.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs, ... }: { - i18n.defaultLocale = "en_US.UTF-8"; - # time.timeZone = "Europe/Bucharest"; - time.timeZone = "Europe/Amsterdam"; - - i18n.inputMethod = { - enabled = "ibus"; - # ibus.engines = with pkgs.ibus-engines; [ /* any engine you want, for example */ anthy ]; - }; - - environment.systemPackages = [ - pkgs.source-code-pro - ]; - - console = { - keyMap = "us"; - font = "SourceCodePro"; - }; -} diff --git a/modules/applications/memes.nix b/modules/applications/memes.nix deleted file mode 100644 index d3db179..0000000 --- a/modules/applications/memes.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs; [ - # I love combining these together and generating random stuff lol - fortune - cowsay - lolcat - figlet - toilet - - # stuff to look at - doge - sl - asciiquarium - cmatrix - ]; -} diff --git a/modules/applications/misc.nix b/modules/applications/misc.nix deleted file mode 100644 index 0003002..0000000 --- a/modules/applications/misc.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs; [ - # cmd stuff - tree # print a directory structure - exa # ls replacement - mkpasswd # hash passwords - gnupg # forgot what this was - # acpi # show remaining battery - # typespeed # speed typing game - # unixtools.xxd # to dump binary stuff into a text file (used it for a ctf) - # youtube-dl # download from youtube - neofetch # display system information - xclip # copy paste stuff - # feh # image viewer - # speedtest-cli # test the internet speed and stuff - # openssl - # pkgconfig - # ngrok - # hugo - unzip # for working with .zip files - unrar # for extracting shit from rars - # jdk11o - # jdk8 - # gtk3 - gnumake - cmake - # unison-ucm - xorg.libX11 # wtf is this - okular # forgot what this does - spotify-tui # spotify terminal ui - # kdeconnect # connect with your phone - sloc # line of code counter - update-nix-fetchgit # for updating fetchgit calls in nix files - pamixer # set pipewire volume - pulseaudio # pactl and stuff (same thing as above) - - # editors - # vscodium - # vscode - # vim - # emacs - vimclip # use neovim anywhere - - # chat apps - # slack - signal-desktop - # tdesktop # telegram for the desktop - # deluge - zoom-us - # teams - - # browsers - unstable.google-chrome - # brave - # firefox - - # other stuff - obsidian # knowedge base - # milkytracker # music tracker thingy - spectacle # take screenshots - peek # record gifs - vlc # video player - gimp # image editing - # korganizer # calendar - libreoffice # free office suite - # edopro # yugioh simulator (my derivation doesn't work yet) - # akonadi - # obs-studio # video recorder - # blueman # bluetooth manager - # freesweep # minesweeper I can play w the keyboard. - # multimc - # lmms # music software - libsForQt5.dolphin - - # Nes emulators and stuff - # zsnes - # higan - # fceux - - # games - # tetrio-desktop # competitive tetris - # vassal # wargame engine - # mindustry # factory building game - # edopro # yugioh sim - ]; -} diff --git a/modules/applications/neovim.nix b/modules/applications/neovim.nix deleted file mode 100644 index ede362c..0000000 --- a/modules/applications/neovim.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ pkgs, lib, paths, ... }: -let - teal = pkgs.fetchFromGitHub { - owner = "teal-language"; - repo = "tl"; - rev = "526fe3640fe6265706541c251e984c033a1a5ec9"; - sha256 = "0l31qj492iaiadpp4s0wflfb7vn6zzxwhbiyczisdgpd9ydj20gf"; - }; - - theme = pkgs.myThemes.current; - - extraPackages = with pkgs; [ - # Language servers - nodePackages.typescript-language-server # typescript - easy-purescript-nix.purescript-language-server # purescript - sumneko-lua-language-server # lua - rnix-lsp # nix - haskell-language-server # haskell - tectonic # also latex something? - texlab # latex - nodePackages_latest.vscode-langservers-extracted - - # Formatters - luaformatter # lua - stylua # lua - ormolu # haskell - easy-purescript-nix.purs-tidy - nodePackages_latest.prettier_d_slim - - # Others - nodePackages.typescript # typescript - wakatime # time tracking - fd # file finder - ripgrep # grep rewrite (I think?) - update-nix-fetchgit # useful for nix stuff - tree-sitter # syntax highlighting - libstdcxx5 # required by treesitter aparently - zathura # pdf reader - xdotool # for zathura reverse search or whatever it's called - lua # for repls and whatnot - glow # md preview in terminal - pandoc # md processing - libsForQt5.falkon # aparently needed for md preview - luajitPackages.luarocks # lua package manager - - texlive.combined.scheme-full # latex stuff - python38Packages.pygments # required for latex syntax highlighting - ]; - - - wrapClient = { base, name }: - pkgs.symlinkJoin { - inherit (base) name meta; - paths = [ base ]; - nativeBuildInputs = [ pkgs.makeWrapper ]; - postBuild = '' - wrapProgram $out/bin/${name} \ - --prefix PATH : ${lib.makeBinPath extraPackages} \ - --set LAZY_NVIM_PATH ${lazy-nvim} \ - --set INSIDE_NEOVIDE ${if name == "neovide" then "1" else "0"} - ''; - }; - - neovim = wrapClient { base = pkgs.neovim-nightly; name = "nvim"; }; - neovide = wrapClient { base = pkgs.neovide; name = "neovide"; }; - - nixPlugins = ".local/share/nvim/site/pack/nix"; -in -{ - home-manager.users.adrielus = { config, ... }: - let simlink = config.lib.file.mkOutOfStoreSymlink; in - { - home.file."${nixPlugins}/start/paq-nvim".source = paq; - home.file."${nixPlugins}/start/theming/lua/my/theme.lua".source = theme.neovim.theme; - home.file."${nixPlugins}/start/teal/lua".source = teal; # teal (typed lua) - home.file."${nixPlugins}/start/snippets".source = simlink "${paths.dotfiles}/vscode-snippets"; - home.file.".config/nvim".source = simlink "${paths.dotfiles}/neovim"; - # home.file.".config/nvim".source = ../../dotfiles/neovim; - - programs.neovim.enable = false; - - home.packages = [ - neovim - neovide - ]; - }; -} diff --git a/modules/applications/polybar.nix b/modules/applications/polybar.nix deleted file mode 100644 index 3fef671..0000000 --- a/modules/applications/polybar.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, lib, paths, ... }: -{ - home-manager.users.adrielus.services.polybar = { - enable = true; - extraConfig = '' - ${pkgs.myThemes.current.polybar.config or ""} - include-file = ${paths.dotfiles}/polybar/config.ini - ''; - - script = '' - polybar main & - ''; - }; - - home-manager.users.adrielus.xsession = { - enable = true; - initExtra = '' - polybar main & - ''; - }; -} diff --git a/modules/applications/postgres.nix b/modules/applications/postgres.nix deleted file mode 100644 index 232ea16..0000000 --- a/modules/applications/postgres.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs, lib, ... }: { - services.postgresql = { - enable = true; - package = pkgs.postgresql_10; - enableTCPIP = true; - - authentication = lib.mkForce '' - # Generated file; do not edit! - # TYPE DATABASE USER ADDRESS METHOD - local all all trust - host all all 127.0.0.1/32 trust - host all all ::1/128 trust - ''; - - initialScript = pkgs.writeText "backend-initScript" '' - CREATE ROLE adrielus WITH - LOGIN - SUPERUSER - INHERIT - CREATEDB - CREATEROLE - REPLICATION; - - CREATE DATABASE lunarbox; - GRANT ALL PRIVILEGES ON DATABASE lunarbox TO adrielus; - ''; - }; -} diff --git a/modules/applications/rofi/default.nix b/modules/applications/rofi/default.nix deleted file mode 100644 index 02bbd0c..0000000 --- a/modules/applications/rofi/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ pkgs, lib, ... }: -let - theme = pkgs.myThemes.current; - rofi = pkgs.rofi.override - { - plugins = with pkgs;[ - rofi-power-menu - rofi-calc - rofi-emoji - ]; - }; -in -{ - home-manager.users.adrielus = { - home.packages = [ rofi ]; - home.file.".local/share/rofi/themes".source = theme.rofi.themes or "/home/adrielus/.temp-empty-rofi-themes-directory"; - - xdg.configFile."rofi/config.rasi".text = '' - @import "${./pre.rasi}" - ${theme.rofi.config or ""} - ''; - }; -} diff --git a/modules/applications/rofi/pre.rasi b/modules/applications/rofi/pre.rasi deleted file mode 100644 index 73a23f8..0000000 --- a/modules/applications/rofi/pre.rasi +++ /dev/null @@ -1,5 +0,0 @@ -configuration { - location: 0; - cycle: true; - font: "Source Code Pro 16"; -} diff --git a/modules/applications/shells/aliases.nix b/modules/applications/shells/aliases.nix deleted file mode 100644 index a9f7b17..0000000 --- a/modules/applications/shells/aliases.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - # Ls but looks nicer - ls = "exa -la"; - - # What even is this??? - sl = "sl -e"; - - # WIfi stuff - wifi = "sudo nmcli con up id"; - - # Volume controls - "v-up" = "pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "v-down" = "pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "v-min" = "pactl set-sink-volume @DEFAULT_SINK@ 0%"; - "v-mid" = "pactl set-sink-volume @DEFAULT_SINK@ 50%"; - "v-max" = "pactl set-sink-volume @DEFAULT_SINK@ 100%"; - # "v-up" = "amixer set Master 8%+"; - # "v-down" = "amixer set Master 8%-"; - # "v-min" = "amixer set Master 0%"; - # "v-mid" = "amixer set Master 50%"; - # "v-max" = "amixer set Master 100%"; - - # Print available battery - battery = "acpi"; - - # Rebuuild nixos - rebuild = "sudo -u adrielus nixos-rebuild switch --flake ~/Projects/nixos-config/"; - - # Render git repo using gource - "git-render" = "gource -f -s 1 -c 4 --key"; - - # Neovide multigrid by default - neovide = "neovide --multigrid"; -} - diff --git a/modules/applications/shells/common.nix b/modules/applications/shells/common.nix deleted file mode 100644 index 60c2916..0000000 --- a/modules/applications/shells/common.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - shellInit = '' - export GITHUB_TOKEN=$(cat ~/water/gh-token) - ''; - # "neofetch --package_managers on --cpu_brand on --cpu_cores on --memory_percent on --memory_display infobar --os_arch on"; -} diff --git a/modules/applications/shells/default.nix b/modules/applications/shells/default.nix deleted file mode 100644 index 6adb9c4..0000000 --- a/modules/applications/shells/default.nix +++ /dev/null @@ -1 +0,0 @@ -{ pkgs, ... }: { imports = [ ./sessionVariables.nix ./fish.nix ]; } diff --git a/modules/applications/shells/fish.nix b/modules/applications/shells/fish.nix deleted file mode 100644 index 24a9e90..0000000 --- a/modules/applications/shells/fish.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ lib, pkgs, ... }: -let - shellAliases = import ./aliases.nix; - common = import ./common.nix; - - globalTheme = pkgs.myThemes.current; - theme = "dangerous"; - themePackage = builtins.getAttr theme pkgs.myFishPlugins.themes; # Dynamically pick the theme path - - defaultDangerousColors = "000000 333333 666666 ff4ff0 0088ff ff6600 ff0000 ff0033 3300ff 0000ff 00ffff 00ff00"; - dangerousColors = globalTheme.fish.dangerousColors or defaultDangerousColors; -in -{ - users.defaultUserShell = pkgs.fish; - home-manager.users.adrielus = { - programs.command-not-found.enable = false; - programs.nix-index.enable = true; - - # Source every file in the theme - xdg.configFile."fish/conf.d/plugin-${theme}.fish".text = lib.mkAfter '' - for f in $plugin_dir/*.fish - source $f - end - ''; - - programs.fish = { - inherit shellAliases; - - enable = true; - plugins = with pkgs; [ - myFishPlugins.z # jump around the file system with ease (might replace with autojump) - themePackage # theme - ]; - - shellInit = '' - source ${../../../dotfiles/fish/config.fish} - - # Source the entire oh-my-fish lib - for f in ${pkgs.myFishPlugins.oh-my-fish}/lib/git/**/*.fish - source $f - end - - - ${if theme == "dangerous" - then "set dangerous_colors ${dangerousColors}" - else ""} - - ${common.shellInit} - ''; - }; - }; -} diff --git a/modules/applications/shells/sessionVariables.nix b/modules/applications/shells/sessionVariables.nix deleted file mode 100644 index 8d5a66c..0000000 --- a/modules/applications/shells/sessionVariables.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs, ... }: -let - theme = pkgs.myThemes.current; - variables = { - # Configure github cli - GITHUB_USERNAME = "Mateiadrielrafael"; - - # Sets neovim as default editor - EDITOR = "nvim"; - - PNPM_HOME = "~/.PNPM_HOME"; - }; -in -{ - imports = [{ - home-manager.users.adrielus.home.sessionVariables = theme.env or { }; - }]; - - home-manager.users.adrielus.home.sessionVariables = variables; -} diff --git a/modules/applications/steam.nix b/modules/applications/steam.nix deleted file mode 100644 index 6af6788..0000000 --- a/modules/applications/steam.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: { - # 32 bit stuff - hardware.opengl.driSupport32Bit = true; - hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ]; - hardware.pulseaudio.support32Bit = true; - - home-manager.users.adrielus.home.packages = with pkgs; [ steam ]; -} diff --git a/modules/applications/tmux.nix b/modules/applications/tmux.nix deleted file mode 100644 index 927f344..0000000 --- a/modules/applications/tmux.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ pkgs, lib, ... }: -let - theme = pkgs.myThemes.current; - - fastcopy = pkgs.tmuxPlugins.mkTmuxPlugin - { - pluginName = "fastcopy"; - version = "unstable-2022-11-16"; - src = pkgs.fetchFromGitHub - { - owner = "abhinav"; - repo = "tmux-fastcopy"; - sha256 = "1ald4ycgwj1fhk82yvsy951kgnn5im53fhsscz20hvjsqql7j4j3"; - rev = "41f4c1c9fae7eb05c85ee2e248719f004dcfc90e"; - }; - }; - - cowboy = pkgs.tmuxPlugins.mkTmuxPlugin - { - pluginName = "cowboy"; - version = "unstable-2021-05-11"; - src = pkgs.fetchFromGitHub - { - owner = "tmux-plugins"; - repo = "tmux-cowboy"; - sha256 = "16wqwfaqy7nhiy1ijkng1x4baqq7s9if0m3ffcrnakza69s6r4r8"; - rev = "75702b6d0a866769dd14f3896e9d19f7e0acd4f2"; - }; - }; - - muxile = pkgs.callPackage ./tmux/muxile.nix { }; -in -{ - home-manager.users.adrielus.programs = { - tmux = { - enable = true; - - clock24 = true; # 24h clock format - # terminal = "screen-256color"; # more colors - historyLimit = 10000; # increase amount of saved lines - - plugins = with pkgs.tmuxPlugins; [ - # cpu # Show CPU load with easy icons - # vim-tmux-navigator # Switch between tmux and vim panes with ease - sessionist # Nicer workflow for switching around between session - # fastcopy # Easy copying of stuff - resurrect # Save / restore tmux sessions - # muxile # Track tmux sessions on my phone - # cowboy # kill all hanging processes inside pane - { - plugin = continuum; # start tmux on boot & more - extraConfig = '' - set -g @continuum-restore 'on' - set -g @continuum-boot 'on' - ''; - } - ]; - - extraConfig = '' - # Load current theme - source ${theme.tmux.path} - - # load the rest of the config - source ${../../dotfiles/tmux/tmux.conf} - ''; - }; - }; -} - diff --git a/modules/applications/tmux/muxile.nix b/modules/applications/tmux/muxile.nix deleted file mode 100644 index 8205fac..0000000 --- a/modules/applications/tmux/muxile.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: -let dependencies = [ pkgs.qrencode pkgs.jq pkgs.websocat ]; -in -pkgs.tmuxPlugins.mkTmuxPlugin -{ - pluginName = "muxile"; - version = "unstable-2021-08-08"; - src = pkgs.fetchFromGitHub - { - owner = "bjesus"; - repo = "muxile"; - sha256 = "12kmcyizzglr4r7nisjbjmwmw1g4hbwpkil53zzmq9wx60l8lwgb"; - rev = "7310995ed1827844a528a32bb2d3a3694f1c4a0d"; - }; - nativeBuildInputs = [ pkgs.makeWrapper ]; - postInstall = '' - for f in $target/scripts/*.sh; do - wrapProgram $f \ - --prefix PATH : ${lib.makeBinPath dependencies} - done - ''; -} diff --git a/modules/applications/vieb.nix b/modules/applications/vieb.nix deleted file mode 100644 index 3e6b43d..0000000 --- a/modules/applications/vieb.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, paths, ... }: -let vieb = "/home/adrielus/.config/Vieb"; in -{ - home-manager.users.adrielus = { - home.packages = [ pkgs.nixos-unstable.vieb ]; - systemd.user.tmpfiles.rules = [ - "L+ /home/adrielus/.viebrc - - - - ${paths.dotfiles}/vieb/.viebrc" - ]; - }; -} diff --git a/modules/applications/wakatime/default.nix b/modules/applications/wakatime/default.nix deleted file mode 100644 index 6c7779d..0000000 --- a/modules/applications/wakatime/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home = { - file.".wakatime.cfg".source = ./wakatime.cfg; - packages = with pkgs; [ wakatime ]; - }; -} diff --git a/modules/applications/wine.nix b/modules/applications/wine.nix deleted file mode 100644 index fae1fe0..0000000 --- a/modules/applications/wine.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs; [ - wineWowPackages.stable - winetricks - playonlinux - ]; -} diff --git a/modules/applications/xmodmap/.Xmodmap b/modules/applications/xmodmap/.Xmodmap deleted file mode 100644 index 20807b2..0000000 --- a/modules/applications/xmodmap/.Xmodmap +++ /dev/null @@ -1,8 +0,0 @@ -! Remap caps lock to control -clear Lock -! clear control -! add control = Caps_Lock Control_L Control_R -! New way of hitting caps lock -keycode 66 = Control_L Caps_Lock NoSymbol NoSymbol -keycode 0x42 = backslash - diff --git a/modules/applications/xmodmap/default.nix b/modules/applications/xmodmap/default.nix deleted file mode 100644 index 9f9a7b0..0000000 --- a/modules/applications/xmodmap/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home = { - packages = [ pkgs.xorg.xmodmap ]; - file.".Xmodmap".source = ./.Xmodmap; - }; - services.xserver.displayManager.sessionCommands = - "${pkgs.xorg.xmodmap}/bin/xmodmap .Xmodmap"; -} diff --git a/modules/applications/xmonad/.gitignore b/modules/applications/xmonad/.gitignore deleted file mode 100644 index 4c61acd..0000000 --- a/modules/applications/xmonad/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dist-newstyle \ No newline at end of file diff --git a/modules/applications/xmonad/Main.hs b/modules/applications/xmonad/Main.hs deleted file mode 100644 index aebe12e..0000000 --- a/modules/applications/xmonad/Main.hs +++ /dev/null @@ -1,116 +0,0 @@ -{-# LANGUAGE BlockArguments #-} - -import Control.Monad (forM_, join) -import Data.Function ((&)) -import System.Environment -import System.Process -import XMonad -import XMonad.Actions.SpawnOn -import XMonad.Config -import XMonad.Config.Kde -import XMonad.Hooks.EwmhDesktops (ewmh, fullscreenEventHook) -import XMonad.Hooks.ManageDocks -import XMonad.Layout.NoBorders -import XMonad.Layout.Spacing -import XMonad.Layout.ThreeColumns -import XMonad.Operations -import XMonad.Util.EZConfig - -kdeOn :: Bool -kdeOn = False - --- startingConfig = if kdeOn then kdeConfig else defaultConfig - -main = - xmonad $ - ewmh $ - docks $ - def - { modMask = mod4Mask, - layoutHook = myLayoutHook, - startupHook = startup, - manageHook = manageDocks <+> manageSpawn <+> myManagerHook <+> manageHook kdeConfig, - handleEventHook = handleEventHook kdeConfig <+> fullscreenEventHook, - terminal = myTerminal, - workspaces = myWorkspaces, - borderWidth = 5, - focusedBorderColor = "#4c4f69", - normalBorderColor = "#4c4f69" - } - `additionalKeysP` keymap - where - myWorkspaces = - ["1:dev", "2:browser", "3:chat", "4:reading", "5", "6"] - - appWorkspaceConfig = - [ (3, "Discord"), - (4, "alacritty"), - (2, "google-chrome-stable") - ] - - manageWorkspaces = - appWorkspaceConfig - & fmap \(workspaceId, name) -> do - let workspaceName = myWorkspaces !! (workspaceId - 1) - className =? name --> doShift workspaceName - - kdeFloats = - [ "yakuake", - "Yakuake", - "Kmix", - "kmix", - "plasma", - "Plasma", - "plasma-desktop", - "Plasma-desktop", - "krunner", - "ksplashsimple", - "ksplashqml", - "ksplashx" - ] - - floatKdeStuff = [className =? name --> doFloat | name <- kdeFloats] - - myManagerHook = - composeAll $ - concat - [ if kdeOn then floatKdeStuff else [], - manageWorkspaces - ] - - myTerminal = "alacritty" - myBrowser = "google-chrome-stable" - - -- TODO: find a way to bind all the program-opening-keybindings to a single sub-map - keymap = - [ ("M-p", spawn "rofi -show drun"), - ("M-w", spawn "rofi -show window"), - ("M-g", spawn myBrowser), - ("M-d", spawn "Discord"), - ("M-v", spawn "alacritty -e vimclip"), - ("M-s", spawn "spectacle -rcb"), - ("M-S-s", spawn "spectacle -mcb"), - ("M-C-s", spawn "spectacle -ucb"), - ("M-c", kill) - ] - - uniformBorder = join $ join $ join Border - border = uniformBorder 0 - spacingHook = spacingRaw False border False border True - - tall = Tall 1 (3 / 100) (1 / 2) - threeCols = ThreeCol 1 (3 / 100) (1 / 2) - - layouts = tall ||| threeCols ||| Full - myLayoutHook = desktopLayoutModifiers $ spacingHook layouts - - startupApps = - [ (0, "alacritty"), - (1, "google-chrome-stable"), - (2, "Discord") - ] - - startup :: X () - startup = do - forM_ startupApps \(index, app) -> do - spawnOn (myWorkspaces !! index) app diff --git a/modules/applications/xmonad/xmonad-config.cabal b/modules/applications/xmonad/xmonad-config.cabal deleted file mode 100644 index 1b3b5f5..0000000 --- a/modules/applications/xmonad/xmonad-config.cabal +++ /dev/null @@ -1,15 +0,0 @@ -cabal-version: 2.4 -name: xmonad-config -version: 0.1.0.0 -author: Matei Adriel -maintainer: rafaeladriel11@gmail.com --- The license under which the package is released. --- license: - -executable xmonad-config - main-is: Main.hs - build-depends: - , base - , xmonad - , X11 - default-language: Haskell2010 diff --git a/modules/applications/zathura.nix b/modules/applications/zathura.nix deleted file mode 100644 index 004593a..0000000 --- a/modules/applications/zathura.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs, lib, ... }: -let - theme = pkgs.myThemes.current; -in -{ - imports = [ - { - home-manager.users.adrielus.programs.zathura.enable = true; - } - ]; - home-manager.users.adrielus = lib.mkIf theme.zathura.enable { - xdg.configFile."zathura/${theme.zathura.name}".source = theme.zathura.theme; - programs.zathura = { - extraConfig = '' - include ${theme.zathura.name} - ''; - }; - }; -} diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix deleted file mode 100644 index c65911a..0000000 --- a/modules/bluetooth.nix +++ /dev/null @@ -1,48 +0,0 @@ -# Taken from https://nixos.wiki/wiki/Bluetooth -{ pkgs, ... }: { - hardware.bluetooth = { - enable = true; - settings = { - General = { - Enable = "Source,Sink,Media,Socket"; - }; - }; - }; - - services.blueman.enable = true; - - # TODO: investigate why this does not work - # systemd.user.services.mpris-proxy = { - # Unit.Description = "Mpris proxy"; - # Unit.After = [ "network.target" "sound.target" ]; - # Service.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; - # Install.WantedBy = [ "default.target" ]; - # }; - - hardware = { - pulseaudio = { - enable = true; - - # NixOS allows either a lightweight build (default) or full build of PulseAudio to be installed. - # Only the full build has Bluetooth support, so it must be selected here. - package = pkgs.pulseaudioFull; - - # Extra codecs - extraModules = [ pkgs.pulseaudio-modules-bt ]; - - configFile = pkgs.writeText "default.pa" '' - load-module module-bluetooth-policy - load-module module-bluetooth-discover - ## module fails to load with - ## module-bluez5-device.c: Failed to get device path from module arguments - ## module.c: Failed to load module "module-bluez5-device" (argument: ""): initialization failed. - load-module module-bluez5-device - # load-module module-bluez5-discover - ''; - - extraConfig = '' - load-module module-switch-on-connect - ''; - }; - }; -} diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100644 index 984fed5..0000000 --- a/modules/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ ... }: { - imports = [ - ./dev - ./applications - ./themes - ./overlays - ./meta - - ./network.nix - ./xserver.nix - ./users.nix - ./nix.nix - ./printers.nix - # ./bluetooth.nix - ]; - -} diff --git a/modules/dev/agda.nix b/modules/dev/agda.nix deleted file mode 100644 index b626b84..0000000 --- a/modules/dev/agda.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = [ pkgs.agda ]; -} diff --git a/modules/dev/default.nix b/modules/dev/default.nix deleted file mode 100644 index 4e849f8..0000000 --- a/modules/dev/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs; [ gcc ]; - imports = [ - ./nix.nix - ./purescript.nix - ./javascript.nix - ./rust.nix - ./dhall.nix - ./haskell - ./fsharp.nix - ./kotlin.nix - # ./racket.nix - # ./elm.nix - - # Proof assistants - # ./agda.nix - # ./idris.nix - ./lean.nix - ]; -} diff --git a/modules/dev/dhall.nix b/modules/dev/dhall.nix deleted file mode 100644 index 959091e..0000000 --- a/modules/dev/dhall.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs.easy-dhall-nix; [ - dhall-simple - dhall-json-simple - dhall-bash-simple - dhall-nix-simple - dhall-yaml-simple - dhall-lsp-simple - ]; -} diff --git a/modules/dev/elm.nix b/modules/dev/elm.nix deleted file mode 100644 index c768350..0000000 --- a/modules/dev/elm.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs; - with elmPackages; [ - elm - elm-format - # elm-repl - ]; -} diff --git a/modules/dev/fsharp.nix b/modules/dev/fsharp.nix deleted file mode 100644 index 7f47d43..0000000 --- a/modules/dev/fsharp.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs; [ - dotnet-sdk - mono - packet - ]; -} diff --git a/modules/dev/haskell/default.nix b/modules/dev/haskell/default.nix deleted file mode 100644 index f1d3829..0000000 --- a/modules/dev/haskell/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs, ... }: -{ - # Use more recent ghc versions - # nixpkgs.overlays = [ - # (self: super: { - # haskell.compiler.ghc902 = self.unstable.haskell.compiler.ghc902; - # }) - # ]; - - home-manager.users.adrielus.home = { - file.".ghci".source = ./ghci; - - packages = with pkgs; - [ ghc ghcid hlint cabal-install stack ] - - ++ (with haskellPackages; [ hoogle hpack ]); - }; -} diff --git a/modules/dev/haskell/ghci b/modules/dev/haskell/ghci deleted file mode 100644 index 4ea943a..0000000 --- a/modules/dev/haskell/ghci +++ /dev/null @@ -1,10 +0,0 @@ -:def paste \_ -> do { paste <- System.Process.readProcess "pbpaste" [] ""; let cmd = if '\n' `elem` paste then ":{\ntype Ö = ()\n" ++ paste ++ "\n:}" else paste in putStrLn ("\SOH\ESC[33m\STX" ++ paste ++ "\SOH\ESC[0m\STX") >> return (":cmd return " ++ show cmd) } -:def paste-quiet \_ -> do { paste <- System.Process.readProcess "pbpaste" [] ""; let cmd = if '\n' `elem` paste then ":{\ntype Ö = ()\n" ++ paste ++ "\n:}" else paste in return (":cmd return " ++ show cmd) } - -:def hoogle \str -> return $ ":! hoogle search --color --count=10 " ++ show str -:def hoogle-all \str -> return $ ":! hoogle search --color " ++ show str -:def doc \str -> return $ ":! hoogle search --color --info " ++ show str - --- :def pointfree \str -> return $ ":! pointfree " ++ show str --- :def pf \str -> return $ ":! pointfree " ++ show str --- :def pointful \str -> return $ ":! pointful " ++ show str \ No newline at end of file diff --git a/modules/dev/haskell/stack.yaml b/modules/dev/haskell/stack.yaml deleted file mode 100644 index a4e4688..0000000 --- a/modules/dev/haskell/stack.yaml +++ /dev/null @@ -1,5 +0,0 @@ -templates: - params: - author-name: "Matei Adriel" - author-email: "rafaeladriel11@gmail.com" - github-username: "Mateiadrielrafael" diff --git a/modules/dev/idris.nix b/modules/dev/idris.nix deleted file mode 100644 index 8ca1b21..0000000 --- a/modules/dev/idris.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus = { - - home.packages = with pkgs; [ - idris2 - idris2-pkgs.lsp # idris2 - ]; - }; -} diff --git a/modules/dev/javascript.nix b/modules/dev/javascript.nix deleted file mode 100644 index ba3fb6c..0000000 --- a/modules/dev/javascript.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs, ... }: -let - node = pkgs.nodejs; - yarn = pkgs.yarn.override { nodejs = node; }; -in -{ - - home-manager.users.adrielus.home.packages = with pkgs; - with nodePackages; [ - node - deno - node2nix - - unstable.nodePackages.pnpm - yarn - - # TODO: find a good way to reinstall some of these - /* tsdx - mklicense - preact-cli - create-next-app - create-snowpack-app - bower - */ - ]; -} diff --git a/modules/dev/kotlin.nix b/modules/dev/kotlin.nix deleted file mode 100644 index 14e293e..0000000 --- a/modules/dev/kotlin.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus = { - home.packages = with pkgs; [ - kotlin - gradle - jdk - android-studio - ]; - }; -} diff --git a/modules/dev/lean.nix b/modules/dev/lean.nix deleted file mode 100644 index 840df2f..0000000 --- a/modules/dev/lean.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs; [ - unstable.elan # lean version manager - ]; -} diff --git a/modules/dev/nix.nix b/modules/dev/nix.nix deleted file mode 100644 index b2b63bf..0000000 --- a/modules/dev/nix.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs; - [ - nixfmt - ]; -} diff --git a/modules/dev/purescript.nix b/modules/dev/purescript.nix deleted file mode 100644 index 87796c0..0000000 --- a/modules/dev/purescript.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs.unstable; [ - purescript - spago - # haskellPackages.zephyr - # purty # purescript formatter - # purs-tidy # purescript formatter - # pscid - # pulp - # psa - ]; -} diff --git a/modules/dev/racket.nix b/modules/dev/racket.nix deleted file mode 100644 index e39ff72..0000000 --- a/modules/dev/racket.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs; [ racket ]; -} diff --git a/modules/dev/rust.nix b/modules/dev/rust.nix deleted file mode 100644 index 95ea437..0000000 --- a/modules/dev/rust.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs; [ rustup rust-analyzer ]; -} diff --git a/modules/foreign.nix b/modules/foreign.nix deleted file mode 100644 index 7adc2a9..0000000 --- a/modules/foreign.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ fetchFromGitHub, ... }: { - vimPlugins = { - kmonad = fetchFromGitHub { - owner = "kmonad"; - repo = "kmonad-vim"; - rev = "37978445197ab00edeb5b731e9ca90c2b141723f"; - sha256 = "13p3i0b8azkmhafyv8hc4hav1pmgqg52xzvk2a3gp3ppqqx9bwpc"; - }; - - }; - fishPlugins = { - z = fetchFromGitHub { - owner = "jethrokuan"; - repo = "z"; - rev = "85f863f20f24faf675827fb00f3a4e15c7838d76"; - sha256 = "1kaa0k9d535jnvy8vnyxd869jgs0ky6yg55ac1mxcxm8n0rh2mgq"; - }; - - themes = { - agnoster = fetchFromGitHub { - owner = "oh-my-fish"; - repo = "theme-agnoster"; - rev = "c142e802983bd1b34b4d91efac2126fc5913126d"; - sha256 = "060yydkxmvmlzq2236pjqfmpgvm3g1085c5yzilq0nl1dvmz3wnh"; - }; - - harleen = fetchFromGitHub { - owner = "aneveux"; - repo = "theme-harleen"; - rev = "caf53d792038e78faa7b6b6b98669abc171c5e64"; - sha256 = "1450qrkdmqxk686c7vpimcydwj9z9a7w7sripfpjzkq6np5s6w8c"; - }; - - dangerous = fetchFromGitHub { - owner = "oh-my-fish"; - repo = "theme-dangerous"; - rev = "3cdfc82060ba280b44f1f0c6616675f36a275467"; - sha256 = "1xxy0b6rnvsfbaa6v7p0fsxi8l161sv4fq49ahra2hf5gzax4xis"; - }; - }; - - oh-my-fish = fetchFromGitHub { - owner = "oh-my-fish"; - repo = "oh-my-fish"; - rev = "d428b723c8c18fef3b2a00b8b8b731177f483ad8"; - sha256 = "0n5a8v9kn4xmmi7app6c4wvpjfv6b3vhj7rhljaf9vny8cl2vhls"; - }; - }; - - sddm-theme-chili = fetchFromGitHub { - owner = "MarianArlt"; - repo = "sddm-chili"; - rev = "6516d50176c3b34df29003726ef9708813d06271"; - sha256 = "036fxsa7m8ymmp3p40z671z163y6fcsa9a641lrxdrw225ssq5f3"; - }; - - easy-dhall-nix = fetchFromGitHub { - owner = "justinwoo"; - repo = "easy-dhall-nix"; - rev = "dce9acbb99776a7f1344db4751d6080380f76f57"; - sha256 = "0ckp6515gfvbxm08yyll87d9vg8sq2l21gwav2npzvwc3xz2lccf"; - }; - - easy-purescript-nix = fetchFromGitHub { - owner = "justinwoo"; - repo = "easy-purescript-nix"; - rev = "3d8b602e80c0fa7d97d7f03cb8e2f8b06967d509"; - sha256 = "0kvnsc4j0h8qvv69613781i2qy51rcbmv5ga8j21nsqzy3l8fd9w"; - }; - - githubNvimTheme = fetchFromGitHub { - owner = "projekt0n"; - repo = "github-nvim-theme"; - rev = "b3f15193d1733cc4e9c9fe65fbfec329af4bdc2a"; - sha256 = "0vnizbmzf42h3idm35nrcv4g2aigvgmgb80qk5s4xq1513bzrdf0"; - }; -} diff --git a/modules/helpers.nix b/modules/helpers.nix deleted file mode 100644 index 76a3e8f..0000000 --- a/modules/helpers.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ lib, ... }: { - mergeLines = lib.lists.foldr - (a: b: '' - ${a} - ${b} - '') ""; - - unwords = lib.lists.foldr (a: b: ''${a} ${b}'') ""; -} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix new file mode 100644 index 0000000..238f0cd --- /dev/null +++ b/modules/home-manager/default.nix @@ -0,0 +1,5 @@ +# (https://nixos.wiki/wiki/Module). + +{ + # example = import ./example.nix; +} diff --git a/modules/meta/default.nix b/modules/meta/default.nix deleted file mode 100644 index f6f7bca..0000000 --- a/modules/meta/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ pkgs, ... }: { - home-manager.sharedModules = [ ./simlink.nix ]; -} diff --git a/modules/meta/simlink.nix b/modules/meta/simlink.nix deleted file mode 100644 index cba8d4d..0000000 --- a/modules/meta/simlink.nix +++ /dev/null @@ -1,13 +0,0 @@ -# This is a home-manager config!!! -{ pkgs, lib, config, ... }: with lib; { - options.home.sfile = mkOption { - description = "Attribute set of files to link into the user home without placing them into the store first"; - default = { }; - type = types.attrsOf types.string; - }; - config.systemd.user.tmpfiles.rules = mapAttrsToList - (name: value: - "L+ ${name} - - - - ${value}" - ) - config.home.sfile; -} diff --git a/modules/network.nix b/modules/network.nix deleted file mode 100644 index 16556db..0000000 --- a/modules/network.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: { - networking = { - networkmanager.enable = true; - hostName = "nixos"; - - useDHCP = false; - interfaces.enp1s0.useDHCP = true; - interfaces.wlp0s20f3.useDHCP = true; - }; -} diff --git a/modules/nix.nix b/modules/nix.nix deleted file mode 100644 index abe91b7..0000000 --- a/modules/nix.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ pkgs, inputs, lib, config, ... }: { - nix = { - gc.automatic = true; - optimise.automatic = true; - - # Protect nix-shell from garbage collection - # TODO: look into whether this is still needed when using nix flakes - extraOptions = '' - keep-outputs = true - keep-derivations = true - experimental-features = nix-command flakes - ''; - - # This will add each flake input as a registry - # To make nix3 commands consistent with your flake - registry = lib.mapAttrs (_: value: { flake = value; }) inputs; - - # This will additionally add your inputs to the system's legacy channels - # Making legacy nix commands consistent as well, awesome! - # nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; - - settings = { - trusted-users = [ "root" "adrielus" "@wheel" ]; - - auto-optimise-store = true; - - # Caching and whatnot - substituters = [ - "https://cache.nixos.org" - "https://nix-community.cachix.org" - "https://cm-idris2-pkgs.cachix.org" - "https://danth.cachix.org" - # "https://all-hies.cachix.org" # Do I even use all-hies anymore? - ]; - - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cm-idris2-pkgs.cachix.org-1:YB2oJSEsD5oMJjAESxolC2GQtE6B5I6jkWhte2gtXjk=" - "danth.cachix.org-1:wpodfSL7suXRc/rJDZZUptMa1t4MJ795hemRN0q84vI=" - # "all-hies.cachix.org-1:JjrzAOEUsD9ZMt8fdFbzo3jNAyEWlPAwdVuHw4RD43k=" - ]; - }; - }; -} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 0000000..238f0cd --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,5 @@ +# (https://nixos.wiki/wiki/Module). + +{ + # example = import ./example.nix; +} diff --git a/modules/overlays/default.nix b/modules/overlays/default.nix deleted file mode 100644 index 0042485..0000000 --- a/modules/overlays/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, lib, ... }: { - nixpkgs.overlays = [ - (import ./tweakSources.nix) - (import ./npm.nix) - ((import ./myPackages.nix) { - inherit lib; - }) # Requires lib access - (import ./vimclip) - - # I hope this works (spoiler: it did not) - # (import ./edopro) - ]; -} diff --git a/modules/overlays/edopro/default.nix b/modules/overlays/edopro/default.nix deleted file mode 100644 index 405b4af..0000000 --- a/modules/overlays/edopro/default.nix +++ /dev/null @@ -1 +0,0 @@ -self: super: { edopro = self.callPackage (import ./edopro.nix) { }; } diff --git a/modules/overlays/edopro/edopro.nix b/modules/overlays/edopro/edopro.nix deleted file mode 100644 index 4e54a27..0000000 --- a/modules/overlays/edopro/edopro.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ pkgs ? import , ... }: -pkgs.stdenv.mkDerivation rec { - pname = "edopro"; - version = "39.2.0"; - rev = "20210927"; - - src = pkgs.fetchurl { - url = - "https://github.com/ProjectIgnis/edopro-assets/releases/download/${rev}/ProjectIgnis-EDOPro-${version}-linux.tar.gz"; - sha256 = "OQSWTuRaTyr2XIDjSbIvrV11LJCpOmw5aOjHU2ji+kI="; - }; - - buildInputs = [ pkgs.mono ]; - configurePhase = ""; - buildPhase = ""; - - installPhase = '' - mkdir -p $out/bin - ls - chmod +x ./EDOPro - mv ./* $out/bin/ - ''; -} diff --git a/modules/overlays/flakes.nix b/modules/overlays/flakes.nix deleted file mode 100644 index b2b7742..0000000 --- a/modules/overlays/flakes.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ system }: -{ home-manager - # nixos stuff -, nixpkgs -, nixpkgs-unstable -, nixos-unstable -, ... -}: self: super: -let - foreign = self.callPackage (import ../foreign.nix) { }; -in -{ - unstable = import nixpkgs-unstable { - inherit system; - config.allowUnfree = true; - config.allowBroken = true; - }; - - nixos-unstable = import nixos-unstable { - inherit system; - config.allowUnfree = true; - config.allowBroken = true; - }; - - easy-purescript-nix = self.callPackage foreign.easy-purescript-nix { }; - easy-dhall-nix = self.callPackage foreign.easy-dhall-nix { }; - - myFishPlugins = { - oh-my-fish = foreign.fishPlugins.oh-my-fish; - - z = { - src = foreign.fishPlugins.z; - name = "z"; - }; - - themes = { - agnoster = { - src = foreign.fishPlugins.themes.agnoster; - name = "agnoster"; - }; - - dangerous = { - src = foreign.fishPlugins.themes.dangerous; - name = "dangerous"; - }; - - harleen = { - src = foreign.fishPlugins.themes.harleen; - name = "harleen"; - }; - }; - }; - - - - # Vim plugins - myVimPlugins = { - githubNvimTheme = foreign.githubNvimTheme; - }; - - sddm-theme-chili = foreign.sddm-theme-chili; -} diff --git a/modules/overlays/legacy.nix b/modules/overlays/legacy.nix deleted file mode 100644 index 543e3f9..0000000 --- a/modules/overlays/legacy.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ ... }: -let - imports = import ../../nix/sources.nix; - edoproPackage = import ./../applications/edopro.nix; - unstable = import imports.nixpkgs-unstable { - config.allowUnfree = true; - config.allowBroken = true; - }; -in -{ - nixpkgs.overlays = [ - (self: super: - with self; rec { - inherit imports; - inherit unstable; - - inherit (import imports.niv { }) niv; - - cached-nix-shell = callPackage imports.cached-nix-shell { }; - easy-purescript-nix = callPackage imports.easy-purescript-nix { }; - easy-dhall-nix = callPackage imports.easy-dhall-nix { }; - - # This is a derivation I made myself for edopro - edopro = callPackage edoproPackage { }; - - all-hies = import imports.all-hies { }; - snack = (import imports.snack).snack-exe; - - # unstable stuff - brave = unstable.brave; - idris2 = unstable.idris2; - ngrok = unstable.ngrok; - vscodium = unstable.vscodium; - vscode = unstable.vscode; - docker-compose = unstable.docker-compose; - deno = unstable.deno; - dotnet-sdk = unstable.dotnet-sdk_5; - elm-repl = unstable.haskellPackages.elm-repl; - }) - ]; -} diff --git a/modules/overlays/myPackages.nix b/modules/overlays/myPackages.nix deleted file mode 100644 index b32205f..0000000 --- a/modules/overlays/myPackages.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ lib, ... }: -self: super: -let - allThemes = self.callPackage (import ../themes/themes.nix) { }; - # currentTheme = "github-light"; - currentTheme = "catppuccin-latte"; -in -with self; { - myHelpers = self.callPackage (import ../helpers.nix) { }; - myThemes = { - all = allThemes; - current = lib.lists.findFirst (theme: theme.name == currentTheme) - (throw '' - Theme "${currentTheme}" not found. - Available themes are: - ${lib.lists.foldr (current: prev: if prev == "" - then current.name - else "${current.name}, ${prev}") "" allThemes} - '') - allThemes; - }; -} - diff --git a/modules/overlays/npm.nix b/modules/overlays/npm.nix deleted file mode 100644 index cf8930f..0000000 --- a/modules/overlays/npm.nix +++ /dev/null @@ -1,15 +0,0 @@ -self: super: - -let - node = self.nodejs-18_x; - customPackages = (import ./npm) { nodejs = node; pkgs = self; }; -in -with self; { - nodejs = node; - - # Faster prettier for editors - prettierd = customPackages."@fsouza/prettierd"; - - # I need this for the css lang server thingy - vscode-langservers-extracted = customPackages."vscode-langservers-extracted"; -} diff --git a/modules/overlays/npm/default.nix b/modules/overlays/npm/default.nix deleted file mode 100644 index a10eaa3..0000000 --- a/modules/overlays/npm/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -# This file has been generated by node2nix 1.11.1. Do not edit! - -{pkgs ? import { - inherit system; - }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}: - -let - nodeEnv = import ./node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; - inherit pkgs nodejs; - libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; - }; -in -import ./node-packages.nix { - inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit; - inherit nodeEnv; -} diff --git a/modules/overlays/npm/node-env.nix b/modules/overlays/npm/node-env.nix deleted file mode 100644 index 2590dd2..0000000 --- a/modules/overlays/npm/node-env.nix +++ /dev/null @@ -1,598 +0,0 @@ -# This file originates from node2nix - -{lib, stdenv, nodejs, python2, pkgs, libtool, runCommand, writeTextFile, writeShellScript}: - -let - # Workaround to cope with utillinux in Nixpkgs 20.09 and util-linux in Nixpkgs master - utillinux = if pkgs ? utillinux then pkgs.utillinux else pkgs.util-linux; - - python = if nodejs ? python then nodejs.python else python2; - - # Create a tar wrapper that filters all the 'Ignoring unknown extended header keyword' noise - tarWrapper = runCommand "tarWrapper" {} '' - mkdir -p $out/bin - - cat > $out/bin/tar <> $out/nix-support/hydra-build-products - ''; - }; - - # Common shell logic - installPackage = writeShellScript "install-package" '' - installPackage() { - local packageName=$1 src=$2 - - local strippedName - - local DIR=$PWD - cd $TMPDIR - - unpackFile $src - - # Make the base dir in which the target dependency resides first - mkdir -p "$(dirname "$DIR/$packageName")" - - if [ -f "$src" ] - then - # Figure out what directory has been unpacked - packageDir="$(find . -maxdepth 1 -type d | tail -1)" - - # Restore write permissions to make building work - find "$packageDir" -type d -exec chmod u+x {} \; - chmod -R u+w "$packageDir" - - # Move the extracted tarball into the output folder - mv "$packageDir" "$DIR/$packageName" - elif [ -d "$src" ] - then - # Get a stripped name (without hash) of the source directory. - # On old nixpkgs it's already set internally. - if [ -z "$strippedName" ] - then - strippedName="$(stripHash $src)" - fi - - # Restore write permissions to make building work - chmod -R u+w "$strippedName" - - # Move the extracted directory into the output folder - mv "$strippedName" "$DIR/$packageName" - fi - - # Change to the package directory to install dependencies - cd "$DIR/$packageName" - } - ''; - - # Bundle the dependencies of the package - # - # Only include dependencies if they don't exist. They may also be bundled in the package. - includeDependencies = {dependencies}: - lib.optionalString (dependencies != []) ( - '' - mkdir -p node_modules - cd node_modules - '' - + (lib.concatMapStrings (dependency: - '' - if [ ! -e "${dependency.packageName}" ]; then - ${composePackage dependency} - fi - '' - ) dependencies) - + '' - cd .. - '' - ); - - # Recursively composes the dependencies of a package - composePackage = { name, packageName, src, dependencies ? [], ... }@args: - builtins.addErrorContext "while evaluating node package '${packageName}'" '' - installPackage "${packageName}" "${src}" - ${includeDependencies { inherit dependencies; }} - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - ''; - - pinpointDependencies = {dependencies, production}: - let - pinpointDependenciesFromPackageJSON = writeTextFile { - name = "pinpointDependencies.js"; - text = '' - var fs = require('fs'); - var path = require('path'); - - function resolveDependencyVersion(location, name) { - if(location == process.env['NIX_STORE']) { - return null; - } else { - var dependencyPackageJSON = path.join(location, "node_modules", name, "package.json"); - - if(fs.existsSync(dependencyPackageJSON)) { - var dependencyPackageObj = JSON.parse(fs.readFileSync(dependencyPackageJSON)); - - if(dependencyPackageObj.name == name) { - return dependencyPackageObj.version; - } - } else { - return resolveDependencyVersion(path.resolve(location, ".."), name); - } - } - } - - function replaceDependencies(dependencies) { - if(typeof dependencies == "object" && dependencies !== null) { - for(var dependency in dependencies) { - var resolvedVersion = resolveDependencyVersion(process.cwd(), dependency); - - if(resolvedVersion === null) { - process.stderr.write("WARNING: cannot pinpoint dependency: "+dependency+", context: "+process.cwd()+"\n"); - } else { - dependencies[dependency] = resolvedVersion; - } - } - } - } - - /* Read the package.json configuration */ - var packageObj = JSON.parse(fs.readFileSync('./package.json')); - - /* Pinpoint all dependencies */ - replaceDependencies(packageObj.dependencies); - if(process.argv[2] == "development") { - replaceDependencies(packageObj.devDependencies); - } - replaceDependencies(packageObj.optionalDependencies); - - /* Write the fixed package.json file */ - fs.writeFileSync("package.json", JSON.stringify(packageObj, null, 2)); - ''; - }; - in - '' - node ${pinpointDependenciesFromPackageJSON} ${if production then "production" else "development"} - - ${lib.optionalString (dependencies != []) - '' - if [ -d node_modules ] - then - cd node_modules - ${lib.concatMapStrings (dependency: pinpointDependenciesOfPackage dependency) dependencies} - cd .. - fi - ''} - ''; - - # Recursively traverses all dependencies of a package and pinpoints all - # dependencies in the package.json file to the versions that are actually - # being used. - - pinpointDependenciesOfPackage = { packageName, dependencies ? [], production ? true, ... }@args: - '' - if [ -d "${packageName}" ] - then - cd "${packageName}" - ${pinpointDependencies { inherit dependencies production; }} - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - fi - ''; - - # Extract the Node.js source code which is used to compile packages with - # native bindings - nodeSources = runCommand "node-sources" {} '' - tar --no-same-owner --no-same-permissions -xf ${nodejs.src} - mv node-* $out - ''; - - # Script that adds _integrity fields to all package.json files to prevent NPM from consulting the cache (that is empty) - addIntegrityFieldsScript = writeTextFile { - name = "addintegrityfields.js"; - text = '' - var fs = require('fs'); - var path = require('path'); - - function augmentDependencies(baseDir, dependencies) { - for(var dependencyName in dependencies) { - var dependency = dependencies[dependencyName]; - - // Open package.json and augment metadata fields - var packageJSONDir = path.join(baseDir, "node_modules", dependencyName); - var packageJSONPath = path.join(packageJSONDir, "package.json"); - - if(fs.existsSync(packageJSONPath)) { // Only augment packages that exist. Sometimes we may have production installs in which development dependencies can be ignored - console.log("Adding metadata fields to: "+packageJSONPath); - var packageObj = JSON.parse(fs.readFileSync(packageJSONPath)); - - if(dependency.integrity) { - packageObj["_integrity"] = dependency.integrity; - } else { - packageObj["_integrity"] = "sha1-000000000000000000000000000="; // When no _integrity string has been provided (e.g. by Git dependencies), add a dummy one. It does not seem to harm and it bypasses downloads. - } - - if(dependency.resolved) { - packageObj["_resolved"] = dependency.resolved; // Adopt the resolved property if one has been provided - } else { - packageObj["_resolved"] = dependency.version; // Set the resolved version to the version identifier. This prevents NPM from cloning Git repositories. - } - - if(dependency.from !== undefined) { // Adopt from property if one has been provided - packageObj["_from"] = dependency.from; - } - - fs.writeFileSync(packageJSONPath, JSON.stringify(packageObj, null, 2)); - } - - // Augment transitive dependencies - if(dependency.dependencies !== undefined) { - augmentDependencies(packageJSONDir, dependency.dependencies); - } - } - } - - if(fs.existsSync("./package-lock.json")) { - var packageLock = JSON.parse(fs.readFileSync("./package-lock.json")); - - if(![1, 2].includes(packageLock.lockfileVersion)) { - process.stderr.write("Sorry, I only understand lock file versions 1 and 2!\n"); - process.exit(1); - } - - if(packageLock.dependencies !== undefined) { - augmentDependencies(".", packageLock.dependencies); - } - } - ''; - }; - - # Reconstructs a package-lock file from the node_modules/ folder structure and package.json files with dummy sha1 hashes - reconstructPackageLock = writeTextFile { - name = "addintegrityfields.js"; - text = '' - var fs = require('fs'); - var path = require('path'); - - var packageObj = JSON.parse(fs.readFileSync("package.json")); - - var lockObj = { - name: packageObj.name, - version: packageObj.version, - lockfileVersion: 1, - requires: true, - dependencies: {} - }; - - function augmentPackageJSON(filePath, dependencies) { - var packageJSON = path.join(filePath, "package.json"); - if(fs.existsSync(packageJSON)) { - var packageObj = JSON.parse(fs.readFileSync(packageJSON)); - dependencies[packageObj.name] = { - version: packageObj.version, - integrity: "sha1-000000000000000000000000000=", - dependencies: {} - }; - processDependencies(path.join(filePath, "node_modules"), dependencies[packageObj.name].dependencies); - } - } - - function processDependencies(dir, dependencies) { - if(fs.existsSync(dir)) { - var files = fs.readdirSync(dir); - - files.forEach(function(entry) { - var filePath = path.join(dir, entry); - var stats = fs.statSync(filePath); - - if(stats.isDirectory()) { - if(entry.substr(0, 1) == "@") { - // When we encounter a namespace folder, augment all packages belonging to the scope - var pkgFiles = fs.readdirSync(filePath); - - pkgFiles.forEach(function(entry) { - if(stats.isDirectory()) { - var pkgFilePath = path.join(filePath, entry); - augmentPackageJSON(pkgFilePath, dependencies); - } - }); - } else { - augmentPackageJSON(filePath, dependencies); - } - } - }); - } - } - - processDependencies("node_modules", lockObj.dependencies); - - fs.writeFileSync("package-lock.json", JSON.stringify(lockObj, null, 2)); - ''; - }; - - prepareAndInvokeNPM = {packageName, bypassCache, reconstructLock, npmFlags, production}: - let - forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com"; - in - '' - # Pinpoint the versions of all dependencies to the ones that are actually being used - echo "pinpointing versions of dependencies..." - source $pinpointDependenciesScriptPath - - # Patch the shebangs of the bundled modules to prevent them from - # calling executables outside the Nix store as much as possible - patchShebangs . - - # Deploy the Node.js package by running npm install. Since the - # dependencies have been provided already by ourselves, it should not - # attempt to install them again, which is good, because we want to make - # it Nix's responsibility. If it needs to install any dependencies - # anyway (e.g. because the dependency parameters are - # incomplete/incorrect), it fails. - # - # The other responsibilities of NPM are kept -- version checks, build - # steps, postprocessing etc. - - export HOME=$TMPDIR - cd "${packageName}" - runHook preRebuild - - ${lib.optionalString bypassCache '' - ${lib.optionalString reconstructLock '' - if [ -f package-lock.json ] - then - echo "WARNING: Reconstruct lock option enabled, but a lock file already exists!" - echo "This will most likely result in version mismatches! We will remove the lock file and regenerate it!" - rm package-lock.json - else - echo "No package-lock.json file found, reconstructing..." - fi - - node ${reconstructPackageLock} - ''} - - node ${addIntegrityFieldsScript} - ''} - - npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} rebuild - - if [ "''${dontNpmInstall-}" != "1" ] - then - # NPM tries to download packages even when they already exist if npm-shrinkwrap is used. - rm -f npm-shrinkwrap.json - - npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} install - fi - ''; - - # Builds and composes an NPM package including all its dependencies - buildNodePackage = - { name - , packageName - , version ? null - , dependencies ? [] - , buildInputs ? [] - , production ? true - , npmFlags ? "" - , dontNpmInstall ? false - , bypassCache ? false - , reconstructLock ? false - , preRebuild ? "" - , dontStrip ? true - , unpackPhase ? "true" - , buildPhase ? "true" - , meta ? {} - , ... }@args: - - let - extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" "meta" ]; - in - stdenv.mkDerivation ({ - name = "${name}${if version == null then "" else "-${version}"}"; - buildInputs = [ tarWrapper python nodejs ] - ++ lib.optional (stdenv.isLinux) utillinux - ++ lib.optional (stdenv.isDarwin) libtool - ++ buildInputs; - - inherit nodejs; - - inherit dontStrip; # Stripping may fail a build for some package deployments - inherit dontNpmInstall preRebuild unpackPhase buildPhase; - - compositionScript = composePackage args; - pinpointDependenciesScript = pinpointDependenciesOfPackage args; - - passAsFile = [ "compositionScript" "pinpointDependenciesScript" ]; - - installPhase = '' - source ${installPackage} - - # Create and enter a root node_modules/ folder - mkdir -p $out/lib/node_modules - cd $out/lib/node_modules - - # Compose the package and all its dependencies - source $compositionScriptPath - - ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }} - - # Create symlink to the deployed executable folder, if applicable - if [ -d "$out/lib/node_modules/.bin" ] - then - ln -s $out/lib/node_modules/.bin $out/bin - - # Patch the shebang lines of all the executables - ls $out/bin/* | while read i - do - file="$(readlink -f "$i")" - chmod u+rwx "$file" - patchShebangs "$file" - done - fi - - # Create symlinks to the deployed manual page folders, if applicable - if [ -d "$out/lib/node_modules/${packageName}/man" ] - then - mkdir -p $out/share - for dir in "$out/lib/node_modules/${packageName}/man/"* - do - mkdir -p $out/share/man/$(basename "$dir") - for page in "$dir"/* - do - ln -s $page $out/share/man/$(basename "$dir") - done - done - fi - - # Run post install hook, if provided - runHook postInstall - ''; - - meta = { - # default to Node.js' platforms - platforms = nodejs.meta.platforms; - } // meta; - } // extraArgs); - - # Builds a node environment (a node_modules folder and a set of binaries) - buildNodeDependencies = - { name - , packageName - , version ? null - , src - , dependencies ? [] - , buildInputs ? [] - , production ? true - , npmFlags ? "" - , dontNpmInstall ? false - , bypassCache ? false - , reconstructLock ? false - , dontStrip ? true - , unpackPhase ? "true" - , buildPhase ? "true" - , ... }@args: - - let - extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ]; - in - stdenv.mkDerivation ({ - name = "node-dependencies-${name}${if version == null then "" else "-${version}"}"; - - buildInputs = [ tarWrapper python nodejs ] - ++ lib.optional (stdenv.isLinux) utillinux - ++ lib.optional (stdenv.isDarwin) libtool - ++ buildInputs; - - inherit dontStrip; # Stripping may fail a build for some package deployments - inherit dontNpmInstall unpackPhase buildPhase; - - includeScript = includeDependencies { inherit dependencies; }; - pinpointDependenciesScript = pinpointDependenciesOfPackage args; - - passAsFile = [ "includeScript" "pinpointDependenciesScript" ]; - - installPhase = '' - source ${installPackage} - - mkdir -p $out/${packageName} - cd $out/${packageName} - - source $includeScriptPath - - # Create fake package.json to make the npm commands work properly - cp ${src}/package.json . - chmod 644 package.json - ${lib.optionalString bypassCache '' - if [ -f ${src}/package-lock.json ] - then - cp ${src}/package-lock.json . - chmod 644 package-lock.json - fi - ''} - - # Go to the parent folder to make sure that all packages are pinpointed - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - - ${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }} - - # Expose the executables that were installed - cd .. - ${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} - - mv ${packageName} lib - ln -s $out/lib/node_modules/.bin $out/bin - ''; - } // extraArgs); - - # Builds a development shell - buildNodeShell = - { name - , packageName - , version ? null - , src - , dependencies ? [] - , buildInputs ? [] - , production ? true - , npmFlags ? "" - , dontNpmInstall ? false - , bypassCache ? false - , reconstructLock ? false - , dontStrip ? true - , unpackPhase ? "true" - , buildPhase ? "true" - , ... }@args: - - let - nodeDependencies = buildNodeDependencies args; - extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "unpackPhase" "buildPhase" ]; - in - stdenv.mkDerivation ({ - name = "node-shell-${name}${if version == null then "" else "-${version}"}"; - - buildInputs = [ python nodejs ] ++ lib.optional (stdenv.isLinux) utillinux ++ buildInputs; - buildCommand = '' - mkdir -p $out/bin - cat > $out/bin/shell <