dotfiles/update.sh

16 lines
557 B
Bash
Raw Normal View History

2023-02-21 05:20:19 +07:00
#!/usr/bin/env bash
cp ~/.config/nixpkgs/overlays.nix ./overlays.nix || (mkdir -p ~/.config/nixpkgs && cp ./overlays.nix ~/.config/nixpkgs)
nix flake update
nvfetcher \
-o ./pkgs/_sources \
-c ./pkgs/nvfetcher.toml || echo "failed to update nvfetcher sources"
mozilla-addons-to-nix \
./pkgs/firefox-addons/addons.json \
./pkgs/firefox-addons/generated.nix || echo "failed to update firefox addons"
if [ -z ${SUDO_ASKPASS+x} ]; then
sudo nixos-rebuild switch --flake .
else
sudo -A nixos-rebuild switch --flake .
fi
home-manager switch --flake .