my NixOS and nix-darwin config
0
fork

Configure Feed

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

fixed fish shell

+119 -110
+1
hosts/Khaos/configuration.nix
··· 13 13 imports = [ 14 14 # Include the results of the hardware scan. 15 15 ./hardware-configuration.nix 16 + ../../modules/system/tailscale.nix 16 17 ]; 17 18 18 19 # Bootloader.
+118 -106
modules/home/shells/fish/default.nix
··· 1 - { config, pkgs, ... }: 1 + { 2 + lib, 3 + config, 4 + pkgs, 5 + ... 6 + }: 2 7 8 + with lib; 9 + let 10 + cfg = config.nyx.fish; 11 + in 3 12 { 4 - home.packages = with pkgs; [ fish ]; 5 13 6 - # whereis fish 7 - # sudo hx /etc/shells 8 - # chsh -s {locaiton of fish} 14 + options.nyx.fish = { 15 + enable = mkEnableOption "Fish"; 16 + }; 9 17 10 - home.file."~/.config/fish/conf.d/nix-env.fish".source = ./nix-fix.fish; 18 + config = mkIf (cfg.enable) { 11 19 12 - programs.fish = { 20 + home.packages = with pkgs; [ fish ]; 13 21 14 - enable = true; 22 + home.file.".config/fish/conf.d/nix-env.fish".source = ./nix-fix.fish; 15 23 16 - interactiveShellInit = '' 17 - set fish_greeting 18 - eval (ssh-agent -c) &> /dev/null 19 - ssh-add ~/.ssh/github &> /dev/null 20 - ssh-add ~/.ssh/ucsc_gitlab &> /dev/null 24 + programs.fish = { 21 25 22 - eval "$(zoxide init fish)" 23 - eval "$(starship init fish)" 26 + enable = true; 24 27 25 - enable_transience 26 - ''; 28 + interactiveShellInit = '' 29 + set fish_greeting 30 + eval (ssh-agent -c) &> /dev/null 31 + ssh-add ~/.ssh/github &> /dev/null 32 + ssh-add ~/.ssh/ucsc_gitlab &> /dev/null 27 33 28 - shellAliases = { 29 - ".." = "cd .."; 30 - "..." = "cd ../.."; 31 - "...." = "cd ../../../"; 32 - "....." = "cd ../../../../"; 34 + eval "$(zoxide init fish)" 35 + eval "$(starship init fish)" 33 36 34 - "dots" = "cd ~/dev/dots"; 37 + enable_transience 38 + ''; 35 39 36 - "cp" = "cp -v"; 37 - "ddf" = "df -h"; 38 - "etc" = "erd -H"; 39 - "mkdir" = "mkdir -p"; 40 - "mv" = "mv -v"; 41 - "rm" = "rm -v"; 42 - "rr" = "rm -rf"; 40 + shellAliases = { 41 + ".." = "cd .."; 42 + "..." = "cd ../.."; 43 + "...." = "cd ../../../"; 44 + "....." = "cd ../../../../"; 43 45 44 - "ld" = "eza -ld */ --no-quotes --time-style long-iso"; 45 - "lla" = "eza -lah --no-quotes --time-style long-iso"; 46 - "ll" = "eza -lh --no-quotes --time-style long-iso"; 47 - "llr" = "eza -lhr --no-quotes --time-style long-iso"; 48 - "lls" = "eza -lh -s size --no-quotes --time-style long-iso"; 49 - "llt" = "eza -lh -s time --no-quotes --time-style long-iso"; 50 - "lltr" = "eza -lhr -s time --no-quotes --time-style long-iso"; 46 + "dots" = "cd ~/dev/dots"; 51 47 52 - "ree" = 53 - "sudo nixos-rebuild switch --flake ~/dots/nixdots#zephryus && git push"; 48 + "cp" = "cp -v"; 49 + "ddf" = "df -h"; 50 + "etc" = "erd -H"; 51 + "mkdir" = "mkdir -p"; 52 + "mv" = "mv -v"; 53 + "rm" = "rm -v"; 54 + "rr" = "rm -rf"; 54 55 55 - "fcd" = '' 56 - cd "$(find ~/coding/ ~/storage/ -type d -not \( -path "*/.git/*" -o -path "*/target/*" -o -path "*/.venv/*" -o -path "*/node_modules/*" -o -path "*/venv/*" -o -path "*/build/*" -o -path "*/.*/*" \) -print 2>/dev/null | fzf)" ''; 56 + "ld" = "eza -ld */ --no-quotes --time-style long-iso"; 57 + "lla" = "eza -lah --no-quotes --time-style long-iso"; 58 + "ll" = "eza -lh --no-quotes --time-style long-iso"; 59 + "llr" = "eza -lhr --no-quotes --time-style long-iso"; 60 + "lls" = "eza -lh -s size --no-quotes --time-style long-iso"; 61 + "llt" = "eza -lh -s time --no-quotes --time-style long-iso"; 62 + "lltr" = "eza -lhr -s time --no-quotes --time-style long-iso"; 57 63 58 - "l" = "exa"; 64 + "ree" = "sudo nixos-rebuild switch --flake ~/dots/nixdots#zephryus && git push"; 59 65 60 - "lg" = "lazygit"; 61 - }; 66 + "fcd" = 67 + ''cd "$(find ~/coding/ ~/storage/ -type d -not \( -path "*/.git/*" -o -path "*/target/*" -o -path "*/.venv/*" -o -path "*/node_modules/*" -o -path "*/venv/*" -o -path "*/build/*" -o -path "*/.*/*" \) -print 2>/dev/null | fzf)" ''; 62 68 63 - shellAbbrs = { 64 - # cargo abbreviations 65 - cb = "cargo build"; 66 - cc = "cargo check"; 67 - cdo = "cargo doc --open"; 68 - cr = "cargo run"; 69 + "l" = "exa"; 69 70 70 - # git abbreviations 71 - gaa = "git add -A"; 72 - ga = "git add"; 73 - gbd = "git branch --delete"; 74 - gb = "git branch"; 75 - gc = "git commit"; 76 - gcm = "git commit -m"; 77 - gcob = "git checkout -b"; 78 - gco = "git checkout"; 79 - gd = "git diff"; 80 - gl = "git log"; 81 - gp = "git push"; 82 - gpom = "git push origin main"; 83 - gs = "git status"; 84 - gst = "git stash"; 85 - gstp = "git stash pop"; 71 + "lg" = "lazygit"; 72 + }; 86 73 87 - }; 74 + shellAbbrs = { 75 + # cargo abbreviations 76 + cb = "cargo build"; 77 + cc = "cargo check"; 78 + cdo = "cargo doc --open"; 79 + cr = "cargo run"; 88 80 89 - functions = { 81 + # git abbreviations 82 + gaa = "git add -A"; 83 + ga = "git add"; 84 + gbd = "git branch --delete"; 85 + gb = "git branch"; 86 + gc = "git commit"; 87 + gcm = "git commit -m"; 88 + gcob = "git checkout -b"; 89 + gco = "git checkout"; 90 + gd = "git diff"; 91 + gl = "git log"; 92 + gp = "git push"; 93 + gpom = "git push origin main"; 94 + gs = "git status"; 95 + gst = "git stash"; 96 + gstp = "git stash pop"; 90 97 91 - # TODO: figure out how this is supposed to work, rn need to call it twice for it to 92 - # use argument 93 - mkcd = '' 94 - function mkcd --argument name 95 - mkdir -p $name 96 - cd $name 97 - end 98 - ''; 99 - # re = '' 100 - # set VERSION (math (readlink /nix/var/nix/profiles/system | grep -o "[0-9]*") + 1) 101 - # z ~/dots/nixdots 102 - # git add -A 103 - # git commit -m "Generation: $VERSION" 104 - # sudo nixos-rebuild switch --flake /home/suri/dots/nixdots#zephryus 105 - # git push 106 - # ''; 98 + }; 107 99 108 - y = '' 109 - set tmp (mktemp -t "yazi-cwd.XXXXXX") 110 - yazi $argv --cwd-file="$tmp" 111 - if test -s "$tmp" 112 - set cwd (cat -- "$tmp") 113 - if test -n "$cwd" -a "$cwd" != "$PWD" 114 - cd -- "$cwd" 115 - end 116 - end 117 - rm -f -- "$tmp" &> /dev/null 100 + functions = { 118 101 119 - ''; 102 + # TODO: figure out how this is supposed to work, rn need to call it twice for it to 103 + # use argument 104 + mkcd = '' 105 + function mkcd --argument name 106 + mkdir -p $name 107 + cd $name 108 + end 109 + ''; 110 + # re = '' 111 + # set VERSION (math (readlink /nix/var/nix/profiles/system | grep -o "[0-9]*") + 1) 112 + # z ~/dots/nixdots 113 + # git add -A 114 + # git commit -m "Generation: $VERSION" 115 + # sudo nixos-rebuild switch --flake /home/suri/dots/nixdots#zephryus 116 + # git push 117 + # ''; 120 118 121 - tz = '' 122 - if test (count $argv) -eq 0 123 - echo "Usage: tz <file.typ>" 124 - return 1 125 - end 119 + y = '' 120 + set tmp (mktemp -t "yazi-cwd.XXXXXX") 121 + yazi $argv --cwd-file="$tmp" 122 + if test -s "$tmp" 123 + set cwd (cat -- "$tmp") 124 + if test -n "$cwd" -a "$cwd" != "$PWD" 125 + cd -- "$cwd" 126 + end 127 + end 128 + rm -f -- "$tmp" &> /dev/null 126 129 127 - set input_file $argv[1] 128 - set output_file (string replace ".typ" ".pdf" -- $input_file) 130 + ''; 129 131 130 - typst watch "$input_file" "$output_file" & # Watch and compile Typst file 131 - sleep 1 # Give Typst some time to generate the PDF 132 - zathura "$output_file" # Open the generated PDF 133 - ''; 132 + tz = '' 133 + if test (count $argv) -eq 0 134 + echo "Usage: tz <file.typ>" 135 + return 1 136 + end 137 + 138 + set input_file $argv[1] 139 + set output_file (string replace ".typ" ".pdf" -- $input_file) 140 + 141 + typst watch "$input_file" "$output_file" & # Watch and compile Typst file 142 + sleep 1 # Give Typst some time to generate the PDF 143 + zathura "$output_file" # Open the generated PDF 144 + ''; 145 + }; 134 146 }; 135 147 }; 136 148 }
-4
modules/home/shells/zsh/default.nix
··· 39 39 shellAliases = { 40 40 darl = "sudo darwin-rebuild switch --flake /Users/suri/dev/dots"; 41 41 darling = ''cd /Users/suri/dev/dots && git add -A && git commit -m "." && sudo darwin-rebuild switch --flake /Users/suri/dev/dots && git push''; 42 - 43 42 dots = "z ~/dev/dots"; 44 - fcd = ''cd "$(find ~/coding/ ~/storage/ -type d -not \( -path "*/.git/*" -o -path "*/target/*" -o -path "*/.venv/*" -o -path "*/node_modules/*" -o -path "*/venv/*" -o -path "*/build/*" -o -path "*/.*/*" \) -print 2>/dev/null | fzf)" ''; 45 - 46 43 l = "exa"; 47 44 ls = "exa"; 48 - 49 45 lg = "lazygit"; 50 46 51 47 cat = "bat";