This commit is contained in:
joy 2024-07-03 15:40:52 +02:00
parent 822e36fac6
commit fc618fcee0
2 changed files with 13 additions and 2 deletions

View file

@ -12,8 +12,7 @@
pu = "git push -u berg main && git push -u hub main";
fr = "sudo systemctl reboot --firmware";
ser = "ssh root@joygnu.org";
sp = "sudo nixos-rebuild switch --flake ~/nix/#pc";
sl = "sudo nixos-rebuild switch --flake ~/nix/#laptop";
rb = "bash ~/nix/home/zsh/pc-laptop.sh";
up = "sudo nix flake update ~/nix";
del = "sudo nix-collect-garbage -d";
gtk = "nvim ~/nix/home/gtk/default.nix";

12
home/zsh/pc-laptop.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
hostname=$(hostname)
if [[ $hostname == *"pc"* ]]; then
sudo nixos-rebuild switch --flake ~/nix/#pc
elif [[ $hostname == *"laptop"* ]]; then
sudo nixos-rebuild switch --flake ~/nix/#laptop
else
echo "Unable to determine the type of machine."
fi