Skip to content

Commit

Permalink
refactor: switch from numtide/flake-utils to flake-parts
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jan 29, 2023
1 parent 7e53d72 commit 9e16be6
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,47 @@
};

nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

utils.url = "github:numtide/flake-utils";
};

outputs = { self, flake-compat, nixpkgs, utils }:
# For each supported platform,
utils.lib.eachDefaultSystem (system:
let
outputs = inputs @ {flake-parts, ...}:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
flake = {
overlays.default = import ./pkgs/phps.nix inputs.nixpkgs;
};

systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];

perSystem = {
config,
pkgs,
system,
...
}: let
# Let’s merge the package set from Nixpkgs with our custom PHP versions.
pkgs = import nixpkgs.outPath {
pkgs = import inputs.nixpkgs {
config = {
allowUnfree = true;
};
inherit system;
overlays = [
self.overlays.default
inputs.self.overlays.default
];
};
in rec {
formatter = pkgs.alejandra;

packages = {
inherit (pkgs) php php56 php70 php71 php72 php73 php74 php80 php81 php82;
};

checks = import ./checks.nix {
inherit packages pkgs system;
};
}
) // {
overlays.default = import ./pkgs/phps.nix nixpkgs.outPath;
};
};
}

0 comments on commit 9e16be6

Please sign in to comment.