nixos-old/sync.sh

22 lines
600 B
Bash
Raw Normal View History

2022-10-24 13:01:11 +00:00
#!/bin/sh
2022-10-24 12:35:26 +00:00
2022-10-24 19:14:09 +00:00
# update in case i was fucking around somewhere else
2022-10-24 13:24:49 +00:00
git pull
2022-10-24 19:14:09 +00:00
# format everything to look nice
2022-10-24 13:24:49 +00:00
nixpkgs-fmt *.nix
2022-10-24 19:14:09 +00:00
nixpkgs-fmt ./nvim/*.nix
2022-10-26 08:17:50 +00:00
nixpkgs-fmt ./penrose/*.nix
2022-10-24 19:14:09 +00:00
# make a backup just in case
2022-10-24 13:01:11 +00:00
cp -r /etc/nixos/ ./backup
2022-10-24 19:14:09 +00:00
# copy over all the files to /etc/nixos/
2022-10-26 09:18:41 +00:00
sudo cp -r ./configuration.nix ./nvim/ ./packages.nix ./home.nix /etc/nixos/ ./user.nix
2022-10-26 08:17:50 +00:00
## copy penrose stuff
sudo mkdir /etc/nixos/penrose
sudo cp -r ./penrose/Cargo.nix ./penrose/src ./penrose/default.nix ./penrose/rust-toolchain /etc/nixos/penrose
2022-10-24 19:14:09 +00:00
# update and build my new config
2022-10-24 12:35:26 +00:00
sudo nixos-rebuild switch --upgrade