From 117aed49e3fb9ca1b73cd00f0e959718095a385a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 19 Jun 2024 11:40:19 +0200 Subject: [PATCH] postgresql: don't prepend postgresql- for states --- clanModules/postgresql/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/clanModules/postgresql/default.nix b/clanModules/postgresql/default.nix index caed28d1..82469bb6 100644 --- a/clanModules/postgresql/default.nix +++ b/clanModules/postgresql/default.nix @@ -66,6 +66,12 @@ in name = lib.mkOption { type = lib.types.str; default = name; + description = "Database name."; + }; + service = lib.mkOption { + type = lib.types.str; + default = name; + description = "Service name that we associate with the database."; }; # set to false, in case the upstream module uses ensureDatabase option create.enable = lib.mkOption { @@ -87,7 +93,7 @@ in restore.stopOnRestore = lib.mkOption { type = lib.types.listOf lib.types.str; default = [ ]; - description = "List of services to stop before restoring the database."; + description = "List of systemd services to stop before restoring the database."; }; }; } @@ -129,7 +135,7 @@ in ''; clan.core.state = lib.mapAttrs' ( - _: db: lib.nameValuePair "postgresql-${db.name}" (createDatatbaseState db) + _: db: lib.nameValuePair db.service (createDatatbaseState db) ) config.clan.postgresql.databases; environment.systemPackages = builtins.map (