nixos/users/malte/shell.nix

127 lines
2.8 KiB
Nix

{ pkgs, ... }:
{
home.packages = with pkgs; [
(pkgs.callPackage ../../pkgs/rip.nix { })
bottom
fd
fishPlugins.done
ripgrep
unzip
zip
sl
fend
file
python39.pkgs.xkcdpass
];
programs.fish = {
enable = true;
shellAbbrs = {
ga = "git add";
gapa = "git add -p";
gc = "git commit";
gco = "git checkout";
gd = "git diff";
gsb = "git status -sb";
hl = "hledger";
l = "exa -la";
ll = "exa -lh";
lt = "exa -aT --icons --git-ignore -I .git";
ltg = "exa -aT --icons --git-ignore -I .git --git";
llt = "exa -laT --icons --git-ignore -I .git --git";
".." = "cd ..";
"..." = "cd ../..";
# New nix3 stuff
nsh = "nix shell nixpkgs#";
nix-shell = "sl";
nix-env = "sl";
sys = "systemctl";
syss = "systemctl status";
sysu = "systemctl --user";
sysus = "systemctl --user status";
dev = "nix develop -c fish";
nix-todo = "task add project:nixos +computer";
uni-todo = "task add project:studium +uni";
note = "task add +unsorted project:unsorted prio:H";
today = "task +heute";
genpw = "xkcdpass -n4";
zat = "zathura --fork";
discord-hack =
"NIXPKGS_ALLOW_UNFREE=1 nix run 'github:NixOS/nixpkgs?ref=master#discord' --impure";
};
shellAliases = {
kal = "khal list (date '+%d.%m.%Y') (date --date='+1week' '+%d.%m.%Y')";
# Prefix for date-based files/folders
now = ''date +"%F-%T"'';
f = "fend";
};
functions = {
at = ''
set date (date --date="$argv" '+%d.%m.%Y')
if test $status -eq 0
khal list $date $date
end
'';
flash-dongle = ''
set output /dev/disk/by-id/usb-SanDisk_Extreme_AA011215151603543802-0:0
if test ! -e $output
echo "No dongle detected"
exit 1
end
set input $argv[1]
echo $input
sudo dd if="$input" of=$output bs=1M status=progress
'';
flash-dongle-nixos = ''
${pkgs.wget}/bin/wget -c "https://channels.nixos.org/nixos-unstable/latest-nixos-minimal-x86_64-linux.iso" -O /tmp/nixos.iso
flash-dongle /tmp/nixos.iso
'';
};
shellInit = ''
set -g fish_greeting
'';
};
programs.starship = {
enable = true;
enableFishIntegration = true;
};
programs.exa = {
enable = true;
enableAliases = true;
};
programs.zoxide = {
enable = true;
enableFishIntegration = true;
};
programs.fzf = {
enable = true;
enableFishIntegration = true;
defaultCommand = "fd --type f";
fileWidgetCommand = "fd --type f";
changeDirWidgetCommand = "fd --type d";
};
programs.bat = {
enable = true;
config = { theme = "gruvbox-dark"; };
};
}