new
This commit is contained in:
parent
2a57f911f6
commit
f927228b42
|
@ -1,32 +1,44 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
systemd.timers."nix-auto-upgrade" = {
|
# systemd.timers."nix-auto-upgrade" = {
|
||||||
wantedBy = ["timers.target"];
|
# wantedBy = ["timers.target"];
|
||||||
timerConfig = {
|
# timerConfig = {
|
||||||
OnCalendar = "weekly";
|
# OnCalendar = "weekly";
|
||||||
Persistent = true;
|
# Persistent = true;
|
||||||
Unit = "nix-auto-upgrade";
|
# Unit = "nix-auto-upgrade";
|
||||||
};
|
# };
|
||||||
};
|
# };
|
||||||
|
|
||||||
systemd.services."nix-auto-upgrade" = {
|
# systemd.services."nix-auto-upgrade" = {
|
||||||
script = ''
|
# script = ''
|
||||||
set -eu
|
# set -eu
|
||||||
alias git=${pkgs.git}/bin/git
|
# # alias git=${pkgs.git}/bin/git
|
||||||
|
|
||||||
${pkgs.git}/bin/git pull
|
# ${pkgs.git}/bin/git pull -v
|
||||||
${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake .#$(cat /etc/hostname)
|
# # ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake .#$(cat /etc/hostname)
|
||||||
|
|
||||||
${pkgs.curl}/bin/curl \
|
# # ${pkgs.curl}/bin/curl \
|
||||||
-H "Title: NixOS upgrade done" \
|
# # -H "Title: NixOS upgrade done" \
|
||||||
-H "Priority: low" \
|
# # -H "Priority: low" \
|
||||||
-H "Tags: low" \
|
# # -H "Tags: low" \
|
||||||
-d "$(cat /etc/hostname ): upgrade script done" \
|
# # -d "$(cat /etc/hostname ): upgrade script done" \
|
||||||
ntfy.sh/tasiaiso_upgrades &> /dev/null # Please don't make me learn how to manage secrets
|
# # ntfy.sh/tasiaiso_upgrades &> /dev/null # Please don't make me learn how to manage secrets
|
||||||
'';
|
# '';
|
||||||
serviceConfig = {
|
# serviceConfig = {
|
||||||
Type = "oneshot";
|
# Type = "oneshot";
|
||||||
User = "root";
|
# User = "root";
|
||||||
WorkingDirectory = /etc/nixos/nixos-config;
|
# WorkingDirectory = /etc/nixos/nixos-config;
|
||||||
};
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
system.autoUpgrade = {
|
||||||
|
enable = true;
|
||||||
|
flake = "git+https://gitea.com/tasiaiso/nixos-config";
|
||||||
|
flags = [
|
||||||
|
# "--update-input"
|
||||||
|
# "nixpkgs"
|
||||||
|
"-L" # print build logs
|
||||||
|
];
|
||||||
|
dates = "weekly";
|
||||||
|
# randomizedDelaySec = "45min";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue