mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 12:15:34 +03:00
atuin: fix systemd after/wants targets
This commit is contained in:
parent
9e4832e691
commit
c5d1ccd473
1 changed files with 14 additions and 13 deletions
|
@ -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 ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue