-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
101 lines (94 loc) · 2.67 KB
/
flake.nix
File metadata and controls
101 lines (94 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
{
description = "Development environment configuration";
nixConfig = {
extra-substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs =
{
nixpkgs,
...
}@inputs:
let
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
pkgsForSystem =
system: nixpkgsSource:
import nixpkgsSource {
inherit system;
config.allowUnfree = true;
overlays = [
# (final: prev: { nodejs = prev.nodejs_20; })
];
};
forEachSystem = f: nixpkgs.lib.genAttrs systems f;
in
{
formatter = forEachSystem (s: nixpkgs.legacyPackages.${s}.nixfmt-rfc-style);
devShells = forEachSystem (
s:
let
pkgs = pkgsForSystem s nixpkgs;
phpEnv = pkgs.php.buildEnv {
extensions = (
{ enabled, all }:
enabled
++ (with all; [
xdebug
])
);
extraConfig = ''
xdebug.mode = debug
xdebug.start_with_request = trigger
'';
};
in
with pkgs;
{
default = mkShell {
packages = [
hadolint # docker
nixfmt-rfc-style
markdownlint-cli2 # markdown
nodePackages.eslint
nodePackages.intelephense
nodePackages.nodejs
nodePackages.pnpm
nodePackages.stylelint
playwright # NOTE: this must match the version of playwright installed in pnpm. figure out how to properly link these.
phpEnv
phpEnv.packages.composer
phpstan
shellcheck-minimal
sqlite
vale # prose
valeStyles.alex
valeStyles.google
valeStyles.proselint
yamllint
];
shellHook = ''
export PATH="$(composer global config home)/vendor/bin:$PATH"
export PATH="$PWD/node_modules/.bin/:$PATH"
export PLAYWRIGHT_BROWSERS_PATH=${playwright.browsers}
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
export PLAYWRIGHT_HOST_PLATFORM_OVERRIDE="ubuntu-24.04"
'';
};
}
);
};
}