From 0c360c6f646b715c0d9623bbbc8bd268c02376d4 Mon Sep 17 00:00:00 2001 From: Christopher Bacher Date: Sun, 23 Oct 2022 23:12:51 +0200 Subject: [PATCH] modules(pihole-container): print a warning if systemd's linger capability for the host user is not managed --- modules/pihole-container.factory.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/pihole-container.factory.nix b/modules/pihole-container.factory.nix index 3f659b0..84311e9 100644 --- a/modules/pihole-container.factory.nix +++ b/modules/pihole-container.factory.nix @@ -313,6 +313,13 @@ in rec { } ]; + warnings = (optional (cfg.hostConfig.enableLingeringForUser == false) '' + If lingering is not enabled for the host user which is running the pihole container then he service might be stopped when no user session is active. + + Set `hostConfig.enableLingeringForUser` to `true` to manage systemd's linger setting through the `linger-flake` dependency. + Set it to "suppressWarning" if you manage lingering in a different way. + ''); + systemd.services."pihole-rootless-container" = { wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" ];