flake/nixos/shell.nix
2024-11-22 09:07:36 -05:00

108 lines
3.7 KiB
Nix
Executable file

{ pkgs, ... }: {
# starship - a customizable prompt for any shell
programs.starship = {
enable = true;
# custom settings
settings = {
format =
"[](bg:#1e1e2e fg:#a6e3a1)$username$hostname[](fg:#a6e3a1 bg:#89b4fa)$directory[](fg:#89b4fa bg:#cba6f7)$direnv[](fg:#cba6f7 bg:#f9e2af)$git_branch$git_status[](fg:#f9e2af bg:#1e1e2e)$character";
username = {
show_always = true;
format = "[ $user@]($style)";
style_user = "fg:#313244 bg:#a6e3a1";
style_root = "fg:#313244 bg:#a6e3a1";
};
hostname = {
ssh_only = false;
format = "[$hostname $ssh_symbol]($style)";
style = "fg:#313244 bg:#a6e3a1";
};
directory = {
format = "[ $path ]($style)";
style = "fg:#313244 bg:#89b4fa";
};
git_branch = {
format = "[ $symbol$branch(:$remote_branch) ]($style)";
symbol = " ";
style = "fg:#313244 bg:#f9e2af";
};
direnv = {
symbol = "󱄅 ";
format = "[ $symbol$loaded/$allowed ]($style)";
disabled = false;
style = "fg:#313244 bg:#cba6f7";
};
git_status = {
format = "[$all_status]($style)";
style = "fg:#313244 bg:#f9e2af";
};
git_metrics = {
format = "([+$added]($added_style))[]($added_style)";
added_style = "fg:#313244 bg:#f9e2af";
deleted_style = "fg:bright-red bg:235";
disabled = false;
};
hg_branch = {
format = "[ $symbol$branch ]($style)";
symbol = " ";
};
cmd_duration = {
format = "[ $duration ]($style)";
style = "fg:bright-white bg:18";
};
character = {
success_symbol = "[ ](#a6e3a1) ";
error_symbol = "[ ](#f38ba8) ";
};
add_newline = false;
};
};
users.defaultUserShell = pkgs.fish;
programs.fish = {
enable = true;
shellInit = ''
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
'';
shellAliases = let ezaArgs = "--time-style='+%Y-%m-%d %H:%M' --icons=auto";
in {
ff = "fastfetch";
neofetch = "fastfetch";
nf = "fastfetch";
lg = "lazygit";
lad = "lazydocker";
clip = "wl-copy";
paste = "wl-paste";
cat = "bat";
l = "eza -lhg ${ezaArgs}";
la = "eza -lAh ${ezaArgs}";
ll = "eza -lhg ${ezaArgs}";
ls = "eza ${ezaArgs}";
lsa = "eza -lah ${ezaArgs}";
tree = "eza --tree --git-ignore ${ezaArgs}";
git = "hub";
create-devenv = "nix flake init --template github:cachix/devenv && direnv allow";
develop = "nix develop --no-pure-eval";
nixpkgs-update = "nix run --option extra-substituters 'https://nix-community.cachix.org/' --option extra-trusted-public-keys 'nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=' github:ryantm/nixpkgs-update --";
nixrc = "$EDITOR /etc/nixos";
delete-vscode-settings-backup = "rm -rf ~/.config/Code/User/settings.json.bak";
upd =
"sudo nixos-generate-config --dir /etc/nixos/hosts && sudo rm /etc/nixos/hosts/configuration.nix && sudo mv /etc/nixos/hosts/hardware-configuration.nix /etc/nixos/hosts/$(hostname).nix && git -C /etc/nixos --git-dir=/etc/nixos/.git add /etc/nixos/hosts/$(hostname).nix && delete-vscode-settings-backup && sudo nixos-rebuild switch --flake /etc/nixos";
taildrop = "tailscale file";
forgejo-runner = "act_runner";
runactions =
"act_runner exec --default-actions-url=https://www.coastalcommits.com --gitea-instance=https://www.coastalcommits.com";
c = "clear";
# alias sudo to itself so user aliases can be sudoed
sudo = "sudo ";
s = "sudo ";
};
};
}