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 Feb 1, 2024
1 parent edb094a commit c57bd75
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 62 deletions.
62 changes: 32 additions & 30 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 26 additions & 32 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,35 @@
description = "Repository of Nix expressions for old PHP versions";

inputs = {
# Shim to make flake.nix work with stable Nix.
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};

flake-compat.url = "github:nix-community/flake-compat";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

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

outputs = { self, flake-compat, nixpkgs, utils }:
# For each supported platform,
utils.lib.eachDefaultSystem (system:
let
# Let’s merge the package set from Nixpkgs with our custom PHP versions.
pkgs = import nixpkgs.outPath {
config = {
allowUnfree = true;
};
inherit system;
overlays = [
self.overlays.default
];
};
in rec {
packages = {
inherit (pkgs) php php56 php70 php71 php72 php73 php74 php80 php81 php82 php83;
};
outputs = inputs@{ self, flake-parts, nixpkgs, systems, ... }: flake-parts.lib.mkFlake { inherit inputs; } {
systems = import systems;

perSystem = { self', inputs', config, pkgs, system, lib, ... }: {
_module.args.pkgs = import self.inputs.nixpkgs {
inherit system;
overlays = [
self.overlays.default
];
config.allowUnfree = true;
};

checks = import ./checks.nix {
inherit packages pkgs system;
};
}
) // {
overlays.default = import ./pkgs/phps.nix nixpkgs.outPath;
packages = {
inherit (pkgs) php php56 php70 php71 php72 php73 php74 php80 php81 php82 php83;
};

checks = import ./checks.nix {
inherit (self') packages;
inherit pkgs system;
};
};

flake = {
overlays.default = import ./pkgs/phps.nix nixpkgs;
};
};
}

0 comments on commit c57bd75

Please sign in to comment.