run nixfmt
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
{ lib, inputs, config, pkgs, ... }:
|
||||
{
|
||||
lib,
|
||||
inputs,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.dnote;
|
||||
fqdn = "${cfg.subdomain}.${config.networking.domain}";
|
||||
@@ -40,10 +46,8 @@ let
|
||||
WebURL = "https://${fqdn}";
|
||||
};
|
||||
|
||||
serializeEnvVar = value:
|
||||
if (lib.isBool value)
|
||||
then if value then "true" else "false"
|
||||
else toString value;
|
||||
serializeEnvVar =
|
||||
value: if (lib.isBool value) then if value then "true" else "false" else toString value;
|
||||
in
|
||||
{
|
||||
options.services.dnote = {
|
||||
@@ -81,7 +85,9 @@ in
|
||||
systemd.services.dnote = {
|
||||
enable = true;
|
||||
description = "Dnote server";
|
||||
environment = lib.mapAttrs (_: value: serializeEnvVar value) (cfg.environment // immutableEnvironment);
|
||||
environment = lib.mapAttrs (_: value: serializeEnvVar value) (
|
||||
cfg.environment // immutableEnvironment
|
||||
);
|
||||
after = [ "postgresql.service" ];
|
||||
requires = [ "postgresql.service" ];
|
||||
serviceConfig = {
|
||||
@@ -113,10 +119,12 @@ in
|
||||
postgresql = {
|
||||
enable = lib.mkDefault true;
|
||||
ensureDatabases = [ cfg.environment.DBName ];
|
||||
ensureUsers = [{
|
||||
name = cfg.user;
|
||||
ensureDBOwnership = true;
|
||||
}];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = cfg.user;
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
webserver = {
|
||||
|
||||
Reference in New Issue
Block a user