chicken5-flake/flake.nix

59 lines
1.5 KiB
Nix
Raw Normal View History

2024-09-16 10:16:45 +00:00
{
description = "A flake to use a development version of Chicken.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = inputs @ {
self,
nixpkgs,
...
}: let
inherit (nixpkgs) lib;
2024-09-17 08:38:18 +00:00
forAllSystems = lib.genAttrs [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
pkgsFor = forAllSystems (system:
2024-09-16 10:16:45 +00:00
import nixpkgs {
localSystem.system = system;
overlays = with self.overlays; [chicken tcc-mob];
});
in {
overlays = {
default = self.overlays.chicken;
2024-09-17 08:38:18 +00:00
chicken = final: prev: {
2024-09-16 10:16:45 +00:00
tcc-mob = final.callPackage ./nix/tinycc.nix {
stdenv = final.gcc13Stdenv;
};
2024-09-16 21:14:33 +00:00
chicken = final.callPackage ./nix/chicken.nix {
stdenv = final.gcc13Stdenv;
};
};
2024-09-16 10:16:45 +00:00
};
2024-09-17 08:38:18 +00:00
devShells = forAllSystems (system: {
2024-09-16 10:16:45 +00:00
default = let
pkgs = import nixpkgs {
2024-09-17 08:38:18 +00:00
overlays = [ self.overlays.chicken ];
2024-09-16 10:16:45 +00:00
};
in pkgs.mkShell {
2024-09-16 21:14:33 +00:00
packages = with pkgs; [ tcc-mob chicken pkg-config ]
++ (with pkgs.chickenPackages_5.chickenEggs; [
]);
2024-09-16 10:16:45 +00:00
shellHook = ''
2024-09-16 21:14:33 +00:00
export CC=${pkgs.tcc-mob}/bin/tcc
2024-09-16 10:16:45 +00:00
export CHICKEN_INSTALL_REPOSITORY="$(pwd)/.chicken/eggs"
export CHICKEN_REPOSITORY_PATH="${pkgs.chicken}/lib/chicken/11:$CHICKEN_REPOSITORY_PATH:$(pwd)/.chicken/eggs"
export PATH="$PATH:$CHICKEN_INSTALL_PREFIX/bin"
'';
};
});
};
}