forked from phpactor/phpactor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
102 lines (93 loc) · 2.67 KB
/
Copy pathflake.nix
File metadata and controls
102 lines (93 loc) · 2.67 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# this is a WIP flake for development and experimentation only
{
description = "phpactor/phpactor";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs @ {
self,
flake-parts,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
# This flake is for Linux (x86) and Apple (darwin) systems
# If you need more systems, inspect `nixpkgs.lib.systems.flakeExposed` and
# add them to this list.
#
# $ nix repl "<nixpkgs>"
# nix-repl> lib.systems.flakeExposed
systems = ["x86_64-linux" "aarch64-linux"];
perSystem = {
pkgs,
system,
...
}: let
jaeger = pkgs.stdenv.mkDerivation {
pname = "jaeger";
version = "1.49.0";
src = pkgs.fetchurl {
url = "https://github.com/jaegertracing/jaeger/releases/download/v1.73.0/jaeger-2.10.0-linux-amd64.tar.gz";
hash = "sha256-/hqgg1MNAqlBWOUJSjM0NikYLKye6GQAM3KinfHAUNM=";
};
phases = ["unpackPhase" "installPhase" "fixupPhase"];
installPhase = ''
mkdir -p $out/bin
install ./jaeger $out/bin
'';
};
phpWithXdebug = pkgs.php84.buildEnv {
extensions = {
enabled,
all,
}:
enabled
++ (with all; [
xdebug
opentelemetry
]);
extraConfig = ''
xdebug.mode=debug
'';
};
in {
packages = {
default = pkgs.phpactor;
};
checks = {
default = pkgs.phpactor;
flake-format =
pkgs.runCommand "phpactor-flake-format-check"
{nativeBuildInputs = [pkgs.alejandra];}
''
alejandra --check ${./flake.nix}
touch $out
'';
phpactor-smoke =
pkgs.runCommand "phpactor-smoke"
{nativeBuildInputs = [pkgs.phpactor];}
''
phpactor --version
touch $out
'';
};
# Run `nix fmt` to reformat the nix files
formatter = pkgs.alejandra;
# Run `nix develop` to enter the development shell
devShells.default = pkgs.mkShellNoCC {
name = "php-devshell";
buildInputs = [
jaeger
pkgs.python3
phpWithXdebug
pkgs.php84.packages.composer
];
shellHook = ''
if [ ! -d ".venv" ]; then
python3 -m venv .venv;
fi
source .venv/bin/activate;'';
};
};
};
}