zammad: reformat

main
Taeer Bar-Yam 2 years ago
parent 75fe105a3d
commit 4d38b6460f
  1. 23
      nixos/modules/services/development/zammad.nix
  2. 44
      nixos/tests/zammad.nix
  3. 7
      pkgs/applications/networking/misc/zammad/default.nix
  4. 1900
      pkgs/applications/networking/misc/zammad/gemset.nix
  5. 666
      pkgs/applications/networking/misc/zammad/yarn.nix

@ -19,11 +19,12 @@ let
environment = {
RAILS_ENV = "production";
NODE_ENV = "production";
RAILS_SERVE_STATIC_FILES="true";
RAILS_LOG_TO_STDOUT="true";
RAILS_SERVE_STATIC_FILES = "true";
RAILS_LOG_TO_STDOUT = "true";
};
databaseConfig = settingsFormat.generate "database.yml" cfg.database.settings;
in {
in
{
options = {
services.zammad = {
@ -125,7 +126,7 @@ in {
settings = mkOption {
type = settingsFormat.type;
default = {};
default = { };
example = literalExpression ''
{
}
@ -193,13 +194,15 @@ in {
group = "zammad";
};
users.groups.zammad = {};
users.groups.zammad = { };
assertions = [
{ assertion = cfg.database.createLocally -> cfg.database.user == "zammad";
{
assertion = cfg.database.createLocally -> cfg.database.user == "zammad";
message = "services.zammad.database.user must be set to \"zammad\" if services.zammad.database.createLocally is set to true";
}
{ assertion = cfg.database.createLocally -> cfg.database.passwordFile == null;
{
assertion = cfg.database.createLocally -> cfg.database.passwordFile == null;
message = "a password cannot be specified if services.zammad.database.createLocally is set to true";
}
];
@ -209,7 +212,8 @@ in {
package = mkDefault pkgs.mariadb;
ensureDatabases = [ cfg.database.name ];
ensureUsers = [
{ name = cfg.database.user;
{
name = cfg.database.user;
ensurePermissions = { "${cfg.database.name}.*" = "ALL PRIVILEGES"; };
}
];
@ -219,7 +223,8 @@ in {
enable = true;
ensureDatabases = [ cfg.database.name ];
ensureUsers = [
{ name = cfg.database.user;
{
name = cfg.database.user;
ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
}
];

@ -1,29 +1,29 @@
import ./make-test-python.nix (
{ lib, pkgs, ... }:
{
name = "zammad";
{
name = "zammad";
meta.maintainers = with lib.maintainers; [ garbas taeer ];
meta.maintainers = with lib.maintainers; [ garbas taeer ];
nodes.machine = {
services.zammad.enable = true;
services.zammad.secretKeyBaseFile = pkgs.writeText "secret" ''
52882ef142066e09ab99ce816ba72522e789505caba224a52d750ec7dc872c2c371b2fd19f16b25dfbdd435a4dd46cb3df9f82eb63fafad715056bdfe25740d6
'';
};
testScript = ''
start_all()
machine.wait_for_unit("postgresql.service")
machine.wait_for_unit("zammad-web.service")
machine.wait_for_unit("zammad-websocket.service")
machine.wait_for_unit("zammad-scheduler.service")
# without the grep the command does not produce valid utf-8 for some reason
with subtest("welcome screen loads"):
machine.succeed(
"curl -sSfL http://localhost:3000/ | grep '<title>Zammad Helpdesk</title>'"
)
nodes.machine = {
services.zammad.enable = true;
services.zammad.secretKeyBaseFile = pkgs.writeText "secret" ''
52882ef142066e09ab99ce816ba72522e789505caba224a52d750ec7dc872c2c371b2fd19f16b25dfbdd435a4dd46cb3df9f82eb63fafad715056bdfe25740d6
'';
}
};
testScript = ''
start_all()
machine.wait_for_unit("postgresql.service")
machine.wait_for_unit("zammad-web.service")
machine.wait_for_unit("zammad-websocket.service")
machine.wait_for_unit("zammad-scheduler.service")
# without the grep the command does not produce valid utf-8 for some reason
with subtest("welcome screen loads"):
machine.succeed(
"curl -sSfL http://localhost:3000/ | grep '<title>Zammad Helpdesk</title>'"
)
'';
}
)

@ -56,13 +56,13 @@ let
gemset = ./gemset.nix;
groups = [
"assets"
"unicorn" # server
"unicorn" # server
"nulldb"
"test"
"mysql"
"puma"
"development"
"postgres" # database
"postgres" # database
];
gemConfig = defaultGemConfig // {
pg = attrs: {
@ -93,7 +93,8 @@ let
packageJSON = sourceDir + "/package.json";
};
in stdenv.mkDerivation {
in
stdenv.mkDerivation {
name = "${pname}-${version}";
inherit pname version;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save