nix/home-manager/bash.nix

99 lines
2.3 KiB
Nix
Raw Normal View History

2023-07-01 19:12:43 +09:00
{ config, pkgs, ... }: {
# Configure BASH exports
2023-07-07 07:36:51 +09:00
# https://nix-community.github.io/home-manager/options.html
# https://github.com/justjanne/powerline-go
2023-08-16 10:53:33 +09:00
# https://nix-community.github.io/home-manager/options.html#opt-programs.powerline-go.enable
programs.powerline-go = {
enable = true;
# https://github.com/justjanne/powerline-go#customization
settings = {
2023-08-21 20:51:58 +09:00
hostname-only-if-ssh = true;
2023-08-16 21:25:44 +09:00
cwd-max-depth = 2;
2023-08-21 20:49:51 +09:00
condensed = true;
2023-08-16 10:53:33 +09:00
theme = "gruvbox";
};
2023-08-16 20:07:56 +09:00
modules = [
"venv"
"user"
2023-08-21 20:51:58 +09:00
"host"
2023-08-16 20:07:56 +09:00
"ssh"
"cwd"
"nix-shell"
"perms"
"git"
"docker"
"exit"
2023-08-21 15:08:24 +09:00
];
modulesRight = [
2023-08-21 19:33:50 +09:00
"root"
2023-08-16 20:07:56 +09:00
];
2023-08-16 10:53:33 +09:00
};
2023-07-10 19:50:38 +09:00
2023-07-01 19:12:43 +09:00
programs = {
bash = {
2023-07-01 19:39:48 +09:00
enable = true;
2023-07-01 19:12:43 +09:00
enableCompletion = true;
2023-07-07 07:36:51 +09:00
bashrcExtra = ''
2023-08-15 13:00:58 +09:00
sops-edit() {
2023-08-15 12:29:23 +09:00
nix-shell -p sops --run "sops $1"
}
2023-08-15 13:19:40 +09:00
sops-update() {
nix-shell -p sops --run "sops updatekeys $1"
}
2023-07-07 07:33:18 +09:00
nix-clean-all() {
nix-channel --update
nix-env -u --always
nix-collect-garbage -d
}
'';
2023-07-01 19:12:43 +09:00
shellAliases = {
2023-07-06 20:49:55 +09:00
# Disable askpass for cli auth:
SSH_ASKPASS = "";
2023-07-07 07:33:18 +09:00
2023-07-12 12:54:40 +09:00
# nVidia prime selector alias:
2023-07-12 12:55:20 +09:00
prime-select = "nvidia-offload";
2023-08-21 22:41:09 +09:00
XDG_DATA_HOME = "$HOME/.local/share";
# Set the GTK Theme
GTK_THEME = "Gruvbox-Dark-BL";
2023-07-12 12:54:40 +09:00
2023-07-01 20:14:29 +09:00
# docker
2023-07-01 19:12:43 +09:00
d = "docker";
dc = "docker-compose";
de = "docker exec -it";
2023-07-01 20:14:29 +09:00
# bash / system
2023-07-01 19:12:43 +09:00
cp = "rsync -avr";
2023-07-01 20:14:29 +09:00
ll = "ls -lah";
rm = "rm -i";
2023-08-18 21:25:32 +09:00
df = "duf";
2023-07-01 20:14:29 +09:00
# git
2023-07-01 19:12:43 +09:00
g = "git";
ga = "git add -A";
gb = "git branch";
gc = "git commit";
gca = "git commit -a";
gco = "git checkout";
gd = "git diff";
gp = "git pull --prune";
gpu = "git push origin HEAD";
gs = "git status -sb";
2023-07-01 20:14:29 +09:00
# time / date
2023-07-01 19:12:43 +09:00
tdate = "date +%Y.%m.%d..%H.%M";
ttime = "date +%H.%M";
2023-07-01 20:14:29 +09:00
ddate = "date +%Y.%m.%d";
dday = "date +%A";
2023-07-01 20:42:01 +09:00
2023-07-01 20:14:29 +09:00
# nixos-rebuild
2023-07-15 22:17:43 +09:00
ns = "nix-shell -p";
2023-07-01 19:12:43 +09:00
nr = "nixos-rebuild";
2023-07-10 19:50:38 +09:00
nrs = "nixos-rebuild --upgrade switch";
2023-07-01 20:42:01 +09:00
nrt = "nixos-rebuild test";
nrb = "nixos-rebuild build";
2023-07-01 19:12:43 +09:00
};
};
};
}