From 2fd683ce588a2822cd36504639fef2795f1c5bfe Mon Sep 17 00:00:00 2001 From: Gabriele Modena Date: Thu, 15 Feb 2024 15:19:47 +0100 Subject: [PATCH] systemd: start unit after multi-user.target (#37) * systemd: start unit after multi-user.targer. Start the flatpak-managed-install service after multi-user.target. This should ensure that network interfaces are up, and connectivity has been established. * nixos: home-manager: remove RemainAfterExit This is not really needed, since state changes will be handled by a timer. --- modules/home-manager.nix | 6 +++--- modules/nixos.nix | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/home-manager.nix b/modules/home-manager.nix index c1b2d7f..6d49cf2 100644 --- a/modules/home-manager.nix +++ b/modules/home-manager.nix @@ -18,16 +18,16 @@ in systemd.user.services."flatpak-managed-install" = { Unit = { After = [ - "network.target" + "multi-user.target" # ensures that network & connectivity have been setup. ]; }; Install = { WantedBy = [ - "default.target" + "default.target" # multi-user target with a GUI. For a desktop, this is typically going to be the graphical.target ]; }; Service = { - Type = "oneshot"; + Type = "oneshot"; # TODO: should this be an async startup, to avoid blocking on network at boot ? ExecStart = import ./installer.nix { inherit cfg pkgs lib installation; }; }; }; diff --git a/modules/nixos.nix b/modules/nixos.nix index 39d8013..e057d98 100644 --- a/modules/nixos.nix +++ b/modules/nixos.nix @@ -8,14 +8,14 @@ in config = lib.mkIf config.services.flatpak.enable { systemd.services."flatpak-managed-install" = { - wants = [ - "network-online.target" - ]; wantedBy = [ - "multi-user.target" + "default.target" # multi-user target with a GUI. For a desktop, this is typically going to be the graphical.target + ]; + after = [ + "multi-user.target" # ensures that network & connectivity have been setup. ]; serviceConfig = { - Type = "oneshot"; + Type = "oneshot"; # TODO: should this be an async startup, to avoid blocking on network at boot ? ExecStart = import ./installer.nix { inherit cfg pkgs lib installation; }; }; };