diff options
| author | aristote <quentin.aristote@irif.fr> | 2025-11-21 09:49:24 +0100 |
|---|---|---|
| committer | aristote <quentin.aristote@irif.fr> | 2025-11-21 10:15:47 +0100 |
| commit | c032f4c09c83feb933d520ccce80e70a1516ca35 (patch) | |
| tree | 6c4a861632f3979c9c287b5983a36776317a5932 /modules/home-manager/personal | |
| parent | 4d3eeda464341243be3fc6c3fbb4a5f1d0ead906 (diff) | |
home: check network before daily services
Diffstat (limited to 'modules/home-manager/personal')
| -rw-r--r-- | modules/home-manager/personal/programs/devenv.nix | 48 | ||||
| -rw-r--r-- | modules/home-manager/personal/programs/emacs.nix | 14 |
2 files changed, 38 insertions, 24 deletions
diff --git a/modules/home-manager/personal/programs/devenv.nix b/modules/home-manager/personal/programs/devenv.nix index 62f2cc2..225425b 100644 --- a/modules/home-manager/personal/programs/devenv.nix +++ b/modules/home-manager/personal/programs/devenv.nix @@ -56,25 +56,33 @@ in ]; home.packages = lib.optional importedDevenv pkgs.devenv; - systemd.user = pkgs.personal.lib.homeManager.serviceWithTimer "devenv-update" { - Unit = { - Description = "Update devenv shells"; - After = [ - "network-online.target" - ]; - }; - Service = { - Type = "oneshot"; - WorkingDirectory = "${config.home.homeDirectory}"; - ExecStart = "${devenvUpdateScript}/bin/devenv-update"; - }; - Timer = { - Persistent = true; - OnCalendar = "daily"; - }; - Install = { - WantedBy = [ "default.target" ]; - }; - }; + systemd.user = lib.mkMerge [ + (pkgs.lib.personal.services.home.serviceWithTimer "devenv-update" { + Unit = { + Description = "Update devenv shells"; + After = [ + "network-online.target" + ]; + }; + Service = { + Type = "oneshot"; + WorkingDirectory = "${config.home.homeDirectory}"; + ExecStart = "${devenvUpdateScript}/bin/devenv-update"; + }; + Timer = { + Persistent = true; + OnCalendar = "daily"; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + }) + ({ + services.devenv-update = pkgs.lib.personal.services.home.checkNetwork { + hosts = [ "github.com" ]; + restart = true; + }; + }) + ]; }; } diff --git a/modules/home-manager/personal/programs/emacs.nix b/modules/home-manager/personal/programs/emacs.nix index 3b00555..5b579c4 100644 --- a/modules/home-manager/personal/programs/emacs.nix +++ b/modules/home-manager/personal/programs/emacs.nix @@ -75,8 +75,8 @@ in home.file.".spacemacs.d/init.el".source = lib.mkDefault config.personal.home.dotfiles.spacemacs; # service to update spacemacs - systemd.user = ( - pkgs.personal.lib.homeManager.serviceWithTimer "spacemacs-update" { + systemd.user = lib.mkMerge [ + (pkgs.lib.personal.services.home.serviceWithTimer "spacemacs-update" { Unit = { Description = "Update Spacemacs by pulling the develop branch"; After = [ @@ -96,7 +96,13 @@ in Install = { WantedBy = [ "default.target" ]; }; - } - ); + }) + ({ + services.spacemacs-update = pkgs.lib.personal.services.home.checkNetwork { + hosts = [ "github.com" ]; + restart = true; + }; + }) + ]; }; } |
