Adds README explaining how to rebuild.

Removes old sysupdate utility.
This commit is contained in:
Bailey 2024-02-27 18:19:10 -05:00
parent 82ae343393
commit c373cd13e3
2 changed files with 19 additions and 28 deletions

19
README.md Normal file
View File

@ -0,0 +1,19 @@
# Geeky Gays Server NixOS Configs
To update using latest pushed config:
```bash
sudo nix flake lock nixconf
sudo nixos-rebuild boot --flake nixconf
sudo reboot
```
To test an update that hasn't been pushed:
```bash
# Seriously, make a commit first!
# Even a temporary one that will be ammended before pushing.
git commit -a
sudo nixos-rebuild boot --flake .
sudo reboot
```

View File

@ -1,28 +0,0 @@
{
pkgs,
...
}:
pkgs.writeShellApplication {
name = "sysupdate";
runtimeInputs = with pkgs; [
nix-output-monitor nixos-rebuild home-manager
];
text = ''
NIXCONF="''${NIXCONF:-/etc/nixos}"
echo Building config from flake at: "$NIXCONF" 1>&2
if [[ "''${1:-}" == "home" ]]; then
home-manager switch -L --flake "$NIXCONF" |& nom
exit $?
fi
if [ "$EUID" -ne 0 ]; then
echo Please rerun as root. 1>&2
exit 1
else
nixos-rebuild switch --log-format internal-json -v --flake "$NIXCONF" |& nom --json && \
exit $?
fi
'';
}