nix-conf/nixos-modules/auto-update/default.nix

29 lines
755 B
Nix
Raw Permalink Normal View History

2024-07-10 23:02:54 +02:00
{
config,
lib,
pkgs,
...
}:
2023-08-14 16:47:59 +02:00
2024-07-10 23:02:54 +02:00
let
cfg = config.jopejoe1.auto-update;
in
{
2023-12-29 16:43:40 +01:00
options.jopejoe1.auto-update = {
enable = lib.mkEnableOption "Enable Auto-Updates";
};
config = lib.mkIf cfg.enable {
system.autoUpgrade = {
enable = true;
randomizedDelaySec = "30min";
2023-12-30 23:39:33 +01:00
flake =
if config.services.archisteamfarm.enable then
2024-07-10 23:02:54 +02:00
"$(${pkgs.coreutils}/bin/rm -rf /var/lib/update-repo && ${lib.getExe pkgs.git} clone git@codeberg.org:jopejoe1/nix-conf.git /var/lib/update-repo -q --depth=1 && ${lib.getExe pkgs.git} -C /var/lib/update-repo am /home/jopejoe1/.config/patches/0001-add-liscense.patch -q)/var/lib/update-repo"
2023-12-30 23:39:33 +01:00
else
"github:jopejoe1/nix-conf";
2023-12-29 16:43:40 +01:00
dates = "hourly";
};
2023-08-14 16:47:59 +02:00
};
}