NixOS-Config/pkgs/update/default.nix

28 lines
630 B
Nix
Raw Permalink Normal View History

{writeShellApplication}:
2024-03-12 14:42:33 +01:00
writeShellApplication
{
name = "update";
runtimeInputs = [];
text = ''
# A script to update the flake lock for NixOS
set -e
pushd /tmp > /dev/null
rm -rf ./update
git clone git@codeberg.org: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
git stage ./flake.lock
2024-03-12 14:42:33 +01:00
git commit -m "update flake lock"
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!"
'';
}