chicken6-flake/flake.nix

51 lines
1.3 KiB
Nix
Raw Normal View History

2024-09-16 08:09:13 +00:00
{
description = "A flake to use a development version of Chicken.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux";
};
outputs = inputs @ {
self,
nixpkgs,
systems,
...
}: let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system:
import nixpkgs {
localSystem.system = system;
overlays = with self.overlays; [chicken];
});
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
version = "6.0.0";
in {
overlays = {
default = self.overlays.chicken;
chicken = final: prev: {
chicken = final.callPackage ./nix/default.nix {
stdenv = final.gcc13Stdenv;
version = version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
};
};
};
devShells = eachSystem (system: {
default = let
pkgs = import nixpkgs {
overlays = [ self.overlays.chicken ];
};
in pkgs.mkShell {
packages = [ pkgs.chicken ];
};
});
};
}