Skip to content

Instantly share code, notes, and snippets.

@drupol
Created October 8, 2023 16:32
Show Gist options
  • Save drupol/2a85952da14191845678f3025b6e639d to your computer and use it in GitHub Desktop.
Save drupol/2a85952da14191845678f3025b6e639d to your computer and use it in GitHub Desktop.
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
php-src-master = {
url = "github:php/php-src/master";
flake = false;
};
php-src-81 = {
url = "github:php/php-src/PHP-8.1";
flake = false;
};
php-src-82 = {
url = "github:php/php-src/PHP-8.2";
flake = false;
};
php-src-83 = {
url = "github:php/php-src/PHP-8.3";
flake = false;
};
php-active = {
url = "https://www.php.net/releases/active";
flake = false;
};
};
outputs = inputs@{ self, flake-parts, systems, ... }: flake-parts.lib.mkFlake { inherit inputs; } {
systems = import systems;
imports = [
inputs.flake-parts.flakeModules.easyOverlay
];
flake = {
overlays.active = import ./src/active.nix inputs;
overlays.archive = import ./src/archive.nix inputs;
overlays.snapshot = import ./src/snapshot.nix inputs;
};
perSystem = { config, self', inputs', pkgs, system, lib, ... }:
let
packages = lib.foldlAttrs
(acc: name: value: acc // { "${name}" = value; })
{ }
(inputs.self.overlays.active pkgs pkgs) // (inputs.self.overlays.archive pkgs pkgs) // (inputs.self.overlays.snapshot pkgs pkgs);
in
{
_module.args.pkgs = import self.inputs.nixpkgs {
inherit system;
overlays = [
inputs.self.overlays.active
];
config.allowUnfree = true;
};
checks = self'.packages;
formatter = pkgs.nixpkgs-fmt;
overlayAttrs = self'.packages;
inherit packages;
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment