From 6cb95c3a2a937eda6de6037829a28fc045762330 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Oct 2022 11:41:16 +0800 Subject: [PATCH] profiles/dev: add timer for profile upgrade service --- modules/nixos/profiles/dev.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/nixos/profiles/dev.nix b/modules/nixos/profiles/dev.nix index 524f74e5..93f14131 100644 --- a/modules/nixos/profiles/dev.nix +++ b/modules/nixos/profiles/dev.nix @@ -83,14 +83,26 @@ in { act # Finally, a local environment for testing GitHub workflows. ]; - systemd.user.services.upgrade-nix-profile = { + systemd.user.services.nix-upgrade-profile = { description = '' - Update packages installed through 'nix profile'. + Update service for user-specific Nix profile ''; + documentation = [ "man:nix3-profile(1)" ]; script = "nix profile upgrade '.*'"; path = [ config.nix.package ]; startAt = "weekly"; }; + + systemd.user.timers.nix-upgrade-profile = { + description = '' + Update service for user-specific Nix profile + ''; + wantedBy = [ "default.target" ]; + timerConfig = { + Persistent = true; + RandomizedDelaySec = 50; + }; + }; }) (lib.mkIf cfg.shell.enable {