-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
41 lines (35 loc) · 1.18 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
{
description = "Guzzle plugin that converts responses to UTF-8";
inputs = {
# For old PHP versions.
phps.url = "github:fossar/nix-phps";
};
outputs = { self, phps }:
let
# nixpkgs is a repository with software packages and some utilities.
# From simplicity, we inherit it from the phps flake.
inherit (phps.inputs) nixpkgs;
# Configure the development shell here (e.g. for CI).
# By default, we use the default PHP version from Nixpkgs.
matrix.phpPackage = "php";
in
let
# We only support a single platform at the moment,
# since our binary cache only contains PHP packages for that.
system = "x86_64-linux";
# Get Nixpkgs packages for current platform.
pkgs = nixpkgs.legacyPackages.${system};
# Create a PHP package from the selected PHP package.
php = phps.packages.${system}.${matrix.phpPackage};
in {
# Expose shell environment for development.
devShell.${system} = pkgs.mkShell {
nativeBuildInputs = [
# Composer and PHP.
php
php.packages.composer
pkgs.phpactor
];
};
};
}