-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathflake.nix
More file actions
142 lines (126 loc) · 3.72 KB
/
Copy pathflake.nix
File metadata and controls
142 lines (126 loc) · 3.72 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
snow-blower.url = "github:use-the-fork/snow-blower";
};
outputs = inputs:
inputs.snow-blower.mkSnowBlower {
inherit inputs;
perSystem = {
config,
lib,
pkgs,
...
}: let
rootDir = config.snow-blower.paths.root;
serv = config.snow-blower.services;
lang = config.snow-blower.languages;
envKeys = builtins.attrNames config.snow-blower.env;
unsetEnv = builtins.concatStringsSep "\n" (
map (key: "unset ${key}") envKeys
);
in {
snow-blower = {
paths.src = ./.;
packages = [
# Local github runner
pkgs.act
];
# Convince scripts
scripts = {
pf.exec = ''
${unsetEnv}
./vendor/bin/pest --filter "$@"
'';
p.exec = ''
${unsetEnv}
./vendor/bin/pest
'';
coverage.exec = ''
export XDEBUG_MODE=coverage
./vendor/bin/pest --coverage
unset XDEBUG_MODE
'';
coverage-xml.exec = ''
export XDEBUG_MODE=coverage
./vendor/bin/pest --coverage --coverage-clover clover.xml
unset XDEBUG_MODE
'';
# swap a and artisan commands for testbench
a.exec = ''
${unsetEnv}
./vendor/bin/testbench "$@"
'';
artisan.exec = ''
${unsetEnv}
./vendor/bin/testbench "$@"
'';
};
languages = {
# the required version of PHP for this project.
php = {
enable = true;
package = pkgs.php82;
extensions = ["grpc" "redis" "imagick" "memcached" "xdebug"];
ini = ''
memory_limit = 5G
max_execution_time = 90
[xdebug]
xdebug.start_with_request=yes
xdebug.start_upon_error=yes
'';
};
};
services = {
aider.enable = true;
# Elasticsearch service for testing
elasticsearch = {
enable = true;
};
};
integrations = {
#Creates Changelogs based on commits
git-cliff.enable = true;
treefmt = {
settings.formatter = {
# Laravel Pint Formating
"laravel-pint" = {
command = "php";
options = [
"${rootDir}/vendor/bin/pint"
#make it verbose
"-v"
"--repair"
];
includes = ["*.php"];
};
};
programs = {
#Nix Formater
alejandra.enable = true;
#Format Markdown files.
mdformat.enable = true;
};
};
# Guess what this does. Go ahead Guess.
git-hooks.hooks = {
# run formatting on files that are being commited
treefmt.enable = true;
#lets make sure there are no keys in the repo
detect-private-keys.enable = true;
#fix line endings.
mixed-line-endings.enable = true;
};
};
shell.interactive = [
''
if [[ ! -d vendor ]]; then
composer install
fi
''
];
};
};
};
}