mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/postfixadmin: format with nixfmt-rfc-style
This commit is contained in:
parent
e318dabd63
commit
c0c3fa6a78
1 changed files with 50 additions and 37 deletions
|
@ -1,4 +1,9 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.postfixadmin;
|
||||
fpm = config.services.phpfpm.pools.postfixadmin;
|
||||
|
@ -89,7 +94,9 @@ in
|
|||
$CONF['database_type'] = 'pgsql';
|
||||
$CONF['database_host'] = ${if localDB then "null" else "'${cfg.database.host}'"};
|
||||
${lib.optionalString localDB "$CONF['database_user'] = '${cfg.database.username}';"}
|
||||
$CONF['database_password'] = ${if localDB then "'dummy'" else "file_get_contents('${cfg.database.passwordFile}')"};
|
||||
$CONF['database_password'] = ${
|
||||
if localDB then "'dummy'" else "file_get_contents('${cfg.database.passwordFile}')"
|
||||
};
|
||||
$CONF['database_name'] = '${cfg.database.dbname}';
|
||||
$CONF['configured'] = true;
|
||||
|
||||
|
@ -126,14 +133,20 @@ in
|
|||
|
||||
services.postgresql = lib.mkIf localDB {
|
||||
enable = true;
|
||||
ensureUsers = [ {
|
||||
ensureUsers = [
|
||||
{
|
||||
name = cfg.database.username;
|
||||
} ];
|
||||
}
|
||||
];
|
||||
};
|
||||
# The postgresql module doesn't currently support concepts like
|
||||
# objects owners and extensions; for now we tack on what's needed
|
||||
# here.
|
||||
systemd.services.postfixadmin-postgres = let pgsql = config.services.postgresql; in lib.mkIf localDB {
|
||||
systemd.services.postfixadmin-postgres =
|
||||
let
|
||||
pgsql = config.services.postgresql;
|
||||
in
|
||||
lib.mkIf localDB {
|
||||
after = [ "postgresql.service" ];
|
||||
bindsTo = [ "postgresql.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
@ -174,7 +187,7 @@ in
|
|||
isSystemUser = true;
|
||||
createHome = false;
|
||||
};
|
||||
users.groups.${user} = lib.mkIf localDB {};
|
||||
users.groups.${user} = lib.mkIf localDB { };
|
||||
|
||||
services.phpfpm.pools.postfixadmin = {
|
||||
user = user;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue