Let's use the standard auto-update instead

This commit is contained in:
Lillian Violet 2024-03-01 15:53:50 +01:00
parent 1878f7b449
commit 3bfa44bdea
3 changed files with 5 additions and 37 deletions

View file

@ -98,20 +98,11 @@
];
# Create an auto-update systemd service that runs every day
systemd.services = {
updater = {
path = [
pkgs.rebuild
pkgs.nix
pkgs.bash
pkgs.git
pkgs.gnutar
pkgs.xz.bin
config.nix.package.out
];
script = "bash /run/current-system/sw/bin/systemd-rebuild";
startAt = "daily";
};
system.autoUpgrade = {
flake = "git+https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git";
dates = "daily";
enable = true;
system.autoUpgrade.dates = "Sat *-*-1..7,15..21 01:00:00";
};
# Enable networking

View file

@ -5,6 +5,5 @@ pkgs: {
dvt = pkgs.callPackage ./dvt {};
servo = pkgs.callPackage ./servo {};
rebuild = pkgs.callPackage ./rebuild {};
systemd-rebuild = pkgs.callPackage ./systemd-rebuild {};
install-nix = pkgs.callPackage ./install-nix {};
}

View file

@ -1,22 +0,0 @@
{
lib,
stdenv,
writeShellApplication,
}:
writeShellApplication
{
name = "systemd-rebuild";
runtimeInputs = [];
text = ''
# A rebuild script for NixOS for use of the systemd service
systemd-inhibit rm -rf /tmp/rebuild
systemd-inhibit git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git /tmp/rebuild
systemd-inhibit echo "NixOS Rebuilding..."
systemd-inhibit nixos-rebuild switch --flake /tmp/rebuild/#
systemd-inhibit echo "Cleaning up repository in '/tmp/rebuild'..."
systemd-inhibit rm -rf /tmp/rebuild
systemd-inhibit echo "NixOS Rebuilt OK!"
'';
}