From b94ddb1f9420240780054e60fa3acb6552ca3a82 Mon Sep 17 00:00:00 2001 From: qaristote Date: Wed, 29 Mar 2023 14:24:27 +0200 Subject: nixos: auto-ugprade: require networkmanager to be online --- modules/nixos/personal/nix.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'modules/nixos/personal/nix.nix') diff --git a/modules/nixos/personal/nix.nix b/modules/nixos/personal/nix.nix index a4948f4..1b49e13 100644 --- a/modules/nixos/personal/nix.nix +++ b/modules/nixos/personal/nix.nix @@ -44,14 +44,18 @@ in { before = lib.mkIf config.nix.gc.automatic [ "nix-gc.service" ]; wantedBy = lib.mkIf config.nix.gc.automatic [ "nix-gc.service" ]; }; - }; - programs.git = lib.mkIf (cfg.flake != null - && lib.hasPrefix "git+file" cfg.flake) { - enable = true; - config.user = { - name = "Root user of ${config.networking.hostName}"; - email = "root@${config.networking.hostName}"; + nixos-upgrade = { + wants = lib.optional config.networking.networkmanager.enable + "NetworkManager-wait-online.service"; }; }; + programs.git = + lib.mkIf (cfg.flake != null && lib.hasPrefix "git+file" cfg.flake) { + enable = true; + config.user = { + name = "Root user of ${config.networking.hostName}"; + email = "root@${config.networking.hostName}"; + }; + }; }; } -- cgit v1.2.3