-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
63 lines (54 loc) · 1.75 KB
/
flake.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
53
54
55
56
57
58
59
60
61
62
63
{
description = "Entry registration system for Rogaining";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.utils.url = "github:numtide/flake-utils";
inputs.composer2nixRepo = {
url = "github:svanderburg/composer2nix";
flake = false;
};
inputs.flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
outputs = { self, nixpkgs, utils, flake-compat, composer2nixRepo }:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
importComposerPackage = path: (import path {
inherit system pkgs;
noDev = true;
}).override {
executable = true;
};
composer2nix = importComposerPackage composer2nixRepo.outPath;
nette-code-checker = importComposerPackage ./.github/workflows/nix/code-checker;
update-php-extradeps = pkgs.writeShellScriptBin "update-php-extradeps" ''
pushd .github/workflows/nix/code-checker
composer update
env NIX_PATH=nixpkgs=${nixpkgs.outPath} ${composer2nix}/bin/composer2nix -p nette/code-checker
popd
'';
in {
devShells = {
default =
let
php = pkgs.php81.withExtensions ({ enabled, all }: with all; enabled ++ [
intl
]);
in
pkgs.mkShell {
nativeBuildInputs = [
php
pkgs.python3 # for create-zipball.py
nette-code-checker
update-php-extradeps
pkgs.nodejs
] ++ (with php.packages; [
composer
psalm
]);
};
};
}
);
}