forked from Fediversity/Fediversity
Deployment: handle nullable config fields
This is quite frustrating. In the meantime, it does get the deployment working again.
This commit is contained in:
parent
4dd1491e71
commit
09119803e8
1 changed files with 16 additions and 2 deletions
|
@ -33,11 +33,25 @@
|
||||||
## information coming from the FediPanel.
|
## information coming from the FediPanel.
|
||||||
##
|
##
|
||||||
## FIXME: lock step the interface with the definitions in the FediPanel
|
## FIXME: lock step the interface with the definitions in the FediPanel
|
||||||
panelConfig:
|
panelConfigNullable:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
|
|
||||||
|
nonNull = x: v: if x == null then v else x;
|
||||||
|
|
||||||
|
panelConfig = {
|
||||||
|
domain = nonNull panelConfigNullable.domain "fediversity.net";
|
||||||
|
initialUser = nonNull panelConfigNullable.initialUser {
|
||||||
|
displayName = "Testy McTestface";
|
||||||
|
username = "test";
|
||||||
|
password = "testtest";
|
||||||
|
email = "test@test.com";
|
||||||
|
};
|
||||||
|
mastodon = nonNull panelConfigNullable.mastodon { enable = false; };
|
||||||
|
peertube = nonNull panelConfigNullable.peertube { enable = false; };
|
||||||
|
pixelfed = nonNull panelConfigNullable.pixelfed { enable = false; };
|
||||||
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
## Regular arguments of a NixOps4 deployment module.
|
## Regular arguments of a NixOps4 deployment module.
|
||||||
|
@ -122,7 +136,7 @@ in
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
mkIf (cfg.mastodon.enable || cfg.peertube.enable || cfg.pixelfed.enable) {
|
mkIf (cfg.mastodon.enable || cfg.peertube.enable || cfg.pixelfed.enable) {
|
||||||
fediversity = {
|
fediversity = {
|
||||||
inherit (panelConfig) domain;
|
inherit (cfg) domain;
|
||||||
garage.enable = true;
|
garage.enable = true;
|
||||||
pixelfed = pixelfedS3KeyConfig { inherit pkgs; };
|
pixelfed = pixelfedS3KeyConfig { inherit pkgs; };
|
||||||
mastodon = mastodonS3KeyConfig { inherit pkgs; };
|
mastodon = mastodonS3KeyConfig { inherit pkgs; };
|
||||||
|
|
Loading…
Add table
Reference in a new issue