2024-03-12 14:42:33 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
writeShellApplication,
|
|
|
|
}:
|
|
|
|
writeShellApplication
|
|
|
|
{
|
|
|
|
name = "update";
|
|
|
|
|
|
|
|
runtimeInputs = [];
|
|
|
|
|
|
|
|
text = ''
|
|
|
|
# A script to update the flake lock for NixOS
|
|
|
|
set -e
|
|
|
|
pushd /tmp > /dev/null
|
|
|
|
rm -rf ./update
|
2024-03-12 14:53:54 +01:00
|
|
|
git clone forgejo@git.lillianviolet.dev:Lillian-Violet/NixOS-Config.git ./update
|
2024-03-12 14:42:33 +01:00
|
|
|
pushd ./update > /dev/null
|
|
|
|
echo "Updating flake lock..."
|
|
|
|
nix flake update
|
2024-03-27 17:32:38 +01:00
|
|
|
git stage ./flake.lock
|
2024-03-12 14:42:33 +01:00
|
|
|
git commit -m "update flake lock"
|
2024-03-27 17:32:38 +01:00
|
|
|
sudo nix flake check
|
2024-03-12 14:42:33 +01:00
|
|
|
git push
|
|
|
|
popd > /dev/null
|
|
|
|
echo "Cleaning up repository in '/tmp/update'..."
|
|
|
|
rm -rf ./update
|
|
|
|
popd > /dev/null
|
|
|
|
echo "Flake lock update OK!"
|
|
|
|
'';
|
|
|
|
}
|