2023-07-01 12:12:43 +02:00
|
|
|
{ config, pkgs, ... }: {
|
|
|
|
# Configure BASH exports
|
2023-07-07 00:36:51 +02:00
|
|
|
# https://nix-community.github.io/home-manager/options.html
|
2023-07-07 00:47:28 +02:00
|
|
|
|
|
|
|
# https://github.com/justjanne/powerline-go
|
2023-08-16 03:53:33 +02: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 = {
|
|
|
|
hostame-only-if-ssh = true;
|
|
|
|
cwd-max-depth = 3;
|
|
|
|
condensed = true;
|
|
|
|
theme = "gruvbox";
|
|
|
|
};
|
2023-08-16 13:07:56 +02:00
|
|
|
modules = [
|
|
|
|
"venv"
|
|
|
|
"user"
|
|
|
|
"host"
|
|
|
|
"ssh"
|
|
|
|
"cwd"
|
|
|
|
"root"
|
|
|
|
];
|
2023-08-16 14:14:54 +02:00
|
|
|
modulesRight = [
|
2023-08-16 13:07:56 +02:00
|
|
|
"nix-shell"
|
|
|
|
"perms"
|
|
|
|
"git"
|
|
|
|
"docker"
|
|
|
|
"exit"
|
|
|
|
];
|
2023-08-16 03:53:33 +02:00
|
|
|
};
|
2023-07-10 12:50:38 +02:00
|
|
|
|
2023-07-01 12:12:43 +02:00
|
|
|
programs = {
|
|
|
|
bash = {
|
2023-07-01 12:39:48 +02:00
|
|
|
enable = true;
|
2023-07-01 12:12:43 +02:00
|
|
|
enableCompletion = true;
|
2023-07-07 00:36:51 +02:00
|
|
|
bashrcExtra = ''
|
2023-08-15 06:00:58 +02:00
|
|
|
sops-edit() {
|
2023-08-15 05:29:23 +02:00
|
|
|
nix-shell -p sops --run "sops $1"
|
|
|
|
}
|
2023-08-15 06:19:40 +02:00
|
|
|
sops-update() {
|
|
|
|
nix-shell -p sops --run "sops updatekeys $1"
|
|
|
|
}
|
2023-07-07 00:33:18 +02:00
|
|
|
nix-clean-all() {
|
|
|
|
nix-channel --update
|
|
|
|
nix-env -u --always
|
|
|
|
nix-collect-garbage -d
|
|
|
|
nix-collect-garbage -d
|
|
|
|
}
|
|
|
|
'';
|
2023-07-01 12:12:43 +02:00
|
|
|
shellAliases = {
|
2023-07-06 13:49:55 +02:00
|
|
|
# Disable askpass for cli auth:
|
|
|
|
SSH_ASKPASS = "";
|
2023-07-07 00:33:18 +02:00
|
|
|
|
2023-07-12 05:54:40 +02:00
|
|
|
# nVidia prime selector alias:
|
2023-07-12 05:55:20 +02:00
|
|
|
prime-select = "nvidia-offload";
|
2023-07-12 08:35:46 +02:00
|
|
|
XDG_DATA_HOME="$HOME/.local/share";
|
2023-07-12 05:54:40 +02:00
|
|
|
|
2023-07-01 13:14:29 +02:00
|
|
|
# docker
|
2023-07-01 12:12:43 +02:00
|
|
|
d = "docker";
|
|
|
|
dc = "docker-compose";
|
|
|
|
de = "docker exec -it";
|
2023-07-01 13:14:29 +02:00
|
|
|
|
|
|
|
# bash / system
|
2023-07-01 12:12:43 +02:00
|
|
|
cp = "rsync -avr";
|
2023-07-01 13:14:29 +02:00
|
|
|
ll = "ls -lah";
|
|
|
|
rm = "rm -i";
|
|
|
|
|
|
|
|
# git
|
2023-07-01 12:12:43 +02: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 13:14:29 +02:00
|
|
|
|
|
|
|
# time / date
|
2023-07-01 12:12:43 +02:00
|
|
|
tdate = "date +%Y.%m.%d..%H.%M";
|
|
|
|
ttime = "date +%H.%M";
|
2023-07-01 13:14:29 +02:00
|
|
|
ddate = "date +%Y.%m.%d";
|
|
|
|
dday = "date +%A";
|
2023-07-01 13:42:01 +02:00
|
|
|
|
2023-07-01 13:14:29 +02:00
|
|
|
# nixos-rebuild
|
2023-07-15 15:17:43 +02:00
|
|
|
ns = "nix-shell -p";
|
2023-07-01 12:12:43 +02:00
|
|
|
nr = "nixos-rebuild";
|
2023-07-10 12:50:38 +02:00
|
|
|
nrs = "nixos-rebuild --upgrade switch";
|
2023-07-01 13:42:01 +02:00
|
|
|
nrt = "nixos-rebuild test";
|
|
|
|
nrb = "nixos-rebuild build";
|
2023-07-04 12:54:12 +02:00
|
|
|
|
2023-07-01 12:12:43 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|