-
Notifications
You must be signed in to change notification settings - Fork 8
/
devenv.nix
52 lines (43 loc) · 1.2 KB
/
devenv.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ pkgs, ... }:
{
# https://devenv.sh/packages/
packages = [ pkgs.git ];
# https://devenv.sh/languages/
languages.nix.enable = true;
languages.php.enable = true;
languages.php.package = pkgs.php80;
# https://devenv.sh/basics/
env.PROJECT_NAME = "openfeature-php-sdk";
# https://devenv.sh/scripts/
scripts.hello.exec = "echo $ Started devenv shell in $PROJECT_NAME";
enterShell = ''
hello
echo
git --version
php --version
echo
# optimization step -- files and directories that match entries
# in the .gitignore will still be traversed, and the .devenv
# directory contains over 5000 files and 121MB.
if ! grep -E "excludesfile.+\.gitignore" .git/config &>/dev/null
then
git config --local core.excludesfile .gitignore
fi
'';
## https://devenv.sh/pre-commit-hooks/
pre-commit.hooks = {
# # general formatting
# prettier.enable = true;
# github actions
actionlint.enable = true;
# nix
deadnix.enable = true;
nixfmt.enable = true;
# php
phpcbf.enable = true;
# # ensure Markdown code is executable
# mdsh.enable = true;
};
# https://devenv.sh/processes/
# processes.ping.exec = "ping example.com";
}