-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
38 lines (35 loc) · 1.03 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/refs/heads/master.tar.gz") {},
}:
let
php_custom = pkgs.php82.buildEnv {
extensions = { all, enabled }: with all; enabled ++ [ xdebug xsl ];
extraConfig = ''
memory_limit=-1
xdebug.mode=debug
'';
};
PROJECT_ROOT = builtins.getEnv "PWD";
rooter = pkgs.writeShellScriptBin "rooter" ''
export ROOTER_TRAEFIK_BIN=${pkgs.traefik}/bin/traefik
export ROOTER_DNSMASQ_BIN=${pkgs.dnsmasq}/bin/dnsmasq
export ROOTER_GZIP_BIN=${pkgs.gzip}/bin/gzip
export ROOTER_PV_BIN=${pkgs.pv}/bin/pv
${php_custom}/bin/php ${PROJECT_ROOT}/rooter.php "$@"
'';
in
pkgs.mkShell {
buildInputs = with pkgs; [
traefik
dnsmasq
pv
gzip
php_custom
php_custom.packages.composer
rooter
];
shellHook = ''
ln -sf ${rooter}/bin/rooter ./rooter
${rooter}/bin/rooter init
'';
}