1
0
forked from extern/nix-config
donovanglover-nix-config/modules/fish.nix

95 lines
3.3 KiB
Nix
Raw Normal View History

{ pkgs, ... }:
2023-06-11 15:51:26 +02:00
2023-06-16 20:03:09 +02:00
let VARIABLES = import ../src/variables.nix; in {
2023-05-18 15:49:56 +02:00
users.defaultUserShell = pkgs.fish;
environment.shells = [ pkgs.fish ];
2023-05-18 15:49:56 +02:00
environment.sessionVariables = {
GIT_DISCOVERY_ACROSS_FILESYSTEM = "1";
FZF_DEFAULT_OPTS = "--height 40% --reverse --border --color=16";
NODE_OPTIONS = "--max_old_space_size=16384";
};
environment.systemPackages = with pkgs; [
wget
jq
exa
fd
fzf
ripgrep
];
2023-05-18 15:49:56 +02:00
programs.fish = {
enable = true;
shellAliases = {
ls = "${pkgs.exa}/bin/exa --group-directories-first -I 'lost+found'";
tree = "${pkgs.exa}/bin/exa --group-directories-first --all --long --tree -I 'node_modules|.git|public|lost+found|target'";
2023-05-18 15:49:56 +02:00
mv = "mv -i";
cp = "cp -ia";
rg = "${pkgs.ripgrep}/bin/rg --max-columns=2000 --smart-case";
yarn = "${pkgs.yarn}/bin/yarn --emoji true";
2023-05-18 15:49:56 +02:00
};
shellAbbrs = {
g = "git";
ga = "git add";
gaa = "git add --all";
gap = "git add --patch";
gb = "git branch"; # List all branches
gbd = "git branch --delete";
2023-05-18 15:49:56 +02:00
gc = "git commit -m";
gca = "git commit --amend";
gcl = "git clone";
gco = "git checkout";
gd = "git diff"; # Show all file changes not staged yet
gds = "git diff --staged"; # Show changes staged but not committed
gi = "git init";
gl = "git log --oneline --decorate --all --graph -n 10";
gm = "git merge";
gp = "git push"; # Push your commits to a remote server
gr = "git reset HEAD~"; # Undo the last commit but keep changed files
2023-06-06 16:03:09 +02:00
gR = "git restore";
gRs = "git restore --staged";
2023-05-18 15:49:56 +02:00
gra = "git remote add";
gre = "git remote --verbose"; # List all remotes
grh = "git reset HEAD";
grr = "git reset --hard HEAD~"; # Remove the last commit and all changes with it
2023-05-18 15:49:56 +02:00
gs = "git status";
gst = "git stash";
gstp = "git stash pop";
gt = "git tag";
gts = "git tag -s";
y = "yarn";
ya = "yarn add";
yar = "yarn remove";
yi = "yarn init";
yin = "yarn install";
yu = "yarn upgrade-interactive";
dl = "yt-dlp";
vol = "wpctl set-volume '@DEFAULT_AUDIO_SINK@'"; # Change the volume, e.g. vol 10%+, vol 10%-, vol 100%
nf = "tput clear; and neofetch --size 56%";
2023-05-18 15:49:56 +02:00
df = "df --human-readable --type=ext4 --total";
du = "du --human-readable --summarize";
jis = "recode shift_jis..utf8"; # Easily convert shift_jis-encoded files to utf8
utf16 = "recode utf16..utf8"; # Rarely, some files from Japan are utf16 instead
2023-05-18 15:49:56 +02:00
jp = "LANG=ja_JP.UTF-8 LC_ALL=ja_JP.UTF-8";
2023-06-11 21:37:06 +02:00
vm = /* fish */ ''cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local && nixos-rebuild build-vm --flake . --verbose && ./result/bin/run-${VARIABLES.hostname}-vm && trash put result ${VARIABLES.hostname}.qcow2'';
2023-06-11 02:07:54 +02:00
sw = "cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local && sudo nixos-rebuild switch --flake . --verbose";
st = "cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local";
2023-06-12 09:48:15 +02:00
tf = "treefmt";
2023-05-18 15:49:56 +02:00
c = "tput clear"; # Clear the terminal completely
2023-05-18 15:49:56 +02:00
e = "exit";
k = "kitty @ set-colors -c -a ~/.cache/wal/kitty";
l = "ls -l";
2023-06-06 16:37:06 +02:00
n = "nvim";
j = "joshuto";
2023-05-18 15:49:56 +02:00
w = "wal -o ~/.config/wal/done.sh";
2023-06-06 16:17:06 +02:00
t = "tree";
2023-05-18 15:49:56 +02:00
};
};
}