nixos-server/aliases.nix
2025-12-11 15:16:47 +01:00

38 lines
1.1 KiB
Nix

{ pkgs, ... }: {
programs.fish = {
enable = true;
shellAliases = {
nrb = "sudo nixos-rebuild switch --flake /etc/nixos --impure";
ni = "nvim /etc/nixos/configuration.nix";
bat =
"upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E 'state|percentage'";
gpu = "nvidia-smi -q | grep -i 'draw.*W'";
wifi = "sudo nmtui";
all = "sudo chmod -R a+rwx ./*";
ng = "cd /etc/nginx/ && sudo nvim .";
copy = "xclip -sel clip";
pubkey = "cat ~/.ssh/id_ed25519.pub | copy";
up = "docker compose up -d";
down = "docker compose down -t 0";
inspect = "nix edit nixpkgs#$1";
fe = "nix develop";
fed = "nvim flake.nix";
cdn = "cd /etc/nixos";
cpu =
"sudo turbostat --quiet --show PkgWatt --interval 1 --num_iterations 1 | awk 'NR==2{print $1}'";
r = "nix run";
};
interactiveShellInit = ''
function enter
if test (count $argv) -lt 1
echo "usage: enter <container-name-or-id>"
return 1
end
docker exec -it $argv[1] sh
end
'';
};
}