Skip to content

Commit

Permalink
fix: [noticket] Fix wrapping
Browse files Browse the repository at this point in the history
- Add correct check for `config.dotenv.enable`
  • Loading branch information
lx-wnk committed Nov 22, 2023
1 parent f89f81f commit 9507f77
Showing 1 changed file with 31 additions and 33 deletions.
64 changes: 31 additions & 33 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -188,38 +188,36 @@ in {
'';

# Environment variables
env = lib.mkIf !dotenv.enable {
lib.mkMerge [
(lib.mkIf cfg.enable {
DATABASE_URL = lib.mkDefault "mysql://shopware:[email protected]:3306/shopware";
MAILER_URL = lib.mkDefault "smtp://127.0.0.1:1025?encryption=&auth_mode=";
MAILER_DSN = lib.mkDefault "smtp://127.0.0.1:1025?encryption=&auth_mode=";

APP_URL = lib.mkDefault "http://127.0.0.1:8000";
CYPRESS_baseUrl = lib.mkDefault "http://127.0.0.1:8000";

APP_SECRET = lib.mkDefault "devsecret";

PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = true;
DISABLE_ADMIN_COMPILATION_TYPECHECK = true;

SHOPWARE_CACHE_ID = "dev";

NODE_OPTIONS = "--openssl-legacy-provider --max-old-space-size=2000";
})
(lib.mkIf (config.services.elasticsearch.enable || config.services.opensearch.enable) {
SHOPWARE_ES_ENABLED = "1";
SHOPWARE_ES_INDEXING_ENABLED = "1";
SHOPWARE_ES_HOSTS = "127.0.0.1";
SHOPWARE_ES_THROW_EXCEPTION = "1";
})
(lib.mkIf config.services.rabbitmq.enable {
RABBITMQ_NODENAME = "rabbit@localhost"; # 127.0.0.1 can't be used as rabbitmq can't set short node name
})
(lib.mkIf config.services.redis.enable {
REDIS_DSN = "redis://127.0.0.1:6379";
})
];
};
env = lib.mkMerge [
(lib.mkIf (cfg.enable && !config.dotenv.enable) {
DATABASE_URL = lib.mkDefault "mysql://shopware:[email protected]:3306/shopware";
MAILER_URL = lib.mkDefault "smtp://127.0.0.1:1025?encryption=&auth_mode=";
MAILER_DSN = lib.mkDefault "smtp://127.0.0.1:1025?encryption=&auth_mode=";

APP_URL = lib.mkDefault "http://127.0.0.1:8000";
CYPRESS_baseUrl = lib.mkDefault "http://127.0.0.1:8000";

APP_SECRET = lib.mkDefault "devsecret";

PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = true;
DISABLE_ADMIN_COMPILATION_TYPECHECK = true;

SHOPWARE_CACHE_ID = "dev";

NODE_OPTIONS = "--openssl-legacy-provider --max-old-space-size=2000";
})
(lib.mkIf ((config.services.elasticsearch.enable || config.services.opensearch.enable) && !config.dotenv.enable) {
SHOPWARE_ES_ENABLED = "1";
SHOPWARE_ES_INDEXING_ENABLED = "1";
SHOPWARE_ES_HOSTS = "127.0.0.1";
SHOPWARE_ES_THROW_EXCEPTION = "1";
})
(lib.mkIf (config.services.rabbitmq.enable && !config.dotenv.enable) {
RABBITMQ_NODENAME = "rabbit@localhost"; # 127.0.0.1 can't be used as rabbitmq can't set short node name
})
(lib.mkIf (config.services.redis.enable && !config.dotenv.enable) {
REDIS_DSN = "redis://127.0.0.1:6379";
})
];
};
}

0 comments on commit 9507f77

Please sign in to comment.