-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Ivan Mincik <ivan.mincik@gmail.com> Co-authored-by: Auguste Baum <auguste.apple@gmail.com> Co-authored-by: Ondrej Kubanek <kubanek0ondrej@gmail.com> Co-authored-by: Andres Navarro <contact@andresnav.com>
- Loading branch information
1 parent
971a217
commit 40303c1
Showing
19 changed files
with
539 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
{pkgs}: { | ||
{ | ||
liberaforms-container = import ./liberaforms/container.nix; | ||
pretalx-postgresql = { | ||
imports = [ | ||
./pretalx/pretalx.nix | ||
./pretalx/postgresql.nix | ||
]; | ||
}; | ||
pretalx-mysql = { | ||
imports = [ | ||
./pretalx/pretalx.nix | ||
./pretalx/mysql.nix | ||
]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
config, | ||
pkgs, | ||
... | ||
}: { | ||
services = { | ||
pretalx.database = { | ||
backend = "mysql"; | ||
host = "/var/run/mysqld/mysqld.sock"; | ||
}; | ||
|
||
mysql = { | ||
enable = true; | ||
package = pkgs.mysql; | ||
ensureUsers = [ | ||
{ | ||
name = config.services.pretalx.database.user; | ||
ensurePermissions."${config.services.pretalx.database.name}.*" = "ALL PRIVILEGES"; | ||
} | ||
]; | ||
ensureDatabases = [config.services.pretalx.database.name]; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{config, ...}: { | ||
services = { | ||
pretalx.database.backend = "postgresql"; | ||
|
||
postgresql = { | ||
enable = true; | ||
authentication = "local all all trust"; | ||
ensureUsers = [ | ||
{ | ||
name = config.services.pretalx.database.user; | ||
ensurePermissions."DATABASE \"${config.services.pretalx.database.name}\"" = "ALL PRIVILEGES"; | ||
} | ||
]; | ||
ensureDatabases = [config.services.pretalx.database.name]; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
config, | ||
pkgs, | ||
... | ||
}: { | ||
nixpkgs.hostPlatform = "x86_64-linux"; | ||
|
||
networking.firewall.allowedTCPPorts = [config.services.nginx.defaultHTTPListenPort]; | ||
|
||
sops.secrets = let | ||
pretalxSecret = { | ||
# For a production configuration also `sopsFile` is required. | ||
# See <https://github.com/Mic92/sops-nix>. | ||
owner = config.services.pretalx.user; | ||
group = config.services.pretalx.group; | ||
}; | ||
in { | ||
"pretalx/database/password" = pretalxSecret; | ||
"pretalx/redis/location" = pretalxSecret; | ||
"pretalx/init/admin/password" = pretalxSecret; | ||
"pretalx/celery/backend" = pretalxSecret; | ||
"pretalx/celery/broker" = pretalxSecret; | ||
}; | ||
|
||
services = { | ||
pretalx = { | ||
enable = true; | ||
package = pkgs.pretalx; | ||
nginx = { | ||
# For a production configuration use this attribute set to configure the virtual host for pretalx. | ||
}; | ||
database = { | ||
user = "pretalx"; | ||
passwordFile = config.sops.secrets."pretalx/database/password".path; | ||
}; | ||
redis = { | ||
enable = true; | ||
locationFile = config.sops.secrets."pretalx/redis/location".path; | ||
}; | ||
celery = { | ||
enable = true; | ||
backendFile = config.sops.secrets."pretalx/celery/backend".path; | ||
brokerFile = config.sops.secrets."pretalx/celery/broker".path; | ||
}; | ||
|
||
init = { | ||
admin = { | ||
email = "pretalx@localhost"; | ||
passwordFile = config.sops.secrets."pretalx/init/admin/password".path; | ||
}; | ||
organiser = { | ||
name = "NGI Packages"; | ||
slug = "ngipkgs"; | ||
}; | ||
}; | ||
mail.enable = false; | ||
}; | ||
|
||
redis.servers."pretalx" = { | ||
enable = true; | ||
user = config.services.pretalx.user; | ||
}; | ||
|
||
nginx = { | ||
enable = true; | ||
recommendedTlsSettings = true; | ||
recommendedOptimisation = true; | ||
recommendedGzipSettings = true; | ||
recommendedProxySettings = true; | ||
}; | ||
}; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.