diff --git a/nixos/modules/services/misc/atuin.nix b/nixos/modules/services/misc/atuin.nix index 59bdae638870..e7a793fe834b 100644 --- a/nixos/modules/services/misc/atuin.nix +++ b/nixos/modules/services/misc/atuin.nix @@ -93,7 +93,12 @@ in systemd.services.atuin = { description = "atuin server"; requires = lib.optionals cfg.database.createLocally [ "postgresql.service" ]; - after = [ "network.target" ] ++ lib.optionals cfg.database.createLocally [ "postgresql.service" ]; + after = [ + "network-online.target" + ] ++ lib.optionals cfg.database.createLocally [ "postgresql.service" ]; + wants = [ + "network-online.target" + ] ++ lib.optionals cfg.database.createLocally [ "postgresql.service" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { @@ -139,18 +144,14 @@ in UMask = "0077"; }; - environment = - { - ATUIN_HOST = cfg.host; - ATUIN_PORT = toString cfg.port; - ATUIN_MAX_HISTORY_LENGTH = toString cfg.maxHistoryLength; - ATUIN_OPEN_REGISTRATION = lib.boolToString cfg.openRegistration; - ATUIN_PATH = cfg.path; - ATUIN_CONFIG_DIR = "/run/atuin"; # required to start, but not used as configuration is via environment variables - } - // lib.optionalAttrs (cfg.database.uri != null) { - ATUIN_DB_URI = cfg.database.uri; - }; + environment = { + ATUIN_HOST = cfg.host; + ATUIN_PORT = toString cfg.port; + ATUIN_MAX_HISTORY_LENGTH = toString cfg.maxHistoryLength; + ATUIN_OPEN_REGISTRATION = lib.boolToString cfg.openRegistration; + ATUIN_PATH = cfg.path; + ATUIN_CONFIG_DIR = "/run/atuin"; # required to start, but not used as configuration is via environment variables + } // lib.optionalAttrs (cfg.database.uri != null) { ATUIN_DB_URI = cfg.database.uri; }; }; networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ];