Skip to content

Commit b64f8f1

Browse files
committed
fmt
1 parent 12e588a commit b64f8f1

10 files changed

Lines changed: 36 additions & 67 deletions

File tree

hosts/prod/backend/default.nix

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,14 @@
113113

114114
SENTRY_ENVIRONMENT = "prod";
115115
}
116-
// (lib.mapAttrs' (
117-
ms:
118-
{ port, ... }:
119-
{
120-
name = "${lib.toUpper ms}_URL";
121-
value = "http://127.0.0.1:${toString port}/";
122-
}
123-
) config.academy.backend.microservices)
124-
// (lib.mapAttrs' (
125-
ms:
126-
{ redis, ... }:
127-
{
128-
name = "${lib.toUpper ms}_REDIS_URL";
129-
value = "redis://127.0.0.1:6379/${toString redis.database}";
130-
}
131-
) config.academy.backend.microservices)
116+
// (lib.mapAttrs' (ms: { port, ... }: {
117+
name = "${lib.toUpper ms}_URL";
118+
value = "http://127.0.0.1:${toString port}/";
119+
}) config.academy.backend.microservices)
120+
// (lib.mapAttrs' (ms: { redis, ... }: {
121+
name = "${lib.toUpper ms}_REDIS_URL";
122+
value = "redis://127.0.0.1:6379/${toString redis.database}";
123+
}) config.academy.backend.microservices)
132124
// {
133125
AUTH_URL = "http://127.0.0.1:8000/auth/";
134126
SHOP_URL = "http://127.0.0.1:8000/shop/";

hosts/test/backend/default.nix

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,14 @@
115115

116116
SENTRY_ENVIRONMENT = "test";
117117
}
118-
// (lib.mapAttrs' (
119-
ms:
120-
{ port, ... }:
121-
{
122-
name = "${lib.toUpper ms}_URL";
123-
value = "http://127.0.0.1:${toString port}/";
124-
}
125-
) config.academy.backend.microservices)
126-
// (lib.mapAttrs' (
127-
ms:
128-
{ redis, ... }:
129-
{
130-
name = "${lib.toUpper ms}_REDIS_URL";
131-
value = "redis://127.0.0.1:6379/${toString redis.database}";
132-
}
133-
) config.academy.backend.microservices)
118+
// (lib.mapAttrs' (ms: { port, ... }: {
119+
name = "${lib.toUpper ms}_URL";
120+
value = "http://127.0.0.1:${toString port}/";
121+
}) config.academy.backend.microservices)
122+
// (lib.mapAttrs' (ms: { redis, ... }: {
123+
name = "${lib.toUpper ms}_REDIS_URL";
124+
value = "redis://127.0.0.1:6379/${toString redis.database}";
125+
}) config.academy.backend.microservices)
134126
// {
135127
AUTH_URL = "http://127.0.0.1:8000/auth/";
136128
SHOP_URL = "http://127.0.0.1:8000/shop/";

modules/acme.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{ config, lib, ... }:
2-
{
1+
{ config, lib, ... }: {
32
security.acme = {
43
acceptTerms = true;
54
defaults.email = "admin@bootstrap.academy";

modules/backend/default.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{ lib, ... }:
2-
{
1+
{ lib, ... }: {
32
imports = [
43
./nginx.nix
54
./postgresql.nix

modules/backend/nginx.nix

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,19 @@
3434
}
3535
'';
3636
locations =
37-
lib.mapAttrs' (
38-
ms:
39-
{ port, ... }:
40-
{
41-
name = "/${ms}/";
42-
value = {
43-
proxyPass = "http://127.0.0.1:${toString port}/";
44-
proxyWebsockets = true;
45-
};
46-
}
47-
) cfg.microservices
48-
// (lib.mapAttrs' (
49-
ms:
50-
{ port, ... }:
51-
{
52-
name = "= /${ms}/";
53-
value = {
54-
return = "307 /${ms}/docs";
55-
};
56-
}
57-
) cfg.microservices)
37+
lib.mapAttrs' (ms: { port, ... }: {
38+
name = "/${ms}/";
39+
value = {
40+
proxyPass = "http://127.0.0.1:${toString port}/";
41+
proxyWebsockets = true;
42+
};
43+
}) cfg.microservices
44+
// (lib.mapAttrs' (ms: { port, ... }: {
45+
name = "= /${ms}/";
46+
value = {
47+
return = "307 /${ms}/docs";
48+
};
49+
}) cfg.microservices)
5850
// (lib.optionalAttrs (cfg.protectInternalEndpoints) { "~* (:*/_internal/.*)".return = "403"; })
5951
// {
6052
"= /" = {

modules/backend/postgresql.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{ lib, config, ... }:
2-
{
1+
{ lib, config, ... }: {
32
config =
43
let
54
cfg = config.academy.backend;

modules/backend/redis.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{ config, lib, ... }:
2-
{
1+
{ config, lib, ... }: {
32
config =
43
let
54
cfg = config.academy.backend;

modules/filesystems.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{ config, lib, ... }:
2-
{
1+
{ config, lib, ... }: {
32
options.filesystems = {
43
defaultLayout = lib.mkOption {
54
type = lib.types.bool;

modules/monitoring.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{ config, lib, ... }:
2-
{
1+
{ config, lib, ... }: {
32
options.monitoring = {
43
enable = lib.mkOption {
54
type = lib.types.bool;

modules/pkgs.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{ pkgs, ... }:
2-
{
1+
{ pkgs, ... }: {
32
environment.systemPackages = builtins.attrValues {
43
inherit (pkgs)
54
dig

0 commit comments

Comments
 (0)