├── nvim ├── .gitignore ├── init.lua ├── stylua.toml ├── README.md ├── lua │ ├── plugins │ │ ├── nixos.lua │ │ ├── mongo.lua │ │ ├── sidekick.lua │ │ ├── lsp.lua │ │ ├── fun.lua │ │ ├── integration.lua │ │ ├── snacks.lua │ │ ├── metals.lua │ │ ├── http.lua │ │ ├── ui.lua │ │ ├── coding.lua │ │ ├── dashboard.lua │ │ ├── editor.lua │ │ └── picker.lua │ └── config │ │ ├── autocmds.lua │ │ ├── keymaps_colemak.lua │ │ ├── options.lua │ │ ├── init.lua │ │ ├── neovide.lua │ │ ├── keymaps.lua │ │ └── keymaps_lazyvim.lua ├── lazyvim.json ├── syntax │ └── play2-routes.vim └── lazy-lock.json ├── nix ├── pkgs │ └── default.nix ├── system │ ├── modules │ │ ├── steam.nix │ │ ├── locale.nix │ │ ├── telegram.nix │ │ ├── torrent.nix │ │ ├── keyboard.nix │ │ ├── rust.nix │ │ ├── android.nix │ │ ├── sound.nix │ │ ├── bluetooth.nix │ │ ├── mongodb.nix │ │ ├── coolercontrol.nix │ │ ├── fonts.nix │ │ ├── zeroad.nix │ │ ├── visualvm.nix │ │ ├── browser.nix │ │ ├── nginx.nix │ │ ├── users.nix │ │ ├── python.nix │ │ ├── network.nix │ │ ├── boot.nix │ │ ├── coding.nix │ │ ├── packages.nix │ │ ├── sway.nix │ │ ├── common.nix │ │ ├── linux.nix │ │ ├── open-bafang-tool.nix │ │ ├── nix.nix │ │ ├── shell.nix │ │ ├── stylix.nix │ │ └── cooklang-chef-nginx.nix │ ├── lichess │ │ ├── default.nix │ │ ├── lila.nix │ │ ├── packages.nix │ │ └── nginx.nix │ ├── crom │ │ ├── motherboard.nix │ │ ├── keyd.nix │ │ ├── default.nix │ │ ├── amdgpu.nix │ │ └── hardware.nix │ └── fw │ │ ├── ectool.nix │ │ ├── default.nix │ │ ├── hardware.nix │ │ └── keyd.nix ├── home │ ├── modules │ │ ├── mongodb.nix │ │ ├── easyeffects.nix │ │ ├── skyrim.nix │ │ ├── wine.nix │ │ ├── zed.nix │ │ ├── scala.nix │ │ ├── neovim.nix │ │ ├── ssh.nix │ │ ├── stream.nix │ │ ├── xdg.nix │ │ ├── lila.nix │ │ ├── cli.nix │ │ ├── lazygit.nix │ │ ├── lan-mouse.nix │ │ ├── mongoshrc.js │ │ ├── git.nix │ │ ├── waybar.nix │ │ ├── kitty.nix │ │ ├── zsh.nix │ │ └── sway.nix │ ├── wallpaper │ │ ├── xp.jpg │ │ ├── fsm1.jpg │ │ └── spider.jpg │ ├── fw │ │ ├── default.nix │ │ ├── sway.nix │ │ └── waybar.nix │ ├── crom │ │ ├── default.nix │ │ ├── sway.nix │ │ ├── waybar.nix │ │ └── s-tui.nix │ ├── services │ │ ├── lila-http.nix │ │ ├── cooklang-chef.nix │ │ ├── gammarelay.nix │ │ ├── fishnet-prod.nix │ │ ├── fishnet-local.nix │ │ ├── lichess-mod-auth-stream.nix │ │ ├── disposable-email.nix │ │ ├── puzzler.nix │ │ └── lila.nix │ └── common.nix └── overlays │ └── default.nix ├── cfg ├── sc2 │ ├── readme │ ├── battlenet.sh │ ├── starcraft.sh │ ├── battlenet-install.sh │ └── customak.SC2Hotkeys ├── zed │ ├── keymap.json │ └── settings.json └── zmk │ └── glove80.keymap ├── scripts ├── doom-ping.sh ├── keyboard-switch-notify.sh ├── systemctl-toggle.sh ├── screenshot.sh └── mongo-ssh.sh ├── doc ├── recipes.md ├── nixos-install.md └── localhost-ssl-cert-https-dev.md ├── README.md ├── flake.nix ├── thibault.duplessis.public_key.gpg └── flake.lock /nvim/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | -------------------------------------------------------------------------------- /nix/pkgs/default.nix: -------------------------------------------------------------------------------- 1 | pkgs: { } 2 | -------------------------------------------------------------------------------- /nvim/init.lua: -------------------------------------------------------------------------------- 1 | require("config.init") 2 | -------------------------------------------------------------------------------- /cfg/sc2/readme: -------------------------------------------------------------------------------- 1 | battlenet no longer works, so start with starcraft.sh 2 | -------------------------------------------------------------------------------- /nix/system/modules/steam.nix: -------------------------------------------------------------------------------- 1 | { ... }: { programs.steam.enable = true; } 2 | -------------------------------------------------------------------------------- /nvim/stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | indent_width = 2 3 | column_width = 120 -------------------------------------------------------------------------------- /nix/home/modules/mongodb.nix: -------------------------------------------------------------------------------- 1 | { ... }: { home.file.".mongoshrc.js".source = ./mongoshrc.js; } 2 | -------------------------------------------------------------------------------- /nix/home/wallpaper/xp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ornicar/dotfiles/HEAD/nix/home/wallpaper/xp.jpg -------------------------------------------------------------------------------- /nix/system/lichess/default.nix: -------------------------------------------------------------------------------- 1 | { ... }: { imports = [ ./packages.nix ./lila.nix ./nginx.nix ]; } 2 | -------------------------------------------------------------------------------- /nix/home/wallpaper/fsm1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ornicar/dotfiles/HEAD/nix/home/wallpaper/fsm1.jpg -------------------------------------------------------------------------------- /nix/home/wallpaper/spider.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ornicar/dotfiles/HEAD/nix/home/wallpaper/spider.jpg -------------------------------------------------------------------------------- /nvim/README.md: -------------------------------------------------------------------------------- 1 | # ornicar's vim 2 | 3 | My NeoVim config based on [LazyVim](https://github.com/LazyVim/LazyVim). 4 | -------------------------------------------------------------------------------- /nix/system/modules/locale.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | time.timeZone = "Europe/Paris"; 3 | i18n.defaultLocale = "en_US.UTF-8"; 4 | } 5 | -------------------------------------------------------------------------------- /nix/system/modules/telegram.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ telegram-desktop ]; 4 | } 5 | -------------------------------------------------------------------------------- /nix/system/modules/torrent.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ transmission_4-gtk ]; 4 | } 5 | -------------------------------------------------------------------------------- /nix/system/lichess/lila.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | 3 | programs.java.enable = true; 4 | 5 | services.redis.servers."".enable = true; 6 | } 7 | -------------------------------------------------------------------------------- /nix/home/modules/easyeffects.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | 3 | services.easyeffects = { 4 | enable = true; 5 | preset = "easyeffects-fw16"; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /nix/system/modules/keyboard.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | console.keyMap = "colemak"; 4 | 5 | environment.systemPackages = with pkgs; [ keyd wev ]; 6 | } 7 | -------------------------------------------------------------------------------- /scripts/doom-ping.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | while ! ping -c 1 141.94.252.178 >/dev/null 2>&1; do 4 | sleep 1 5 | done 6 | 7 | playerctl -p spotify play-pause 8 | -------------------------------------------------------------------------------- /doc/recipes.md: -------------------------------------------------------------------------------- 1 | ## change open file limit of process 2 | 3 | like when pipewire-pulse complains about "Too many open files" 4 | 5 | ```sh 6 | _ prlimit --pid 2671 --nofile=4096:524288 7 | ``` 8 | -------------------------------------------------------------------------------- /nix/system/modules/rust.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ 4 | cargo 5 | cargo-watch 6 | rustc 7 | rust-analyzer 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /nix/home/modules/skyrim.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | # https://www.nexusmods.com/skyrimspecialedition/mods/91500?tab=files&file_id=464258 4 | home.packages = with pkgs; [ protontricks p7zip zenity ]; 5 | } 6 | -------------------------------------------------------------------------------- /nix/system/modules/android.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | programs.adb.enable = true; 4 | users.users.thib.extraGroups = [ "adbusers" ]; 5 | 6 | environment.systemPackages = with pkgs; [ android-studio ]; 7 | } 8 | -------------------------------------------------------------------------------- /nix/system/modules/sound.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ pavucontrol ]; 4 | 5 | services.pipewire = { 6 | enable = true; 7 | pulse.enable = true; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /scripts/keyboard-switch-notify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | swaymsg input type:keyboard xkb_switch_layout next 3 | swaymsg -t get_inputs | jq 'map(select(has("xkb_active_layout_name")))[0].xkb_active_layout_name' | xargs notify-send -t 1000 -- 4 | -------------------------------------------------------------------------------- /nix/system/modules/bluetooth.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | let enable = false; # save energy until we need it 3 | in { 4 | hardware.bluetooth.enable = enable; 5 | hardware.bluetooth.powerOnBoot = false; 6 | services.blueman.enable = enable; 7 | } 8 | -------------------------------------------------------------------------------- /scripts/systemctl-toggle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | service=$1 4 | systemctl="systemctl --user" 5 | 6 | if $systemctl is-active --quiet $service; then 7 | $systemctl stop $service 8 | else 9 | $systemctl start $service 10 | fi 11 | -------------------------------------------------------------------------------- /nix/system/modules/mongodb.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ mongodb-ce mongodb-tools mongosh ]; 4 | 5 | services.mongodb = { 6 | package = pkgs.mongodb-ce; 7 | enable = true; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /nix/system/modules/coolercontrol.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ 4 | coolercontrol.coolercontrold 5 | coolercontrol.coolercontrol-gui 6 | ]; 7 | 8 | programs.coolercontrol = { enable = true; }; 9 | } 10 | -------------------------------------------------------------------------------- /nix/home/modules/wine.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | home.packages = with pkgs; [ 4 | (wineWowPackages.full.override { 5 | wineRelease = "staging"; 6 | mingwSupport = true; 7 | }) 8 | winetricks 9 | protontricks 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /nix/system/modules/fonts.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | # more in stylix.nix 3 | fonts.packages = with pkgs; [ 4 | font-awesome # installed for waybar icons 5 | jetbrains-mono # terminal 6 | # iosevka-bin 7 | nerd-fonts.jetbrains-mono 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /nix/system/modules/zeroad.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ zeroad ]; 4 | 5 | networking = { 6 | firewall = { 7 | allowedTCPPorts = [ 20595 ]; 8 | allowedUDPPorts = [ 20595 ]; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /nix/system/modules/visualvm.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ visualvm ]; 4 | 5 | # https://github.com/oracle/visualvm/issues/403#issuecomment-1152895277 6 | environment.sessionVariables = { _JAVA_AWT_WM_NONREPARENTING = 1; }; 7 | } 8 | -------------------------------------------------------------------------------- /cfg/sc2/battlenet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # https://nixos.wiki/wiki/Battle.net 4 | 5 | export WINEARCH=win64 6 | export WINEPREFIX=$HOME/.wine-battlenet 7 | 8 | winetricks dxvk 9 | 10 | wine64 ~/.wine-battlenet/dosdevices/c:/Program\ Files\ \(x86\)/Battle.net/Battle.net.exe 11 | -------------------------------------------------------------------------------- /cfg/sc2/starcraft.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # https://nixos.wiki/wiki/Battle.net 4 | 5 | export WINEARCH=win64 6 | export WINEPREFIX=$HOME/.wine-battlenet 7 | 8 | winetricks dxvk 9 | 10 | wine64 ~/.wine-battlenet/dosdevices/c:/Program\ Files\ \(x86\)/StarCraft\ II/Support/SC2Switcher.exe 11 | -------------------------------------------------------------------------------- /nvim/lua/plugins/nixos.lua: -------------------------------------------------------------------------------- 1 | -- mason doesn't work on nixos 2 | return { 3 | { "mason-org/mason-lspconfig.nvim", enabled = false }, 4 | { "mason-org/mason.nvim", enabled = false }, 5 | { "mfussenegger/nvim-dap", enabled = false }, 6 | 7 | { "lukas-reineke/lsp-format.nvim", enabled = true }, 8 | } 9 | -------------------------------------------------------------------------------- /nix/home/modules/zed.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: { 2 | home.packages = with pkgs; [ zed-editor ]; 3 | 4 | # Use the external dotfiles zed config for quicker hacking 5 | home.file.".config/zed".source = config.lib.file.mkOutOfStoreSymlink 6 | "${config.home.homeDirectory}/dotfiles/zed"; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /scripts/screenshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$1" = "clipboard" ]; then 4 | grim -g "$(slurp)" - | wl-copy 5 | notify-send -t 1000 "Screenshot -> clipboard" 6 | else 7 | FILENAME="screenshot-`date +%F-%T`" 8 | grim -g "$(slurp)" $FILENAME.png 9 | notify-send $FILENAME -t 3000 10 | fi 11 | -------------------------------------------------------------------------------- /nix/system/crom/motherboard.nix: -------------------------------------------------------------------------------- 1 | { config, ... }: { 2 | 3 | # fan controller 4 | boot.kernelModules = [ "nct6687" ]; 5 | boot.extraModulePackages = with config.boot.kernelPackages; [ nct6687d ]; 6 | 7 | services.hardware.openrgb = { 8 | enable = true; 9 | motherboard = "amd"; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /nix/system/modules/browser.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ 4 | firefox 5 | google-chrome 6 | # brave 7 | ]; 8 | 9 | programs.firefox = { 10 | enable = true; 11 | autoConfig = '' 12 | pref("key_toggleMute", 0); 13 | ''; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /nix/home/fw/default.nix: -------------------------------------------------------------------------------- 1 | # frame.work 16 home config 2 | { ... }: { 3 | imports = [ 4 | ../common.nix 5 | ../modules/easyeffects.nix 6 | ./sway.nix 7 | ./waybar.nix 8 | ../modules/wine.nix 9 | ]; 10 | 11 | # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion 12 | home.stateVersion = "24.05"; 13 | } 14 | -------------------------------------------------------------------------------- /nix/home/modules/scala.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | 3 | # https://scalacenter.github.io/bloop/docs/server-reference#custom-java-options 4 | 5 | home.file."./.sbtrc".text = '' 6 | alias c=compile 7 | alias cc=~compile 8 | alias r=run 9 | alias l=reload 10 | alias p=project 11 | alias t=test 12 | alias tt=~testQuick 13 | ''; 14 | } 15 | -------------------------------------------------------------------------------- /nvim/lua/plugins/mongo.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "jrop/mongo.nvim", 4 | lazy = true, 5 | keys = { 6 | { "om", "Mongoconnect lichess", desc = "MongoDB connect" }, 7 | { "omc", "Mongocollections", desc = "MongoDB collections" }, 8 | { "omq", "Mongoquery", desc = "MongoDB collections" }, 9 | }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /cfg/sc2/battlenet-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # https://nixos.wiki/wiki/Battle.net 4 | 5 | INSTALLER_FILE=~/Downloads/Battle.net-Setup.exe 6 | 7 | wget --output-document $INSTALLER_FILE 'https://downloader.battle.net//download/getInstallerForGame?os=win&gameProgram=BATTLENET_APP&version=Live' 8 | 9 | export WINEARCH=win64 10 | export WINEPREFIX=$HOME/.wine-battlenet 11 | 12 | winetricks dxvk 13 | 14 | wine64 $INSTALLER_FILE 15 | -------------------------------------------------------------------------------- /cfg/zed/keymap.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "context": "Workspace", 4 | "bindings": {} 5 | }, 6 | { 7 | "context": "Editor", 8 | "bindings": {} 9 | }, 10 | { 11 | "context": "VimControl && !menu", 12 | "bindings": { 13 | "e": "vim::Up", 14 | "n": "vim::Down", 15 | "shift-n": ["vim::Down", 3], 16 | "j": "vim::MoveToNextMatch", 17 | "J": "vim::MoveToPrevMatch" 18 | } 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /nix/system/modules/nginx.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ nginx ]; 4 | 5 | security.acme = { 6 | acceptTerms = true; 7 | defaults.email = "t@lichess.org"; 8 | }; 9 | 10 | services.nginx = { 11 | enable = true; 12 | enableReload = true; 13 | commonHttpConfig = '' 14 | 15 | proxy_cache_path /tmp/nginx-cache keys_zone=static_pages:2m; 16 | ''; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /nix/system/modules/users.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | users.users = { 3 | thib = { 4 | isNormalUser = true; 5 | extraGroups = [ "wheel" "video" "nginx" "dialout" ]; 6 | homeMode = "750"; # for nginx to read assets 7 | }; 8 | }; 9 | 10 | security.sudo = { 11 | execWheelOnly = true; 12 | wheelNeedsPassword = true; 13 | extraConfig = '' 14 | Defaults timestamp_timeout=600 15 | ''; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /nix/system/lichess/packages.nix: -------------------------------------------------------------------------------- 1 | { pkgs, inputs, ... }: { 2 | 3 | imports = [ ../modules/mongodb.nix ]; 4 | 5 | environment.systemPackages = with pkgs; [ 6 | # jdk24 7 | jdk25 8 | sbt 9 | bloop 10 | coursier # required by metals 11 | metals 12 | dart-sass 13 | redis 14 | fishnet 15 | # fontforge-gtk # icon font editor 16 | inkscape 17 | inputs.bbpPairings.packages.x86_64-linux.default 18 | inputs.picfit.defaultPackage.x86_64-linux 19 | ]; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /nix/system/modules/python.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | environment.systemPackages = with pkgs; 3 | [ 4 | (python3.withPackages (ps: 5 | with ps; [ 6 | requests 7 | gitpython 8 | tldextract 9 | dnspython 10 | httpx 11 | h2 12 | websocket-client 13 | pymongo 14 | chess 15 | networkx 16 | pydot 17 | zstandard 18 | urllib3 19 | numpy 20 | ])) 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /nvim/lua/config/autocmds.lua: -------------------------------------------------------------------------------- 1 | -- Autocmds are automatically loaded on the VeryLazy event 2 | -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua 3 | -- Add any additional autocmds here 4 | 5 | -- trim white space 6 | -- vim.api.nvim_create_autocmd("BufWritePre", { command = "%s/\\s\\+$//e" }) 7 | 8 | vim.cmd([[ 9 | " play2 10 | au BufRead,BufNewFile */conf/\(*\|\)routes set filetype=play2-routes 11 | au BufRead,BufNewFile */conf/*.conf setf hocon 12 | ]]) 13 | -------------------------------------------------------------------------------- /nix/system/modules/network.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ networkmanagerapplet iw ]; 4 | 5 | networking = { 6 | firewall = { 7 | enable = true; 8 | extraPackages = with pkgs; [ ipset ]; 9 | }; 10 | nftables.enable = true; # the new iptables 11 | networkmanager.enable = true; 12 | stevenblack.enable = true; 13 | # networkmanager.dns = "none"; 14 | useDHCP = false; 15 | dhcpcd.enable = false; 16 | nameservers = [ "1.1.1.1" "1.0.0.1" "8.8.8.8" "8.8.4.4" ]; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /nix/home/crom/default.nix: -------------------------------------------------------------------------------- 1 | # desktop PC home config 2 | { ... }: { 3 | imports = [ 4 | ../common.nix 5 | ../modules/stream.nix 6 | # ../modules/wine.nix 7 | # ../modules/skyrim.nix 8 | ../services/disposable-email.nix 9 | ../services/puzzler.nix 10 | ../services/lichess-mod-auth-stream.nix 11 | ../services/cooklang-chef.nix 12 | # ../services/fishnet-prod.nix 13 | 14 | ./sway.nix 15 | ./waybar.nix 16 | ./s-tui.nix 17 | ]; 18 | 19 | # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion 20 | home.stateVersion = "24.05"; 21 | } 22 | -------------------------------------------------------------------------------- /nix/system/modules/boot.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | boot = { 4 | loader = { 5 | systemd-boot.enable = true; 6 | efi.canTouchEfiVariables = true; 7 | timeout = 1; 8 | }; 9 | kernelPackages = pkgs.linuxPackages_latest; 10 | kernel.sysctl = { 11 | "fs.inotify.max_user_watches" = "1048576"; 12 | "vm.dirty_writeback_centisecs" = "2500"; 13 | # https://www.techtarget.com/searchdatacenter/definition/Linux-swappiness 14 | # default was 60 15 | "vm.swappiness" = "30"; 16 | }; 17 | kernelParams = [ "nmi_watchdog=0" ]; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /cfg/zed/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "assistant": { 3 | "default_model": { 4 | "provider": "anthropic", 5 | "model": "claude-3-5-sonnet-latest" 6 | }, 7 | "version": "2" 8 | }, 9 | "telemetry": { 10 | "metrics": true 11 | }, 12 | "vim_mode": true, 13 | "cursor_blink": false, 14 | "vertical_scroll_margin": 5, 15 | "ui_font_size": 22, 16 | "buffer_font_size": 22, 17 | "theme": { 18 | "mode": "dark", 19 | "light": "Catppuccin Latte", 20 | "dark": "JetBrains New Dark" 21 | }, 22 | "theme_overrides": { 23 | "editor.background": "#1f1e22000" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /nix/home/services/lila-http.nix: -------------------------------------------------------------------------------- 1 | { config, ... }: { 2 | 3 | systemd.user.services.lila-http = let 4 | dir = "${config.home.homeDirectory}/lila-http"; 5 | lila-http = "${dir}/target/release/lila-http"; 6 | redis-url = "redis://localhost"; 7 | bind = "127.0.0.1:3882"; 8 | in { 9 | Unit = { 10 | Description = "Cooklang chef"; 11 | After = [ "network-online.target" ]; 12 | }; 13 | Service = { 14 | ExecStart = "${lila-http} --redis-url ${redis-url} --bind ${bind}"; 15 | WorkingDirectory = dir; 16 | }; 17 | Install = { WantedBy = [ "default.target" ]; }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /nix/system/modules/coding.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ 4 | git 5 | neovim 6 | neovide 7 | gh 8 | gh-copilot 9 | gcc 10 | gnumake 11 | go 12 | luarocks 13 | stylua 14 | tree-sitter 15 | python3 16 | ruby 17 | scala-cli 18 | nodejs_24 19 | delta 20 | pyright 21 | taplo # TOML language server 22 | marksman # markdown language server 23 | http-server 24 | meld 25 | ansible 26 | openssl 27 | fx # tui json viewer 28 | goaccess 29 | copilot-cli 30 | pnpm 31 | esbuild 32 | ]; 33 | } 34 | -------------------------------------------------------------------------------- /nix/home/services/cooklang-chef.nix: -------------------------------------------------------------------------------- 1 | { config, ... }: { 2 | 3 | systemd.user.services.cooklang-chef = let 4 | recipes = "${config.home.homeDirectory}/recipes"; 5 | chef = "${config.home.homeDirectory}/cooklang-chef/target/release/chef"; 6 | port = "9801"; 7 | in { 8 | Unit = { 9 | Description = "Cooklang chef"; 10 | After = [ "network-online.target" ]; 11 | }; 12 | Service = { 13 | ExecStart = 14 | "${chef} serve --port ${port} --host --path ${recipes} --disable-open-editor"; 15 | WorkingDirectory = recipes; 16 | }; 17 | Install = { WantedBy = [ "default.target" ]; }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /nix/home/modules/neovim.nix: -------------------------------------------------------------------------------- 1 | # The idea is to symlink dotfiles/nvim into .config/nvim, 2 | # because I don't want nix to manage my nvim config. LazyVim does it. 3 | { pkgs, config, ... }: { 4 | 5 | home.packages = with pkgs; [ 6 | lua-language-server 7 | yaml-language-server 8 | vscode-langservers-extracted 9 | prettierd 10 | shfmt 11 | nodePackages_latest.typescript-language-server 12 | copilot-language-server 13 | ]; 14 | 15 | # Use the external dotfiles nvim config for quicker hacking 16 | home.file.".config/nvim".source = config.lib.file.mkOutOfStoreSymlink 17 | "${config.home.homeDirectory}/dotfiles/nvim"; 18 | 19 | # stylix.targets.neovim.enable = false; 20 | } 21 | -------------------------------------------------------------------------------- /nix/system/fw/ectool.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = [ pkgs.fw-ectool ]; 4 | 5 | systemd.services.thib-ectool-monitor = { 6 | description = "Read fan RPM from ectool and write to /tmp/ectool-fan-rpm"; 7 | wantedBy = [ "multi-user.target" ]; 8 | script = let 9 | sed = "${pkgs.gnused}/bin/sed"; 10 | ectool = "${pkgs.fw-ectool}/bin/ectool"; 11 | in '' 12 | while : 13 | do 14 | rpm1=$(${ectool} pwmgetfanrpm | ${sed} -rn 's/Fan 0 RPM: ([0-9]+)/\1/p') 15 | rpm2=$(${ectool} pwmgetfanrpm | ${sed} -rn 's/Fan 1 RPM: ([0-9]+)/\1/p') 16 | echo "$rpm1 $rpm2" > /tmp/ectool-fan-rpm 17 | sleep 2 18 | done 19 | ''; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /nix/home/services/gammarelay.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | environment.systemPackages = with pkgs; 3 | [ 4 | wl-gammarelay-rs # redshift for wayland 5 | ]; 6 | 7 | systemd.user.services.gammarelay = { 8 | Unit = { 9 | Description = 10 | "DBus interface to control display temperature and brightness under wayland"; 11 | PartOf = [ "graphical-session.target" ]; 12 | After = [ "graphical-session.target" ]; 13 | ConditionEnvironment = "WAYLAND_DISPLAY"; 14 | }; 15 | Service = { 16 | Type = "dbus"; 17 | BusName = "rs.wl-gammarelay"; 18 | ExecStart = pkgs.wl-gammarelay-rs; 19 | }; 20 | Install = { WantedBy = [ "graphical-session.target" ]; }; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Thibs' NixOs config 2 | 3 | This is my personal [NixOs](https://nixos.org/) configurations for my machines. 4 | It's not meant to be used by anyone else, but feel free to take inspiration from it. 5 | 6 | - `nix/home/` contains my [home-manager](https://github.com/nix-community/home-manager) configuration 7 | - `nix/system/` contains my [NixOs](https://nixos.org/) configuration 8 | - `flake.nix` is the entry point from which all machines are configured 9 | - `nvim/` contains my [neovim](https://neovim.io/) configuration 10 | 11 | Thanks to: 12 | 13 | - 14 | - 15 | - The [knight who says Nix](https://www.youtube.com/@vimjoyer) 16 | -------------------------------------------------------------------------------- /nix/home/services/fishnet-prod.nix: -------------------------------------------------------------------------------- 1 | { config, ... }: { 2 | systemd.user.services.fishnet-prod = let 3 | fishnet = "${config.home.homeDirectory}/fishnet"; 4 | release = "${fishnet}/target/release"; 5 | in { 6 | Unit = { 7 | Description = "Fishnet prod"; 8 | After = [ "network-online.target" ]; 9 | }; 10 | Service = { 11 | ExecStart = 12 | "${release}/fishnet --conf ${fishnet}/fishnet.ini --auto-update"; 13 | KillMode = "mixed"; 14 | WorkingDirectory = release; 15 | ReadWriteDirectories = release; 16 | Nice = 19; 17 | PrivateTmp = true; 18 | DevicePolicy = "closed"; 19 | ProtectSystem = "full"; 20 | }; 21 | Install = { WantedBy = [ "default.target" ]; }; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /nix/system/modules/packages.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ 4 | wayland 5 | wlr-randr 6 | wdisplays # visual monitor manager 7 | wget 8 | tldr 9 | xdg-utils 10 | glib 11 | ffmpeg 12 | btop 13 | htop 14 | zip 15 | unzip 16 | dtrx 17 | signal-desktop 18 | neofetch 19 | spotify 20 | playerctl 21 | gimp 22 | gthumb 23 | feh 24 | libnotify 25 | nautilus 26 | stockfish 27 | lm_sensors 28 | gping # ping with a graph 29 | trippy # network diagnostic https://github.com/fujiapple852/trippy 30 | mpv-unwrapped 31 | vlc 32 | evince # pdf viewer 33 | ghostscript 34 | libreoffice-qt 35 | imagemagick 36 | ]; 37 | } 38 | -------------------------------------------------------------------------------- /nvim/lazyvim.json: -------------------------------------------------------------------------------- 1 | { 2 | "extras": [ 3 | "lazyvim.plugins.extras.ai.copilot", 4 | "lazyvim.plugins.extras.ai.copilot-chat", 5 | "lazyvim.plugins.extras.ai.sidekick", 6 | "lazyvim.plugins.extras.coding.blink", 7 | "lazyvim.plugins.extras.coding.mini-surround", 8 | "lazyvim.plugins.extras.editor.inc-rename", 9 | "lazyvim.plugins.extras.editor.snacks_explorer", 10 | "lazyvim.plugins.extras.editor.snacks_picker", 11 | "lazyvim.plugins.extras.lang.json", 12 | "lazyvim.plugins.extras.lang.python", 13 | "lazyvim.plugins.extras.lang.rust", 14 | "lazyvim.plugins.extras.lang.yaml", 15 | "lazyvim.plugins.extras.ui.edgy" 16 | ], 17 | "install_version": 7, 18 | "news": { 19 | "NEWS.md": "11866" 20 | }, 21 | "version": 8 22 | } -------------------------------------------------------------------------------- /nix/home/services/fishnet-local.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: { 2 | 3 | systemd.user.services.fishnet-local = 4 | let fishnet-dir = "${config.home.homeDirectory}/fishnet"; 5 | in { 6 | Unit = { 7 | Description = "Fishnet client"; 8 | After = [ "network-online.target" ]; 9 | }; 10 | Service = { 11 | ExecStart = 12 | "${pkgs.fishnet}/bin/fishnet --conf ${fishnet-dir}/fishnet.ini.local.analysis"; 13 | KillMode = "mixed"; 14 | WorkingDirectory = fishnet-dir; 15 | ReadWriteDirectories = fishnet-dir; 16 | Nice = 19; 17 | PrivateTmp = true; 18 | DevicePolicy = "closed"; 19 | ProtectSystem = "full"; 20 | }; 21 | Install = { WantedBy = [ "default.target" ]; }; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /nix/home/services/lichess-mod-auth-stream.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: { 2 | 3 | systemd.user.services = let scala-cli = "${pkgs.scala-cli}/bin/scala-cli"; 4 | in { 5 | lichess-mod-auth-stream = { 6 | Unit = { 7 | Description = "Lichess mod"; 8 | After = [ "network-online.target" ]; 9 | }; 10 | Install = { WantedBy = [ "default.target" ]; }; 11 | Service = { 12 | WorkingDirectory = "${config.home.homeDirectory}/lichess-mod"; 13 | ExecStart = "${scala-cli} auth-http-stream.sc"; 14 | StandardOutput = "journal"; 15 | StandardError = "journal"; 16 | SyslogIdentifier = "lichess-mod-auth-stream"; 17 | Restart = "always"; 18 | RestartSec = 5; 19 | RuntimeMaxSec = 900; 20 | }; 21 | }; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /nix/system/crom/keyd.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | services.keyd = { 3 | enable = true; 4 | keyboards = { 5 | glove = { 6 | ids = [ "16c0:27db" ]; 7 | settings = { 8 | main = { leftcontrol = "layer(leftcontrol)"; }; 9 | "leftcontrol:C" = { 10 | j = "down"; 11 | k = "up"; 12 | comma = "C-tab"; 13 | m = "C-S-tab"; 14 | # h = "left"; 15 | # u = "right"; ctrl+l focuses the address bar 16 | }; 17 | }; 18 | }; 19 | kone = { 20 | ids = [ "1e7d:afca" ]; 21 | settings = { 22 | main = { 23 | # enables prev/next in zulip 24 | mouse1 = "A-left"; 25 | mouse2 = "A-right"; 26 | }; 27 | }; 28 | }; 29 | }; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /nix/system/modules/sway.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ 4 | sway 5 | glib # gsettings 6 | swaylock 7 | swayidle 8 | grim 9 | slurp 10 | mako # notification daemon 11 | wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout 12 | bemenu # wayland clone of dmenu 13 | xdg-utils 14 | waybar 15 | ]; 16 | 17 | programs.sway = { 18 | enable = true; 19 | wrapperFeatures.gtk = true; 20 | }; 21 | 22 | hardware.graphics.enable = true; 23 | 24 | # required for hm sway? https://nixos.wiki/wiki/Sway 25 | security.polkit.enable = true; 26 | 27 | # faster sway maybe? https://nixos.wiki/wiki/Sway 28 | security.pam.loginLimits = [{ 29 | domain = "@users"; 30 | item = "rtprio"; 31 | type = "-"; 32 | value = 1; 33 | }]; 34 | } 35 | -------------------------------------------------------------------------------- /nix/home/modules/ssh.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | 3 | { 4 | programs.ssh = { 5 | enable = true; 6 | enableDefaultConfig = false; 7 | matchBlocks = { "*" = { forwardAgent = true; }; }; 8 | extraConfig = '' 9 | Host fw 10 | HostName 192.168.1.3 11 | User thib 12 | Host crom 13 | HostName 192.168.1.2 14 | User thib 15 | Host crom-pub 16 | HostName 82.64.134.116 17 | User thib 18 | Host crom-forward 19 | HostName 82.64.134.116 20 | User thib 21 | LocalForward 27017 localhost:27017 22 | LocalForward 9663 localhost:9663 23 | LocalForward 9664 localhost:9664 24 | Host github-nokey 25 | HostName github.com 26 | User git 27 | IdentityFile ~/.ssh/id_nokey 28 | ''; 29 | }; 30 | 31 | services.ssh-agent.enable = true; 32 | } 33 | -------------------------------------------------------------------------------- /nvim/lua/config/keymaps_colemak.lua: -------------------------------------------------------------------------------- 1 | local map = vim.keymap.set 2 | 3 | -- next -> down 4 | -- map("", "n", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) 5 | map("", "n", "j") 6 | -- Faster viewport scrolling 7 | map("", "N", "v:count == 0 ? '3gj' : '3j'", { expr = true, silent = true }) 8 | -- down -> next 9 | map("n", "j", "n") 10 | -- join lines -> previous 11 | map("n", "J", "N") 12 | -- new mapping for join 13 | map("n", "j", "J") 14 | 15 | -- end -> up 16 | -- map("", "e", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) 17 | map("", "e", "k") 18 | -- Faster viewport scrolling 19 | map("", "E", "v:count == 0 ? '3gk' : '3k'", { expr = true, silent = true }) 20 | -- up -> end 21 | map("n", "k", "e") 22 | map("v", "k", "e") 23 | -- program -> end inclusive 24 | map("n", "K", "E") 25 | 26 | map("", "H", "^") 27 | map("", "L", "$") 28 | -------------------------------------------------------------------------------- /nvim/lua/plugins/sidekick.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { "copilot.lua" }, 3 | { 4 | "folke/sidekick.nvim", 5 | opts = { 6 | cli = { 7 | mux = { 8 | backend = "zellij", 9 | enabled = false, 10 | }, 11 | }, 12 | }, 13 | keys = { 14 | { 15 | "", 16 | function() 17 | -- if there is a next edit, jump to it, otherwise apply it if any 18 | if not require("sidekick").nes_jump_or_apply() then 19 | return "" -- fallback to normal tab 20 | end 21 | end, 22 | expr = true, 23 | desc = "Goto/Apply Next Edit Suggestion", 24 | }, 25 | { 26 | "aa", 27 | function() 28 | require("sidekick.cli").toggle() 29 | end, 30 | desc = "Sidekick Toggle CLI", 31 | }, 32 | }, 33 | }, 34 | } 35 | -------------------------------------------------------------------------------- /nix/system/modules/common.nix: -------------------------------------------------------------------------------- 1 | { outputs, ... }: { 2 | nixpkgs.config.allowUnfree = true; 3 | 4 | nixpkgs = { 5 | # You can add overlays here 6 | overlays = [ 7 | # Add overlays your own flake exports (from overlays and pkgs dir): 8 | outputs.overlays.additions 9 | outputs.overlays.modifications 10 | ]; 11 | }; 12 | 13 | imports = [ 14 | ./boot.nix 15 | ./coding.nix 16 | ./rust.nix 17 | ./fonts.nix 18 | ./keyboard.nix 19 | ./linux.nix 20 | ./locale.nix 21 | ./mongodb.nix 22 | ./network.nix 23 | ./nginx.nix 24 | ./nix.nix 25 | ./packages.nix 26 | ./python.nix 27 | ./shell.nix 28 | ./sound.nix 29 | ./stylix.nix 30 | ./sway.nix 31 | ./users.nix 32 | ./browser.nix 33 | ./visualvm.nix 34 | # ../modules/telegram.nix 35 | # ./zeroad.nix 36 | ]; 37 | 38 | services.dbus.enable = true; 39 | } 40 | -------------------------------------------------------------------------------- /nix/system/modules/linux.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ 4 | fzf 5 | fd 6 | jq 7 | bat 8 | httpie 9 | mosh 10 | dust 11 | psmisc # fuser 12 | lsof 13 | bind 14 | gparted 15 | dmidecode 16 | pciutils 17 | usbutils 18 | unixtools.xxd 19 | iprange 20 | ps_mem 21 | bc # calculator 22 | unixtools.netstat 23 | ]; 24 | 25 | # enable zsh completion for system packages 26 | environment.pathsToLink = [ "/share/zsh" ]; 27 | 28 | services.logind.settings.Login = { 29 | HandlePowerKey = "suspend"; 30 | HandleLidSwitch = "suspend"; 31 | }; 32 | 33 | # automount removable media 34 | services.devmon.enable = true; 35 | services.gvfs.enable = true; 36 | services.udisks2.enable = true; 37 | 38 | services.openssh = { 39 | enable = true; 40 | settings = { PasswordAuthentication = false; }; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /nix/home/common.nix: -------------------------------------------------------------------------------- 1 | { config, ... }: { 2 | imports = [ 3 | ./modules/cli.nix 4 | ./modules/scala.nix 5 | ./modules/lila.nix 6 | ./modules/git.nix 7 | ./modules/kitty.nix 8 | ./modules/lazygit.nix 9 | ./modules/mongodb.nix 10 | ./modules/neovim.nix 11 | # ./modules/zed.nix 12 | ./modules/ssh.nix 13 | ./modules/sway.nix 14 | ./modules/waybar.nix 15 | ./modules/xdg.nix 16 | ./modules/zsh.nix 17 | # ./modules/lan-mouse.nix 18 | 19 | ./services/lila.nix 20 | # ./services/lila-http.nix 21 | # ./services/fishnet-local.nix 22 | # ./services/gammarelay.nix 23 | ]; 24 | 25 | home = rec { 26 | username = "thib"; 27 | homeDirectory = "/home/${username}"; 28 | file.".local/bin".source = 29 | config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/dotfiles/scripts"; 30 | }; 31 | 32 | programs.home-manager.enable = true; 33 | 34 | # Nicely reload system units when changing configs 35 | systemd.user.startServices = "sd-switch"; 36 | } 37 | -------------------------------------------------------------------------------- /nix/home/modules/stream.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: { 2 | 3 | programs.obs-studio.enable = true; 4 | 5 | programs.zsh.shellAliases = lib.mkAfter { 6 | streamvoice = 7 | "google-chrome-stable --user-data-dir=/home/thib/stream-voice/chrome-voice-data-dir --app=file:///home/thib/stream-voice/index.html &"; 8 | streamtv = 9 | "google-chrome-stable --user-data-dir=/home/thib/stream-voice/chrome-tv-data-dir --app=https://lichess.org/tv &"; 10 | streamyt = 11 | "google-chrome-stable --user-data-dir=/home/thib/stream-voice/chrome-tv-data-dir --app=https://youtube.com &"; 12 | }; 13 | 14 | home.packages = [ pkgs.showmethekey ]; 15 | 16 | wayland.windowManager.sway.extraConfig = lib.mkAfter '' 17 | for_window [title="Floating Window - Show Me The Key"] floating enable, sticky enable, resize set width 400px height 100px, move position 2000px 1000px 18 | 19 | for_window [title="www.twitch.tv/ornicar2 voice"] floating enable, resize set width 500px height 49px, move position 3050px 2088px 20 | ''; 21 | } 22 | -------------------------------------------------------------------------------- /nix/system/modules/open-bafang-tool.nix: -------------------------------------------------------------------------------- 1 | { pkgs, options, ... }: { 2 | 3 | # openbafangtool 4 | programs.nix-ld.enable = true; 5 | ## If needed, you can add missing libraries here. nix-index-database is your friend to 6 | ## find the name of the package from the error message, like: 7 | ## $ nix run github:mic92/nix-index-database missinglib.so 8 | ## More details: https://github.com/nix-community/nix-index-database, you might like 9 | programs.nix-ld.libraries = options.programs.nix-ld.libraries.default 10 | ++ (with pkgs; [ 11 | electron 12 | glib 13 | nss 14 | nspr 15 | atk 16 | cups 17 | dbus 18 | dbus-glib 19 | libdrm 20 | gtk2 21 | gtk3 22 | pango 23 | cairo 24 | xorg.libX11 25 | xorg.libXcomposite 26 | xorg.libXdamage 27 | xorg.libXext 28 | xorg.libXfixes 29 | xorg.libXrandr 30 | libgbm 31 | expat 32 | xorg.libxcb 33 | libxkbcommon 34 | alsa-lib 35 | libusb1 36 | ]); 37 | } 38 | -------------------------------------------------------------------------------- /nix/home/modules/xdg.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | # for electron apps 3 | home.sessionVariables.DEFAULT_BROWSER = "firefox"; 4 | 5 | xdg.mimeApps = { 6 | enable = true; 7 | defaultApplications = let browser = "firefox.desktop"; 8 | in { 9 | "text/html" = [ browser ]; 10 | "x-scheme-handler/http" = [ browser ]; 11 | "x-scheme-handler/https" = [ browser ]; 12 | "x-scheme-handler/about" = [ browser ]; 13 | "x-scheme-handler/unknown" = [ browser ]; 14 | "application/pdf" = [ "evince.desktop" browser ]; 15 | 16 | "image/png" = [ "gthumb.desktop" ]; 17 | "image/jpeg" = [ "gthumb.desktop" ]; 18 | "image/gif" = [ "gthumb.desktop" ]; 19 | 20 | "audio/mpeg" = [ "vlc.desktop" ]; 21 | "audio/flac" = [ "vlc.desktop" ]; 22 | 23 | "video/mp4" = [ "vlc.desktop" ]; 24 | "video/quicktime" = [ "vlc.desktop" ]; 25 | 26 | "inode/directory" = [ "org.gnome.Nautilus.desktop" ]; 27 | 28 | "text/markdown" = "nvim.desktop"; 29 | "text/plain" = "nvim.desktop"; 30 | }; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /nix/home/modules/lila.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | let 3 | home = config.home.homeDirectory; 4 | lila-deploy = "cd ${home}/lila; python bin/deploy"; 5 | in { 6 | 7 | home.sessionVariables = { 8 | # for lila/ui/build to find the sass executable 9 | SASS_PATH = "${pkgs.dart-sass}/bin/dart-sass"; 10 | }; 11 | programs.zsh.shellAliases = { 12 | # deploy 13 | "stage-assets" = "${lila-deploy} snafu-assets"; 14 | "stage-server" = "${lila-deploy} snafu-server"; 15 | "prod-assets" = "${lila-deploy} manta-assets"; 16 | "prod-server" = "${lila-deploy} manta-server"; 17 | }; 18 | programs.ssh.extraConfig = lib.mkAfter '' 19 | Host manta 20 | HostName manta.lichess.ovh 21 | User root 22 | Host kaiju 23 | HostName kaiju.lichess.ovh 24 | User root 25 | Host rodan 26 | HostName rodan.lichess.ovh 27 | User root 28 | Host snafu 29 | HostName 141.94.96.141 30 | User root 31 | Host rubik-nokey 32 | HostName rubik.lichess.ovh 33 | User root 34 | IdentityFile ~/.ssh/id_nokey 35 | ''; 36 | } 37 | -------------------------------------------------------------------------------- /nix/system/modules/nix.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, inputs, config, ... }: { 2 | 3 | environment.systemPackages = with pkgs; [ nix-search-cli nixfmt-classic nil ]; 4 | 5 | nix = let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; 6 | in { 7 | settings = { 8 | # Enable flakes and new 'nix' command 9 | experimental-features = "nix-command flakes"; 10 | # Opinionated: disable global registry 11 | flake-registry = ""; 12 | # Workaround for https://github.com/NixOS/nix/issues/9574 13 | nix-path = config.nix.nixPath; 14 | }; 15 | # Opinionated: disable channels 16 | channel.enable = false; 17 | 18 | # Opinionated: make flake registry and nix path match flake inputs 19 | registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; 20 | nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; 21 | }; 22 | 23 | home-manager = { 24 | useGlobalPkgs = true; 25 | useUserPackages = true; 26 | }; 27 | 28 | programs.nh = { 29 | enable = true; 30 | clean.enable = true; 31 | clean.extraArgs = "--keep-since 4d --keep 3"; 32 | flake = "/home/thib/dotfiles"; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /nvim/lua/config/options.lua: -------------------------------------------------------------------------------- 1 | -- Options are automatically loaded before lazy.nvim startup 2 | -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua 3 | -- Add any additional options here 4 | 5 | vim.g.mapleader = "," 6 | vim.g.maplocalleader = "," 7 | 8 | -- vim.opt.mouse = "" -- mouse mode is required for neovide middle-click paste 9 | vim.opt.relativenumber = false -- Relative line numbers 10 | vim.opt.scrolloff = 9 -- Lines of context 11 | 12 | vim.opt.backup = false -- Don't store backup while overwriting the file 13 | vim.opt.writebackup = false -- Don't store backup while overwriting the file 14 | vim.opt.swapfile = false -- Use an SCM instead of swap files 15 | 16 | vim.opt.virtualedit = "block" -- Allow going past the end of line in visual block mode 17 | 18 | -- for edgy: Default splitting will cause your main splits to jump when opening an edgebar. 19 | -- To prevent this, set `splitkeep` to either `screen` or `topline`. 20 | vim.opt.splitkeep = "screen" 21 | 22 | vim.g.deprecation_warnings = true 23 | vim.g.snacks_animate = false 24 | 25 | if vim.g.neovide then 26 | require("config.neovide") 27 | end 28 | -------------------------------------------------------------------------------- /nix/home/services/disposable-email.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: { 2 | systemd.user.services.disposable = let home = config.home.homeDirectory; 3 | in { 4 | Unit = { 5 | Description = "Updates and pushes disposable emails"; 6 | After = [ "ssh-agent.service" ]; 7 | }; 8 | Install = { WantedBy = [ "multi-user.target" ]; }; 9 | Service = { 10 | ExecStart = pkgs.writeShellScript "disposable-update.sh" '' 11 | git pull origin master 12 | python .generate 13 | git add . 14 | git commit -m "auto update domains" 15 | git push publish-nokey publish 16 | ''; 17 | Type = "oneshot"; 18 | WorkingDirectory = "${home}/disposable"; 19 | Environment = "PATH=$PATH:/run/current-system/sw/bin"; 20 | }; 21 | }; 22 | systemd.user.timers.disposable-timer = { 23 | Unit = { 24 | Description = "Runs disposable nightly"; 25 | Requires = [ "disposable.service" ]; 26 | }; 27 | Timer = { 28 | Unit = "disposable.service"; 29 | # every night at 1am 30 | OnCalendar = "*-*-* 01:00:00"; 31 | }; 32 | Install = { WantedBy = [ "timers.target" ]; }; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /nix/system/fw/default.nix: -------------------------------------------------------------------------------- 1 | # fw is my frame.work 16 2 | { pkgs, inputs, ... }: { 3 | imports = [ 4 | ./hardware.nix 5 | inputs.nixos-hardware.nixosModules.framework-16-7040-amd 6 | ./ectool.nix 7 | ./keyd.nix 8 | ../lichess 9 | ../modules/common.nix 10 | ../modules/bluetooth.nix 11 | ../modules/torrent.nix 12 | ../modules/steam.nix 13 | # ../modules/coolercontrol.nix 14 | ]; 15 | 16 | environment.systemPackages = with pkgs; [ powertop libinput acpi ]; 17 | 18 | networking = { 19 | hostName = "fw"; 20 | extraHosts = '' 21 | 192.168.1.2 crom 22 | ''; 23 | }; 24 | 25 | programs.nm-applet.enable = true; 26 | 27 | powerManagement.enable = true; 28 | 29 | # as per https://github.com/NixOS/nixos-hardware/tree/master/framework 30 | services.fwupd.enable = true; 31 | 32 | # Enable touchpad support 33 | services.libinput.enable = true; 34 | 35 | # Display backlight 36 | programs.light.enable = true; 37 | hardware.sensor.iio.enable = true; 38 | 39 | hardware.keyboard.qmk.enable = false; # am using keyd instead 40 | 41 | # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion 42 | system.stateVersion = "24.05"; 43 | } 44 | -------------------------------------------------------------------------------- /nix/system/crom/default.nix: -------------------------------------------------------------------------------- 1 | # crom is my desktop PC 2 | { inputs, lib, ... }: { 3 | imports = [ 4 | ./hardware.nix 5 | inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate 6 | inputs.nixos-hardware.nixosModules.common-pc-ssd 7 | inputs.nixos-hardware.nixosModules.common-gpu-amd 8 | ./amdgpu.nix 9 | ./keyd.nix 10 | ./motherboard.nix 11 | ../lichess 12 | ../modules/common.nix 13 | ../modules/bluetooth.nix 14 | ../modules/coolercontrol.nix 15 | ../modules/steam.nix 16 | ../modules/cooklang-chef-nginx.nix 17 | ../modules/telegram.nix 18 | ../modules/android.nix 19 | ]; 20 | 21 | # Open ports in the firewall. 22 | programs.mosh.enable = true; 23 | 24 | networking = { 25 | hostName = "crom"; 26 | extraHosts = '' 27 | 192.168.1.3 fw 28 | ''; 29 | firewall.allowedTCPPorts = [ 30 | 80 31 | 443 32 | 9371 # puzzler 33 | 9800 # cook 34 | ]; 35 | }; 36 | 37 | stylix.fonts.sizes = lib.mkForce { 38 | applications = 14; 39 | desktop = 14; 40 | popups = 14; 41 | terminal = 14; 42 | }; 43 | 44 | # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion 45 | system.stateVersion = "24.05"; 46 | } 47 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lsp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- language servers 3 | { 4 | "neovim/nvim-lspconfig", 5 | opts = { 6 | servers = { 7 | ["*"] = { 8 | -- stylua: ignore 9 | keys = { 10 | { "ge", function() Snacks.picker.lsp_definitions() end, desc = "Definition", has = "definition", }, 11 | { "gE", vim.lsp.buf.declaration, desc = "Goto Declaration" }, 12 | { "gn", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" }, 13 | { "gh", vim.lsp.buf.hover, desc = "Hover" }, 14 | { "cl", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "x" }, has = "codeLens" }, 15 | { "cq", vim.diagnostic.setqflist, desc = "Put diagnostics in quickfix" }, 16 | { "cz", vim.diagnostic.reset, desc = "Reset diagnostics" } 17 | }, 18 | }, 19 | ts_ls = { 20 | enabled = true, 21 | settings = { 22 | typescript = {}, 23 | javascript = {}, 24 | completions = { 25 | completeFunctionCalls = true, 26 | }, 27 | }, 28 | }, 29 | }, 30 | }, 31 | }, 32 | } 33 | -------------------------------------------------------------------------------- /nix/system/modules/shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | users.defaultUserShell = pkgs.zsh; 4 | environment.shells = with pkgs; [ zsh ]; 5 | environment.variables = { 6 | EDITOR = "neovide"; 7 | TERMINAL = "kitty -1"; 8 | TERM = "xterm-kitty"; 9 | }; 10 | 11 | environment.sessionVariables = rec { 12 | XDG_CACHE_HOME = "$HOME/.cache"; 13 | XDG_CONFIG_HOME = "$HOME/.config"; 14 | XDG_DATA_HOME = "$HOME/.local/share"; 15 | XDG_STATE_HOME = "$HOME/.local/state"; 16 | XDG_BIN_HOME = "$HOME/.local/bin"; 17 | PATH = [ "${XDG_BIN_HOME}" "$HOME/.cargo/bin" ]; 18 | BLOOP_JAVA_OPTS = "-Xmx16G"; 19 | }; 20 | environment.systemPackages = with pkgs; [ 21 | kitty 22 | zsh 23 | zsh-syntax-highlighting 24 | ripgrep 25 | ast-grep 26 | eza 27 | keychain 28 | zoxide 29 | fira-code 30 | pass 31 | gnupg 32 | pinentry-tty 33 | bat-extras.batman 34 | bat-extras.batwatch 35 | tmux 36 | cmatrix 37 | sysz 38 | systemctl-tui 39 | chafa # terminal image viewer 40 | direnv 41 | zellij # tmux alt 42 | ]; 43 | 44 | programs.gnupg.agent = { 45 | enable = true; 46 | enableSSHSupport = true; 47 | pinentryPackage = pkgs.pinentry-tty; 48 | }; 49 | 50 | # required for root user 51 | programs.zsh.enable = true; 52 | } 53 | -------------------------------------------------------------------------------- /nvim/lua/plugins/fun.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- just 4 fun 3 | { 4 | "eandrju/cellular-automaton.nvim", 5 | enabled = true, 6 | keys = { 7 | { 8 | "cer", 9 | "CellularAutomaton make_it_rain", 10 | desc = "Automaton: Make it rain", 11 | }, 12 | { 13 | "cel", 14 | "CellularAutomaton game_of_life", 15 | desc = "Automaton: Game of life", 16 | }, 17 | { 18 | "ces", 19 | "CellularAutomaton scramble", 20 | desc = "Automaton: Scramble", 21 | }, 22 | }, 23 | }, 24 | { 25 | "nvchad/showkeys", 26 | cmd = "ShowkeysToggle", 27 | keys = { 28 | { "uk", "ShowkeysToggle", desc = "Show keys" }, 29 | }, 30 | opts = { 31 | timeout = 2, 32 | maxkeys = 7, 33 | position = "top-right", 34 | show_count = true, 35 | }, 36 | }, 37 | -- { "nvzone/timerly", cmd = "TimerlyToggle", dependencies = { "nvzone/volt" } }, 38 | -- { 39 | -- "jackplus-xyz/player-one.nvim", 40 | -- ---@type PlayerOne.Config 41 | -- opts = { 42 | -- -- your configuration comes here 43 | -- -- or leave it empty to use the default settings 44 | -- -- refer to the configuration section below 45 | -- }, 46 | -- }, 47 | } 48 | -------------------------------------------------------------------------------- /doc/nixos-install.md: -------------------------------------------------------------------------------- 1 | # Install minimal nixos 2 | 3 | ## Docs 4 | 5 | https://nixos.org/manual/nixos/stable/ 6 | https://gist.github.com/Vincibean/baf1b76ca5147449a1a479b5fcc9a222 7 | 8 | ## First things first 9 | 10 | sudo loadkeys colemak 11 | 12 | ## Network 13 | 14 | https://nixos.org/manual/nixos/stable/#sec-installation-booting-networking 15 | 16 | ```sh 17 | sudo systemctl start wpa_supplicant 18 | wpa_cli 19 | 20 | add_network 21 | set_network 0 ssid "thib-wifi" 22 | set_network 0 psk "mypassword" 23 | set_network 0 key_mgmt WPA-PSK 24 | enable_network 0 25 | ``` 26 | 27 | ## Partitioning with UEFI (GTP) 28 | 29 | ```sh 30 | sudo parted /dev/sda 31 | mklabel gpt 32 | mkpart root ext4 512MB -64GB 33 | mkpart swap linux-swap -64GB 100% 34 | mkpart ESP fat32 1MB 512MB 35 | set 3 esp on 36 | ``` 37 | 38 | ## Formatting 39 | 40 | https://nixos.org/manual/nixos/stable/#sec-installation-manual-partitioning-formatting 41 | 42 | ```sh 43 | sudo mkfs.ext4 -L nixos /dev/sda1 44 | sudo mkswap -L swap /dev/sda2 45 | sudo mkfs.fat -F 32 -n boot /dev/sda3 46 | ``` 47 | 48 | ## Edit /etc/nixos/configuration.nix 49 | 50 | ``` 51 | console.keyMap = "colemak"; 52 | ``` 53 | 54 | ## Easy 55 | 56 | It's all actually straightforward with `nixos-generate-config` and `nixos-install`. 57 | 58 | ## Setup 59 | 60 | https://github.com/nix-community/awesome-nix 61 | -------------------------------------------------------------------------------- /nvim/syntax/play2-routes.vim: -------------------------------------------------------------------------------- 1 | if exists("b:current_syntax") 2 | finish 3 | endif 4 | 5 | syn match routesRegexp "<[^>]\+>" 6 | syn match routesParam /[:*][A-Za-z0-9]\+/ 7 | syn match routesParam /\($[A-Za-z0-9]\+\)<[^>]\+>/ contains=routesRegexp 8 | 9 | syn include @scala syntax/scala.vim 10 | 11 | syn region routesActionArgs matchgroup=routesAction start="(" end=")" contains=@scala contained oneline 12 | syn region routesString start=+"+ end=+"+ oneline 13 | 14 | syn keyword routesHttpMethod GET PUT PATCH POST DELETE HEAD OPTIONS contained 15 | syn region routesMethod start="^" end=/\s/ contains=routesHttpMethod nextgroup=routesPath skipwhite oneline 16 | syn region routesPath start="/" end=/\s/ contains=routesParam nextgroup=routesAction skipwhite oneline 17 | syn region routesAction start=/[a-zA-Z]\+\./ end="$" contains=routesActionArgs skipwhite oneline 18 | syn match routesComment "#.*" contains=routesComment 19 | 20 | if version >= 508 || !exists("did_play2routes_syn_inits") 21 | command -nargs=+ HiLink hi def link 22 | HiLink routesHttpMethod Statement 23 | HiLink routesRegexp Statement 24 | HiLink routesPath Special 25 | HiLink routesAction Underlined 26 | HiLink routesParam Identifier 27 | HiLink routesComment Comment 28 | HiLink routesString String 29 | delcommand HiLink 30 | endif 31 | 32 | let b:current_syntax = "play2-routes" 33 | -------------------------------------------------------------------------------- /nix/system/crom/amdgpu.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | systemd.services.thib-amdgpu-monitor = { 4 | script = let 5 | device = "amdgpu-pci-0300"; 6 | sensors = "${pkgs.lm_sensors}/bin/sensors"; 7 | sed = "${pkgs.gnused}/bin/sed"; 8 | in '' 9 | while : 10 | do 11 | sens=$(${sensors} ${device}) 12 | power=$(echo $sens | ${sed} -rn 's/.*PPT:\s+([0-9]+).*/\1/p') 13 | echo $power > /tmp/gpu-power 14 | echo $sens | ${sed} -rn 's/.*edge:\s+.([0-9]+).*/\1/p' > /tmp/gpu-temp 15 | sleep 1 16 | done 17 | ''; 18 | }; 19 | 20 | # https://wiki.archlinux.org/title/AMDGPU#Boot_parameter 21 | # boot.kernelParams = [ "amdgpu.ppfeaturemask=0xfffd7fff" ]; 22 | # 23 | # systemd.services.thib-amdgpu-set-power = { 24 | # script = let drm-dir = "/sys/class/drm/card1/device"; 25 | # in '' 26 | # ${pkgs.coreutils}/bin/echo "manual" > ${drm-dir}/power_dpm_force_performance_level 27 | # ${pkgs.coreutils}/bin/echo "2" > ${drm-dir}/pp_power_profile_mode 28 | # ''; 29 | # serviceConfig = { 30 | # Type = "oneshot"; 31 | # User = "root"; 32 | # }; 33 | # }; 34 | 35 | # systemd.timers.thib-amdgpu-set-power = { 36 | # wantedBy = [ "timers.target" ]; 37 | # timerConfig = { 38 | # OnCalendar = "*:0/5"; # every 5 minutes 39 | # Unit = "thib-amdgpu-set-power.service"; 40 | # }; 41 | # }; 42 | } 43 | -------------------------------------------------------------------------------- /nvim/lua/plugins/integration.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "mikesmithgh/kitty-scrollback.nvim", 4 | enabled = true, 5 | lazy = true, 6 | cmd = { "KittyScrollbackGenerateKittens", "KittyScrollbackCheckHealth" }, 7 | event = { "User KittyScrollbackLaunch" }, 8 | version = "*", -- latest stable version, may have breaking changes if major version changed 9 | config = function() 10 | require("kitty-scrollback").setup() 11 | end, 12 | }, 13 | { 14 | "glacambre/firenvim", 15 | -- Lazy load firenvim 16 | -- Explanation: https://github.com/folke/lazy.nvim/discussions/463#discussioncomment-4819297 17 | lazy = not vim.g.started_by_firenvim, 18 | build = function() 19 | vim.fn["firenvim#install"](0) 20 | end, 21 | config = function() 22 | vim.g.firenvim_config = { 23 | -- config values, like in my case: 24 | localSettings = { 25 | [".*"] = { 26 | takeover = "never", 27 | -- selector = 'textarea:not([readonly], [aria-readonly]), div[role="textbox"]' 28 | selector = "textarea:not([readonly], [aria-readonly])", 29 | cmdline = "firenvim", 30 | }, 31 | ["https://google.com/"] = { takeover = "never", priority = 1 }, 32 | }, 33 | } 34 | end, 35 | }, 36 | { "noice.nvim", cond = not vim.g.started_by_firenvim }, 37 | { "lualine.nvim", cond = not vim.g.started_by_firenvim }, 38 | } 39 | -------------------------------------------------------------------------------- /nvim/lua/plugins/snacks.lua: -------------------------------------------------------------------------------- 1 | local large = { 2 | width = 0.95, 3 | height = 0.9, 4 | } 5 | return { 6 | { 7 | "folke/snacks.nvim", 8 | opts = { 9 | styles = { 10 | lazygit = large, 11 | blame_line = large, 12 | notification_history = large, 13 | }, 14 | picker = { 15 | sources = { 16 | explorer = {}, 17 | gh_issue = {}, 18 | gh_pr = {}, 19 | }, 20 | }, 21 | image = {}, 22 | lazygit = { 23 | configure = true, 24 | config = { 25 | os = { editPreset = "nvim-remote" }, 26 | }, 27 | }, 28 | gh = {}, 29 | bigfile = {}, 30 | }, 31 | keys = { 32 | { 33 | "e", 34 | function() 35 | Snacks.explorer.open({ cwd = LazyVim.root() }) 36 | end, 37 | desc = "Explorer Snacks (root dir)", 38 | }, 39 | { 40 | "E", 41 | function() 42 | Snacks.explorer() 43 | end, 44 | desc = "Explorer Snacks (cwd)", 45 | }, 46 | 47 | { 48 | "gi", 49 | function() 50 | Snacks.picker.gh_issue() 51 | end, 52 | desc = "GitHub Issues (open)", 53 | }, 54 | { 55 | "gp", 56 | function() 57 | Snacks.picker.gh_pr() 58 | end, 59 | desc = "GitHub Pull Requests (open)", 60 | }, 61 | }, 62 | }, 63 | } 64 | -------------------------------------------------------------------------------- /nvim/lua/config/init.lua: -------------------------------------------------------------------------------- 1 | -- Load or install lazy.nvim 2 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 3 | if not (vim.uv or vim.loop).fs_stat(lazypath) then 4 | -- stylua: ignore 5 | vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) 6 | end 7 | vim.opt.rtp:prepend(vim.env.LAZY or lazypath) 8 | -- End lazy.nvim setup 9 | 10 | -- Configure LazyVim 11 | -- https://www.lazyvim.org/configuration/lazy.nvim 12 | local theme = "catppuccin-mocha" 13 | 14 | require("lazy").setup({ 15 | spec = { 16 | { 17 | "LazyVim/LazyVim", 18 | opts = { 19 | colorscheme = theme, 20 | defaults = { 21 | autocmds = true, -- lazyvim.config.autocmds 22 | keymaps = false, -- lazyvim.config.keymaps 23 | options = true, -- lazyvim.config.options 24 | }, 25 | }, 26 | import = "lazyvim.plugins", 27 | }, 28 | { import = "plugins" }, 29 | }, 30 | install = { colorscheme = { theme } }, 31 | defaults = { 32 | lazy = false, 33 | version = false, 34 | }, 35 | checker = { enabled = false }, -- automatically check for plugin updates 36 | performance = { 37 | rtp = { 38 | disabled_plugins = { 39 | "gzip", 40 | -- "matchit", 41 | -- "matchparen", 42 | "netrwPlugin", 43 | "tarPlugin", 44 | "tohtml", 45 | "tutor", 46 | "zipPlugin", 47 | }, 48 | }, 49 | }, 50 | }) 51 | -------------------------------------------------------------------------------- /nix/home/modules/cli.nix: -------------------------------------------------------------------------------- 1 | { config, ... }: { 2 | 3 | programs.fzf = { 4 | enable = true; 5 | enableZshIntegration = true; 6 | # defaultCommand = "fd --type f'"; 7 | defaultCommand = "rg --files --hidden"; 8 | defaultOptions = [ "--no-mouse" "--info=inline-right" ]; 9 | }; 10 | 11 | programs.zoxide = { 12 | enable = true; 13 | enableZshIntegration = true; 14 | }; 15 | programs.eza = { 16 | enable = true; 17 | enableZshIntegration = true; 18 | }; 19 | programs.bat = { enable = true; }; 20 | # man with bat 21 | home.sessionVariables = { 22 | MANPAGER = "sh -c 'col -bx | bat -l man -p'"; 23 | MANROFFOPT = "-c"; 24 | }; 25 | programs.ripgrep = { enable = true; }; 26 | programs.btop = { 27 | enable = true; 28 | settings = { 29 | show_battery = false; 30 | cpu_sensor = "k10temp/Tctl"; 31 | custom_cpu_name = "He Boiled For Your Sins"; 32 | update_ms = 800; 33 | cpu_single_graph = true; 34 | proc_per_core = true; 35 | }; 36 | }; 37 | 38 | programs.starship = { 39 | enable = true; 40 | enableZshIntegration = true; 41 | settings = { 42 | character = { 43 | success_symbol = "[›](bold green)"; 44 | error_symbol = "[›](bold red)"; 45 | }; 46 | 47 | scala = { symbol = ""; }; 48 | git_status = { 49 | deleted = "✗"; 50 | modified = "✶"; 51 | staged = "✓"; 52 | stashed = "≡"; 53 | }; 54 | }; 55 | }; 56 | home.sessionVariables.STARSHIP_CACHE = "${config.xdg.cacheHome}/starship"; 57 | } 58 | -------------------------------------------------------------------------------- /nix/home/services/puzzler.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: { 2 | systemd.user.services = let 3 | home = config.home.homeDirectory; 4 | puzzler = "${home}/lichess-puzzler"; 5 | in { 6 | puzzler = { 7 | Unit = { 8 | Description = "Puzzler validator backend"; 9 | After = [ "mongodb.service" ]; 10 | }; 11 | Install = { WantedBy = [ "default.target" ]; }; 12 | Service = { 13 | WorkingDirectory = "${puzzler}/validator/back"; 14 | ExecStart = ''${pkgs.nodejs}/bin/node build/src/index.js "--env=prod"''; 15 | StandardOutput = "journal"; 16 | StandardError = "journal"; 17 | SyslogIdentifier = "puzzler"; 18 | Restart = "on-failure"; 19 | RestartSec = 5; 20 | }; 21 | }; 22 | 23 | puzzler-copy = { 24 | Unit = { Description = "Tags and uploads new puzzles"; }; 25 | Service = { 26 | Type = "oneshot"; 27 | ExecStart = "${puzzler}/bin/import-more.sh"; 28 | WorkingDirectory = puzzler; 29 | Environment = "PATH=$PATH:/run/current-system/sw/bin"; 30 | }; 31 | Install = { WantedBy = [ "multi-user.target" ]; }; 32 | }; 33 | }; 34 | 35 | systemd.user.timers.puzzler-copy-timer = { 36 | Unit = { 37 | Description = "Runs puzzler-copy nightly"; 38 | Requires = [ "puzzler-copy.service" ]; 39 | }; 40 | Timer = { 41 | Unit = "puzzler-copy.service"; 42 | # every night at 4am 43 | OnCalendar = "*-*-* 04:00:00"; 44 | }; 45 | Install = { WantedBy = [ "timers.target" ]; }; 46 | }; 47 | } 48 | -------------------------------------------------------------------------------- /nix/system/crom/hardware.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, modulesPath, ... }: 5 | 6 | { 7 | imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; 8 | 9 | boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" ]; 10 | boot.initrd.kernelModules = [ ]; 11 | boot.kernelModules = [ "kvm-amd" ]; 12 | boot.extraModulePackages = [ ]; 13 | 14 | fileSystems."/" = { 15 | device = "/dev/nvme0n1p1"; 16 | fsType = "ext4"; 17 | }; 18 | 19 | fileSystems."/boot" = { 20 | device = "/dev/nvme0n1p3"; 21 | fsType = "vfat"; 22 | options = [ "fmask=0077" "dmask=0077" ]; 23 | }; 24 | 25 | swapDevices = [{ device = "/dev/nvme0n1p2"; }]; 26 | 27 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 28 | # (the default) this is the recommended approach. When using systemd-networkd it's 29 | # still possible to use this option, but it's recommended to use it in conjunction 30 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`. 31 | networking.useDHCP = lib.mkDefault true; 32 | # networking.interfaces.enp12s0.useDHCP = lib.mkDefault true; 33 | # networking.interfaces.wlp13s0.useDHCP = lib.mkDefault true; 34 | 35 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 36 | hardware.cpu.amd.updateMicrocode = 37 | lib.mkDefault config.hardware.enableRedistributableFirmware; 38 | } 39 | -------------------------------------------------------------------------------- /nix/system/fw/hardware.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, modulesPath, ... }: 5 | 6 | { 7 | imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; 8 | 9 | boot.initrd.availableKernelModules = 10 | [ "nvme" "xhci_pci" "thunderbolt" "usbhid" ]; 11 | boot.initrd.kernelModules = [ ]; 12 | boot.kernelModules = [ "kvm-amd" ]; 13 | boot.extraModulePackages = [ ]; 14 | 15 | fileSystems."/" = { 16 | device = "/dev/disk/by-uuid/618f4e15-cd7f-471c-827c-4cd213ef3193"; 17 | fsType = "ext4"; 18 | }; 19 | 20 | fileSystems."/boot" = { 21 | device = "/dev/disk/by-uuid/00D1-EED8"; 22 | fsType = "vfat"; 23 | options = [ "fmask=0022" "dmask=0022" ]; 24 | }; 25 | 26 | swapDevices = 27 | [{ device = "/dev/disk/by-uuid/6ea0d45e-8935-469d-9cb8-71c972acfe4b"; }]; 28 | 29 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 30 | # (the default) this is the recommended approach. When using systemd-networkd it's 31 | # still possible to use this option, but it's recommended to use it in conjunction 32 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`. 33 | networking.useDHCP = lib.mkDefault true; 34 | # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; 35 | 36 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 37 | hardware.cpu.amd.updateMicrocode = 38 | lib.mkDefault config.hardware.enableRedistributableFirmware; 39 | } 40 | -------------------------------------------------------------------------------- /nix/system/fw/keyd.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | # very personal configuration for colemak and weak pinkies 3 | services.keyd = { 4 | enable = true; 5 | keyboards = { 6 | default = { 7 | # 32ac:0012 Framework Laptop 16 Keyboard Module 8 | ids = [ "32ac:0012" ]; 9 | settings = { 10 | # to view key names: 11 | # sudo keyd -m 12 | main = { 13 | shift = "oneshot(shiftAltGr)"; 14 | capslock = "layer(capsShift)"; 15 | leftmeta = "layer(leftcontrol)"; 16 | leftalt = "layer(leftalt)"; 17 | rightalt = "layer(rightaltMaj)"; 18 | # tab acts as escape and can do nothing else because: 19 | # - we want escape on keydown, not keyup 20 | # - we don't want to escape before doing something else 21 | tab = "esc"; 22 | }; 23 | "leftcontrol:C" = { 24 | j = "down"; 25 | k = "up"; 26 | comma = "C-tab"; 27 | m = "C-S-tab"; 28 | # h = "left"; 29 | # u = "right"; ctrl+l focuses the address bar 30 | }; 31 | # both shift keys act as alt gr for french accents 32 | "shiftAltGr:G" = { }; 33 | # caps lock acts as shift 34 | "capsShift:S" = { 35 | delete = "S-insert"; 36 | space = "tab"; 37 | }; 38 | # left alt combines with space for enter 39 | "leftalt:A" = { space = "enter"; }; 40 | # right alt acts as shift 41 | "rightaltMaj:S" = { space = "S-tab"; }; 42 | }; 43 | }; 44 | }; 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /nix/home/modules/lazygit.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | 3 | programs.lazygit = { 4 | enable = true; 5 | settings = { 6 | git = { 7 | pagers = [{ pager = "delta --paging=never"; }]; 8 | disableForcePushing = true; 9 | }; 10 | gui = { 11 | language = "en"; 12 | mouseEvents = false; 13 | sidePanelWidth = 0.3; 14 | mainPanelSplitMode = 15 | "flexible"; # one of "horizontal" | "flexible" | "vertical" 16 | showFileTree = false; # ` to toggle 17 | nerdFontsVersion = "3"; 18 | commitHashLength = 6; 19 | showDivergenceFromBaseBranch = "arrowAndNumber"; 20 | }; 21 | quitOnTopLevelReturn = true; 22 | disableStartupPopups = true; 23 | promptToReturnFromSubprocess = false; 24 | os = { editPreset = "nvim"; }; 25 | keybinding = { 26 | files = { 27 | stashAllChanges = ""; # instead of just 's' which I typod for 'c' 28 | }; 29 | universal = { 30 | prevItem = "e"; 31 | nextItem = "n"; 32 | scrollUpMain = ""; # main panel scroll up 33 | scrollDownMain = ""; # main panel scroll down 34 | nextMatch = "j"; 35 | prevMatch = "J"; 36 | new = ""; 37 | edit = ""; 38 | }; 39 | }; 40 | # https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Command_Keybindings.md 41 | customCommands = [{ 42 | key = "H"; 43 | context = "commits"; 44 | # or use "y u" to copy the url 45 | command = "gh browse {{.SelectedLocalCommit.Hash}}"; 46 | }]; 47 | }; 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /nvim/lua/plugins/metals.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 3 | -- scala lsp 4 | { 5 | "scalameta/nvim-metals", 6 | ft = { "scala", "sbt", "java" }, 7 | keys = { 8 | { 9 | "mc", 10 | function() 11 | require("metals").compile_cascade() 12 | end, 13 | desc = "Metals compile cascade", 14 | }, 15 | { 16 | "me", 17 | function() 18 | require("metals").commands() 19 | end, 20 | desc = "Metals menu", 21 | }, 22 | }, 23 | config = function() 24 | local metals = require("metals") 25 | local config = metals.bare_config() 26 | 27 | config.init_options.statusBarProvider = "on" 28 | config.settings = { 29 | -- showImplicitArguments = true, 30 | excludedPackages = { "akka.actor.typed.javadsl" }, 31 | serverProperties = { "-Xms256m", "-Xmx4g" }, 32 | -- serverVersion = "latest.snapshot", 33 | } 34 | 35 | config.capabilities = require("blink.cmp").get_lsp_capabilities() 36 | 37 | config.on_attach = function(client, bufnr) 38 | -- metals.setup_dap() 39 | require("lsp-format").on_attach(client, bufnr) 40 | end 41 | 42 | -- Autocmd that will actually be in charge of starting the whole thing 43 | local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) 44 | vim.api.nvim_create_autocmd("FileType", { 45 | pattern = { "scala", "sbt", "java" }, 46 | callback = function() 47 | metals.initialize_or_attach(config) 48 | end, 49 | group = nvim_metals_group, 50 | }) 51 | end, 52 | }, 53 | } 54 | -------------------------------------------------------------------------------- /nvim/lua/config/neovide.lua: -------------------------------------------------------------------------------- 1 | -- https://neovide.dev/configuration.html 2 | vim.g.neovide_floating_corner_radius = 0.7 3 | vim.g.neovide_normal_opacity = 0.94 4 | -- vim.o.guifont = "JetBrains Mono:h15.5" 5 | 6 | -- vim.g.neovide_position_animation_length = 0.15 7 | 8 | vim.g.neovide_scroll_animation_length = 0.22 9 | vim.g.neovide_scroll_animation_far_lines = 5 10 | 11 | vim.g.neovide_cursor_animation_length = 0.15 12 | vim.g.neovide_cursor_trail_size = 0.9 13 | -- typing animation 14 | vim.g.neovide_cursor_short_animation_length = 0.25 15 | 16 | vim.g.neovide_hide_mouse_when_typing = true 17 | vim.g.neovide_cursor_unfocused_outline_width = 0.125 18 | 19 | -- vim.g.neovide_cursor_vfx_mode = "sonicboom" 20 | -- vim.g.neovide_cursor_vfx_mode = { "railgun", "pixiedust", "sonicboom" } 21 | vim.g.neovide_cursor_vfx_mode = { "railgun", "pixiedust" } 22 | -- vim.g.neovide_cursor_vfx_particle_highlight_lifetime = 0.1 -- sonicboom 23 | vim.g.neovide_cursor_vfx_particle_lifetime = 0.7 -- railgun 24 | 25 | -- https://github.com/neovide/neovide/issues/1282#issuecomment-2496204257 26 | vim.api.nvim_set_keymap("t", "", '"+Pi', { noremap = true }) 27 | 28 | -- vim.opt.guicursor = { 29 | -- "n-v-c-sm:block-Cursor", -- Use 'Cursor' highlight for normal, visual, and command modes 30 | -- "i-ci-ve:ver25-lCursor", -- Use 'lCursor' highlight for insert and visual-exclusive modes 31 | -- "r-cr:hor20-CursorIM", -- Use 'CursorIM' for replace mode 32 | -- } 33 | 34 | vim.keymap.set({ "n" }, "", ":lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + 0.1") 35 | vim.keymap.set({ "n" }, "", ":lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor - 0.1") 36 | -------------------------------------------------------------------------------- /nix/system/modules/stylix.nix: -------------------------------------------------------------------------------- 1 | { pkgs, inputs, ... }: { 2 | imports = [ inputs.stylix.nixosModules.stylix ]; 3 | stylix = { 4 | 5 | enable = true; 6 | 7 | # https://tinted-theming.github.io/base16-gallery/ 8 | base16Scheme = let theme = "catppuccin-mocha"; 9 | in "${pkgs.base16-schemes}/share/themes/${theme}.yaml"; 10 | 11 | override = { base00 = "#1f1e22"; }; 12 | 13 | image = ../../home/wallpaper/xp.jpg; 14 | 15 | fonts = rec { 16 | sansSerif = { 17 | package = pkgs.dejavu_fonts; 18 | name = "DejaVu Sans"; 19 | }; 20 | 21 | serif = sansSerif; 22 | 23 | monospace = { 24 | package = pkgs.jetbrains-mono; 25 | name = "JetBrains Mono"; 26 | }; 27 | # monospace = { 28 | # package = pkgs.fira-code; 29 | # name = "Fira Code"; 30 | # }; 31 | 32 | # monospace = { 33 | # package = pkgs.iosevka-bin; 34 | # name = "Iosevka Term"; 35 | # }; 36 | 37 | emoji = { 38 | package = pkgs.noto-fonts-color-emoji; 39 | name = "Noto Color Emoji"; 40 | }; 41 | 42 | sizes = { 43 | applications = 13; 44 | desktop = 13; 45 | popups = 13; 46 | terminal = 13; 47 | }; 48 | }; 49 | 50 | opacity = { 51 | terminal = 0.95; 52 | popups = 0.9; 53 | desktop = 0.9; 54 | applications = 0.9; 55 | }; 56 | 57 | # cursor = { 58 | # name = "Numix-Cursor"; 59 | # package = pkgs.numix-cursor-theme; 60 | # size = 32; 61 | # }; 62 | 63 | cursor = { 64 | package = pkgs.bibata-cursors; 65 | name = "Bibata-Modern-Ice"; 66 | size = 24; 67 | }; 68 | }; 69 | } 70 | -------------------------------------------------------------------------------- /nix/home/crom/sway.nix: -------------------------------------------------------------------------------- 1 | { config, lib, pkgs, ... }: { 2 | 3 | wayland.windowManager.sway = { 4 | config = let 5 | volumeDec = "exec 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.0'"; 6 | volumeInc = "exec 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.0'"; 7 | in { 8 | input = lib.mkAfter { 9 | # the glove is a bit too repeaty 10 | "type:keyboard".repeat_delay = lib.mkForce "250"; 11 | # flat profile, no acceleration 12 | "type:mouse" = { accel_profile = "flat"; }; 13 | }; 14 | keybindings = 15 | let inherit (config.wayland.windowManager.sway.config) modifier menu; 16 | in lib.mkAfter { 17 | "${modifier}+space" = "exec ${menu}"; 18 | "F8" = "exec '${pkgs.playerctl}/bin/playerctl -p spotify play-pause'"; 19 | "F9" = volumeDec; 20 | "F10" = volumeInc; 21 | "${modifier}+F10" = "exec 'screenshot.sh clipboard'"; 22 | "ctrl+f9" = ''exec "sleep 1; pkill -SIGUSR1 swayidle"''; 23 | }; 24 | modes = { 25 | gaming = { 26 | "F9" = volumeDec; 27 | "F10" = volumeInc; 28 | }; 29 | }; 30 | }; 31 | }; 32 | 33 | services.swayidle = { 34 | enable = true; 35 | timeouts = let 36 | crom-mode = pkgs.writeShellScript "crom-mode.sh" '' 37 | mode=$1 38 | # hack to get the current sway socket as I've seen it be wrong once. 39 | export SWAYSOCK=$XDG_RUNTIME_DIR/sway-ipc.$UID.$(${pkgs.procps}/bin/pgrep -x sway).sock 40 | ${pkgs.sway}/bin/swaymsg "output * power $mode" 41 | ''; 42 | in [{ 43 | timeout = 420; 44 | command = "${crom-mode} off"; 45 | resumeCommand = "${crom-mode} on"; 46 | }]; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /nix/system/modules/cooklang-chef-nginx.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: { 2 | 3 | networking = { firewall.allowedTCPPorts = [ 9800 ]; }; 4 | 5 | # allow reading assets from home 6 | users.users.nginx.extraGroups = [ "users" ]; 7 | systemd.services.nginx.serviceConfig.ProtectHome = "read-only"; 8 | 9 | services.nginx = { 10 | commonHttpConfig = lib.mkAfter '' 11 | 12 | upstream chef { 13 | server 127.0.0.1:9801; 14 | } 15 | ''; 16 | 17 | virtualHosts = let 18 | listenLocal80 = { 19 | addr = "0.0.0.0"; 20 | port = 9800; 21 | }; 22 | # listenLocal443 = { 23 | # addr = "0.0.0.0"; 24 | # port = 443; 25 | # ssl = true; 26 | # }; 27 | # listenLocal = [ listenLocal443 listenLocal80 ]; 28 | listenLocal = [ listenLocal80 ]; 29 | in { 30 | "chef.freeboxos.fr" = let 31 | proxyConf = '' 32 | proxy_set_header Host $host; 33 | proxy_set_header X-Forwarded-For $remote_addr; 34 | proxy_set_header X-Forwarded-Proto $scheme; 35 | proxy_http_version 1.1;''; 36 | in { 37 | listen = listenLocal; 38 | enableACME = false; 39 | forceSSL = false; 40 | extraConfig = '' 41 | 42 | # ssl_certificate /etc/ssl/certs/l.org.crt; 43 | # ssl_certificate_key /etc/ssl/private/l.org.key; 44 | 45 | error_log /var/log/nginx/chef.error.log; 46 | access_log /var/log/nginx/chef.access.log; 47 | 48 | location = /robots.txt { 49 | add_header Content-Type text/plain; 50 | return 200 "User-agent: *\nDisallow: /\n"; 51 | } 52 | 53 | location / { 54 | ${proxyConf} 55 | proxy_pass http://chef; # no trailing / 56 | } 57 | ''; 58 | }; 59 | }; 60 | }; 61 | } 62 | -------------------------------------------------------------------------------- /doc/localhost-ssl-cert-https-dev.md: -------------------------------------------------------------------------------- 1 | ## localhost ssl cert for https dev 2 | 3 | https://medium.com/@eng.fadishaar/step-by-step-guide-configuring-nginx-with-https-on-localhost-for-secure-web-application-testing-c78febc26c78 4 | 5 | ```sh 6 | take ~/localhost-ssl/l.org 7 | # passphrase: local 8 | openssl genrsa -des3 -out rootCA.key 2048 9 | # ignore all questions 10 | openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 7300 -out rootCert.pem 11 | openssl genrsa -out cert.key 2048 12 | # ignore all questions 13 | openssl req -new -key cert.key -out cert.csr 14 | v openssl.cnf 15 | ``` 16 | 17 | ``` 18 | # Extensions to add to a certificate request 19 | basicConstraints = CA:FALSE 20 | authorityKeyIdentifier = keyid:always, issuer:always 21 | keyUsage = nonRepudiation, digitalSignature, keyEncipherment, dataEncipherment 22 | subjectAltName = @alt_names 23 | [ alt_names ] 24 | DNS.1 = l.org 25 | ``` 26 | 27 | ```sh 28 | openssl x509 -req -in cert.csr -CA rootCert.pem -CAkey rootCA.key -CAcreateserial -out cert.crt -days 7300 -sha256 -extfile openssl.cnf 29 | openssl verify -CAfile rootCert.pem -verify_hostname l.org cert.crt 30 | ``` 31 | 32 | ### firefox 33 | 34 | settings > privacy/security > certificates > authorities > import 35 | 36 | ### chrome 37 | 38 | chrome://settings/certificates 39 | Authorities 40 | Import rootCert.pem 41 | trust for identifying websites 42 | 43 | ```sh 44 | sudo ln -s /home/thib/localhost-ssl/l.org/cert.crt /etc/ssl/certs/l.org.crt 45 | sudo mkdir -p /etc/ssl/private 46 | sudo ln -s /home/thib/localhost-ssl/l.org/cert.key /etc/ssl/private/l.org.key 47 | sudo chown nginx /etc/ssl/private/l.org.key 48 | ``` 49 | 50 | nginx.conf 51 | 52 | ``` 53 | 54 | server { 55 | server_name localhost; 56 | listen 443 ssl; 57 | ssl_certificate /etc/ssl/certs/l.org.crt; 58 | ssl_certificate_key /etc/ssl/private/l.org.key; 59 | } 60 | ``` 61 | 62 | then same for socket.l.org 63 | -------------------------------------------------------------------------------- /nix/home/modules/lan-mouse.nix: -------------------------------------------------------------------------------- 1 | { inputs, pkgs, ... }: { 2 | imports = [ inputs.lan-mouse.homeManagerModules.default ]; 3 | programs.lan-mouse = { 4 | enable = true; 5 | systemd = true; 6 | # package = inputs.lan-mouse.packages.${pkgs.stdenv.hostPlatform.system}.default 7 | # Optional configuration in nix syntax, see config.toml for available options 8 | settings = let 9 | # we can't use any ${pkgs} proper path, 10 | # because it also runs commands on the remote machine 11 | shareClipboard = dest: 12 | "wl-paste --no-newline | ssh ${dest} -i .ssh/id_home_nokey env WAYLAND_DISPLAY='wayland-1' wl-copy"; 13 | in { 14 | release_bind = [ "KeyLeftCtrl" "Key5" ]; 15 | port = 4242; 16 | frontend = "cli"; 17 | right = { 18 | hostname = "crom"; 19 | activate_on_startup = true; 20 | enter_hook = shareClipboard "crom"; 21 | ips = [ "192.168.1.2" ]; 22 | }; 23 | left = { 24 | hostname = "fw"; 25 | activate_on_startup = true; 26 | enter_hook = shareClipboard "fw"; 27 | ips = [ "192.168.1.3" ]; 28 | }; 29 | }; 30 | }; 31 | 32 | systemd.user.services.lan-mouse.Service.Environment = 33 | "PATH=$PATH:/run/current-system/sw/bin"; 34 | 35 | programs.waybar.settings.mainBar."custom/lan-mouse" = let 36 | systemctl = "${pkgs.systemd}/bin/systemctl --user"; 37 | service = "lan-mouse.service"; 38 | in { 39 | interval = 5; 40 | exec = pkgs.writeShellScript "lan-mouse-check" '' 41 | if ${systemctl} is-active --quiet ${service} 42 | then echo "󰍽 ON" 43 | else echo "󰍾" 44 | fi 45 | ''; 46 | format = "{}"; 47 | tooltip-format = "LAN Mouse"; 48 | on-click = pkgs.writeShellScript "lan-mouse-toggle" '' 49 | if ${systemctl} is-active --quiet ${service} 50 | then ${systemctl} stop ${service} 51 | else ${systemctl} start ${service} 52 | fi 53 | ''; 54 | }; 55 | } 56 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Thib's NixOS config"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 | nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05"; 7 | nixpkgs-master.url = "github:NixOS/nixpkgs/master"; 8 | 9 | nixos-hardware.url = "github:NixOS/nixos-hardware"; 10 | 11 | home-manager = { 12 | url = "github:nix-community/home-manager"; 13 | inputs.nixpkgs.follows = "nixpkgs"; 14 | }; 15 | 16 | stylix = { 17 | url = "github:nix-community/stylix"; 18 | inputs = { 19 | nixpkgs.follows = "nixpkgs"; 20 | home-manager.follows = "home-manager"; 21 | }; 22 | }; 23 | 24 | bbpPairings.url = "github:ornicar/bbpPairings/2b01f2c1e2b839d2"; 25 | picfit.url = "github:ornicar/picfit/e64ee4fb03f65742ed2ff"; 26 | 27 | # lan-mouse.url = "github:feschber/lan-mouse"; 28 | }; 29 | 30 | outputs = { self, nixpkgs, nixos-hardware, home-manager, ... }@inputs: 31 | let 32 | inherit (self) outputs; 33 | inherit (nixpkgs.lib) nixosSystem; 34 | specialArgs = { inherit inputs outputs; }; 35 | in { 36 | overlays = import ./nix/overlays { inherit inputs; }; 37 | nixosConfigurations = { 38 | fw = nixosSystem { 39 | specialArgs = specialArgs; 40 | modules = [ 41 | home-manager.nixosModules.home-manager 42 | { 43 | home-manager.users.thib = import ./nix/home/fw; 44 | home-manager.extraSpecialArgs = specialArgs; 45 | } 46 | ./nix/system/fw 47 | ]; 48 | }; 49 | crom = nixosSystem { 50 | specialArgs = specialArgs; 51 | modules = [ 52 | home-manager.nixosModules.home-manager 53 | { 54 | home-manager.users.thib = import ./nix/home/crom; 55 | home-manager.extraSpecialArgs = specialArgs; 56 | } 57 | ./nix/system/crom 58 | ]; 59 | }; 60 | }; 61 | }; 62 | } 63 | -------------------------------------------------------------------------------- /nvim/lua/plugins/http.lua: -------------------------------------------------------------------------------- 1 | -- replaces lua/lazyvim/plugins/extras/util/rest.lua 2 | -- because I want different keymaps 3 | vim.filetype.add({ 4 | extension = { 5 | ["http"] = "http", 6 | }, 7 | }) 8 | return { 9 | { 10 | "mistweaverco/kulala.nvim", 11 | enabled = false, 12 | ft = "http", 13 | keys = { 14 | { "oh", "lua require('kulala').scratchpad()", desc = "HTTP scratchpad" }, 15 | 16 | { "h", "", desc = "+Rest", ft = "http" }, 17 | { "hc", "lua require('kulala').copy()", desc = "Copy as cURL", ft = "http" }, 18 | { "hC", "lua require('kulala').from_curl()", desc = "Paste from curl", ft = "http" }, 19 | { 20 | "hg", 21 | "lua require('kulala').download_graphql_schema()", 22 | desc = "Download GraphQL schema", 23 | ft = "http", 24 | }, 25 | { "hi", "lua require('kulala').inspect()", desc = "Inspect current request", ft = "http" }, 26 | { "hn", "lua require('kulala').jump_next()", desc = "Jump to next request", ft = "http" }, 27 | { "hp", "lua require('kulala').jump_prev()", desc = "Jump to previous request", ft = "http" }, 28 | { "hq", "lua require('kulala').close()", desc = "Close window", ft = "http" }, 29 | { "hr", "lua require('kulala').replay()", desc = "Replay the last request", ft = "http" }, 30 | { "hs", "lua require('kulala').run()", desc = "Send the request", ft = "http" }, 31 | { "hS", "lua require('kulala').show_stats()", desc = "Show stats", ft = "http" }, 32 | { "ht", "lua require('kulala').toggle_view()", desc = "Toggle headers/body", ft = "http" }, 33 | }, 34 | opts = {}, 35 | }, 36 | -- { 37 | -- "nvim-treesitter/nvim-treesitter", 38 | -- enabled = false, 39 | -- opts = { 40 | -- ensure_installed = { "http", "graphql" }, 41 | -- }, 42 | -- }, 43 | } 44 | -------------------------------------------------------------------------------- /nix/home/crom/waybar.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: { 2 | programs.waybar = { 3 | settings = { 4 | mainBar = { 5 | modules-left = lib.mkAfter [ "custom/spotify" ]; 6 | modules-right = [ 7 | "cpu" 8 | "temperature#cpu" 9 | "custom/amdgpu" 10 | "memory" 11 | # "custom/files" 12 | "network" 13 | "pulseaudio" 14 | # "custom/lan-mouse" 15 | "tray" 16 | "clock#utc" 17 | "clock#local" 18 | ]; 19 | "cpu" = { 20 | interval = 1; 21 | format = 22 | "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}{icon16}{icon17}{icon18}{icon19}{icon20}{icon21}{icon22}{icon23}"; 23 | format-icons = [ "" "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ]; 24 | states = { 25 | warning = 20; 26 | critical = 50; 27 | }; 28 | }; 29 | "temperature#cpu" = { 30 | interval = 1; 31 | hwmon-path = "/sys/class/hwmon/hwmon6/temp1_input"; 32 | critical-threshold = 60; 33 | format = "{icon} {temperatureC}°"; 34 | format-icons = [ "" ]; 35 | }; 36 | "custom/amdgpu" = { 37 | interval = 1; 38 | format = " {}"; 39 | exec = pkgs.writeShellScript "thib-amdgpu-waybar" '' 40 | power=$(cat /tmp/gpu-power) 41 | temp=$(cat /tmp/gpu-temp) 42 | echo "''${power}W $temp°" 43 | ''; 44 | }; 45 | "custom/spotify" = { 46 | interval = 5; 47 | exec = '' 48 | ${pkgs.playerctl}/bin/playerctl -p spotify metadata --format "{{xesam:artist}} - {{xesam:album}}"''; 49 | format = "♫ {}"; 50 | max-length = 70; 51 | on-click = "${pkgs.playerctl}/bin/playerctl -p spotify play-pause"; 52 | }; 53 | "custom/files" = { 54 | interval = 1; 55 | format = " {}"; 56 | exec = '' 57 | awk '{print $1}' /proc/sys/fs/file-nr 58 | ''; 59 | }; 60 | }; 61 | }; 62 | }; 63 | } 64 | -------------------------------------------------------------------------------- /nix/home/fw/sway.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, lib, ... }: { 2 | 3 | wayland.windowManager.sway = { 4 | config = { 5 | input = lib.mkAfter { 6 | "type:touchpad" = { 7 | left_handed = "disabled"; 8 | tap = "enabled"; 9 | natural_scroll = "disabled"; 10 | # dwt = "enabled"; 11 | accel_profile = "adaptive"; 12 | pointer_accel = "0.4"; # set mouse sensitivity (between -1 and 1) 13 | }; 14 | }; 15 | keybindings = let 16 | inherit (config.wayland.windowManager.sway.config) modifier menu; 17 | spotify = "${pkgs.playerctl}/bin/playerctl -p spotify"; 18 | home = config.home.homeDirectory; 19 | in lib.mkAfter { 20 | "${modifier}+equal" = "exec ${menu}"; 21 | "XF86MonBrightnessDown" = "exec 'light -U 10'"; 22 | "XF86MonBrightnessUp" = "exec 'light -A 10'"; 23 | "XF86AudioRaiseVolume" = 24 | "exec 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.5'"; 25 | "XF86AudioLowerVolume" = 26 | "exec 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 0.0'"; 27 | "XF86AudioMute" = "exec 'wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle'"; 28 | "XF86AudioPlay" = "exec '${spotify} play-pause'"; 29 | "XF86AudioNext" = "exec '${spotify} next'"; 30 | "XF86AudioPrev" = "exec '${spotify} previous'"; 31 | "Print" = "exec 'screenshot.sh clipboard'"; 32 | "F10" = 33 | "exec '${home}/dotfiles/scripts/systemctl-toggle.sh easyeffects'"; 34 | }; 35 | }; 36 | }; 37 | 38 | services.swayidle = { 39 | enable = true; 40 | timeouts = let 41 | swayMsg = "${pkgs.sway}/bin/swaymsg"; 42 | light = "${pkgs.light}/bin/light"; 43 | resumeCommand = ''${swayMsg} "output * power on"''; 44 | in [ 45 | { 46 | timeout = 900; 47 | command = "${light} -O; ${light} -T 0.2"; 48 | resumeCommand = "${light} -I"; 49 | } 50 | { 51 | timeout = 1200; 52 | command = ''${swayMsg} "output * power off"''; 53 | inherit resumeCommand; 54 | } 55 | { 56 | timeout = 1500; 57 | command = "${pkgs.systemd}/bin/systemctl suspend"; 58 | inherit resumeCommand; 59 | } 60 | ]; 61 | }; 62 | } 63 | -------------------------------------------------------------------------------- /scripts/mongo-ssh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | server=$1 4 | background="-fNL" 5 | foreground="-NL" 6 | options=$background 7 | 8 | gappa=27117 9 | study=27118 10 | achoo=27119 11 | snafu=27217 12 | rubik=27317 13 | insight=27318 14 | feck1=27417 15 | kaiju=27917 16 | 17 | fw=27417 18 | crom=27418 19 | 20 | if [ "$server" = "sec" ]; then 21 | 22 | host="gappa" 23 | port=$gappa 24 | 25 | elif [ "$server" = "study" ]; then 26 | 27 | host="study" 28 | port=$study 29 | 30 | elif [ "$server" = "achoo" ]; then 31 | 32 | host="achoo" 33 | port=$achoo 34 | 35 | elif [ "$server" = "stage" ]; then 36 | 37 | host="snafu" 38 | port=$snafu 39 | as="localhost" 40 | 41 | elif [ "$server" = "puzzle" ]; then 42 | 43 | host="rubik" 44 | port=$rubik 45 | 46 | elif [ "$server" = "insight" ]; then 47 | 48 | host="rubik" 49 | port=$insight 50 | 51 | elif [ "$server" = "pri" ]; then 52 | 53 | host="kaiju" 54 | port=$kaiju 55 | 56 | elif [ "$server" = "late1" ]; then 57 | 58 | host="feck1" 59 | port=$feck1 60 | 61 | elif [ "$server" = "fw" ]; then 62 | 63 | host="fw" 64 | fullHost="fw" 65 | port=$fw 66 | as="localhost" 67 | user="thib" 68 | 69 | elif [ "$server" = "crom" ]; then 70 | 71 | host="crom" 72 | fullHost="crom" 73 | port=$crom 74 | as="localhost" 75 | user="thib" 76 | 77 | elif [ "$server" = "stage" ]; then 78 | 79 | host="snafu" 80 | port=$snafu 81 | as="localhost" 82 | 83 | fi 84 | 85 | if [ -z "$as" ]; then 86 | as="$host.vrack.lichess.ovh" 87 | fi 88 | 89 | if [ -z "$user" ]; then 90 | user="root" 91 | fi 92 | 93 | if [ -z "$fullHost" ]; then 94 | fullHost="$host.lichess.ovh" 95 | fi 96 | 97 | if [ "$server" = "all" ]; then 98 | echo "Connecting all servers" 99 | for server in sec study achoo stage puzzle; do 100 | echo "$0 $server" 101 | $0 $server 102 | done 103 | # if port is defined 104 | elif [ -n "$port" ]; then 105 | echo "Terminating previous connections to $port" 106 | for pid in $(lsof -t -i:$port); do 107 | kill -9 $pid 108 | done 109 | echo "Connecting $server to $fullHost on port $port" 110 | command="ssh $options $port:$as:27017 $user@$fullHost" 111 | echo $command 112 | $command 113 | else 114 | echo "Usage: $0 [all|sec|feck1|study|achoo|stage|puzzle|pri|insight|fw|crom]" 115 | fi 116 | -------------------------------------------------------------------------------- /nvim/lua/plugins/ui.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "catppuccin", 4 | opts = { 5 | term_colors = true, 6 | color_overrides = { 7 | mocha = { 8 | -- base = "1e1e2e", 9 | base = "#1f1e22", 10 | mantle = "#232224", 11 | }, 12 | }, 13 | }, 14 | }, 15 | { 16 | "folke/tokyonight.nvim", 17 | enabled = false, 18 | }, 19 | 20 | -- edgy 21 | { 22 | "folke/edgy.nvim", 23 | opts = { 24 | options = { 25 | left = { size = 30 }, 26 | bottom = { size = 10 }, 27 | right = { size = 50 }, 28 | top = { size = 10 }, 29 | }, 30 | animate = { 31 | enabled = false, 32 | }, 33 | }, 34 | }, 35 | 36 | -- bufferline 37 | { 38 | "akinsho/bufferline.nvim", 39 | opts = { 40 | options = { 41 | show_buffer_close_icons = false, 42 | }, 43 | }, 44 | keys = { 45 | { "t", "BufferLinePick", desc = "Buffer picker" }, 46 | { "bp", "BufferLineTogglePin", desc = "Toggle pin" }, 47 | { "bP", "BufferLineGroupClose ungrouped", desc = "Delete non-pinned buffers" }, 48 | { "1", "BufferLineGoToBuffer 1" }, 49 | { "2", "BufferLineGoToBuffer 2" }, 50 | { "3", "BufferLineGoToBuffer 3" }, 51 | { "4", "BufferLineGoToBuffer 4" }, 52 | { "5", "BufferLineGoToBuffer 5" }, 53 | { "6", "BufferLineGoToBuffer 6" }, 54 | { "7", "BufferLineGoToBuffer 7" }, 55 | { "8", "BufferLineGoToBuffer 8" }, 56 | { "9", "BufferLineGoToBuffer 9" }, 57 | }, 58 | }, 59 | 60 | -- statusline 61 | { 62 | "nvim-lualine/lualine.nvim", 63 | opts = function(_, opts) 64 | opts.sections.lualine_a = 65 | { { 66 | "mode", 67 | fmt = function(str) 68 | return str:sub(1, 1) 69 | end, 70 | } } 71 | opts.sections.lualine_c[4] = { LazyVim.lualine.pretty_path({ length = 6 }) } 72 | -- move metals status to the left 73 | opts.sections.lualine_z = opts.sections.lualine_y 74 | opts.sections.lualine_y = opts.sections.lualine_x 75 | opts.sections.lualine_x = { "g:metals_status" } 76 | -- remove dap: 77 | -- table.remove(opts.sections.lualine_y, 3) 78 | end, 79 | }, 80 | } 81 | -------------------------------------------------------------------------------- /nix/home/fw/waybar.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | programs.waybar = { 3 | settings = { 4 | mainBar = { 5 | modules-right = [ 6 | "cpu" 7 | "temperature#cpu" 8 | # "custom/ectool-fan" 9 | "memory" 10 | "network" 11 | "pulseaudio" 12 | "backlight" 13 | "battery" 14 | "power-profiles-daemon" 15 | "idle_inhibitor" 16 | # "custom/lan-mouse" 17 | "tray" 18 | "clock#utc" 19 | "clock#local" 20 | ]; 21 | "cpu" = { 22 | interval = 1; 23 | format = 24 | "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}"; 25 | format-icons = [ "" "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ]; 26 | states = { 27 | warning = 20; 28 | critical = 50; 29 | }; 30 | }; 31 | "temperature#cpu" = { 32 | interval = 1; 33 | hwmon-path = "/sys/class/thermal/thermal_zone3/temp"; 34 | critical-threshold = 70; 35 | format = "{icon} {temperatureC}°"; 36 | format-icons = [ "" ]; 37 | }; 38 | # "custom/ectool-fan" = { 39 | # interval = 1; 40 | # format = "󰈐 {}"; 41 | # exec = "cat /tmp/ectool-fan-rpm"; 42 | # tooltip = "Fan speed"; 43 | # }; 44 | "backlight" = { 45 | format = "{icon} {percent}%"; 46 | format-icons = [ " " " " " " " " " " " " " " " " " " ]; 47 | }; 48 | "battery" = { 49 | interval = 5; 50 | states = { 51 | good = 100; 52 | warning = 50; 53 | critical = 25; 54 | }; 55 | format = "{icon} {capacity}% {power:2.1f}W"; 56 | format-charging = " {capacity}% {power:2.1f}W"; 57 | format-plugged = " {capacity}% {power:2.1f}W"; 58 | format-alt = "{icon} {time}"; 59 | format-icons = [ " " " " " " " " " " ]; 60 | }; 61 | "power-profiles-daemon" = { 62 | format = "{icon}"; 63 | tooltip-format = '' 64 | Power profile: {profile} 65 | Driver: {driver}''; 66 | tooltip = true; 67 | format-icons = { 68 | default = "-"; 69 | performance = " "; 70 | balanced = " "; 71 | "power-saver" = " "; 72 | }; 73 | }; 74 | }; 75 | }; 76 | }; 77 | } 78 | -------------------------------------------------------------------------------- /nix/home/modules/mongoshrc.js: -------------------------------------------------------------------------------- 1 | const ports = { 2 | gappa: 27117, 3 | study: 27118, 4 | achoo: 27119, 5 | snafu: 27217, 6 | rubik: 27317, 7 | feck1: 27417, 8 | kaiju: 27917, 9 | fw: 27417, 10 | crom: 27418 11 | }; 12 | const defaultOpts = { 13 | port: ports.gappa, 14 | db: 'lichess', 15 | deleteFirst: false, 16 | } 17 | 18 | const fid = (coll, id, proj = {}) => db.getCollection(coll).findOne({ _id: id }, proj); 19 | const find = (coll, query, proj = {}) => db.getCollection(coll).find(query, proj); 20 | 21 | const upid = (coll, id, up) => db.getCollection(coll).updateOne({ _id: id }, { $set: up }); 22 | 23 | const prod = (port, db = 'lichess') => connect(`mongodb://localhost:${port}/${db}`); 24 | const sec = () => prod(ports.gappa); 25 | 26 | const secImportOne = (coll, id, opts = {}) => { 27 | opts = { ...defaultOpts, ...opts }; 28 | if (opts.deleteFirst) db[coll].deleteOne({ _id: id }); 29 | const doc = prod(opts.port, opts.db).getCollection(coll).findOne({ _id: id }); 30 | const debug = `${coll}:${id}`; 31 | console.log(doc ? `Importing document ${debug}` : `Document ${debug} not found`); 32 | db[coll].insertOne(doc); 33 | } 34 | 35 | const secImportMany = (coll, query, opts = {}) => { 36 | opts = { ...defaultOpts, ...opts }; 37 | if (opts.deleteFirst) db[coll].deleteMany(query); 38 | let ins = 0, dup = 0; 39 | prod(opts.port, opts.db).getCollection(coll).find(query).forEach(doc => { 40 | try { 41 | db[coll].insertOne(doc); 42 | ins++; 43 | if ((ins + dup) % 1000 === 0) console.log(`Inserted: ${ins}, Duplicates: ${dup}`); 44 | } catch (e) { 45 | dup++; 46 | } 47 | }); 48 | console.log(`Inserted: ${ins}, Duplicates: ${dup}`); 49 | } 50 | 51 | const uploadOne = (coll, id, opts = {}) => { 52 | opts = { ...defaultOpts, port: ports.kaiju, ...opts }; 53 | prod(opts.port, opts.db).getCollection(coll).insertOne(db[coll].findOne({ _id: id })); 54 | } 55 | 56 | const uploadMany = (coll, query, opts = {}) => { 57 | opts = { ...defaultOpts, port: ports.kaiju, ...opts }; 58 | const prodColl = prod(opts.port, opts.db).getCollection(coll); 59 | db[coll].find(query).forEach(doc => { 60 | try { 61 | prodColl.insertOne(doc) 62 | } catch (e) { 63 | console.error(`Error uploading ${coll}:${doc._id} ${e.code}`) 64 | } 65 | }); 66 | } 67 | 68 | const changeId = (coll, oldId, newId) => { 69 | const doc = db[coll].findOne({ _id: oldId }); 70 | if (!doc) { 71 | console.log(`Document ${coll}:${oldId} not found`); 72 | return; 73 | } 74 | doc._id = newId; 75 | try { 76 | db[coll].insertOne(doc); 77 | db[coll].deleteOne({ _id: oldId }); 78 | console.log(`Changed id ${coll}:${oldId} -> ${newId}`); 79 | } catch (e) { 80 | console.error(`Error updating id ${coll}:${oldId} -> ${newId}:`, e); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /nix/home/services/lila.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, inputs, ... }: { 2 | systemd.user.services = let 3 | home = config.home.homeDirectory; 4 | bloop = "${pkgs.bloop}/bin/bloop"; 5 | picfit = "${inputs.picfit.defaultPackage.x86_64-linux}/bin/picfit"; 6 | in { 7 | lila = { 8 | Unit = { 9 | Description = "lila"; 10 | Wants = [ "lila-ws.service" "lila-watch.service" ]; 11 | }; 12 | Service = { 13 | WorkingDirectory = "${home}/lila"; 14 | ExecStart = "${bloop} run lila"; 15 | ExecStop = "${pkgs.psmisc}/bin/fuser -k 9663/tcp -TERM"; 16 | }; 17 | Install = { WantedBy = [ "multi-user.target" ]; }; 18 | }; 19 | lila-watch = { 20 | Unit = { Description = "lila-watch"; }; 21 | Service = { 22 | Environment = "DISPLAY=:0"; 23 | ExecStart = pkgs.writeShellScript "lila-watch.sh" '' 24 | journalctl --user --since=now -fu lila | ${pkgs.gawk}/bin/awk '\ 25 | /Listening for HTTP on / { system("${pkgs.libnotify}/bin/notify-send \"lila ready\" -t 1000 -u low") } \ 26 | /Failed with result / { system("${pkgs.libnotify}/bin/notify-send \"lila fail\" -t 2000 -u critical") }' 27 | ''; 28 | }; 29 | Install = { WantedBy = [ "multi-user.target" ]; }; 30 | }; 31 | lila-ws = { 32 | Unit = { Description = "lila-ws"; }; 33 | Service = { 34 | WorkingDirectory = "${home}/lila-ws"; 35 | ExecStart = 36 | "${bloop} run lila-ws -- -J-Dcsrf.origin=https://l.org -J-Dlogback.configurationFile=logback.dev.xml -J-Dkamon.influxdb.hostname=monitor.lichess.ovh"; 37 | ExecStop = "${pkgs.psmisc}/bin/fuser -k 9664/tcp -TERM"; 38 | }; 39 | Install = { WantedBy = [ "lila.target" ]; }; 40 | }; 41 | lila-fishnet = { 42 | Unit = { Description = "lila-fishnet"; }; 43 | Service = { 44 | WorkingDirectory = "${home}/lila-fishnet"; 45 | ExecStart = "${bloop} run app"; 46 | }; 47 | Install = { WantedBy = [ "lila.target" ]; }; 48 | }; 49 | # lila-search = { 50 | # Unit = { 51 | # Description = "lila-search"; 52 | # }; 53 | # Service = { 54 | # ExecStart = "${bloop} run lila-search -m play.core.server.ProdServerStart -c ${home}/lila-search/.bloop"; 55 | # ExecStop = "rm ${home}/lila-search/RUNNING_PID"; 56 | # }; 57 | # Install = { 58 | # WantedBy = [ "multi-user.target" ]; 59 | # }; 60 | # }; 61 | picfit = { 62 | Unit = { Description = "Picfit lila image server"; }; 63 | Service = { 64 | ExecStart = "${picfit} -c ${home}/picfit/config.json"; 65 | StandardOutput = "journal"; 66 | StandardError = "journal"; 67 | SyslogIdentifier = "picfit"; 68 | }; 69 | Install = { WantedBy = [ "lila.target" ]; }; 70 | }; 71 | }; 72 | } 73 | -------------------------------------------------------------------------------- /nvim/lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | -- Keymaps are automatically loaded on the VeryLazy event █ 2 | -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua █ 3 | -- Add any additional keymaps here 4 | 5 | require("config.keymaps_colemak") 6 | require("config.keymaps_lazyvim") 7 | 8 | local function map(mode, lhs, rhs, opts) 9 | local keys = require("lazy.core.handler").handlers.keys 10 | ---@cast keys LazyKeysHandler 11 | -- do not create the keymap if a lazy keys handler exists 12 | if not keys.active[keys.parse({ lhs, mode = mode }).id] then 13 | opts = opts or {} 14 | opts.silent = opts.silent ~= false 15 | vim.keymap.set(mode, lhs, rhs, opts) 16 | end 17 | end 18 | 19 | map("n", "!", ":!") 20 | 21 | -- close quickfix and other pesky windows 22 | map("n", "wo", "only", { desc = "Close other windows" }) 23 | 24 | -- delete buffer and file 25 | map("n", "bD", "!rm %:bd!", { desc = "Delete file" }) 26 | 27 | -- Copy current file path to registers "* and "+ 28 | map("n", "cp", "let @*=@%:let @+=@%") 29 | 30 | -- Start a substitute 31 | map("n", "ss", ":%s/") 32 | 33 | -- Pull word under cursor into LHS of a substitute (for quick search and replace) 34 | map("n", "zs", ':%s#=expand("")#') 35 | 36 | -- wordwise yank from line above 37 | vim.cmd([[ 38 | inoremap :let @z = @"mz 39 | \:exec 'normal!' (col('.')==1 && col('$')==1 ? 'k' : 'kl') 40 | \:exec (col('.')==col('$')-1 ? 'let @" = @_' : 'normal! yw') 41 | \`zp:let @" = @za 42 | ]]) 43 | 44 | -- Make the current file executable 45 | map("n", "%", ":!chmod +x %") 46 | 47 | -- Expand current filed dir in console mode 48 | map("c", "%%", "=expand('%:h').'/'") 49 | 50 | -- Jump to line AND col 51 | map("n", "'", "`") 52 | 53 | -- Add empty lines before and after cursor line 54 | map("n", "[", "call append(line('.') - 1, repeat([''], v:count1))", { desc = "Put empty line above" }) 55 | map("n", "]", "call append(line('.'), repeat([''], v:count1))", { desc = "Put empty line below" }) 56 | 57 | -- Duplicate line and comment the first line 58 | map("n", "ycc", '"yy" . v:count1 . "gcc\']p"', { remap = true, expr = true }) 59 | 60 | -- Reselect latest changed, put, or yanked text 61 | map( 62 | "n", 63 | "v", 64 | '"`[" . strpart(getregtype(), 0, 1) . "`]"', 65 | { expr = true, desc = "Visually select changed text" } 66 | ) 67 | 68 | -- Correct latest misspelled word by taking first suggestion. 69 | -- Use `u` in Insert mode to mark this as separate undoable action. 70 | -- Source: https://stackoverflow.com/a/16481737 71 | -- NOTE: this remaps `` in Normal mode (completely stops Neovim), but 72 | -- it seems to be too harmful anyway. 73 | map("n", "", "[s1z=", { desc = "Correct latest misspelled word" }) 74 | map("i", "", "u[s1z=`]au", { desc = "Correct latest misspelled word" }) 75 | -------------------------------------------------------------------------------- /nvim/lua/plugins/coding.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- swap arguments and things 3 | { 4 | "mizlan/iswap.nvim", 5 | keys = { 6 | { "gw", ":ISwapWithRight", desc = "Swap two arguments" }, 7 | { "is", ":ISwap", desc = "Swap many arguments" }, 8 | }, 9 | opts = { 10 | keys = "arstdhneio", 11 | }, 12 | }, 13 | 14 | -- autocompletion https://www.lazyvim.org/extras/coding/blink 15 | { 16 | "saghen/blink.cmp", 17 | opts = function(_, opts) 18 | opts.sources.default = { "copilot", "lsp", "buffer", "path" } 19 | opts.keymap = { 20 | preset = nil, 21 | [""] = { "select_and_accept" }, 22 | [""] = { "show", "accept" }, 23 | [""] = { "hide" }, 24 | [""] = { "select_prev" }, 25 | [""] = { "select_next" }, 26 | } 27 | opts.completion.accept.auto_brackets.enabled = false 28 | opts.completion.documentation = { 29 | auto_show = true, 30 | auto_show_delay_ms = 50, 31 | update_delay_ms = 50, 32 | } 33 | -- Displays a preview of the selected item on the current line 34 | opts.completion.ghost_text = { 35 | enabled = true, 36 | } 37 | end, 38 | }, 39 | 40 | -- 30ms of load time for not much use 41 | { "rafamadriz/friendly-snippets", enabled = false }, 42 | { "garymjr/nvim-snippets", enabled = false }, 43 | 44 | { "nvim-mini/mini.pairs", enabled = false }, 45 | 46 | -- surround 47 | { 48 | "nvim-mini/mini.surround", 49 | opts = { 50 | mappings = { 51 | add = "sa", -- Add surrounding in Normal and Visual modes 52 | delete = "sd", -- Delete surrounding 53 | find = "sf", -- Find surrounding (to the right) 54 | find_left = "sF", -- Find surrounding (to the left) 55 | highlight = "sh", -- Highlight surrounding 56 | replace = "sr", -- Replace surrounding 57 | update_n_lines = "sn", -- Update `n_lines` 58 | }, 59 | }, 60 | }, 61 | 62 | { 63 | "stevearc/conform.nvim", 64 | opts = { 65 | formatters_by_ft = { 66 | nix = { "nixfmt" }, 67 | scss = { "prettierd" }, 68 | typescript = { "prettierd" }, 69 | markdown = { "prettierd" }, 70 | ["markdown.mdx"] = { "prettierd" }, 71 | }, 72 | }, 73 | }, 74 | 75 | { 76 | "nvim-treesitter/nvim-treesitter", 77 | opts = { 78 | ensure_installed = { 79 | "bash", 80 | "c", 81 | "css", 82 | "diff", 83 | "html", 84 | "javascript", 85 | "jsdoc", 86 | "json", 87 | "jsonc", 88 | "lua", 89 | "luadoc", 90 | "luap", 91 | "markdown", 92 | "markdown_inline", 93 | "nix", 94 | "printf", 95 | "python", 96 | "query", 97 | "regex", 98 | "rust", 99 | "scala", 100 | "scss", 101 | "toml", 102 | "tsx", 103 | "typescript", 104 | "vim", 105 | "vimdoc", 106 | "xml", 107 | "yaml", 108 | }, 109 | }, 110 | }, 111 | } 112 | -------------------------------------------------------------------------------- /nix/home/modules/git.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | 3 | programs.git = { 4 | enable = true; 5 | settings = { 6 | user.name = "Thibault Duplessis"; 7 | user.email = "t@lichess.org"; 8 | 9 | alias = { 10 | l = let format = "%Cred%h%Creset %Cblue%ad%Creset %Cgreen%an%Creset %s"; 11 | in ''log --pretty=format:"${format}"''; 12 | }; 13 | 14 | core = { 15 | editor = "neovide"; 16 | whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol"; 17 | }; 18 | merge.conflictStyle = "zdiff3"; 19 | diff.tool = "meld"; 20 | web.browser = "firefox"; 21 | push.default = "tracking"; 22 | push.autoSetupRemote = true; 23 | pull.rebase = false; 24 | rebase.autoStash = true; 25 | branch.autosetupmerge = true; 26 | init.defaultBranch = "master"; 27 | rerere.enabled = true; 28 | color.ui = true; 29 | blame.date = "relative"; 30 | paging.colorArg = "never"; 31 | }; 32 | 33 | lfs.enable = true; 34 | 35 | ignores = [ 36 | ".idea" 37 | ".venv" 38 | ".bloop" 39 | ".metals" 40 | ".bsp" 41 | "project/metals.sbt" 42 | "project/project" 43 | "**/*.worksheet.sc" 44 | ]; 45 | }; 46 | 47 | programs.delta = { 48 | enable = true; 49 | enableGitIntegration = true; 50 | options = { 51 | navigate = false; 52 | syntax-theme = "none"; 53 | features = "catppuccin-mocha"; 54 | true-color = "always"; 55 | catppuccin-mocha = { 56 | blame-palette = "#1e1e2e #181825 #11111b #313244 #45475a"; 57 | commit-decoration-style = "#6c7086 bold box ul"; 58 | dark = true; 59 | file-decoration-style = "#6c7086"; 60 | file-style = "#cdd6f4"; 61 | hunk-header-decoration-style = "#6c7086 box ul"; 62 | hunk-header-file-style = "bold"; 63 | hunk-header-line-number-style = "bold #a6adc8"; 64 | hunk-header-style = "file line-number syntax"; 65 | minus-emph-style = "bold syntax #694559"; 66 | minus-style = "syntax #493447"; 67 | plus-emph-style = "bold syntax #4e6356"; 68 | plus-style = "syntax #394545"; 69 | map-styles = '' 70 | bold purple => syntax "#5b4e74", 71 | bold blue => syntax "#445375", 72 | bold cyan => syntax "#446170", 73 | bold yellow => syntax "#6b635b"''; 74 | }; 75 | }; 76 | }; 77 | 78 | programs.gh = { 79 | enable = true; 80 | gitCredentialHelper.enable = true; 81 | }; 82 | 83 | programs.zsh.shellAliases = { 84 | "t" = "lazygit"; 85 | "g" = "git"; 86 | "gs" = "git status"; 87 | "ga" = "git add -A"; 88 | "gf" = "git fetch"; 89 | "gp" = "git push"; 90 | "gl" = "git pull"; 91 | "glr" = "git pull --rebase"; 92 | "gc" = "git commit -v"; 93 | "gca" = "git commit --amend"; 94 | "gch" = "git commit --amend -C HEAD"; 95 | "gac" = "git commit -av"; 96 | "gb" = "git branch -v"; 97 | "gba" = "git branch -va"; 98 | "gcp" = "git cherry-pick"; 99 | "glo" = "git l"; 100 | "gco" = "git checkout"; 101 | "gm" = "git merge"; 102 | "gmt" = "git mergetool --no-prompt"; 103 | "gd" = "git diff"; 104 | "gr" = "git remote -v"; 105 | "gcf" = "git clean -f"; 106 | "grh" = "git reset --hard"; 107 | "grhh" = "git reset --hard HEAD"; 108 | }; 109 | } 110 | -------------------------------------------------------------------------------- /thibault.duplessis.public_key.gpg: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | 3 | mQENBE7JXkIBCADcJdQnFcXwIr0cZ3YyM/rPBJdEFJGAbrj4xqc07SN+Tu4G1vdM 4 | AqEwvDnOkEUxFOPwCDsGbgOWf6dmIEjBe9iyqia7rtPJeMdw5o2VDxQx2ppTbcOF 5 | sfccyWLsPlXfZvk+w2Ylu/sQ/R5TLJX8xMfGpNCKD4udYG13PSBycUqcfYASUvnS 6 | ht4lqR5kRsE2Pxzqvf1d0l7rDrHJM2jjv1z3fgAdeBA+rUGr7Uk0nSwA4dzryDuq 7 | /FWgVf8WxTbesrbUyhgQU/C9cgT2riv6JjMukUPzQEZO1RJGA5aJxrJMSQjgiI2G 8 | 0ymJbultg8biAkdCxY6Txsb9+tobDLy/VGEnABEBAAG0MVRoaWJhdWx0IER1cGxl 9 | c3NpcyA8dGhpYmF1bHQuZHVwbGVzc2lzQGdtYWlsLmNvbT6JATgEEwECACIFAk7J 10 | XkICGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJECbBbMoml0WPIcIIAKwh 11 | lM8vC7Yipbn6I7VO4o7CV/MWIpdlBytKkFOahg//+AZnqok/IbG1aFfACpTM8Ric 12 | i22SbOlHkZGP7uLfwE6Dkp5sr7ENuPAKLmikwo+qBEeXBfMrj5pzovlSmoT/kaiR 13 | mT4UKMC66hL0gTTdYQNVetk12XK0XyQSy+1nRq489cAfGnA/Yx2cIGkidGkPAj15 14 | IcbzD0sXix/zS5OBoqXiOsnAPkyDS51fvVTBQvedZxYvoHg9o2GTN9WOtmr8gzWS 15 | xxVGoQquiKTZOVDPRn3mGmPAA7mFhvTf1qeG+b5nunrMH2T0fBmHGp8HfwdBM0H7 16 | npYNdLjHKDUd04nfBMu5AQ0ETsleQgEIAKtsBjqz0zUvBjjFJV22kPeeUcrj68y/ 17 | 8QOARz0M6z9MOyorVhJJV/qZF8RVqNUVDLvpLiB/2+8LJ1zEtklzZmuvlgNT4Q/3 18 | QUkS5jjRxVgK3ddYxxvxDVzcf2UE7pABMp4TLulkCkqzDAGRVMQ7jPWbOLP7BQyZ 19 | q7Yro8drpCx+eN18pPbjBcuBgJSgXTNLvdGeP6J+9gUIWQxERfPb8WnaItpXlzw7 20 | PJl3OQnNgSaeXh4YjKG9URPCjQEkdcp6AQkrw3VsbPVJZirPud1V6Qh1lzPxSL23 21 | EZZtxEU9lGbw6Z/dW3nTL1cB2bFvpr0fbHSwm/FesPKHFTyy0vuIhLEAEQEAAYkB 22 | HwQYAQIACQUCTsleQgIbDAAKCRAmwWzKJpdFj0UfCACWpQsznnDlXw+wbWBEg3ir 23 | OzF1D59/IFF3I+PX/DA95AIL6R9hv8Z5KwH2cxYIkIxfeg9Ta9/kk3Cuyj/US74B 24 | HFiTq3y/ePSp/fPLMaafCyF49ngHkEycTWJd2sU7LQBQFMl1QyWED3SXu3oSLK9y 25 | KnC/16Hm0VzlfkX4IhI8EH5R+LsM22FBQob7azDsHgAwGQ5DhGwdMWS9rYRJ/7vf 26 | Cc+SkMJ9nuS+ZijDV5Jrl8gDth1J9ihmBMcjZiG2vvnh61F5WZbndnN48xZUtWS0 27 | eqGWxaFV5kPgZfI6KKtzn2DANNFSor7YtPaWN7VEr5IYKYRRYczhwOFWKi0PMXzF 28 | mQENBF5noi0BCADCqGxH6e4gtM8rU6jHV9bcv1AD4U7IbdIMEfDqP+T7XYwR4wbj 29 | q2UrPu1wisWSPLOznJYy73t1zxOaWBMJJknScrrGyF4pNVWAAYPlZj7uH7F5DBFX 30 | P6XNUAO9ba8ZXbeLq4cH8qdazL7z4sQ1aH9bXWvEtnij6I6ASrWsC3WwyxLhEQwH 31 | kYckkFhMNl8J2m4g5We0zLsXxKEcnt2uOYW2d2M1KlAVHFykfdlj8zlLjag3Ua1l 32 | 5QiAXLu5rlsm/fj/Ca7Uqlt0JrslJj+P+sDHFjyLc4sUBOepo2SkXoFJt/rH6eXC 33 | Ik48fgMohOB2+Du8cvnFhANAFy/t78dnLeorABEBAAG0KVRoaWJhdWx0IER1cGxl 34 | c3NpcyA8dGhpYmF1bHRAbGljaGVzcy5vcmc+iQFOBBMBCAA4FiEEnD4Tjyf9Lhtb 35 | /8kk8J7c/lETjZ8FAl5noi0CGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ 36 | 8J7c/lETjZ9DfggAga1aLJiOyPYFR2MlYYQBcquvl91i6U9gbnklxBHaBDjxjH3K 37 | jOJwUFexta6w56zolNOmo24/l4rJlTmDMcY7t5hosNGNZ7eQZt5ZQeP6YFfn24dD 38 | BjNKeZ0BRkfhZUO9iFXWlsVjJQ9Tlk1Mii6jVkX65OtLi75I3rF9CNxAFSPckm+R 39 | 7TuLfr7crmnNzuCtJxk6UNZikDQSvZAR+821PT73ykLdIwD/yU4sVXlFPlY1HLP8 40 | 99e0wU058+jI2aPJYqgbo9z37VV6MX9zeI/ZQ6Y28FlcnlsSUDtX+SsmIfMLpSm7 41 | wxNeNgQAwOMOwNMcdMK/OIHEMIWsf/P61CPgTrkBDQReZ6ItAQgAxiJW+rDK0Plt 42 | QhxOjqnLYhtS8/pCJ6LjF5TxhlWEyH24tejgcXSEfZpiV0POOIeNqP1wmovAa67A 43 | 509twy/92e2y6FVCQ4EXforbfDH6hwjNUklxcLJ5yiVUYX3E4Ivi14AtPLCXmned 44 | h+ncK64A+q62tOLeyvSSibQYyTxtB9o4JDD+hrvtjDBUPMO+5N/mqcoGL9Rbv8Zr 45 | uUt+qNe5q7yOUqQHTQ8dSfd2DDjZJoLr2RbzLSJVxgfsO1EpARhGKaAP3cNsbAuE 46 | GHKEdJ7uSk9QoT4XJTxlV1UDxErslOvbdCtwtmDXpgVOXY5P4tifjTciBTxq17Xu 47 | lmbPcO9PLwARAQABiQE2BBgBCAAgFiEEnD4Tjyf9Lhtb/8kk8J7c/lETjZ8FAl5n 48 | oi0CGwwACgkQ8J7c/lETjZ9KSAgAjR1IQTZsrqqVi3qYLi/1YWL4P/3HT+dRwJvc 49 | RYCU3eKTed1NvxZSca5fO+D17bMeLwoxaw1D2TJ7CwACbD/pY4Oi2Plc2pFQdI/b 50 | tkzrATc2Uf0emUYMc32AvlIvQvpIm0O+ffB2d7/5F6/8O1HrA/ogK2Npx6EyAI7J 51 | xjYwvr2GfrBp7UlySS/PtR3cRrVOHhdegsOu5vSHHZz53Y6/UAUjv2rCtswur6Zt 52 | NOPigSeyhHHdW0KodjtheqTyH3lvSJbCKPBT56fEZGXW9wVE9NzIrjITqqYg4RJE 53 | 13xwqwWEEVW1ezcmJ9XvIMrKIDTEIexJCUH9SHgH/IvzYOSxPw== 54 | =vMNl 55 | -----END PGP PUBLIC KEY BLOCK----- 56 | -------------------------------------------------------------------------------- /nvim/lua/plugins/dashboard.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/snacks.nvim", 4 | opts = { 5 | dashboard = { 6 | preset = { 7 | keys = { 8 | { 9 | icon = "󰘬 ", 10 | key = "g", 11 | desc = "Git", 12 | action = function() 13 | Snacks.lazygit() 14 | end, 15 | }, 16 | { 17 | icon = " ", 18 | key = "f", 19 | desc = "Find File", 20 | action = ":lua Snacks.dashboard.pick('files', {winopts={fullscreen=true}})", 21 | }, 22 | { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, 23 | { icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" }, 24 | { icon = " ", key = "s", desc = "Restore Session", section = "session" }, 25 | { icon = " ", key = "p", desc = "Select Project", action = ":lua require('persistence').select()" }, 26 | { icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy", enabled = package.loaded.lazy ~= nil }, 27 | { icon = " ", key = "q", desc = "Quit", action = ":qa" }, 28 | }, 29 | header = [[ 30 | ================= =============== =============== ======== ======== 31 | \\ . . . . . . .\\ //. . . . . . .\\ //. . . . . . .\\ \\. . .\\// . . // 32 | ||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\/ . . .|| 33 | || . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . || 34 | ||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .|| 35 | || . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\ . . . . || 36 | ||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\_ . .|. .|| 37 | || . _|| || || || || ||_ . || || . _|| || || || |\ `-_/| . || 38 | ||_-' || .|/ || || \|. || `-_|| ||_-' || .|/ || || | \ / |-_.|| 39 | || ||_-' || || `-_|| || || ||_-' || || | \ / | `|| 40 | || `' || || `' || || `' || || | \ / | || 41 | || .===' `===. .==='.`===. .===' /==. | \/ | || 42 | || .==' \_|-_ `===. .===' _|_ `===. .===' _-|/ `== \/ | || 43 | || .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \/ | || 44 | || .==' _-' '-__\._-' '-_./__-' `' |. /| | || 45 | ||.==' _-' `' | /==.|| 46 | ==' _-' N E O V I M \/ `== 47 | \ _-' `-_ / 48 | `'' ``' 49 | ]], 50 | }, 51 | sections = { 52 | { section = "header" }, 53 | { section = "keys", gap = 1, padding = 1 }, 54 | { pane = 2, icon = " ", title = "Projects", section = "projects", limit = 10, indent = 2, padding = 1 }, 55 | { 56 | pane = 2, 57 | icon = " ", 58 | title = "Git Status", 59 | section = "terminal", 60 | enabled = function() 61 | return Snacks.git.get_root() ~= nil 62 | end, 63 | cmd = "git status --short --branch --renames", 64 | height = 5, 65 | padding = 1, 66 | ttl = 5 * 60, 67 | indent = 3, 68 | }, 69 | { section = "startup" }, 70 | }, 71 | }, 72 | }, 73 | }, 74 | } 75 | -------------------------------------------------------------------------------- /nix/overlays/default.nix: -------------------------------------------------------------------------------- 1 | { inputs, ... }: { 2 | 3 | # When applied, the unstable nixpkgs set (declared in the flake inputs) will 4 | # be accessible through 'pkgs.unstable' 5 | # unstable-packages = final: _prev: { 6 | # unstable = import inputs.nixpkgs-unstable { 7 | # system = final.system; 8 | # config.allowUnfree = true; 9 | # }; 10 | # }; 11 | 12 | # This one brings our custom packages from the 'pkgs' directory 13 | additions = final: _prev: import ../pkgs final.pkgs; 14 | 15 | # This one contains whatever you want to overlay 16 | # You can change versions, add patches, set compilation flags, anything really. 17 | # https://nixos.wiki/wiki/Overlays 18 | modifications = final: prev: { 19 | 20 | # Get latest bloop 21 | bloop = (import inputs.nixpkgs-master { 22 | system = final.system; 23 | config.allowunfree = true; 24 | }).bloop; 25 | 26 | # stable gimp 27 | gimp = (import inputs.nixpkgs-stable { 28 | system = final.system; 29 | config.allowunfree = true; 30 | }).gimp; 31 | 32 | # stable neovim 33 | # neovim = (import inputs.nixpkgs-stable { 34 | # system = final.system; 35 | # config.allowunfree = true; 36 | # }).neovim; 37 | 38 | openrgb = prev.openrgb.overrideAttrs (previousAttrs: { 39 | version = "candidate_1.0rc2-dev"; 40 | src = prev.fetchFromGitHub { 41 | owner = "CalcProgrammer1"; 42 | repo = "OpenRGB"; 43 | rev = "56b75aaffc730f1e28c77d576d94d70983bb1db7"; 44 | hash = "sha256-/jbwP8urk0wgj3KCGuUSwJfbKqSV9GQO/dc5d3ZJiT0="; 45 | }; 46 | patches = [ ]; 47 | 48 | postPatch = '' 49 | patchShebangs scripts/build-udev-rules.sh 50 | substituteInPlace scripts/build-udev-rules.sh \ 51 | --replace /bin/chmod "${prev.coreutils}/bin/chmod" 52 | substituteInPlace scripts/build-udev-rules.sh \ 53 | --replace /usr/bin/env "${prev.coreutils}/bin/env" 54 | ''; 55 | }); 56 | 57 | easyeffects = (import inputs.nixpkgs-stable { 58 | system = final.system; 59 | config.allowunfree = true; 60 | }).easyeffects; 61 | 62 | # esbuild = prev.esbuild.overrideAttrs (previousAttrs: rec { 63 | # version = "0.25.9"; 64 | # src = prev.fetchFromGitHub { 65 | # owner = "evanw"; 66 | # repo = "esbuild"; 67 | # rev = "v${version}"; 68 | # hash = "sha256-eaYDUKtTEisSNyb5KN+32JX1yY/UJ4/UDQwzToEMAkw="; 69 | # }; 70 | # }); 71 | 72 | # stockfish = let 73 | # version = "17.1"; 74 | # arch = "x86-64-avx512"; 75 | # # see src/evaluate.h for nnue names 76 | # nnueBigFile = "nn-1c0000000000.nnue"; 77 | # nnueSmallFile = "nn-37f18f62d772.nnue"; 78 | # nnueBig = prev.fetchurl { 79 | # name = nnueBigFile; 80 | # url = "https://tests.stockfishchess.org/api/nn/${nnueBigFile}"; 81 | # sha256 = "sha256-HAAAAAAApn1imZnZMtDDc/dFDOQ80S0FYoaPTq+a4q0="; 82 | # }; 83 | # nnueSmall = prev.fetchurl { 84 | # name = nnueSmallFile; 85 | # url = "https://tests.stockfishchess.org/api/nn/${nnueSmallFile}"; 86 | # sha256 = "sha256-N/GPYtdy8xB+HWqso4mMEww8hvKrY+ZVX7vKIGNaiZ0="; 87 | # }; 88 | # in prev.stockfish.overrideAttrs (previousAttrs: { 89 | # version = "${version}"; 90 | # src = prev.fetchFromGitHub { 91 | # owner = "official-stockfish"; 92 | # repo = "Stockfish"; 93 | # rev = "sf_${version}"; 94 | # sha256 = "sha256-c8o1d7/yPnF3Eo7M/MSzYuYQr2qt2tIwyu7WfuKMAzg="; 95 | # }; 96 | # postUnpack = '' 97 | # sourceRoot+=/src 98 | # cp "${nnueBig}" "$sourceRoot/${nnueBigFile}" 99 | # cp "${nnueSmall}" "$sourceRoot/${nnueSmallFile}" 100 | # ''; 101 | # makeFlags = [ 102 | # "PREFIX=$(out)" 103 | # "ARCH=${arch}" 104 | # "CXX=${prev.stdenv.cc.targetPrefix}c++" 105 | # ]; 106 | # buildFlags = [ "build" ]; 107 | # }); 108 | }; 109 | } 110 | -------------------------------------------------------------------------------- /nix/home/modules/waybar.nix: -------------------------------------------------------------------------------- 1 | { ... }: { 2 | programs.waybar = { 3 | enable = true; 4 | settings = { 5 | mainBar = { 6 | layer = "top"; 7 | position = "bottom"; 8 | modules-left = [ "sway/workspaces" "sway/mode" ]; 9 | modules-center = [ "sway/window" ]; 10 | "sway/workspaces" = { 11 | disable-scroll = true; 12 | all-outputs = true; 13 | window-rewrite = { }; # just to get rid of the warning 14 | }; 15 | "sway/mode" = { "format" = " {}"; }; 16 | idle_inhibitor = { 17 | format = "{icon}"; 18 | format-icons = { 19 | activated = " "; 20 | deactivated = " "; 21 | }; 22 | }; 23 | # "sway/language" = { 24 | # "tooltip-format" = "{long}"; 25 | # "format" = " {variant}"; 26 | # }; 27 | "clock#local" = { 28 | tooltip-format = '' 29 | {:%Y %B} 30 | {calendar}''; 31 | format-alt = "{:%Y-%m-%d}"; 32 | }; 33 | "clock#utc" = { 34 | timezone = "UTC"; 35 | format-alt = "{:%Y-%m-%d}"; 36 | }; 37 | "memory" = { 38 | format = " {percentage}%  {swapPercentage}%"; 39 | states = { 40 | warning = 70; 41 | critical = 85; 42 | }; 43 | }; 44 | "network" = { 45 | interval = 1; 46 | # "format-wifi" = " {essid} {signalStrength}% {bandwidthTotalBytes}"; 47 | "format-wifi" = " {essid} {signalStrength}%"; 48 | "tooltip-format" = "{bandwidthTotalBytes} {ifname} via {gwaddr}"; 49 | "format-linked" = " {ifname} (No IP)"; 50 | "format-disconnected" = "Disconnected ⚠ {ifname}"; 51 | "format-alt" = " {ifname}: {ipaddr}/{cidr}"; 52 | }; 53 | pulseaudio = { 54 | "scroll-step" = 2; 55 | "format" = "{icon} {volume}%"; 56 | #"format-bluetooth"= "{icon} {volume}%"; 57 | "format-muted" = ""; 58 | "format-icons" = { 59 | "headphones" = ""; 60 | "handsfree" = ""; 61 | "headset" = ""; 62 | "phone" = ""; 63 | "portable" = ""; 64 | "car" = ""; 65 | "default" = [ "" "" ]; 66 | }; 67 | "on-click" = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; 68 | }; 69 | }; 70 | }; 71 | style = # css 72 | '' 73 | window#waybar > box { 74 | opacity: 0.9; 75 | } 76 | #workspaces { 77 | opacity: 0.6; 78 | } 79 | .modules-right label { 80 | margin: 0 5px; 81 | } 82 | #tray { 83 | margin: 0 15px; 84 | } 85 | #cpu { 86 | opacity: 0.6; 87 | } 88 | .good { 89 | color: @base0B; 90 | } 91 | .warning:not(.charging) { 92 | color: @base09; 93 | } 94 | .critical:not(.charging), 95 | #network.disconnected { 96 | color: @base08; 97 | } 98 | #battery.charging, 99 | #battery.plugged { 100 | color: @base0B; 101 | } 102 | #battery:not(.charging) { 103 | font-weight: bold; 104 | } 105 | #battery.critical:not(.charging) { 106 | background-color: red; 107 | color: #ffffff; 108 | font-weight: bold; 109 | } 110 | #workspaces button.urgent { 111 | background-color: @base09; 112 | } 113 | #clock.utc { 114 | margin: 0; 115 | } 116 | #clock.local { 117 | font-weight: bold; 118 | } 119 | #idle_inhibitor.activated { 120 | background-color: @base08; 121 | font-weight: bold; 122 | color: #ffffff; 123 | } 124 | #custom-spotify { 125 | margin-left: 20px; 126 | color: @base0E; 127 | } 128 | ''; 129 | }; 130 | } 131 | -------------------------------------------------------------------------------- /nix/home/crom/s-tui.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | 3 | # sensors tui 4 | 5 | home.packages = with pkgs; [ s-tui ]; 6 | 7 | home.file.".config/s-tui/s-tui.conf".text = '' 8 | [GraphControl] 9 | refresh = 2.0 10 | utf8 = True 11 | 12 | [Temp,Graphs] 13 | edge,0 = True 14 | junction,0 = False 15 | mem,0 = False 16 | edge,1 = False 17 | tctl,0 = True 18 | mt7921_phy0,0 = False 19 | cpu,0 = False 20 | system,0 = True 21 | vrmmos,0 = True 22 | pch,0 = False 23 | cpusocket,0 = True 24 | pciex1,0 = False 25 | composite,0 = False 26 | sensor1,0 = True 27 | sensor2,0 = False 28 | spd5118,0 = True 29 | spd5118,1 = False 30 | 31 | [Frequency,Graphs] 32 | avg = False 33 | core 0 = True 34 | core 1 = True 35 | core 2 = True 36 | core 3 = True 37 | core 4 = False 38 | core 5 = False 39 | core 6 = False 40 | core 7 = False 41 | core 8 = False 42 | core 9 = False 43 | core 10 = False 44 | core 11 = False 45 | core 12 = False 46 | core 13 = False 47 | core 14 = False 48 | core 15 = False 49 | core 16 = False 50 | core 17 = False 51 | core 18 = False 52 | core 19 = False 53 | core 20 = False 54 | core 21 = False 55 | core 22 = False 56 | core 23 = False 57 | 58 | [Util,Graphs] 59 | avg = True 60 | core 0 = False 61 | core 1 = False 62 | core 2 = False 63 | core 3 = False 64 | core 4 = False 65 | core 5 = False 66 | core 6 = False 67 | core 7 = False 68 | core 8 = False 69 | core 9 = False 70 | core 10 = False 71 | core 11 = False 72 | core 12 = False 73 | core 13 = False 74 | core 14 = False 75 | core 15 = False 76 | core 16 = False 77 | core 17 = False 78 | core 18 = False 79 | core 19 = False 80 | core 20 = False 81 | core 21 = False 82 | core 22 = False 83 | core 23 = False 84 | 85 | [Power,Graphs] 86 | 87 | [Fan,Graphs] 88 | amdgpu,0 = True 89 | cpu fan = True 90 | pump fan = True 91 | system fan #1 = True 92 | system fan #2 = True 93 | system fan #3 = True 94 | system fan #4 = False 95 | system fan #5 = False 96 | system fan #6 = False 97 | 98 | [Temp,Summaries] 99 | edge,0 = True 100 | junction,0 = False 101 | mem,0 = False 102 | edge,1 = False 103 | tctl,0 = True 104 | mt7921_phy0,0 = False 105 | cpu,0 = False 106 | system,0 = True 107 | vrmmos,0 = True 108 | pch,0 = False 109 | cpusocket,0 = True 110 | pciex1,0 = False 111 | composite,0 = False 112 | sensor1,0 = True 113 | sensor2,0 = False 114 | spd5118,0 = True 115 | spd5118,1 = False 116 | 117 | [Frequency,Summaries] 118 | avg = False 119 | core 0 = True 120 | core 1 = True 121 | core 2 = True 122 | core 3 = True 123 | core 4 = False 124 | core 5 = False 125 | core 6 = False 126 | core 7 = False 127 | core 8 = False 128 | core 9 = False 129 | core 10 = False 130 | core 11 = False 131 | core 12 = False 132 | core 13 = False 133 | core 14 = False 134 | core 15 = False 135 | core 16 = False 136 | core 17 = False 137 | core 18 = False 138 | core 19 = False 139 | core 20 = False 140 | core 21 = False 141 | core 22 = False 142 | core 23 = False 143 | 144 | [Util,Summaries] 145 | avg = True 146 | core 0 = False 147 | core 1 = False 148 | core 2 = False 149 | core 3 = False 150 | core 4 = False 151 | core 5 = False 152 | core 6 = False 153 | core 7 = False 154 | core 8 = False 155 | core 9 = False 156 | core 10 = False 157 | core 11 = False 158 | core 12 = False 159 | core 13 = False 160 | core 14 = False 161 | core 15 = False 162 | core 16 = False 163 | core 17 = False 164 | core 18 = False 165 | core 19 = False 166 | core 20 = False 167 | core 21 = False 168 | core 22 = False 169 | core 23 = False 170 | 171 | [Power,Summaries] 172 | 173 | [Fan,Summaries] 174 | amdgpu,0 = True 175 | cpu fan = True 176 | pump fan = True 177 | system fan #1 = True 178 | system fan #2 = True 179 | system fan #3 = True 180 | system fan #4 = False 181 | system fan #5 = False 182 | system fan #6 = False 183 | ''; 184 | } 185 | -------------------------------------------------------------------------------- /nvim/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "CopilotChat.nvim": { "branch": "main", "commit": "df5376c132382dd47e3e552612940cbf25b3580c" }, 3 | "LazyVim": { "branch": "main", "commit": "28db03f958d58dfff3c647ce28fdc1cb88ac158d" }, 4 | "SchemaStore.nvim": { "branch": "main", "commit": "8b92ea89835b8e5dbc779a675ebb0e5fcb9a1993" }, 5 | "blink-copilot": { "branch": "main", "commit": "7ad8209b2f880a2840c94cdcd80ab4dc511d4f39" }, 6 | "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, 7 | "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, 8 | "catppuccin": { "branch": "main", "commit": "ce8d176faa4643e026e597ae3c31db59b63cef09" }, 9 | "cellular-automaton.nvim": { "branch": "main", "commit": "1606e9d5d04ff254023c3f3c62842d065708d6d3" }, 10 | "conform.nvim": { "branch": "master", "commit": "5f5152fae39a57e3a04cbce09fb21e10c49c9d95" }, 11 | "copilot.lua": { "branch": "master", "commit": "e78d1ffebdf6ccb6fd8be4e6898030c1cf5f9b64" }, 12 | "crates.nvim": { "branch": "main", "commit": "ac9fa498a9edb96dc3056724ff69d5f40b898453" }, 13 | "edgy.nvim": { "branch": "main", "commit": "8bfd2808994a988c975694122f68624b8a219f5f" }, 14 | "firenvim": { "branch": "master", "commit": "a18ef908ac06b52ad9333b70e3e630b0a56ecb3d" }, 15 | "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, 16 | "gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" }, 17 | "grug-far.nvim": { "branch": "main", "commit": "bc589a1ba340a00ae40bf1436401eac5b1454687" }, 18 | "inc-rename.nvim": { "branch": "main", "commit": "2597bccb57d1b570fbdbd4adf88b955f7ade715b" }, 19 | "iswap.nvim": { "branch": "master", "commit": "e02cc91f2a8feb5c5a595767d208c54b6e3258ec" }, 20 | "key-analyzer.nvim": { "branch": "main", "commit": "4e4bef34498e821bcbd5203f44db8b67e4f10e04" }, 21 | "kitty-scrollback.nvim": { "branch": "main", "commit": "2ca6956b9c99cc2d5df0ef1be537b54ccbb7b3d9" }, 22 | "kulala.nvim": { "branch": "main", "commit": "48902de58ea576c30f8aa8e0a791d06b54f9f81f" }, 23 | "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, 24 | "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, 25 | "lsp-format.nvim": { "branch": "master", "commit": "42d1d3e407c846d95f84ea3767e72ed6e08f7495" }, 26 | "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, 27 | "mini.ai": { "branch": "main", "commit": "bfb26d9072670c3aaefab0f53024b2f3729c8083" }, 28 | "mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" }, 29 | "mini.surround": { "branch": "main", "commit": "88c52297ed3e69ecf9f8652837888ecc727a28ee" }, 30 | "mongo.nvim": { "branch": "master", "commit": "15091de723ee0c84832e1bcfb0299984475a4378" }, 31 | "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, 32 | "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, 33 | "nvim-lint": { "branch": "master", "commit": "7a64f4067065c16a355d40d0d599b8ca6b25de6d" }, 34 | "nvim-lspconfig": { "branch": "master", "commit": "d20d83b3f24f5884da73a9fc92fdc47e778b8d0d" }, 35 | "nvim-metals": { "branch": "main", "commit": "6db781444e4f02a73696346ad6ff8d13dbda1032" }, 36 | "nvim-treesitter": { "branch": "main", "commit": "8cdffc6d334731ce3703b6d870a5a34fd878208a" }, 37 | "nvim-treesitter-textobjects": { "branch": "main", "commit": "e91c585ac0ee760198dabc1fad2e6227effdcd5e" }, 38 | "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, 39 | "persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" }, 40 | "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, 41 | "replacer.nvim": { "branch": "master", "commit": "32e1713230844fa52f7f0598c59295de3c90dc95" }, 42 | "rustaceanvim": { "branch": "master", "commit": "0fa0462a2d6c9629e0bd03d1902e6a1472ceac3e" }, 43 | "showkeys": { "branch": "main", "commit": "cb0a50296f11f1e585acffba8c253b9e8afc1f84" }, 44 | "sidekick.nvim": { "branch": "main", "commit": "c2bdf8cfcd87a6be5f8b84322c1b5052e78e302e" }, 45 | "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, 46 | "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, 47 | "ts-comments.nvim": { "branch": "main", "commit": "123a9fb12e7229342f807ec9e6de478b1102b041" }, 48 | "venv-selector.nvim": { "branch": "main", "commit": "58bae72c84b9f7f864c879ec1896e384296f9ffb" }, 49 | "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, 50 | "yanky.nvim": { "branch": "main", "commit": "04fc42b94305d94948c9c197f679336668af3292" } 51 | } 52 | -------------------------------------------------------------------------------- /nvim/lua/plugins/editor.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- sudo with password prompt 3 | -- { 4 | -- "lambdalisue/suda.vim", 5 | -- }, 6 | -- yank ring 7 | { 8 | "gbprod/yanky.nvim", 9 | enabled = true, 10 | opts = { highlight = { timer = 150 } }, 11 | event = "LazyFile", 12 | -- stylua: ignore 13 | keys = { 14 | -- { "mp", function() require("telescope").extensions.yank_history.yank_history({}) end, desc = "Open Yank History", }, 15 | { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank Text", }, 16 | { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor", }, 17 | { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor", }, 18 | { "gp", "(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection", }, 19 | { "]p", "(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, 20 | { "[p", "(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" }, 21 | { "]g", "(YankyCycleForward)" }, 22 | { "[g", "(YankyCycleBackward)" }, 23 | }, 24 | }, 25 | 26 | { 27 | "folke/flash.nvim", 28 | ---@type Flash.Config 29 | opts = { 30 | labels = "nteshdlpufiryw", 31 | modes = { 32 | char = { 33 | enabled = false, 34 | label = { exclude = "rdc" }, 35 | }, 36 | treesitter = { 37 | label = { before = false, after = false }, 38 | }, 39 | }, 40 | }, 41 | keys = function() 42 | -- stylua: ignore 43 | return { 44 | { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, 45 | { "S", mode = { "n", "o", "x" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, 46 | -- { "r", mode = "o", function() requiee("flash").remote() end, desc = "Remote Flash" }, 47 | -- { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, 48 | { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, 49 | } 50 | end, 51 | }, 52 | 53 | { "folke/todo-comments.nvim", enabled = false }, 54 | 55 | { 56 | "folke/trouble.nvim", 57 | opts = { 58 | auto_close = true, -- auto close when there are no items 59 | -- auto_preview = true, -- automatically open preview when on an item 60 | auto_refresh = true, -- auto refresh when open 61 | modes = { 62 | -- errors = { 63 | -- mode = "diagnostics", -- inherit from diagnostics mode 64 | -- auto_open = false, -- auto open when there are items 65 | -- filter = { 66 | -- any = { 67 | -- { 68 | -- severity = vim.diagnostic.severity.ERROR, -- errors only 69 | -- }, 70 | -- }, 71 | -- }, 72 | -- }, 73 | -- mydiags = { 74 | -- mode = "diagnostics", -- inherit from diagnostics mode 75 | -- auto_open = true, -- auto open when there are items 76 | -- filter = { 77 | -- any = { 78 | -- buf = 0, -- current buffer 79 | -- { 80 | -- severity = vim.diagnostic.severity.ERROR, -- errors only 81 | -- -- limit to files in the current project 82 | -- function(item) 83 | -- return item.filename:find((vim.loop or vim.uv).cwd(), 1, true) 84 | -- end, 85 | -- }, 86 | -- }, 87 | -- }, 88 | -- }, 89 | cascade = { 90 | mode = "diagnostics", -- inherit from diagnostics mode 91 | auto_open = false, -- auto open when there are items 92 | filter = function(items) 93 | local severity = vim.diagnostic.severity.HINT 94 | for _, item in ipairs(items) do 95 | severity = math.min(severity, item.severity) 96 | end 97 | return vim.tbl_filter(function(item) 98 | return item.severity == severity 99 | end, items) 100 | end, 101 | }, 102 | }, 103 | }, 104 | keys = { 105 | { "d", "Trouble cascade toggle", desc = "Diagnostics (Trouble)" }, 106 | { 107 | "", 108 | "Trouble cascade open focus=true", 109 | desc = "Diagnostics (Trouble)", 110 | }, 111 | }, 112 | }, 113 | 114 | { 115 | "gabrielpoca/replacer.nvim", 116 | lazy = true, 117 | keys = { 118 | { "qr", ':lua require("replacer").run()', desc = "QuickFix Replacer" }, 119 | }, 120 | }, 121 | 122 | { "meznaric/key-analyzer.nvim", lazy = true, opts = { layout = "colemak" }, cmd = "KeyAnalyzer" }, 123 | } 124 | -------------------------------------------------------------------------------- /nix/home/modules/kitty.nix: -------------------------------------------------------------------------------- 1 | { config, ... }: { 2 | # stylix gets the bright color wrongs 3 | stylix.targets.kitty.enable = false; 4 | 5 | programs.kitty = { 6 | enable = true; 7 | font = { 8 | inherit (config.stylix.fonts.monospace) package name; 9 | size = config.stylix.fonts.sizes.terminal; 10 | }; 11 | settings.background_opacity = with config.stylix.opacity; 12 | "${builtins.toString terminal}"; 13 | settings = { 14 | enable_audio_bell = false; 15 | cursor_blink_interval = 0; 16 | open_url_with = "firefox"; 17 | }; 18 | shellIntegration.enableZshIntegration = true; 19 | keybindings = { 20 | "alt+p" = "paste_from_clipboard"; 21 | "ctrl+pagedown" = "change_font_size current -1.0"; 22 | "ctrl+pageup" = "change_font_size current +1.0"; 23 | "ctrl+f5" = "load_config_file"; 24 | "kitty_mod+Enter" = "launch --type=os-window --cwd=current"; 25 | "kitty_mod+\\" = "launch --type=background --cwd=current neovide"; 26 | }; 27 | extraConfig = let 28 | # stylix-generated = '' 29 | # # Generated by stylix 30 | # font_family JetBrains Mono 31 | # font_size 16 32 | # 33 | # # Shell integration is sourced and configured manually 34 | # shell_integration no-rc 35 | # 36 | # background_opacity 1.000000 37 | # cursor_blink_interval 0 38 | # enable_audio_bell no 39 | # open_url_with firefox 40 | # ''; 41 | scrollback = '' 42 | scrollback_lines 9000 43 | scrollback_pager_history_size 32 44 | ''; 45 | remote = '' 46 | # the following is for kitty-remote https://github.com/mikesmithgh/kitty-scrollback.nvim?tab=readme-ov-file#%EF%B8%8F-setup 47 | allow_remote_control socket-only 48 | listen_on unix:/tmp/kitty 49 | shell_integration enabled 50 | # kitty-scrollback.nvim Kitten alias 51 | action_alias kitty_scrollback_nvim kitten /home/thib/.local/share/nvim/lazy/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py 52 | # Browse scrollback buffer in nvim 53 | map kitty_mod+h kitty_scrollback_nvim 54 | # Browse output of the last shell command in nvim 55 | map kitty_mod+g kitty_scrollback_nvim --config ksb_builtin_last_cmd_output 56 | ''; 57 | forwardMaps = '' 58 | # Instead of handling these at the kitty level, 59 | # we rewrite these events so that the shell program, 60 | # probably neovim, can use them. 61 | # https://www.reddit.com/r/neovim/comments/12hyi9t/make_scr_cscr_stab_ctab_work_in_neovim_kitty/ 62 | map ctrl+tab send_text all \x1b[9;5u 63 | map ctrl+shift+tab send_text all \x1b[9;6u 64 | ''; 65 | theme = '' 66 | # The basic colors 67 | foreground #cdd6f4 68 | background #1f1e22 69 | selection_foreground #1f1e22 70 | selection_background #f5e0dc 71 | 72 | # Cursor colors 73 | cursor #f5e0dc 74 | cursor_text_color #1f1e22 75 | 76 | # URL underline color when hovering with mouse 77 | url_color #f5e0dc 78 | 79 | # Kitty window border colors 80 | active_border_color #b4befe 81 | inactive_border_color #6c7086 82 | bell_border_color #f9e2af 83 | 84 | # OS Window titlebar colors 85 | wayland_titlebar_color system 86 | macos_titlebar_color system 87 | 88 | # Tab bar colors 89 | active_tab_foreground #11111b 90 | active_tab_background #cba6f7 91 | inactive_tab_foreground #cdd6f4 92 | inactive_tab_background #181825 93 | tab_bar_background #11111b 94 | 95 | # Colors for marks (marked text in the terminal) 96 | mark1_foreground #1f1e22 97 | mark1_background #b4befe 98 | mark2_foreground #1f1e22 99 | mark2_background #cba6f7 100 | mark3_foreground #1f1e22 101 | mark3_background #74c7ec 102 | 103 | # The 16 terminal colors 104 | 105 | # black 106 | color0 #45475a 107 | color8 #585b70 108 | 109 | # red 110 | color1 #f38ba8 111 | color9 #f38ba8 112 | 113 | # green 114 | color2 #a6e3a1 115 | color10 #a6e3a1 116 | 117 | # yellow 118 | color3 #f9e2af 119 | color11 #f9e2af 120 | 121 | # blue 122 | color4 #89b4fa 123 | color12 #89b4fa 124 | 125 | # magenta 126 | color5 #f5c2e7 127 | color13 #f5c2e7 128 | 129 | # cyan 130 | color6 #94e2d5 131 | color14 #94e2d5 132 | 133 | # white 134 | color7 #bac2de 135 | color15 #a6adc8 136 | ''; 137 | in '' 138 | ${scrollback} 139 | ${remote} 140 | ${forwardMaps} 141 | ${theme} 142 | ''; 143 | }; 144 | } 145 | -------------------------------------------------------------------------------- /nix/home/modules/zsh.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: { 2 | programs.zsh = let 3 | 4 | stty = # sh 5 | '' 6 | # unbind ^S, ^Q 7 | # https://unix.stackexchange.com/questions/12107/how-to-unfreeze-after-accidentally-pressing-ctrl-s-in-a-terminal 8 | stty -ixon 9 | ''; 10 | 11 | constants = # sh 12 | '' 13 | 14 | # Load private configuration 15 | source ~/.zshrc.local 16 | # tells the cd command to look in this colon-separated list of directories for your destination. 17 | CDPATH=$HOME:.. 18 | # https://github.com/zsh-users/zsh-autosuggestions?tab=readme-ov-file#suggestion-strategy 19 | ZSH_AUTOSUGGEST_STRATEGY=(history completion) 20 | ''; 21 | 22 | keychain = # sh 23 | '' 24 | 25 | # Unlock the ssh private key 26 | eval `keychain --eval --nogui -Q -q id_ed25519` 27 | ''; 28 | 29 | fzfCompletion = # sh 30 | '' 31 | 32 | # https://github.com/junegunn/fzf?tab=readme-ov-file#settings 33 | FZF_COMPLETION_TRIGGER='..' 34 | 35 | # Use fd (https://github.com/sharkdp/fd) for listing path candidates. 36 | _fzf_compgen_path() { fd --hidden --follow --exclude ".git" . "$1" } 37 | 38 | # Use fd to generate the list for directory completion 39 | _fzf_compgen_dir() { fd --type d --hidden --follow --exclude ".git" . "$1" } 40 | ''; 41 | 42 | keyMappings = # sh 43 | '' 44 | 45 | # Avoid binding ^J, ^M, ^C, ^?, ^S, ^Q, etc. 46 | bindkey -d # Reset to default. 47 | bindkey -v # Use vi key bindings. 48 | 49 | bindkey "^H" autosuggest-execute 50 | bindkey "^ " autosuggest-accept 51 | bindkey "^Q" autosuggest-clear 52 | bindkey -M vicmd "e" history-search-backward 53 | bindkey -M vicmd "n" history-search-forward 54 | bindkey -M vicmd "^[[A" history-search-backward # up 55 | bindkey -M vicmd "^[[B" history-search-forward # down 56 | bindkey -M vicmd v edit-command-line # ESC-v to edit in an external editor. 57 | bindkey -M viins "^L" clear-screen 58 | bindkey -M viins "^W" backward-kill-word 59 | ''; 60 | 61 | editCommandLine = # sh 62 | '' 63 | 64 | # Allow command line editing in an external editor. 65 | autoload -Uz edit-command-line 66 | zle -N edit-command-line 67 | ''; 68 | 69 | zshCompletion = # sh 70 | '' 71 | 72 | # complete case insensitive (https://stackoverflow.com/questions/13424429/can-zsh-do-smartcase-completion-like-vims-search) 73 | zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 74 | 75 | # complete sudo commands 76 | zstyle ':completion::complete:*' gain-privileges 1 77 | 78 | bindkey "''${key[Up]}" fzf-history-widget 79 | ''; 80 | 81 | functions = # sh 82 | '' 83 | 84 | function limosh() { mosh root@$1.lichess.ovh } 85 | function psg() { ps aux | grep $* } 86 | function take() { mkdir -p $1; cd $1 } 87 | # Get a 16 chars password: generate-password 16 88 | function generate-password() { strings /dev/urandom | grep -o '[[:alnum:]]' | head -n $1 | tr -d '\n'; echo } 89 | function where-from() { readlink -f $(which $1) } 90 | function url-sha256() { curl -sL $1 | sha256sum | cut -d ' ' -f 1 | xxd -r -p | base64 } 91 | function c() { printf "%s\n" "$@" | bc -l; } 92 | function kitty-reload() { kill -SIGUSR1 $(pidof kitty) } 93 | ''; 94 | beforeCompInit = lib.mkOrder 550 '' 95 | ${stty} 96 | ${constants} 97 | ${fzfCompletion} 98 | ${keychain} 99 | ${editCommandLine} 100 | ${keyMappings} 101 | ${functions} 102 | ''; 103 | afterCompInit = lib.mkOrder 1000 '' 104 | ${zshCompletion} 105 | ''; 106 | in { 107 | enable = true; 108 | enableCompletion = true; 109 | autosuggestion.enable = true; 110 | syntaxHighlighting.enable = true; 111 | autocd = true; 112 | history = { 113 | expireDuplicatesFirst = true; 114 | path = "${config.xdg.dataHome}/zsh_history"; 115 | size = 100000; 116 | save = 100000; 117 | }; 118 | initContent = lib.mkMerge [ beforeCompInit afterCompInit ]; 119 | shellAliases = let 120 | home = config.home.homeDirectory; 121 | dotfiles = "${home}/dotfiles"; 122 | in { 123 | "nswitch" = "nh os switch ${dotfiles}"; 124 | "ntry" = "nh os test ${dotfiles}"; 125 | "ndry" = "nh os test ${dotfiles} --dry"; 126 | "nup" = "nh os switch --update ${dotfiles}"; 127 | "ndev" = "nix develop --command zsh"; 128 | "locks" = '' 129 | git add flake.lock nvim/lazy-lock.json && git commit -m "locks" && git push''; 130 | "su" = "systemctl --user"; 131 | "sr" = "sudo systemctl"; 132 | "ju" = "journalctl --user -u"; 133 | "jr" = "sudo journalctl -u "; 134 | ".." = "cd .."; 135 | "..." = "cd ../.."; 136 | "...." = "cd ../../.."; 137 | # Propagate user config 138 | "_" = "sudo -E"; 139 | "l" = "ls -la"; 140 | "h" = "history"; 141 | "man" = "batman"; 142 | # Add suffix alias for less 143 | "-g L" = "| less"; 144 | "v" = "nvim"; 145 | "x" = "dtrx"; 146 | "reload" = ". ~/.zshrc"; 147 | "meteo" = "curl -4 http://wttr.in/44600"; 148 | "lipass" = "PASSWORD_STORE_DIR=~/lichess-sysadmin/pass pass"; 149 | # Stuff 150 | "st" = "_ systemctl-tui"; 151 | "on" = ''swaymsg " output * power on"''; 152 | }; 153 | }; 154 | } 155 | -------------------------------------------------------------------------------- /nvim/lua/plugins/picker.lua: -------------------------------------------------------------------------------- 1 | local function pick(command, opts) 2 | opts = opts or {} 3 | -- if not opts.winopts then 4 | -- opts.winopts = fullscreen 5 | -- end 6 | return LazyVim.pick(command, opts) 7 | end 8 | 9 | local layouts = require("snacks.picker.config.layouts") 10 | layouts.full_horiz = { 11 | reverse = true, 12 | layout = { 13 | box = "horizontal", 14 | width = 0.95, 15 | height = 0.9, 16 | border = "none", 17 | { 18 | box = "vertical", 19 | { win = "list", title = " Results ", title_pos = "center", border = "none" }, 20 | { win = "input", height = 1, border = "none", title = "{title} {live} {flags}", title_pos = "center" }, 21 | }, 22 | { 23 | win = "preview", 24 | title = "{preview:Preview}", 25 | width = 0.6, 26 | border = "none", 27 | title_pos = "center", 28 | }, 29 | }, 30 | } 31 | layouts.full_vert = { 32 | layout = { 33 | backdrop = false, 34 | fullscreen = true, 35 | box = "vertical", 36 | border = "rounded", 37 | title = "{title} {live} {flags}", 38 | title_pos = "center", 39 | { win = "input", height = 1, border = "bottom" }, 40 | { win = "list", border = "none" }, 41 | { win = "preview", title = "{preview}", height = 0.4, border = "top" }, 42 | }, 43 | } 44 | 45 | return { 46 | { 47 | "folke/snacks.nvim", 48 | opts = { 49 | picker = { 50 | layout = { 51 | --- Use the default layout or vertical if the window is too narrow 52 | preset = function() 53 | return vim.o.columns >= 120 and "full_horiz" or "full_vert" 54 | end, 55 | }, 56 | win = { 57 | -- input window 58 | input = { 59 | keys = { 60 | [""] = { "close", mode = "i" }, 61 | [""] = { "", mode = { "i" }, expr = true, desc = "delete word" }, 62 | [""] = { "toggle_ignored", mode = { "i", "n" } }, 63 | [""] = { "toggle_hidden", mode = { "i", "n" } }, 64 | [""] = { "preview_scroll_up", mode = { "i", "n" } }, 65 | [""] = { "preview_scroll_down", mode = { "i", "n" } }, 66 | }, 67 | }, 68 | }, 69 | }, 70 | }, 71 | keys = function() 72 | -- stylua: ignore 73 | return { 74 | { "mr", pick("files", { root = false }), desc = "Find Files (cwd)" }, 75 | { "ms", pick("files"), desc = "Find Files (Root Dir)" }, 76 | { "mt", function() pick("files", { cwd = vim.fn.expand("%:p:h") })() end, desc = "Find Files (Buffer dir)" }, 77 | 78 | { "r", pick("live_grep", { root = false }), desc = "Grep (cwd)" }, 79 | { "s", pick("live_grep"), desc = "Grep (Root Dir)" }, 80 | { "t", function() pick("live_grep", { cwd = vim.fn.expand("%:p:h") })() end, desc = "Grep (Buffer dir)" }, 81 | 82 | 83 | -- { "R", pick("grep_cword", { root = false }), desc = "Word (cwd)" }, 84 | -- { "S", pick("grep_cword"), desc = "Word (Root Dir)" }, 85 | { "R", pick("grep_word", { root = false }), desc = "Visual selection or word (cwd)", mode = { "n", "x" } }, 86 | { "S", pick("grep_word"), desc = "Visual selection or word (Root Dir)", mode = { "n", "x" } }, 87 | { "T", function() pick("grep_word", { cwd = vim.fn.expand("%:p:h") })() end, desc = "Word (Buffer dir)" }, 88 | 89 | { "mv", function() Snacks.picker.smart() end, desc = "Smart picker" }, 90 | { "mb", function() Snacks.picker.buffers() end, desc = "Buffers" }, 91 | { "H", function() Snacks.picker.help() end, desc = "Help Pages" }, 92 | { "mq", function() Snacks.picker.commands() end, desc = "Commands" }, 93 | { "my", "YankyRingHistory", desc = "Yank History" }, 94 | { "qq", function() Snacks.picker.command_history() end, desc = "Command History" }, 95 | -- { "q/", "Telescope search_history", desc = "Command History" }, 96 | { "mn", function() Snacks.picker.notifications() end, desc = "Notification History" }, 97 | { "mj", function() Snacks.picker.jumps() end, desc = "Jumps" }, 98 | { "qf", function() Snacks.picker.qflist() end, desc = "Quickfix List" }, 99 | { "mm", function() Snacks.picker.resume() end, desc = "Resume" }, 100 | { "mu", function() Snacks.picker.undo() end, desc = "Undo tree" }, 101 | { "ml", function() Snacks.picker.loclist() end, desc = "Location List" }, 102 | { "mi", function() Snacks.picker.icons() end, desc = "Icons" }, 103 | { "mp", function() Snacks.picker.projects() end, desc = "Projects" }, 104 | -- lsp 105 | { "o", function() Snacks.picker.lsp_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Symbols" }, 106 | { "O", function() Snacks.picker.lsp_workspace_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Workspace Symbols" }, 107 | -- { 108 | -- "O", 109 | -- function() 110 | -- require("fzf-lua").lsp_live_workspace_symbols(lsp_symbols_opts) 111 | -- end, 112 | -- desc = "Goto Symbol (Workspace)", 113 | -- }, 114 | { "i", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, 115 | { "I", "FzfLua diagnostics_workspace", desc = "Workspace Diagnostics" }, 116 | { "mk", function() Snacks.picker.keymaps() end, desc = "Keymaps" }, 117 | -- git 118 | { "gc", function() Snacks.picker.git_log() end, desc = "Git Log" }, 119 | { "gd", function() Snacks.picker.git_diff() end, desc = "Git Diff (hunks)" }, 120 | { "gs", function() Snacks.picker.git_status() end, desc = "Git Status" }, 121 | } 122 | end, 123 | }, 124 | } 125 | -------------------------------------------------------------------------------- /nix/home/modules/sway.nix: -------------------------------------------------------------------------------- 1 | { config, lib, ... }: 2 | with config.lib.stylix.colors.withHashtag; { 3 | # auto start 4 | # programs.zsh.profileExtra = '' 5 | # if [ -z "$DISPLAY" ] && [ "''${XDG_VTNR:-0}" -eq 1 ]; then 6 | # exec sway 7 | # fi 8 | # ''; 9 | 10 | programs.bemenu = { enable = true; }; 11 | stylix.targets.bemenu.enable = false; 12 | 13 | gtk = { enable = true; }; 14 | 15 | wayland.windowManager.sway = { 16 | enable = true; 17 | wrapperFeatures.gtk = true; 18 | checkConfig = false; 19 | config = rec { 20 | fonts = lib.mkForce { 21 | names = [ "DejaVu Sans" ]; 22 | size = 0.5; 23 | }; 24 | modifier = "Mod1"; 25 | terminal = "kitty -1"; 26 | left = "n"; 27 | right = "e"; 28 | down = "h"; 29 | up = "l"; 30 | menu = "bemenu-run -H 40 | xargs swaymsg exec --"; 31 | input = { 32 | "type:keyboard" = { 33 | xkb_layout = "us,us"; 34 | xkb_variant = "colemak,"; 35 | repeat_rate = "64"; 36 | repeat_delay = "180"; 37 | }; 38 | }; 39 | colors = let 40 | text = base04; 41 | urgent = base09; 42 | focused = base04; 43 | unfocused = base00; 44 | background = base00; 45 | indicator = base0C; 46 | in lib.mkForce { 47 | inherit background; 48 | urgent = { 49 | inherit background indicator text; 50 | border = urgent; 51 | childBorder = urgent; 52 | }; 53 | focused = { 54 | border = focused; 55 | childBorder = focused; 56 | background = focused; 57 | indicator = focused; 58 | text = focused; 59 | }; 60 | focusedInactive = { 61 | inherit background indicator text; 62 | border = unfocused; 63 | childBorder = unfocused; 64 | }; 65 | unfocused = { 66 | inherit background indicator text; 67 | border = unfocused; 68 | childBorder = unfocused; 69 | }; 70 | placeholder = { 71 | inherit background indicator text; 72 | border = unfocused; 73 | childBorder = unfocused; 74 | }; 75 | }; 76 | focus.followMouse = false; 77 | floating.modifier = modifier; 78 | keybindings = { 79 | "${modifier}+return" = "exec ${terminal}"; 80 | "${modifier}+v" = "exec neovide"; 81 | "${modifier}+q" = "kill"; 82 | "${modifier}+shift+c" = "reload"; 83 | "${modifier}+s" = "splith"; 84 | "${modifier}+f" = "layout toggle tabbed split"; 85 | "${modifier}+shift+f" = "layout toggle splitv splith"; 86 | "F11" = "fullscreen toggle"; 87 | # Move the focused window with the same, but add Shift 88 | "${modifier}+shift+${left}" = "move left"; 89 | "${modifier}+shift+${down}" = "move down"; 90 | "${modifier}+shift+${up}" = "move up"; 91 | "${modifier}+shift+${right}" = "move right"; 92 | # Ditto, with arrow keys 93 | "${modifier}+shift+Left" = "move left"; 94 | "${modifier}+shift+Down" = "move down"; 95 | "${modifier}+shift+Up" = "move up"; 96 | "${modifier}+shift+Right" = "move right"; 97 | 98 | "F2" = "exec 'systemctl --user restart lila'"; 99 | "F3" = "exec 'systemctl --user restart lila-ws'"; 100 | 101 | "${modifier}+${left}" = "focus left"; 102 | "${modifier}+${right}" = "focus right"; 103 | "${modifier}+${down}" = "focus down"; 104 | "${modifier}+${up}" = "focus up"; 105 | "${modifier}+o" = "focus parent"; 106 | "${modifier}+i" = "focus child"; 107 | 108 | "${modifier}+shift+minus" = "move scratchpad"; 109 | "${modifier}+minus" = "scratchpad show"; 110 | 111 | "${modifier}+shift+r" = "mode resize"; 112 | 113 | # "${modifier}+t" = "splitv; exec kitty; resize set height 200 px"; 114 | 115 | # Switch to workspace 116 | "${modifier}+1" = "workspace number 1"; 117 | "${modifier}+2" = "workspace number 2"; 118 | "${modifier}+3" = "workspace number 3"; 119 | "${modifier}+4" = "workspace number 4"; 120 | "${modifier}+5" = "workspace number 5"; 121 | "${modifier}+6" = "workspace number 6"; 122 | "${modifier}+7" = "workspace number 7"; 123 | "${modifier}+8" = "workspace number 8"; 124 | "${modifier}+9" = "workspace number 9"; 125 | "${modifier}+0" = "workspace number 10"; 126 | # Move focused container to workspace 127 | "${modifier}+Shift+1" = "move container to workspace number 1"; 128 | "${modifier}+Shift+2" = "move container to workspace number 2"; 129 | "${modifier}+Shift+3" = "move container to workspace number 3"; 130 | "${modifier}+Shift+4" = "move container to workspace number 4"; 131 | "${modifier}+Shift+5" = "move container to workspace number 5"; 132 | "${modifier}+Shift+6" = "move container to workspace number 6"; 133 | "${modifier}+Shift+7" = "move container to workspace number 7"; 134 | "${modifier}+Shift+8" = "move container to workspace number 8"; 135 | "${modifier}+Shift+9" = "move container to workspace number 9"; 136 | "${modifier}+Shift+0" = "move container to workspace number 10"; 137 | # 138 | "ctrl+f1" = "exec 'keyboard-switch-notify.sh'"; 139 | "ctrl+f6" = "mode gaming"; 140 | }; 141 | modes = { 142 | resize = { 143 | "escape" = "mode default"; 144 | "${left}" = "resize shrink width 10 px"; 145 | "${right}" = "resize grow width 10 px"; 146 | "${down}" = "resize grow height 10 px"; 147 | "${up}" = "resize shrink height 10 px"; 148 | "shift+${left}" = "resize shrink width 300 px"; 149 | "shift+${right}" = "resize grow width 300 px"; 150 | "shift+${down}" = "resize grow height 300 px"; 151 | "shift+${up}" = "resize shrink height 300 px"; 152 | }; 153 | gaming = { 154 | "ctrl+f6" = "mode default"; 155 | # "f11" = "fullscreen toggle"; 156 | # Switch to workspace 157 | "${modifier}+1" = "workspace number 1"; 158 | "${modifier}+2" = "workspace number 2"; 159 | "${modifier}+3" = "workspace number 3"; 160 | "${modifier}+4" = "workspace number 4"; 161 | "${modifier}+5" = "workspace number 5"; 162 | "${modifier}+6" = "workspace number 6"; 163 | "${modifier}+7" = "workspace number 7"; 164 | "${modifier}+8" = "workspace number 8"; 165 | "${modifier}+9" = "workspace number 9"; 166 | "${modifier}+0" = "workspace number 10"; 167 | }; 168 | }; 169 | bars = [{ 170 | position = "top"; 171 | command = "waybar"; 172 | }]; 173 | }; 174 | extraConfig = '' 175 | default_border pixel 1 176 | # borders, lol 177 | hide_edge_borders both 178 | titlebar_padding 1 1 179 | focus_follows_mouse yes 180 | 181 | # start some apps: 182 | workspace number 1 183 | exec kitty -1 184 | workspace number 2 185 | exec firefox 186 | ''; 187 | }; 188 | 189 | services.mako = { 190 | enable = true; 191 | settings = { 192 | default-timeout = 5000; 193 | ignore-timeout = false; 194 | }; 195 | }; 196 | 197 | # fixes: 198 | # Unable to connect to the compositor. If your compositor is running, check or set the WAYLAND_DISPLAY environment variable. 199 | systemd.user.services.swayidle.Service.Environment = 200 | lib.mkAfter [ "WAYLAND_DISPLAY='wayland-1'" ]; 201 | } 202 | -------------------------------------------------------------------------------- /nvim/lua/config/keymaps_lazyvim.lua: -------------------------------------------------------------------------------- 1 | -- This file replaces LazyVim/lua/lazyvim/config/keymaps.lua 2 | local map = LazyVim.safe_keymap_set 3 | 4 | -- Move in windows using arrow keys 5 | map("n", "n", "h", { desc = "Go to left window" }) 6 | map("n", "e", "l", { desc = "Go to right window" }) 7 | -- map("n", "l", "k", { desc = "Go to upper window" }) 8 | -- map("n", "h", "j", { desc = "Go to lower window" }) 9 | -- Resize window using arrow keys 10 | -- map("n", "", "resize +2", { desc = "Increase window height" }) 11 | -- map("n", "", "resize -2", { desc = "Decrease window height" }) 12 | -- map("n", "", "vertical resize -2", { desc = "Decrease window width" }) 13 | -- map("n", "", "vertical resize +2", { desc = "Increase window width" }) 14 | 15 | -- Move Lines 16 | -- map("n", "", "m .+1==", { desc = "Move down" }) 17 | -- map("n", "", "m .-2==", { desc = "Move up" }) 18 | -- map("i", "", "m .+1==gi", { desc = "Move down" }) 19 | -- map("i", "", "m .-2==gi", { desc = "Move up" }) 20 | -- map("v", "", ":m '>+1gv=gv", { desc = "Move down" }) 21 | -- map("v", "", ":m '<-2gv=gv", { desc = "Move up" }) 22 | 23 | -- buffers 24 | map("n", "", "BufferLineCycleNext", { desc = "Prev buffer" }) 25 | map("n", "", "BufferLineCyclePrev", { desc = "Next buffer" }) 26 | map("n", "md", "e #", { desc = "Switch to Other Buffer" }) 27 | map("n", "wd", function() 28 | Snacks.bufdelete() 29 | end, { desc = "Delete Buffer" }) 30 | map("n", "wO", function() 31 | Snacks.bufdelete.other() 32 | end, { desc = "Delete other buffers" }) 33 | 34 | -- Clear search with 35 | map({ "i", "n" }, "", "noh", { desc = "Escape and Clear hlsearch" }) 36 | 37 | -- Clear search, diff update and redraw 38 | -- taken from runtime/lua/_editor.lua 39 | map( 40 | "n", 41 | "ur", 42 | "nohlsearchdiffupdatenormal! ", 43 | { desc = "Redraw / clear hlsearch / diff update" } 44 | ) 45 | 46 | -- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n 47 | map("n", "j", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) 48 | map("x", "j", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) 49 | map("o", "j", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) 50 | map("n", "J", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) 51 | map("x", "J", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) 52 | map("o", "J", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) 53 | 54 | -- Add undo break-points 55 | map("i", ",", ",u") 56 | map("i", ".", ".u") 57 | map("i", ";", ";u") 58 | 59 | -- Alternative way to save and exit in Normal mode. 60 | -- NOTE: Adding `redraw` helps with `cmdheight=0` if buffer is not modified 61 | map("n", "", "silent! update | redraw", { desc = "Save" }) 62 | map({ "i", "x" }, "", "silent! update | redraw", { desc = "Save and go to Normal mode" }) 63 | 64 | -- better indenting 65 | map("v", "<", "", ">gv", { desc = "Indent left" }) 67 | 68 | -- new file 69 | map("n", "fn", "enew", { desc = "New File" }) 70 | 71 | map("n", "xl", "lopen", { desc = "Location List" }) 72 | map("n", "xq", "copen", { desc = "Quickfix List" }) 73 | 74 | map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" }) 75 | map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" }) 76 | 77 | -- formatting 78 | map({ "n", "v" }, "cf", function() 79 | LazyVim.format({ force = true }) 80 | end, { desc = "Format" }) 81 | 82 | -- diagnostic 83 | local diagnostic_goto = function(next, severity) 84 | return function() 85 | vim.diagnostic.jump({ 86 | count = (next and 1 or -1) * vim.v.count1, 87 | severity = severity and vim.diagnostic.severity[severity] or nil, 88 | float = true, 89 | }) 90 | end 91 | end 92 | map("n", "cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" }) 93 | map("n", "]d", diagnostic_goto(true), { desc = "Next Diagnostic" }) 94 | map("n", "[d", diagnostic_goto(false), { desc = "Prev Diagnostic" }) 95 | map("n", "]e", diagnostic_goto(true, "ERROR"), { desc = "Next Error" }) 96 | map("n", "[e", diagnostic_goto(false, "ERROR"), { desc = "Prev Error" }) 97 | map("n", "]w", diagnostic_goto(true, "WARN"), { desc = "Next Warning" }) 98 | map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" }) 99 | 100 | -- stylua: ignore start 101 | 102 | -- toggle options 103 | LazyVim.format.snacks_toggle():map("uf") 104 | Snacks.toggle.option("spell", { name = "Spelling"}):map("us") 105 | Snacks.toggle.option("wrap", {name = "Wrap"}):map("uw") 106 | Snacks.toggle.option("relativenumber", { name = "Relative Number"}):map("uL") 107 | Snacks.toggle.diagnostics():map("ud") 108 | Snacks.toggle.line_number():map("ul") 109 | Snacks.toggle.option("conceallevel", {off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2}):map("uc") 110 | Snacks.toggle.treesitter():map("uT") 111 | Snacks.toggle.option("background", { off = "light", on = "dark" , name = "Dark Background"}):map("ub") 112 | if vim.lsp.inlay_hint then 113 | Snacks.toggle.inlay_hints():map("uh") 114 | end 115 | map("n", "ug", "Gitsigns toggle_current_line_blame", { desc = "Toggle Git blame" }) 116 | 117 | -- lazygit 118 | map("n", "gg", function() Snacks.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" }) 119 | -- map("n", "gG", function() Snacks.lazygit() end, { desc = "Lazygit (cwd)" }) 120 | map("n", "gb", function() Snacks.git.blame_line() end, { desc = "Git Blame Line" }) 121 | map({ "n", "x" }, "gB", function() Snacks.gitbrowse() end, { desc = "Git Browse (open)" }) 122 | map({"n", "x" }, "gY", function() 123 | Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end, notify = false }) 124 | end, { desc = "Git Browse (copy)" }) 125 | map("n", "gf", function() Snacks.lazygit.log_file() end, { desc = "Lazygit Current File History" }) 126 | map("n", "gl", function() Snacks.lazygit.log({ cwd = LazyVim.root.git() }) end, { desc = "Lazygit Log" }) 127 | map("n", "gL", function() Snacks.lazygit.log() end, { desc = "Lazygit Log (cwd)" }) 128 | -- local full_size = { width = 1, height = 1 } 129 | -- map("n", "gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git(), size = full_size }) end, { desc = "Lazygit (Root Dir)" }) 130 | 131 | -- quit 132 | map("n", "qq", "qa", { desc = "Quit all" }) 133 | 134 | -- highlights under cursor 135 | map("n", "ui", vim.show_pos, { desc = "Inspect Pos" }) 136 | 137 | -- floating terminal 138 | map("n", "ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" }) 139 | map("n", "fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" }) 140 | map("t", "", "", { desc = "Enter Normal Mode" }) 141 | map("t", "", "k", { desc = "Switch away from the terminal to top window." }) 142 | 143 | -- windows 144 | map("n", "ww", "p", { desc = "Other window" }) 145 | 146 | -- tabs 147 | map("n", "o", "tabonly", { desc = "Close Other Tabs" }) 148 | map("n", "d", "tabclose", { desc = "Close Tab" }) 149 | map("n", "]", "tabnext", { desc = "Next Tab" }) 150 | map("n", "[", "tabprevious", { desc = "Previous Tab" }) 151 | -------------------------------------------------------------------------------- /nix/system/lichess/nginx.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: { 2 | 3 | networking.extraHosts = '' 4 | 127.0.0.1 l.org l1.org socket.l.org 5 | ''; 6 | 7 | # allow reading assets from home 8 | users.users.nginx.extraGroups = [ "users" ]; 9 | systemd.services.nginx.serviceConfig.ProtectHome = "read-only"; 10 | 11 | services.nginx = { 12 | commonHttpConfig = lib.mkAfter '' 13 | 14 | upstream lila { 15 | server 127.0.0.1:9663; 16 | } 17 | 18 | log_format log_format_sample '$remote_addr - $remote_user [$time_local] ' 19 | '"$request" $status $body_bytes_sent ' 20 | '"$http_referer" "$http_user_agent"'; 21 | 22 | log_format log_format_rate_limit '$remote_addr'; # extremely simplified ratelimit log lines 23 | 24 | geo $limited { 25 | default 0; 26 | 127.0.0.1 0; 27 | } 28 | 29 | geo $ip_tier { 30 | default 1; 31 | 127.0.0.1 2; 32 | } 33 | 34 | map $limited $limit { 35 | 1 $binary_remote_addr; 36 | 0 ""; 37 | } 38 | 39 | # access log sampling, see https://www.nginx.com/blog/sampling-requests-with-nginx-conditional-logging/ 40 | split_clients $request_id $log_sample_access { 41 | 1% 1; 42 | * 0; 43 | } 44 | split_clients $request_id $log_sample_rate_limit { 45 | 10% 1; 46 | * 0; 47 | } 48 | 49 | map $status $rate_limited { 50 | default 0; 51 | 429 $log_sample_rate_limit; # sample rate limit logs 52 | } 53 | 54 | limit_req_zone $limit zone=all:4m rate=5000r/m; 55 | 56 | map "$scheme $http_user_agent" $redirect_browser { 57 | default 0; 58 | "~*^http Mozilla" 1; 59 | } 60 | ''; 61 | 62 | virtualHosts = let 63 | listenParams = [ "so_keepalive=15:5:3" ]; 64 | listenLocal80 = { 65 | addr = "0.0.0.0"; 66 | port = 80; 67 | }; 68 | listenLocal443 = { 69 | addr = "0.0.0.0"; 70 | port = 443; 71 | ssl = true; 72 | }; 73 | listenLocal80WithKeepalive = listenLocal80 // { 74 | extraParameters = listenParams; 75 | }; 76 | listenLocal443WithKeepalive = listenLocal443 // { 77 | extraParameters = listenParams; 78 | }; 79 | listenLocal = [ listenLocal443 listenLocal80 ]; 80 | listenLocalWithKeepalive = 81 | [ listenLocal443WithKeepalive listenLocal80WithKeepalive ]; 82 | in { 83 | # "lichess-assets.local" = { 84 | # listen = [ { addr = "0.0.0.0"; port = 80; } { addr = "0.0.0.0"; port = 443; ssl = true; } ]; 85 | # extraConfig = '' 86 | # location /assets/ { 87 | # add_header "Access-Control-Allow-Origin" "*"; 88 | # alias /home/thib/lila/public; 89 | # } 90 | # ''; 91 | # }; 92 | "l.org" = let 93 | lichessProxyConf = '' 94 | proxy_set_header Host $host; 95 | proxy_set_header X-Forwarded-For $remote_addr; 96 | proxy_set_header X-Forwarded-Proto $scheme; 97 | proxy_http_version 1.1;''; 98 | in { 99 | listen = listenLocalWithKeepalive; 100 | enableACME = false; 101 | forceSSL = false; 102 | extraConfig = '' 103 | if ($redirect_browser = 1) { 104 | rewrite ^/(.*)$ https://l.org/$1; 105 | } 106 | 107 | ssl_certificate /etc/ssl/certs/l.org.crt; 108 | ssl_certificate_key /etc/ssl/private/l.org.key; 109 | 110 | error_log /var/log/nginx/lila.error.log; 111 | access_log /var/log/nginx/lila.access.log log_format_sample if=$log_sample_access; 112 | 113 | limit_req_log_level warn; # put rate limit logs in a distinct file, not in the error log 114 | access_log /var/log/nginx/rate_limited.log log_format_rate_limit if=$log_sample_rate_limit; 115 | 116 | error_page 501 /oops/disabled.html; 117 | error_page 500 501 502 503 /oops/servererror.html; 118 | error_page 504 /oops/timeout.html; 119 | error_page 429 /oops/toomanyrequests.html; 120 | location /oops/ { 121 | root /home/thib/lila/public/; 122 | } 123 | 124 | location = /favicon.ico { 125 | alias /home/thib/lila/public/favicon.ico; 126 | } 127 | location /assets/ { 128 | rewrite "^/assets/_\w{6}/(.+)$" /assets/$1; 129 | add_header Service-Worker-Allowed "/"; 130 | add_header Cross-Origin-Embedder-Policy "require-corp"; # for stockfish 131 | alias /home/thib/lila/public/; 132 | # proxy_pass http://lila; # no trailing / 133 | } 134 | location /game/export/ { 135 | access_log /var/log/nginx/lichess.image.log; 136 | proxy_http_version 1.1; 137 | proxy_pass http://lila/game/export/; 138 | } 139 | location /image/ { 140 | expires 6M; 141 | access_log /var/log/nginx/lichess.image.log; 142 | proxy_http_version 1.1; 143 | proxy_pass http://lila/image/; 144 | } 145 | 146 | #location = /games/search { 147 | #return 501; 148 | #} 149 | 150 | location /statlog { 151 | access_log /var/log/nginx/lila.stat.log; 152 | return 204; 153 | } 154 | location = /manifest.json { 155 | proxy_cache static_pages; 156 | proxy_cache_valid 200 10m; 157 | proxy_pass http://lila; 158 | } 159 | 160 | location /api/stream { 161 | ${lichessProxyConf} 162 | access_log /var/log/nginx/lila.stream.log; 163 | proxy_read_timeout 3h; 164 | proxy_send_timeout 5s; 165 | send_timeout 5s; 166 | proxy_pass http://lila/api/stream; 167 | } 168 | 169 | location /upload { 170 | ${lichessProxyConf} 171 | access_log /var/log/nginx/lichess.access.log; 172 | client_max_body_size 6M; 173 | proxy_read_timeout 60s; 174 | proxy_pass http://lila; 175 | } 176 | 177 | location = /login { 178 | ${lichessProxyConf} 179 | proxy_set_header X-Ip-Tier $ip_tier; 180 | proxy_pass http://lila; 181 | } 182 | 183 | # location /insights/ { 184 | # ${lichessProxyConf} 185 | # return 501; 186 | # # proxy_pass http://lila/temporarily-disabled/; 187 | # } 188 | 189 | location ~ ^/opening/ { 190 | ${lichessProxyConf} 191 | rewrite ^(.+)["/)\]]$ $1 permanent; 192 | limit_req zone=all burst=20 nodelay; 193 | proxy_pass http://lila; # no trailing / 194 | } 195 | 196 | location / { 197 | ${lichessProxyConf} 198 | #limit_req zone=nodos_base_tier1 burst=50 nodelay; 199 | #limit_req zone=nodos_base_tier2 burst=150 nodelay; 200 | limit_req zone=all burst=20 nodelay; 201 | proxy_pass http://lila; # no trailing / 202 | } 203 | ''; 204 | }; 205 | "socket.l.org" = { 206 | enableACME = false; 207 | forceSSL = false; 208 | listen = listenLocal; 209 | extraConfig = '' 210 | 211 | ssl_certificate /etc/ssl/certs/socket.l.org.crt; 212 | ssl_certificate_key /etc/ssl/private/socket.l.org.key; 213 | 214 | if ( $request_method !~ GET ) { 215 | return 405; 216 | } 217 | 218 | location / { 219 | proxy_http_version 1.1; 220 | proxy_set_header Host $host; 221 | proxy_set_header Upgrade $http_upgrade; 222 | proxy_set_header Connection $http_connection; 223 | proxy_set_header X-Forwarded-For $remote_addr; 224 | proxy_set_header X-Forwarded-Proto $scheme; 225 | proxy_pass http://127.0.0.1:9664; # no trailing / 226 | } 227 | ''; 228 | }; 229 | }; 230 | }; 231 | } 232 | -------------------------------------------------------------------------------- /cfg/sc2/customak.SC2Hotkeys: -------------------------------------------------------------------------------- 1 | [Settings] 2 | AllowSetConflicts=1 3 | 4 | [Hotkeys] 5 | ChatDefault=Enter 6 | AlertRecall= 7 | ArmySelect=Comma 8 | CameraCenter=Shift+MiddleMouseButton 9 | CameraMoveLeft= 10 | CameraMoveRight= 11 | CameraTurnRight= 12 | CameraPush=Alt+Right 13 | ControlGroupAppend0= 14 | ControlGroupAppend1= 15 | ControlGroupAppend2= 16 | ControlGroupAppend3= 17 | ControlGroupAppend4= 18 | ControlGroupAppend5= 19 | ControlGroupAppend6= 20 | ControlGroupAppend7= 21 | ControlGroupAppend8= 22 | ControlGroupAppend9= 23 | ControlGroupAppendAndSteal0=Shift+0 24 | ControlGroupAppendAndSteal1=Shift+Q 25 | ControlGroupAppendAndSteal2=Shift+W 26 | ControlGroupAppendAndSteal3=Shift+F 27 | ControlGroupAppendAndSteal4=Shift+P 28 | ControlGroupAppendAndSteal5=Shift+G 29 | ControlGroupAppendAndSteal6=Shift+6 30 | ControlGroupAppendAndSteal7=Shift+7 31 | ControlGroupAppendAndSteal8=Shift+8 32 | ControlGroupAppendAndSteal9=Shift+9 33 | ControlGroupAssign0= 34 | ControlGroupAssign1= 35 | ControlGroupAssign2= 36 | ControlGroupAssign3= 37 | ControlGroupAssign4= 38 | ControlGroupAssign5= 39 | ControlGroupAssign6= 40 | ControlGroupAssign7= 41 | ControlGroupAssign8= 42 | ControlGroupAssign9= 43 | ControlGroupAssignAndSteal0=Equals 44 | ControlGroupAssignAndSteal1=Control+Q 45 | ControlGroupAssignAndSteal2=Control+W 46 | ControlGroupAssignAndSteal3=Control+F 47 | ControlGroupAssignAndSteal4=Control+P 48 | ControlGroupAssignAndSteal5=Control+G 49 | ControlGroupAssignAndSteal6= 50 | ControlGroupAssignAndSteal7= 51 | ControlGroupAssignAndSteal8= 52 | ControlGroupAssignAndSteal9= 53 | ControlGroupRecall1=Q 54 | ControlGroupRecall2=W 55 | ControlGroupRecall3=F 56 | ControlGroupRecall4=P 57 | ControlGroupRecall5=G 58 | GameTooltipsOn= 59 | IdleWorker= 60 | MinimapTerrain= 61 | QuickSave= 62 | ReplaySpeedDec=Minus,Left 63 | ReplaySpeedInc=Equals,Right 64 | SubgroupNext=Alt+Left 65 | SubgroupPrev= 66 | TargetCancel=RightMouseButton,V 67 | TargetChoose=LeftMouseButton,P,G,J,S,T,D,H 68 | TownCamera= 69 | CameraSave0=Shift+Delete 70 | CameraSave1=Shift+1 71 | CameraSave2=Shift+2 72 | CameraSave3=Shift+3 73 | CameraSave4=Shift+4 74 | CameraSave5=Shift+5 75 | CameraSave6= 76 | CameraSave7= 77 | CameraView0=Delete 78 | CameraView1=1 79 | CameraView2=2 80 | CameraView3=3 81 | CameraView4=4 82 | CameraView5=5 83 | 84 | [Commands] 85 | AWrp=D 86 | AdeptPhaseShift/Adept=T 87 | AdeptResearchPiercingUpgrade/TwilightCouncil=R 88 | AmorphousArmorcloud/Infestor=R 89 | AnionPulseCrystals/FleetBeacon=T 90 | ArmorpiercingMode=T 91 | AssaultMode=T 92 | Assimilator/Probe=S 93 | Attack=V 94 | AutoTurret/Raven=T 95 | Baneling/Zergling=D 96 | BanelingNest/Drone=Z 97 | Banshee/Starport=R 98 | BansheeSpeed/StarportTechLab=S 99 | Barracks/SCV=R 100 | BatteryOvercharge/Nexus=A 101 | Battlecruiser/Starport=A 102 | BlindingCloud/Viper=S 103 | Blink/Stalker=T 104 | BroodLord/Corruptor=D 105 | BuildCreepTumor/Queen=T 106 | BuildCreepTumorPropagate/CreepTumorBurrowed=T 107 | BuildCyclone/Factory=D 108 | BuildTechLabFactory/FactoryFlying=C 109 | BuildTechLabStarport/StarportFlying=C 110 | Bunker/SCV=X 111 | BunkerLoad=S 112 | BunkerUnloadAll=T 113 | BurrowDown= 114 | BurrowUp= 115 | CalldownMULE/CommandCenter=S 116 | CalldownMULE/OrbitalCommand=S 117 | Carrier/Stargate=A 118 | CausticSpray/Corruptor=T 119 | Charge/Zealot= 120 | ChronoBoostEnergyCost/Nexus=S 121 | CloakOff=S 122 | CloakOnBanshee=T 123 | CloakOnGhost/Ghost=T 124 | CloakingField/Mothership=R 125 | Colossus/RoboticsFacility=S 126 | CommandCenter/SCV=D 127 | CommandCenterLoad= 128 | CommandCenterUnloadAll= 129 | Contaminate/Overseer= 130 | Corruptor/Larva=X 131 | CyberneticsCore/Probe=Z 132 | CycloneResearchHurricaneThrusters/FactoryTechLab=D 133 | D8Charge/Reaper= 134 | DarkShrine/Probe=C 135 | DarkTemplar=C 136 | DarkTemplarBlink/DarkTemplar=T 137 | Diamondback/Factory= 138 | DisableBuildingAttack/Baneling= 139 | Drone/Larva=T 140 | EnableBuildingAttack/Baneling= 141 | EngineeringBay/SCV=A 142 | EvolutionChamber/Drone=R 143 | EvolveAnabolicSynthesis2/UltraliskCavern=S 144 | EvolveCentrificalHooks/BanelingNest=T 145 | EvolveChitinousPlating/UltraliskCavern=T 146 | EvolveDiggingClaws/LurkerDenMP=T 147 | EvolveGlialRegeneration/RoachWarren=T 148 | EvolveGroovedSpines/HydraliskDen=T 149 | EvolveInfestorEnergyUpgrade/InfestationPit= 150 | EvolveMuscularAugments/HydraliskDen=S 151 | EvolvePeristalsis/InfestationPit= 152 | EvolveTunnelingClaws/RoachWarren=S 153 | ExperimentalPlasmaGun/Raynor= 154 | Explode/Baneling=T 155 | ExplosiveMode=S 156 | Extractor/Drone=S 157 | FaceEmbrace/Viper=T 158 | Factory/SCV=T 159 | Feedback/HighTemplar=T 160 | FighterMode=S 161 | Firebat/Barracks= 162 | FleetBeacon/Probe=D 163 | ForceField/Sentry=T 164 | Forge/Probe=A 165 | FungalGrowth/Infestor= 166 | FusionCore/SCV=D 167 | Gateway/Probe=R 168 | GatherProt= 169 | GenerateCreep/Overlord=R 170 | GenerateCreep/OverlordTransport=R 171 | Ghost/Barracks=D 172 | GhostAcademy/SCV=C 173 | GhostHoldFire/Ghost= 174 | Goliath/Factory=D 175 | GravitonBeam/Phoenix=T 176 | GravitonBeam/Urun= 177 | GreaterSpire/Spire=D 178 | GuardianShield/Sentry=S 179 | Hallucination/Sentry= 180 | Halt= 181 | Hatchery/Drone=D 182 | Hellion/Factory=S 183 | HellionTank/Factory= 184 | HeroNukeCalldown/Nova= 185 | HeroNukeCalldown/Tosh= 186 | HighTemplar=X 187 | HireKelmorianMiners/MercCompound= 188 | Hive/Lair=D 189 | Hydralisk/Larva=V 190 | HydraliskDen/Drone=T 191 | Hyperjump/Battlecruiser=S 192 | Immortal/RoboticsFacility=T 193 | InfestationPit/Drone=C 194 | Infestor/Larva= 195 | Interceptor/Carrier=T 196 | KD8Charge/Reaper=T 197 | Lair/Hatchery=D 198 | Land=Left 199 | Larva=T 200 | Liberator/Starport=D 201 | LiberatorAAMode/Liberator=S 202 | LiberatorAGMode/Liberator=T 203 | Lift=Right 204 | LockOn/Cyclone=D 205 | LocustMPFlyingSwoop/LocustMPFlying= 206 | Lower/SupplyDepot=T 207 | LurkerCancelHoldFire/LurkerMP= 208 | LurkerHoldFire/LurkerMP= 209 | LurkerMP/Hydralisk=D 210 | Marauder/Barracks=S 211 | Marine/Barracks=T 212 | MassRecall/Mothership=T 213 | Medic/Barracks=A 214 | Medivac/Starport=S 215 | MedivacSpeedBoost/Medivac=R 216 | MissileTurret/SCV=C 217 | MorphMorphalisk/Queen=S 218 | MorphToHellion/Hellion=T 219 | MorphToHellionTank/Hellion=S 220 | MorphToOverseer/Overlord=D 221 | MorphToOverseer/OverlordTransport=D 222 | MorphtoObserver/Observer=S 223 | MorphtoObserverSiege/Observer=T 224 | MorphtoOverlordTransport/Overlord= 225 | MorphtoOverseerNormal/Overseer=S 226 | MorphtoOverseerSiege/Overseer=T 227 | Mothership/Nexus=D 228 | Move=Z 229 | MoveHoldPosition=A 230 | MovePatrol=N 231 | Mutalisk/Larva=C 232 | MutateintoLurkerDen/Drone=R 233 | NanoRepair/ScienceVessel= 234 | NeuralParasite/Infestor=S 235 | Nexus/Probe=D 236 | NukeArm/GhostAcademy=T 237 | NukeCalldown/Ghost=D 238 | NydusNetwork/Drone=X 239 | Observer/RoboticsFacility=R 240 | OdinNukeCalldown/Odin= 241 | Oracle/Stargate=R 242 | OracleAttack= 243 | OracleBuildStasisTrap/Oracle=D 244 | OracleWeaponOff/Oracle=S 245 | OracleWeaponOn/Oracle=T 246 | OrbitalCommand/CommandCenter=C 247 | Overlord/Larva=D 248 | PerditionTurret/SCV= 249 | PhasingMode/WarpPrism=R 250 | Phoenix/Stargate=T 251 | Predator/Factory= 252 | Probe/Nexus=T 253 | ProtossAirArmorLevel1/CyberneticsCore=S 254 | ProtossAirWeaponsLevel1/CyberneticsCore=T 255 | ProtossBuild/Probe=T 256 | ProtossBuildAdvanced/Probe=S 257 | ProtossGroundArmorLevel1/Forge=S 258 | ProtossGroundWeaponsLevel1/Forge=T 259 | ProtossShieldsLevel1/Forge=R 260 | PsiStorm/HighTemplar=S 261 | PurificationNovaTargeted/Disruptor=T 262 | Pylon/Probe=T 263 | Queen=S 264 | Raise/SupplyDepotLowered=S 265 | RallyEgg=C 266 | Ravager/Roach=D 267 | RavagerCorrosiveBile/Ravager=T 268 | Raven/Starport=Z 269 | RavenScramblerMissile/Raven=S 270 | RavenShredderMissile/Raven=R 271 | Reactor/Barracks=X 272 | Reactor/BarracksFlying=X 273 | Reactor/Factory=X 274 | Reactor/FactoryFlying=X 275 | Reactor/Starport=X 276 | Reactor/StarportFlying=X 277 | Reaper/Barracks=R 278 | Refinery/SCV=S 279 | Repair=R 280 | ResearchBallisticRange/FusionCore=R 281 | ResearchBansheeCloak/StarportTechLab=T 282 | ResearchBattlecruiserSpecializations/FusionCore=T 283 | ResearchCharge/TwilightCouncil=T 284 | ResearchDarkTemplarBlink/DarkShrine=T 285 | ResearchDrillClaws/FactoryTechLab=T 286 | ResearchExtendedThermalLance/RoboticsBay=T 287 | ResearchGraviticBooster/RoboticsBay=S 288 | ResearchGraviticDrive/RoboticsBay=R 289 | ResearchHiSecAutoTracking/EngineeringBay=R 290 | ResearchHighCapacityBarrels/FactoryTechLab=R 291 | ResearchInterceptorLaunchSpeedUpgrade/FleetBeacon= 292 | ResearchMedivacEnergyUpgrade/FusionCore=S 293 | ResearchNeosteelFrame/EngineeringBay=D 294 | ResearchNeuralParasite/InfestationPit=T 295 | ResearchPersonalCloaking/GhostAcademy=S 296 | ResearchPunisherGrenades/BarracksTechLab=R 297 | ResearchRavenInterferenceMatrix/StarportTechLab=R 298 | ResearchShieldWall/BarracksTechLab=T 299 | ResearchSmartServos/FactoryTechLab=S 300 | ResearchStalkerTeleport/TwilightCouncil=S 301 | ResearchVoidRaySpeedUpgrade/FleetBeacon=S 302 | ResearchWarpGate/CyberneticsCore=R 303 | ReturnCargo= 304 | RoachWarren/Drone=A 305 | RoboticsBay/Probe=A 306 | RoboticsFacility/Probe=T 307 | SCV=T 308 | Salvage/Bunker= 309 | Scourge/Larva= 310 | SelectBuilder= 311 | SensorTower/SCV=Z 312 | Sentry=R 313 | ShieldBattery/Probe=X 314 | SiegeMode=T 315 | SiegeTank/Factory=T 316 | SpawnChangeling/Overseer=R 317 | SpawningPool/Drone=T 318 | SpectreHoldFire/Spectre= 319 | SpectreNukeCalldown/Spectre= 320 | SpectreWeaponsFree/Spectre= 321 | SpineCrawler/Drone=X 322 | SpineCrawlerRoot/SpineCrawlerUprooted=T 323 | SpineCrawlerUproot/SpineCrawlerUprooted=S 324 | SporeCrawler/Drone=C 325 | SporeCrawlerRoot/SporeCrawlerUprooted=T 326 | SporeCrawlerUproot/SporeCrawlerUprooted=S 327 | Spray= 328 | Starport/SCV=S 329 | Stim=D 330 | Stimpack/BarracksTechLab=S 331 | Stop=Backspace 332 | StopPlanetaryFortress/PlanetaryFortress= 333 | SummonNydusWorm/NydusNetwork=D 334 | SupplyDepot/SCV=T 335 | SwarmHostMP/Larva=Z 336 | TCxnWsZvLj4nRechLabFactory/Factory=C 337 | TechLabBarracks/Barracks=C 338 | TechLabBarracks/BarracksFlying=C 339 | TechLabFactory/Factory=C 340 | TechLabFactory/FactoryFlying=C 341 | TechLabStarport/Starport=C 342 | TechLabStarport/StarportFlying=C 343 | TechReactorAI/Starport= 344 | Tempest/Stargate=D 345 | TempestResearchGroundAttackUpgrade/FleetBeacon=R 346 | TemplarArchive/Probe=X 347 | TemporalField/Mothership=S 348 | TerranBuild/SCV=T 349 | TerranBuildAdvanced/SCV=S 350 | TerranInfantryArmorLevel1/EngineeringBay=S 351 | TerranInfantryArmorLevel2/EngineeringBay=S 352 | TerranInfantryArmorLevel3/EngineeringBay=S 353 | TerranInfantryWeapons1/EngineeringBay=T 354 | TerranInfantryWeapons2/EngineeringBay=T 355 | TerranInfantryWeapons3/EngineeringBay=T 356 | TerranInfantryWeaponsLevel1/EngineeringBay=T 357 | TerranShipPlatingLevel1/Armory=A 358 | TerranShipWeaponsLevel1/Armory=R 359 | TerranShipWeaponsLevel2/Armory=R 360 | TerranShipWeaponsLevel3/Armory=R 361 | TerranVehicleAndShipPlatingLevel1/Armory=S 362 | TerranVehicleAndShipPlatingLevel2/Armory=T 363 | TerranVehicleAndShipPlatingLevel3/Armory=T 364 | TerranVehiclePlatingLevel1/Armory=S 365 | TerranVehicleWeaponsLevel1/Armory=T 366 | TerranVehicleWeaponsLevel2/Armory=S 367 | TerranVehicleWeaponsLevel3/Armory=S 368 | Thor/Factory=A 369 | Transfusion/Queen=R 370 | TransportMode/WarpPrism= 371 | TwilightCouncil/Probe=R 372 | Ultralisk/Larva=A 373 | UltraliskCavern/Drone=A 374 | Unsiege=S 375 | UpgradeBuildingArmorLevel1/EngineeringBay=D 376 | UpgradeToPlanetaryFortress/CommandCenter=X 377 | UpgradeToWarpGate/Gateway=A 378 | VikingFighter/Starport=T 379 | ViperConsume/Viper=D 380 | VoidRay/Stargate=S 381 | VoidRaySwarmDamageBoost/VoidRay=T 382 | VoidSwarmHostSpawnLocust/SwarmHostMP=T 383 | Vortex/Artanis= 384 | Vortex/Mothership= 385 | WarpInAdept/Gateway=D 386 | WarpInAdept/WarpGate=D 387 | WarpInScout/Stargate= 388 | WeaponsFree/Ghost= 389 | WidowMine/Factory=R 390 | WidowMineBurrow/WidowMine=T 391 | WidowMineUnburrow/WidowMine=S 392 | Wraith/Starport= 393 | YamatoGun=T 394 | Zealot=T 395 | ZeratulStun/Zeratul=D 396 | ZergBuild/Drone=T 397 | ZergBuildAdvanced/Drone=S 398 | Zergling/Larva=S 399 | hydraliskspeed/HydraliskDen= 400 | overlordspeed=X 401 | zergflyerarmor1=S 402 | zergflyerattack1=T 403 | zerggroundarmor1/EvolutionChamber=R 404 | zerglingattackspeed/SpawningPool=S 405 | zerglingmovementspeed/SpawningPool=T 406 | zergmeleeweapons1/EvolutionChamber=T 407 | zergmissileweapons1/EvolutionChamber=S 408 | 409 | -------------------------------------------------------------------------------- /cfg/zmk/glove80.keymap: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2020 The ZMK Contributors 4 | * Copyright (c) 2023 Innaworks Development Limited, trading as MoErgo 5 | * 6 | * SPDX-License-Identifier: MIT 7 | */ 8 | 9 | 10 | /* THIS FILE WAS GENERATED BY GLOVE80 LAYOUT EDITOR 11 | * 12 | * This file was generated automatically. You may or may not want to 13 | * edit it directly. 14 | */ 15 | 16 | #include 17 | /* Include all behavior includes needed */ 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | /* On demand includes */ 24 | 25 | 26 | /* Automatically generated layer name #define */ 27 | #define LAYER_Base 0 28 | #define LAYER_Lower 1 29 | #define LAYER_Magic 2 30 | 31 | /* To deal with the situation where there is no Lower layer, to keep &lower happy */ 32 | #ifndef LAYER_Lower 33 | #define LAYER_Lower 0 34 | #endif 35 | 36 | /* Custom Device-tree */ 37 | 38 | 39 | 40 | /* Glove80 system behavior & macros */ 41 | / { 42 | behaviors { 43 | // For the "layer" key, it'd nice to be able to use it as either a shift or a toggle. 44 | // Configure it as a tap dance, so the first tap (or hold) is a &mo and the second tap is a &to 45 | lower: lower { 46 | compatible = "zmk,behavior-tap-dance"; 47 | label = "LAYER_TAP_DANCE"; 48 | #binding-cells = <0>; 49 | tapping-term-ms = <200>; 50 | bindings = <&mo LAYER_Lower>, <&to LAYER_Lower>; 51 | }; 52 | }; 53 | }; 54 | 55 | / { 56 | macros { 57 | rgb_ug_status_macro: rgb_ug_status_macro { 58 | label = "RGB_UG_STATUS"; 59 | compatible = "zmk,behavior-macro"; 60 | #binding-cells = <0>; 61 | bindings 62 | = <&rgb_ug RGB_STATUS>; 63 | }; 64 | }; 65 | }; 66 | 67 | 68 | / { 69 | #ifdef BT_DISC_CMD 70 | behaviors { 71 | bt_0: bt_0 { 72 | compatible = "zmk,behavior-tap-dance"; 73 | label = "BT_0"; 74 | #binding-cells = <0>; 75 | tapping-term-ms = <200>; 76 | bindings = <&bt_select_0>, <&bt BT_DISC 0>; 77 | }; 78 | bt_1: bt_1 { 79 | compatible = "zmk,behavior-tap-dance"; 80 | label = "BT_1"; 81 | #binding-cells = <0>; 82 | tapping-term-ms = <200>; 83 | bindings = <&bt_select_1>, <&bt BT_DISC 1>; 84 | }; 85 | bt_2: bt_2 { 86 | compatible = "zmk,behavior-tap-dance"; 87 | label = "BT_2"; 88 | #binding-cells = <0>; 89 | tapping-term-ms = <200>; 90 | bindings = <&bt_select_2>, <&bt BT_DISC 2>; 91 | }; 92 | bt_3: bt_3 { 93 | compatible = "zmk,behavior-tap-dance"; 94 | label = "BT_3"; 95 | #binding-cells = <0>; 96 | tapping-term-ms = <200>; 97 | bindings = <&bt_select_3>, <&bt BT_DISC 3>; 98 | }; 99 | }; 100 | macros { 101 | bt_select_0: bt_select_0 { 102 | label = "BT_SELECT_0"; 103 | compatible = "zmk,behavior-macro"; 104 | #binding-cells = <0>; 105 | bindings 106 | = <&out OUT_BLE>, 107 | <&bt BT_SEL 0>; 108 | }; 109 | bt_select_1: bt_select_1 { 110 | label = "BT_SELECT_1"; 111 | compatible = "zmk,behavior-macro"; 112 | #binding-cells = <0>; 113 | bindings 114 | = <&out OUT_BLE>, 115 | <&bt BT_SEL 1>; 116 | }; 117 | bt_select_2: bt_select_2 { 118 | label = "BT_SELECT_2"; 119 | compatible = "zmk,behavior-macro"; 120 | #binding-cells = <0>; 121 | bindings 122 | = <&out OUT_BLE>, 123 | <&bt BT_SEL 2>; 124 | }; 125 | bt_select_3: bt_select_3 { 126 | label = "BT_SELECT_3"; 127 | compatible = "zmk,behavior-macro"; 128 | #binding-cells = <0>; 129 | bindings 130 | = <&out OUT_BLE>, 131 | <&bt BT_SEL 3>; 132 | }; 133 | }; 134 | #else 135 | macros { 136 | bt_0: bt_0 { 137 | label = "BT_0"; 138 | compatible = "zmk,behavior-macro"; 139 | #binding-cells = <0>; 140 | bindings 141 | = <&out OUT_BLE>, 142 | <&bt BT_SEL 0>; 143 | }; 144 | bt_1: bt_1 { 145 | label = "BT_1"; 146 | compatible = "zmk,behavior-macro"; 147 | #binding-cells = <0>; 148 | bindings 149 | = <&out OUT_BLE>, 150 | <&bt BT_SEL 1>; 151 | }; 152 | bt_2: bt_2 { 153 | label = "BT_2"; 154 | compatible = "zmk,behavior-macro"; 155 | #binding-cells = <0>; 156 | bindings 157 | = <&out OUT_BLE>, 158 | <&bt BT_SEL 2>; 159 | }; 160 | bt_3: bt_3 { 161 | label = "BT_3"; 162 | compatible = "zmk,behavior-macro"; 163 | #binding-cells = <0>; 164 | bindings 165 | = <&out OUT_BLE>, 166 | <&bt BT_SEL 3>; 167 | }; 168 | }; 169 | #endif 170 | }; 171 | 172 | / { 173 | behaviors { 174 | magic: magic { 175 | compatible = "zmk,behavior-hold-tap"; 176 | label = "MAGIC_HOLD_TAP"; 177 | #binding-cells = <2>; 178 | flavor = "tap-preferred"; 179 | tapping-term-ms = <200>; 180 | bindings = <&mo>, <&rgb_ug_status_macro>; 181 | }; 182 | }; 183 | }; 184 | 185 | /* #define for key positions */ 186 | #define POS_LH_T1 52 187 | #define POS_LH_T2 53 188 | #define POS_LH_T3 54 189 | #define POS_LH_T4 69 190 | #define POS_LH_T5 70 191 | #define POS_LH_T6 71 192 | #define POS_LH_C1R2 15 193 | #define POS_LH_C1R3 27 194 | #define POS_LH_C1R4 39 195 | #define POS_LH_C1R5 51 196 | #define POS_LH_C2R1 4 197 | #define POS_LH_C2R2 14 198 | #define POS_LH_C2R3 26 199 | #define POS_LH_C2R4 38 200 | #define POS_LH_C2R5 50 201 | #define POS_LH_C2R6 68 202 | #define POS_LH_C3R1 3 203 | #define POS_LH_C3R2 13 204 | #define POS_LH_C3R3 25 205 | #define POS_LH_C3R4 37 206 | #define POS_LH_C3R5 49 207 | #define POS_LH_C3R6 67 208 | #define POS_LH_C4R1 2 209 | #define POS_LH_C4R2 12 210 | #define POS_LH_C4R3 24 211 | #define POS_LH_C4R4 36 212 | #define POS_LH_C4R5 48 213 | #define POS_LH_C4R6 66 214 | #define POS_LH_C5R1 1 215 | #define POS_LH_C5R2 11 216 | #define POS_LH_C5R3 23 217 | #define POS_LH_C5R4 35 218 | #define POS_LH_C5R5 47 219 | #define POS_LH_C5R6 65 220 | #define POS_LH_C6R1 0 221 | #define POS_LH_C6R2 10 222 | #define POS_LH_C6R3 22 223 | #define POS_LH_C6R4 34 224 | #define POS_LH_C6R5 46 225 | #define POS_LH_C6R6 64 226 | #define POS_RH_T1 57 227 | #define POS_RH_T2 56 228 | #define POS_RH_T3 55 229 | #define POS_RH_T4 74 230 | #define POS_RH_T5 73 231 | #define POS_RH_T6 72 232 | #define POS_RH_C1R2 16 233 | #define POS_RH_C1R3 28 234 | #define POS_RH_C1R4 40 235 | #define POS_RH_C1R5 58 236 | #define POS_RH_C2R1 5 237 | #define POS_RH_C2R2 17 238 | #define POS_RH_C2R3 29 239 | #define POS_RH_C2R4 41 240 | #define POS_RH_C2R5 59 241 | #define POS_RH_C2R6 75 242 | #define POS_RH_C3R1 6 243 | #define POS_RH_C3R2 18 244 | #define POS_RH_C3R3 30 245 | #define POS_RH_C3R4 42 246 | #define POS_RH_C3R5 60 247 | #define POS_RH_C3R6 76 248 | #define POS_RH_C4R1 7 249 | #define POS_RH_C4R2 19 250 | #define POS_RH_C4R3 31 251 | #define POS_RH_C4R4 43 252 | #define POS_RH_C4R5 61 253 | #define POS_RH_C4R6 77 254 | #define POS_RH_C5R1 8 255 | #define POS_RH_C5R2 20 256 | #define POS_RH_C5R3 32 257 | #define POS_RH_C5R4 44 258 | #define POS_RH_C5R5 62 259 | #define POS_RH_C5R6 78 260 | #define POS_RH_C6R1 9 261 | #define POS_RH_C6R2 21 262 | #define POS_RH_C6R3 33 263 | #define POS_RH_C6R4 45 264 | #define POS_RH_C6R5 63 265 | #define POS_RH_C6R6 79 266 | 267 | /* Custom Defined Behaviors */ 268 | / { 269 | 270 | }; 271 | 272 | /* Automatically generated macro definitions */ 273 | / { 274 | macros { 275 | 276 | }; 277 | }; 278 | 279 | /* Automatically generated behavior definitions */ 280 | / { 281 | behaviors { 282 | 283 | }; 284 | }; 285 | 286 | /* Automatically generated combos definitions */ 287 | 288 | 289 | /* Automatically generated keymap */ 290 | / { 291 | keymap { 292 | compatible = "zmk,keymap"; 293 | 294 | 295 | layer_Base { 296 | bindings = < 297 | &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 298 | &kp DEL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp F11 299 | &kp EQUAL &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH 300 | &kp LSHFT &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT 301 | &lower &kp Z &kp X &kp C &kp V &kp B &kp LSHFT &kp LCTRL &kp TAB &kp RALT &kp RCTRL &kp RSHFT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp PG_UP 302 | &magic LAYER_Magic 0 &kp LEFT &kp RIGHT &kp GRAVE &kp MINUS &kp BSPC &kp LALT &kp ESC &kp TAB &kp RET &kp SPACE &kp LBKT &kp RBKT &kp UP &kp DOWN &kp PG_DN 303 | >; 304 | }; 305 | 306 | layer_Lower { 307 | bindings = < 308 | &kp C_BRI_DN &kp C_BRI_UP &kp C_PREV &kp C_NEXT &kp C_PP &kp C_MUTE &kp C_VOL_DN &kp C_VOL_UP &none &kp PAUSE_BREAK 309 | &trans &none &none &none &none &kp HOME &kp LEFT_PARENTHESIS &kp KP_NUM &kp KP_EQUAL &kp KP_SLASH &kp KP_MULTIPLY &kp PRINTSCREEN 310 | &trans &none &none &kp UP_ARROW &none &kp END &kp RIGHT_PARENTHESIS &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp SCROLLLOCK 311 | &trans &none &kp LEFT_ARROW &kp DOWN_ARROW &kp RIGHT_ARROW &kp PG_UP &kp PERCENT &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &none 312 | &trans &kp K_APP &none &kp F11 &kp F12 &kp PG_DN &trans &trans &to 0 &trans &trans &trans &kp COMMA &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_ENTER &trans 313 | &magic LAYER_Magic 0 &kp CAPS &kp INS &kp F11 &kp F12 &trans &trans &trans &trans &trans &trans &kp KP_N0 &kp KP_N0 &kp KP_DOT &kp KP_ENTER &trans 314 | >; 315 | }; 316 | 317 | layer_Magic { 318 | bindings = < 319 | &bt BT_CLR &none &none &none &none &none &none &none &none &bt BT_CLR_ALL 320 | &none &none &none &none &none &none &none &none &none &none &none &none 321 | &none &rgb_ug RGB_SPI &rgb_ug RGB_SAI &rgb_ug RGB_HUI &rgb_ug RGB_BRI &rgb_ug RGB_TOG &none &none &none &none &none &none 322 | &bootloader &rgb_ug RGB_SPD &rgb_ug RGB_SAD &rgb_ug RGB_HUD &rgb_ug RGB_BRD &rgb_ug RGB_EFF &none &none &none &none &none &bootloader 323 | &sys_reset &none &none &none &none &none &bt_2 &bt_3 &none &none &none &none &none &none &none &none &none &sys_reset 324 | &none &none &none &none &none &bt_0 &bt_1 &out OUT_USB &none &none &none &none &none &none &none &none 325 | >; 326 | }; 327 | 328 | }; 329 | }; 330 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "base16": { 4 | "inputs": { 5 | "fromYaml": "fromYaml" 6 | }, 7 | "locked": { 8 | "lastModified": 1755819240, 9 | "narHash": "sha256-qcMhnL7aGAuFuutH4rq9fvAhCpJWVHLcHVZLtPctPlo=", 10 | "owner": "SenchoPens", 11 | "repo": "base16.nix", 12 | "rev": "75ed5e5e3fce37df22e49125181fa37899c3ccd6", 13 | "type": "github" 14 | }, 15 | "original": { 16 | "owner": "SenchoPens", 17 | "repo": "base16.nix", 18 | "type": "github" 19 | } 20 | }, 21 | "base16-fish": { 22 | "flake": false, 23 | "locked": { 24 | "lastModified": 1765809053, 25 | "narHash": "sha256-XCUQLoLfBJ8saWms2HCIj4NEN+xNsWBlU1NrEPcQG4s=", 26 | "owner": "tomyun", 27 | "repo": "base16-fish", 28 | "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", 29 | "type": "github" 30 | }, 31 | "original": { 32 | "owner": "tomyun", 33 | "repo": "base16-fish", 34 | "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", 35 | "type": "github" 36 | } 37 | }, 38 | "base16-helix": { 39 | "flake": false, 40 | "locked": { 41 | "lastModified": 1760703920, 42 | "narHash": "sha256-m82fGUYns4uHd+ZTdoLX2vlHikzwzdu2s2rYM2bNwzw=", 43 | "owner": "tinted-theming", 44 | "repo": "base16-helix", 45 | "rev": "d646af9b7d14bff08824538164af99d0c521b185", 46 | "type": "github" 47 | }, 48 | "original": { 49 | "owner": "tinted-theming", 50 | "repo": "base16-helix", 51 | "type": "github" 52 | } 53 | }, 54 | "base16-vim": { 55 | "flake": false, 56 | "locked": { 57 | "lastModified": 1732806396, 58 | "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", 59 | "owner": "tinted-theming", 60 | "repo": "base16-vim", 61 | "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", 62 | "type": "github" 63 | }, 64 | "original": { 65 | "owner": "tinted-theming", 66 | "repo": "base16-vim", 67 | "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", 68 | "type": "github" 69 | } 70 | }, 71 | "bbpPairings": { 72 | "inputs": { 73 | "nixpkgs": "nixpkgs" 74 | }, 75 | "locked": { 76 | "lastModified": 1732569077, 77 | "narHash": "sha256-rMMIr7rofcDWZz8DTx4CQpHZNa0FOSPWLVJ8esoAogQ=", 78 | "owner": "ornicar", 79 | "repo": "bbpPairings", 80 | "rev": "2b01f2c1e2b839d265f3ef665f3220c92af67c6f", 81 | "type": "github" 82 | }, 83 | "original": { 84 | "owner": "ornicar", 85 | "ref": "2b01f2c1e2b839d2", 86 | "repo": "bbpPairings", 87 | "type": "github" 88 | } 89 | }, 90 | "firefox-gnome-theme": { 91 | "flake": false, 92 | "locked": { 93 | "lastModified": 1764724327, 94 | "narHash": "sha256-OkFLrD3pFR952TrjQi1+Vdj604KLcMnkpa7lkW7XskI=", 95 | "owner": "rafaelmardojai", 96 | "repo": "firefox-gnome-theme", 97 | "rev": "66b7c635763d8e6eb86bd766de5a1e1fbfcc1047", 98 | "type": "github" 99 | }, 100 | "original": { 101 | "owner": "rafaelmardojai", 102 | "repo": "firefox-gnome-theme", 103 | "type": "github" 104 | } 105 | }, 106 | "flake-parts": { 107 | "inputs": { 108 | "nixpkgs-lib": [ 109 | "stylix", 110 | "nixpkgs" 111 | ] 112 | }, 113 | "locked": { 114 | "lastModified": 1763759067, 115 | "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", 116 | "owner": "hercules-ci", 117 | "repo": "flake-parts", 118 | "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", 119 | "type": "github" 120 | }, 121 | "original": { 122 | "owner": "hercules-ci", 123 | "repo": "flake-parts", 124 | "type": "github" 125 | } 126 | }, 127 | "fromYaml": { 128 | "flake": false, 129 | "locked": { 130 | "lastModified": 1731966426, 131 | "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", 132 | "owner": "SenchoPens", 133 | "repo": "fromYaml", 134 | "rev": "106af9e2f715e2d828df706c386a685698f3223b", 135 | "type": "github" 136 | }, 137 | "original": { 138 | "owner": "SenchoPens", 139 | "repo": "fromYaml", 140 | "type": "github" 141 | } 142 | }, 143 | "gnome-shell": { 144 | "flake": false, 145 | "locked": { 146 | "host": "gitlab.gnome.org", 147 | "lastModified": 1764524476, 148 | "narHash": "sha256-bTmNn3Q4tMQ0J/P0O5BfTQwqEnCiQIzOGef9/aqAZvk=", 149 | "owner": "GNOME", 150 | "repo": "gnome-shell", 151 | "rev": "c0e1ad9f0f703fd0519033b8f46c3267aab51a22", 152 | "type": "gitlab" 153 | }, 154 | "original": { 155 | "host": "gitlab.gnome.org", 156 | "owner": "GNOME", 157 | "ref": "gnome-49", 158 | "repo": "gnome-shell", 159 | "type": "gitlab" 160 | } 161 | }, 162 | "home-manager": { 163 | "inputs": { 164 | "nixpkgs": [ 165 | "nixpkgs" 166 | ] 167 | }, 168 | "locked": { 169 | "lastModified": 1766282146, 170 | "narHash": "sha256-0V/nKU93KdYGi+5LB/MVo355obBJw/2z9b2xS3bPJxY=", 171 | "owner": "nix-community", 172 | "repo": "home-manager", 173 | "rev": "61fcc9de76b88e55578eb5d79fc80f2b236df707", 174 | "type": "github" 175 | }, 176 | "original": { 177 | "owner": "nix-community", 178 | "repo": "home-manager", 179 | "type": "github" 180 | } 181 | }, 182 | "nixos-hardware": { 183 | "locked": { 184 | "lastModified": 1764440730, 185 | "narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=", 186 | "owner": "NixOS", 187 | "repo": "nixos-hardware", 188 | "rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3", 189 | "type": "github" 190 | }, 191 | "original": { 192 | "owner": "NixOS", 193 | "repo": "nixos-hardware", 194 | "type": "github" 195 | } 196 | }, 197 | "nixpkgs": { 198 | "locked": { 199 | "lastModified": 1732549392, 200 | "narHash": "sha256-muNzem25togwjoGlHhm64M4Sbo3pFPHz2Yp6pEvzyuo=", 201 | "owner": "NixOS", 202 | "repo": "nixpkgs", 203 | "rev": "091621ce37dad208abd687b58ebfb848a24be463", 204 | "type": "github" 205 | }, 206 | "original": { 207 | "owner": "NixOS", 208 | "repo": "nixpkgs", 209 | "type": "github" 210 | } 211 | }, 212 | "nixpkgs-master": { 213 | "locked": { 214 | "lastModified": 1766306720, 215 | "narHash": "sha256-IfwmeDgVGYNlt16QXPdAllEW1UWJO0ZfR9jtXqq3UeM=", 216 | "owner": "NixOS", 217 | "repo": "nixpkgs", 218 | "rev": "86f6db280727f1c8fd4f70b88c981786b8be05ef", 219 | "type": "github" 220 | }, 221 | "original": { 222 | "owner": "NixOS", 223 | "ref": "master", 224 | "repo": "nixpkgs", 225 | "type": "github" 226 | } 227 | }, 228 | "nixpkgs-stable": { 229 | "locked": { 230 | "lastModified": 1766014764, 231 | "narHash": "sha256-+73VffE5GP5fvbib6Hs1Su6LehG+9UV1Kzs90T2gBLA=", 232 | "owner": "NixOS", 233 | "repo": "nixpkgs", 234 | "rev": "2b0d2b456e4e8452cf1c16d00118d145f31160f9", 235 | "type": "github" 236 | }, 237 | "original": { 238 | "owner": "NixOS", 239 | "ref": "nixos-25.05", 240 | "repo": "nixpkgs", 241 | "type": "github" 242 | } 243 | }, 244 | "nixpkgs_2": { 245 | "locked": { 246 | "lastModified": 1766070988, 247 | "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", 248 | "owner": "NixOS", 249 | "repo": "nixpkgs", 250 | "rev": "c6245e83d836d0433170a16eb185cefe0572f8b8", 251 | "type": "github" 252 | }, 253 | "original": { 254 | "owner": "NixOS", 255 | "ref": "nixos-unstable", 256 | "repo": "nixpkgs", 257 | "type": "github" 258 | } 259 | }, 260 | "nixpkgs_3": { 261 | "locked": { 262 | "lastModified": 1732567409, 263 | "narHash": "sha256-k4ZnULVI+Us3zRGZL7l3jAU8Z7bNnJfFjqVuPUMlcpM=", 264 | "owner": "NixOS", 265 | "repo": "nixpkgs", 266 | "rev": "203401241d7af1d353ae688506767f7f16d436df", 267 | "type": "github" 268 | }, 269 | "original": { 270 | "owner": "NixOS", 271 | "repo": "nixpkgs", 272 | "type": "github" 273 | } 274 | }, 275 | "nur": { 276 | "inputs": { 277 | "flake-parts": [ 278 | "stylix", 279 | "flake-parts" 280 | ], 281 | "nixpkgs": [ 282 | "stylix", 283 | "nixpkgs" 284 | ] 285 | }, 286 | "locked": { 287 | "lastModified": 1764773531, 288 | "narHash": "sha256-mCBl7MD1WZ7yCG6bR9MmpPO2VydpNkWFgnslJRIT1YU=", 289 | "owner": "nix-community", 290 | "repo": "NUR", 291 | "rev": "1d9616689e98beded059ad0384b9951e967a17fa", 292 | "type": "github" 293 | }, 294 | "original": { 295 | "owner": "nix-community", 296 | "repo": "NUR", 297 | "type": "github" 298 | } 299 | }, 300 | "picfit": { 301 | "inputs": { 302 | "nixpkgs": "nixpkgs_3" 303 | }, 304 | "locked": { 305 | "lastModified": 1732571796, 306 | "narHash": "sha256-pSMT5hxGdgivmaCACSvtYop3qulzWZSqFZWgb2QtgU4=", 307 | "owner": "ornicar", 308 | "repo": "picfit", 309 | "rev": "e64ee4fb03f65742ed2ff84b1c4b9f385a6a723c", 310 | "type": "github" 311 | }, 312 | "original": { 313 | "owner": "ornicar", 314 | "ref": "e64ee4fb03f65742ed2ff", 315 | "repo": "picfit", 316 | "type": "github" 317 | } 318 | }, 319 | "root": { 320 | "inputs": { 321 | "bbpPairings": "bbpPairings", 322 | "home-manager": "home-manager", 323 | "nixos-hardware": "nixos-hardware", 324 | "nixpkgs": "nixpkgs_2", 325 | "nixpkgs-master": "nixpkgs-master", 326 | "nixpkgs-stable": "nixpkgs-stable", 327 | "picfit": "picfit", 328 | "stylix": "stylix" 329 | } 330 | }, 331 | "stylix": { 332 | "inputs": { 333 | "base16": "base16", 334 | "base16-fish": "base16-fish", 335 | "base16-helix": "base16-helix", 336 | "base16-vim": "base16-vim", 337 | "firefox-gnome-theme": "firefox-gnome-theme", 338 | "flake-parts": "flake-parts", 339 | "gnome-shell": "gnome-shell", 340 | "nixpkgs": [ 341 | "nixpkgs" 342 | ], 343 | "nur": "nur", 344 | "systems": "systems", 345 | "tinted-foot": "tinted-foot", 346 | "tinted-kitty": "tinted-kitty", 347 | "tinted-schemes": "tinted-schemes", 348 | "tinted-tmux": "tinted-tmux", 349 | "tinted-zed": "tinted-zed" 350 | }, 351 | "locked": { 352 | "lastModified": 1765897595, 353 | "narHash": "sha256-NgTRxiEC5y96zrhdBygnY+mSzk5FWMML39PcRGVJmxg=", 354 | "owner": "nix-community", 355 | "repo": "stylix", 356 | "rev": "e6829552d4bb659ebab00f08c61d8c62754763f3", 357 | "type": "github" 358 | }, 359 | "original": { 360 | "owner": "nix-community", 361 | "repo": "stylix", 362 | "type": "github" 363 | } 364 | }, 365 | "systems": { 366 | "locked": { 367 | "lastModified": 1681028828, 368 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 369 | "owner": "nix-systems", 370 | "repo": "default", 371 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 372 | "type": "github" 373 | }, 374 | "original": { 375 | "owner": "nix-systems", 376 | "repo": "default", 377 | "type": "github" 378 | } 379 | }, 380 | "tinted-foot": { 381 | "flake": false, 382 | "locked": { 383 | "lastModified": 1726913040, 384 | "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", 385 | "owner": "tinted-theming", 386 | "repo": "tinted-foot", 387 | "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", 388 | "type": "github" 389 | }, 390 | "original": { 391 | "owner": "tinted-theming", 392 | "repo": "tinted-foot", 393 | "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", 394 | "type": "github" 395 | } 396 | }, 397 | "tinted-kitty": { 398 | "flake": false, 399 | "locked": { 400 | "lastModified": 1735730497, 401 | "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", 402 | "owner": "tinted-theming", 403 | "repo": "tinted-kitty", 404 | "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", 405 | "type": "github" 406 | }, 407 | "original": { 408 | "owner": "tinted-theming", 409 | "repo": "tinted-kitty", 410 | "type": "github" 411 | } 412 | }, 413 | "tinted-schemes": { 414 | "flake": false, 415 | "locked": { 416 | "lastModified": 1763914658, 417 | "narHash": "sha256-Hju0WtMf3iForxtOwXqGp3Ynipo0EYx1AqMKLPp9BJw=", 418 | "owner": "tinted-theming", 419 | "repo": "schemes", 420 | "rev": "0f6be815d258e435c9b137befe5ef4ff24bea32c", 421 | "type": "github" 422 | }, 423 | "original": { 424 | "owner": "tinted-theming", 425 | "repo": "schemes", 426 | "type": "github" 427 | } 428 | }, 429 | "tinted-tmux": { 430 | "flake": false, 431 | "locked": { 432 | "lastModified": 1764465359, 433 | "narHash": "sha256-lbSVPqLEk2SqMrnpvWuKYGCaAlfWFMA6MVmcOFJjdjE=", 434 | "owner": "tinted-theming", 435 | "repo": "tinted-tmux", 436 | "rev": "edf89a780e239263cc691a987721f786ddc4f6aa", 437 | "type": "github" 438 | }, 439 | "original": { 440 | "owner": "tinted-theming", 441 | "repo": "tinted-tmux", 442 | "type": "github" 443 | } 444 | }, 445 | "tinted-zed": { 446 | "flake": false, 447 | "locked": { 448 | "lastModified": 1764464512, 449 | "narHash": "sha256-rCD/pAhkMdCx6blsFwxIyvBJbPZZ1oL2sVFrH07lmqg=", 450 | "owner": "tinted-theming", 451 | "repo": "base16-zed", 452 | "rev": "907dbba5fb8cf69ebfd90b00813418a412d0a29a", 453 | "type": "github" 454 | }, 455 | "original": { 456 | "owner": "tinted-theming", 457 | "repo": "base16-zed", 458 | "type": "github" 459 | } 460 | } 461 | }, 462 | "root": "root", 463 | "version": 7 464 | } 465 | --------------------------------------------------------------------------------