Add NixOS support

This commit is contained in:
2025-03-24 13:24:03 +00:00
parent a7c30f5e34
commit bdd61b9e37
5 changed files with 122 additions and 19 deletions

View File

@@ -52,10 +52,13 @@ p() (
if [[ ${packageManagers[@]} =~ "nix" ]]; then
printf "%b\n" "${YELLOW}Updating nix...${ENDCOLOR}"
nix-channel --update
nix-collect-garbage --delete-older-than 7d
nix-collect-garbage --delete-older-than 7d &>/dev/null
if command -v nixos-rebuild >/dev/null 2>&1; then
sudo nix-channel --update
sudo nixos-rebuild switch
printf "${YELLOW}Rebuilding NixOS...${NC}\n"
sudo nixos-rebuild switch &>/tmp/nixos_rebuild.log || (
cat /tmp/nixos_rebuild.log | grep --color error && false
)
fi
fi
if [[ ${packageManagers[@]} =~ "brew" ]]; then