Skip to content

Commit

Permalink
systemd: start unit after multi-user.targer.
Browse files Browse the repository at this point in the history
Start the flatpak-managed-install service after
multi-user.target.
This should ensure that network interfaces are up,
and connectivity has been established.
  • Loading branch information
gmodena committed Feb 7, 2024
1 parent 6079344 commit 1d905cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions modules/home-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ 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; };
RemainAfterExit = "yes";
};
};

Expand Down
11 changes: 6 additions & 5 deletions modules/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ 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 ?
RemainAfterExit = "yes";
ExecStart = import ./installer.nix { inherit cfg pkgs lib installation; };
};
};
Expand Down

0 comments on commit 1d905cd

Please sign in to comment.