0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Back on zsh ๐Ÿ‘€ this is neat


Signed-off-by: MLC Bloeiman <mar@strawmelonjuice.com>

+266 -33
+2 -1
configs/fish/config/20-aliases.fish
··· 61 61 end 62 62 end 63 63 64 + 64 65 function dev 65 66 if set -q IN_NIX_SHELL 66 67 echo "โš ๏ธ Already inside Nix shell!" ··· 127 128 # JJ-related abbreviations and aliases 128 129 abbr jje 'jj edit' 129 130 # ===================================================== --> Please do not break 130 - alias jjd 'jj desc @ -m " 131 + alias jjd 'jj desc @ -m " 131 132 132 133 133 134 Signed-off-by: $(git config user.name) <$(git config user.email)>" && jj desc @ && jj sign -r @'
+14 -1
configs/nvim/lua/config/keymaps.lua
··· 80 80 map("n", "<space>ca", vim.lsp.buf.code_action, { desc = "LSP -> Code action" }) 81 81 map("v", "<space>ca", vim.lsp.buf.code_action, { desc = "LSP -> Code action" }) 82 82 -- Rename 83 - map("n", "<Space>cr", vim.lsp.buf.rename, { desc = "LSP -> Rename symbol" }) 83 + map("n", "<space>cr", vim.lsp.buf.rename, { desc = "LSP -> Rename symbol" }) 84 + 85 + -- Stolen from Ollie 86 + map("n", "<space>cs", function() 87 + -- get current line(string) and row(int) in the buffer 88 + local line = vim.trim(vim.api.nvim_get_current_line()) 89 + local row, _ = unpack(vim.api.nvim_win_get_cursor(0)) 90 + 91 + -- make "-----------" seperator line at consitent length 92 + local seperator = string.rep("-", 80 - string.len(line)) 93 + 94 + -- write line with seperator to current buffer at current cursor position 95 + vim.api.nvim_buf_set_lines(0, row - 1, row, true, { line .. " " .. seperator }) 96 + end, { desc = "set [S]eperator" }) 84 97 85 98 -- Movement -------------------------------------------------------------------------------------------------------------------------------------------------- 86 99 map("i", "<down>", "<esc>gj", { desc = "Move down and exit insert" })
+114
configs/zshrc-append
··· 1 + # Stole ollies idea of putting _part_ in a separate file and part inline :3 2 + 3 + # Function: zap 4 + _zap() { 5 + if [[ -d .jj || -d .git ]]; then 6 + clear -x 7 + local repo_type="" 8 + 9 + if [[ -d .git && -d .jj ]]; then 10 + repo_type="JJ (git-colocated)" 11 + elif [[ -d .jj ]]; then 12 + repo_type="Jujutsu" 13 + else 14 + repo_type="Git" 15 + fi 16 + 17 + echo "๐Ÿ“‚ Opened $repo_type repository: $(pwd)" 18 + 19 + if [[ -d .git ]]; then 20 + git fetch 21 + else 22 + jj git fetch 23 + fi 24 + 25 + # Show repository line counts (assuming 'kc' is another alias/function) 26 + kc 27 + 28 + if [[ -d .jj ]]; then 29 + jj log -Tbuiltin_log_compact_full_description -r'ancestors(bookmarks() & @-, 5) & ~@' --reversed --no-pager --limit 5 30 + jj show --summary 31 + else 32 + git status 33 + fi 34 + 35 + # Dynamically tell user of flakes. 36 + if [[ -f flake.nix ]] && command -v nix >/dev/null 2>&1 && [[ -z "$IN_NIX_SHELL" ]] && [[ ! -f .envrc ]]; then 37 + echo -e "\n\nโ„๏ธ\tFound flake.nix, run 'create-envrc' to create a .envrc file here to load this flake automatically." 38 + echo -e "\tOr alternatively, run 'dev' to open Fish in a nix develop shell." 39 + fi 40 + else 41 + eza -a --icons 42 + fi 43 + } 44 + 45 + _zap_on_cd() { 46 + # Check if we are in an interactive shell to avoid 47 + # cluttering automated scripts 48 + [[ -t 1 ]] && _zap 49 + } 50 + 51 + autoload -Uz add-zsh-hook 52 + add-zsh-hook chpwd _zap_on_cd 53 + 54 + # Alias function: dev 55 + dev() { 56 + if [[ -n "$IN_NIX_SHELL" ]]; then 57 + echo "โš ๏ธ Already inside Nix shell!" 58 + return 0 59 + fi 60 + 61 + if [[ -f .envrc ]]; then 62 + echo "โš ๏ธ .envrc found, direnv will be used." 63 + direnv allow 64 + return 0 65 + fi 66 + 67 + if [[ -f flake.nix ]] && command -v nix >/dev/null 2>&1; then 68 + nix develop --set-env-var SHELL "$SHELL" -c "$SHELL" 69 + elif ! command -v nix >/dev/null 2>&1; then 70 + echo "๓ฑ„… Nix is not installed!" 71 + else 72 + echo "โŒ No Flake.nix file in this directory" 73 + fi 74 + } 75 + 76 + # Function: create-envrc 77 + function create-envrc() { 78 + if [ -e .envrc ] 79 + then 80 + echo "โš ๏ธ .envrc already here, can't safely insert." 81 + return 0 82 + fi 83 + 84 + if ! command -v nix > /dev/null 2>&1 85 + then 86 + echo "๓ฑ„… Nix is not installed!" 87 + return 1 88 + fi 89 + 90 + if ! command -v direnv > /dev/null 2>&1 91 + then 92 + echo "๓ฑ„… Direnv is not installed!" 93 + return 1 94 + fi 95 + 96 + if [ -e flake.nix ] 97 + then 98 + echo "โŒ No flake.nix file in this directory" 99 + return 1 100 + fi 101 + 102 + 103 + if ! [ -e .gitignore ] || ! grep -q "^\.direnv/" .gitignore 104 + then 105 + echo "๐Ÿ’จ Adding direnv cache to gitignore" 106 + echo -e "\n# Ignore direnv cache\n.direnv/" >> .gitignore 107 + fi 108 + 109 + echo "if nix flake show &> /dev/null; then 110 + use flake 111 + fi" >./.envrc 112 + 113 + direnv allow 114 + }
+24 -24
flake.lock
··· 8 8 }, 9 9 "locked": { 10 10 "dir": "pkgs/firefox-addons", 11 - "lastModified": 1773661557, 12 - "narHash": "sha256-4vwz59H6qE77UZXcv23Q5pyq8/qC9UK2+7yI5hC5ctE=", 11 + "lastModified": 1773806610, 12 + "narHash": "sha256-mh0egzUnzXfHPrOjWI0hChOiyfibEqb8lPtfQaqfTdo=", 13 13 "owner": "rycee", 14 14 "repo": "nur-expressions", 15 - "rev": "cd73982e721557fcea774dcf914d3c5627a8b64b", 15 + "rev": "df5c2d43f13c73d6bc16f4ccdacd588d8442af3d", 16 16 "type": "gitlab" 17 17 }, 18 18 "original": { ··· 29 29 ] 30 30 }, 31 31 "locked": { 32 - "lastModified": 1773666768, 33 - "narHash": "sha256-7XvLaFMQOsfWrK+msO0Oqe5CeNYsAlSGjrl5y14gA6w=", 32 + "lastModified": 1773810247, 33 + "narHash": "sha256-6Vz1Thy/1s7z+Rq5OfkWOBAdV4eD+OrvDs10yH6xJzQ=", 34 34 "owner": "nix-community", 35 35 "repo": "home-manager", 36 - "rev": "ca53f083dbd4c83dd5dca8a3099374708e155c32", 36 + "rev": "d47357a4c806d18a3e853ad2699eaec3c01622e7", 37 37 "type": "github" 38 38 }, 39 39 "original": { ··· 52 52 "xwayland-satellite-unstable": "xwayland-satellite-unstable" 53 53 }, 54 54 "locked": { 55 - "lastModified": 1773646853, 56 - "narHash": "sha256-9xzEP9ExGPYOg9Oa4CCQo3kGCwxVQ9oSjmB897XWiF0=", 55 + "lastModified": 1773809319, 56 + "narHash": "sha256-ZuMZEuxqWneGaK+HAXz50JyCmtFo0neo6mp6F2NWj24=", 57 57 "owner": "sodiboo", 58 58 "repo": "niri-flake", 59 - "rev": "7b3fd75b0a117bc247cb5183ed22cf7d5e3e135a", 59 + "rev": "c4ee62058cd37d7b842c3b081917f792efee9082", 60 60 "type": "github" 61 61 }, 62 62 "original": { ··· 100 100 }, 101 101 "nixpkgs": { 102 102 "locked": { 103 - "lastModified": 1773579282, 104 - "narHash": "sha256-LWvZj9Bvm1EuoO6zbX4yjZebwnZNfeTbmCJGS7RGQ3Y=", 103 + "lastModified": 1773734432, 104 + "narHash": "sha256-IF5ppUWh6gHGHYDbtVUyhwy/i7D261P7fWD1bPefOsw=", 105 105 "owner": "NixOS", 106 106 "repo": "nixpkgs", 107 - "rev": "5a88de74db0e948139be4b46f9a94d64aa11391c", 107 + "rev": "cda48547b432e8d3b18b4180ba07473762ec8558", 108 108 "type": "github" 109 109 }, 110 110 "original": { ··· 116 116 }, 117 117 "nixpkgs-stable": { 118 118 "locked": { 119 - "lastModified": 1773524153, 120 - "narHash": "sha256-Jms57zzlFf64ayKzzBWSE2SGvJmK+NGt8Gli71d9kmY=", 119 + "lastModified": 1773705440, 120 + "narHash": "sha256-xB30bbAp0e7ogSEYyc126mAJMt4FRFh8wtm6ADE1xuM=", 121 121 "owner": "NixOS", 122 122 "repo": "nixpkgs", 123 - "rev": "e9f278faa1d0c2fc835bd331d4666b59b505a410", 123 + "rev": "48652e9d5aea46e555b3df87354280d4f29cd3a3", 124 124 "type": "github" 125 125 }, 126 126 "original": { ··· 132 132 }, 133 133 "nixpkgs-stable_2": { 134 134 "locked": { 135 - "lastModified": 1773524153, 136 - "narHash": "sha256-Jms57zzlFf64ayKzzBWSE2SGvJmK+NGt8Gli71d9kmY=", 135 + "lastModified": 1773705440, 136 + "narHash": "sha256-xB30bbAp0e7ogSEYyc126mAJMt4FRFh8wtm6ADE1xuM=", 137 137 "owner": "nixos", 138 138 "repo": "nixpkgs", 139 - "rev": "e9f278faa1d0c2fc835bd331d4666b59b505a410", 139 + "rev": "48652e9d5aea46e555b3df87354280d4f29cd3a3", 140 140 "type": "github" 141 141 }, 142 142 "original": { ··· 148 148 }, 149 149 "nixpkgs_2": { 150 150 "locked": { 151 - "lastModified": 1773579282, 152 - "narHash": "sha256-LWvZj9Bvm1EuoO6zbX4yjZebwnZNfeTbmCJGS7RGQ3Y=", 151 + "lastModified": 1773734432, 152 + "narHash": "sha256-IF5ppUWh6gHGHYDbtVUyhwy/i7D261P7fWD1bPefOsw=", 153 153 "owner": "nixos", 154 154 "repo": "nixpkgs", 155 - "rev": "5a88de74db0e948139be4b46f9a94d64aa11391c", 155 + "rev": "cda48547b432e8d3b18b4180ba07473762ec8558", 156 156 "type": "github" 157 157 }, 158 158 "original": { ··· 186 186 "noctalia-qs": "noctalia-qs" 187 187 }, 188 188 "locked": { 189 - "lastModified": 1773662174, 190 - "narHash": "sha256-b3Z40vBcd2ilBBYbLMJRMs32xWwXZ0LByLQVPv2nLS0=", 189 + "lastModified": 1773777742, 190 + "narHash": "sha256-3lluT9/nXWmv3yV3orSuMMgmj25wbOxy76mJzvqN/w0=", 191 191 "owner": "noctalia-dev", 192 192 "repo": "noctalia-shell", 193 - "rev": "c3e18d4db9530f99125bb38272acd342866e91f2", 193 + "rev": "d9ae5e617f7f512ac7732c5cfb2538d1ae2fa594", 194 194 "type": "github" 195 195 }, 196 196 "original": {
+2
home/modules/development.nix
··· 9 9 ]; 10 10 programs.mise = { 11 11 enable = true; 12 + enableZshIntegration = false; 13 + enableFishIntegration = false; 12 14 }; 13 15 home.packages = with pkgs; [ 14 16 # Mise is being faded out in favor of just due to growing friction between me and Mise's style
+1
home/modules/shell.nix
··· 3 3 { 4 4 imports = [ 5 5 ./shell/kc.nix 6 + ./shell/zsh.nix 6 7 ]; 7 8 programs.fish = { 8 9 enable = true;
+98
home/modules/shell/zsh.nix
··· 1 + { lib, pkgs, ... }: 2 + { 3 + programs.zoxide = { 4 + enable = true; 5 + enableZshIntegration = true; 6 + options = [ "--cmd zox" ]; 7 + }; 8 + 9 + programs.fzf = { 10 + enable = true; 11 + enableZshIntegration = true; 12 + }; 13 + 14 + programs.starship = { 15 + enable = true; 16 + enableZshIntegration = true; 17 + 18 + }; 19 + # Forcing myself to evaluate all the options from https://home-manager-options.extranix.com/?query=programs.zsh.&release=release-25.11 and add them or ignore 20 + programs.zsh = { 21 + enable = true; 22 + zplug = { 23 + enable = true; 24 + plugins = [ 25 + { name = "zsh-users/zsh-syntax-highlighting"; } 26 + { name = "zsh-users/zsh-completions"; } 27 + { name = "zsh-users/zsh-autosuggestions"; } 28 + { name = "Aloxaf/fzf-tab"; } 29 + { name = "anatolykopyl/doas-zsh-plugin"; } 30 + ]; 31 + }; 32 + shellAliases = { 33 + # Stealing these back actually! 34 + to-dotfiles = "cd ~/.dotfiles || cd ~/dotfiles"; 35 + rb = "to-dotfiles && jj file track . && doas nixos-rebuild switch --flake ~/.dotfiles#$(hostname)"; 36 + 37 + ls = "eza --icons"; 38 + la = "eza --icons -a"; 39 + ll = "eza --icons -al"; 40 + lt = "eza --icons -a --tree --level=1"; 41 + v = "$EDITOR"; 42 + cat = "bat -p"; 43 + nano = "nvim"; 44 + shutdown = "systemctl poweroff"; 45 + ide = "zellij --layout ide"; 46 + # JJ-related 47 + jje = "jj edit"; 48 + jjd = "jj desc @"; 49 + # jjd (in editor) and sign 50 + jjds = '' 51 + jj desc @ -m " 52 + 53 + 54 + Signed-off-by: $(git config user.name) <$(git config user.email)>" && jj desc @ && jj sign -r @ 55 + ''; 56 + jjda = ''jj describe @ -m "$(date)"''; 57 + jjs = "jj show"; 58 + jjn = "jj next --edit"; 59 + cargock = "cargo-clean-all --keep-days 21 ~ -i"; 60 + 61 + # Zoxide + a little dash of info ------------------------------------------------ 62 + cd = "zox"; 63 + cdi = "zoxi"; 64 + }; 65 + initContent = 66 + let 67 + zshConfigEarlyInit = lib.mkOrder 500 '' 68 + hyfetch 69 + if [[ -r "''${XDG_CACHE_HOME:-''$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then 70 + source "''${XDG_CACHE_HOME:-''$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" 71 + fi 72 + ''; 73 + zshConfig = lib.mkOrder 1000 '' 74 + # Completion styling ------------------------------------------------------------ 75 + zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' 76 + zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}" 77 + zstyle ':completion:*' menu no 78 + zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath' 79 + zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath' 80 + ''; 81 + # more complex zsh functions n such go in here since i dont wanna deal with writing those without proper lsp <- Good idea of Ollie! 82 + zshConfigRest = lib.mkOrder 1100 (builtins.readFile ../../../configs/zshrc-append); 83 + in 84 + lib.mkMerge [ 85 + zshConfigEarlyInit 86 + zshConfig 87 + zshConfigRest 88 + ]; 89 + enableCompletion = true; 90 + autocd = true; 91 + history = { 92 + ignoreSpace = true; 93 + }; 94 + }; 95 + home.packages = with pkgs; [ 96 + shfmt 97 + ]; 98 + }
+1 -1
home/modules/wezterm.nix
··· 11 11 return "Rosรฉ Pine Dawn (Gogh)" 12 12 elseif hour >= 12 and hour < 18 then 13 13 -- afternoon 14 - return "Rosรฉ Pine Dawn (Gogh)" 14 + return "Breadog (Gogh)" 15 15 elseif hour >= 18 and hour < 24 then 16 16 -- evening 17 17 return "tokyonight_night"
+10 -6
hosts/all-hosts.nix
··· 30 30 }; 31 31 }; 32 32 }; 33 - environment.variables = { 34 - GTK_IM_MODULE = lib.mkForce null; 35 - QT_IM_MODULE = lib.mkForce null; 33 + environment = { 34 + 35 + pathsToLink = [ "/share/zsh" ]; 36 + variables = { 37 + GTK_IM_MODULE = lib.mkForce null; 38 + QT_IM_MODULE = lib.mkForce null; 39 + }; 36 40 }; 37 41 38 42 nix.settings.experimental-features = [ ··· 65 69 66 70 services.tailscale.enable = true; 67 71 68 - # Enable fish 69 - programs.fish.enable = true; 72 + # Enable zsh 73 + programs.zsh.enable = true; 70 74 71 75 # Enable the X11 windowing system. 72 76 services.xserver.enable = true; ··· 90 94 users.users.mar = { 91 95 isNormalUser = true; 92 96 description = "MLC Bloeiman"; 93 - shell = pkgs.fish; 97 + shell = pkgs.zsh; 94 98 extraGroups = [ 95 99 "networkmanager" 96 100 "wheel"