add rebuild command (untested)
This commit is contained in:
parent
983e994930
commit
52a5010891
3 changed files with 40 additions and 0 deletions
27
pkgs/rebuild/default.nix
Normal file
27
pkgs/rebuild/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
writeShellApplication,
|
||||
}:
|
||||
writeShellApplication
|
||||
{
|
||||
name = "rebuild";
|
||||
|
||||
runtimeInputs = [];
|
||||
|
||||
text = ''
|
||||
# A rebuild script for NixOS
|
||||
set -e
|
||||
pushd /tmp
|
||||
git clone forgejo@git.lillianviolet.dev:Lillian-Violet/NixOS-Config.git ./rebuild
|
||||
$hostname=$(hostname)
|
||||
pushd ./rebuild
|
||||
echo "NixOS Rebuilding..."
|
||||
sudo nixos-rebuild switch --flake #$hostname &>nixos-switch.log || (cat nixos-switch.log | grep --color error && false)
|
||||
popd
|
||||
echo "Cleaning up repository in tmp..."
|
||||
rm -rf ./rebuild
|
||||
popd
|
||||
notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue