Files
nix-dotfiles-v2/home/bash.nix
T

64 lines
1.5 KiB
Nix

{
pkgs,
lib,
config,
inputs,
...
}:
{
sops.secrets = {
"ai/openai" = { };
"ai/fireworks" = { };
"ai/cerebras" = { };
"ai/groq" = { };
"ai/mistral" = { };
"ai/aistudio" = { };
};
programs.bash = {
enable = true;
shellAliases = {
"rebuild" =
"sudo nixos-rebuild switch --no-write-lock-file --flake git+https://github.com/adrlau/nix-dotfiles.git -L --impure";
"," = "comma ";
"gst" = "git status";
"gsw" = "git switch";
"gcm" = "git commit -m ";
"gca" = "git commit --amend";
"gaa" = "git add -A";
"gb" = "git branch";
"sl" = "eza";
"ls" = "eza";
"lls" = "ls";
"la" = "eza -la";
"tree" = "eza -T";
"neofetch" = "fastfetch";
"htop" = "btm";
};
bashrcExtra = ''
# Export AI API keys from decrypted sops-nix secrets
export OPENAI_API_KEY="$(cat ${config.sops.secrets."ai/openai".path})"
export FIREWORKS_API_KEY="$(cat ${config.sops.secrets."ai/fireworks".path})"
export CEREBRAS_API_KEY="$(cat ${config.sops.secrets."ai/cerebras".path})"
export GROQ_API_KEY="$(cat ${config.sops.secrets."ai/groq".path})"
export MISTRAL_API_KEY="$(cat ${config.sops.secrets."ai/mistral".path})"
export AISTUDIO_API_KEY="$(cat ${config.sops.secrets."ai/aistudio".path})"
'';
historyControl = [
"ignoredups"
"ignorespace"
"erasedups"
];
historyIgnore = [
"ls"
"cd"
"exit"
"cd .."
".."
"la"
];
};
}