69 lines
2 KiB
Nix
69 lines
2 KiB
Nix
|
{
|
||
|
description = "A flake to use Chicken 6 with TinyCC.";
|
||
|
|
||
|
inputs = {
|
||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||
|
};
|
||
|
|
||
|
outputs = inputs @ {
|
||
|
self,
|
||
|
nixpkgs,
|
||
|
systems,
|
||
|
...
|
||
|
}: let
|
||
|
inherit (nixpkgs) lib;
|
||
|
forAllSystems = lib.genAttrs [
|
||
|
"aarch64-linux"
|
||
|
"i686-linux"
|
||
|
"x86_64-linux"
|
||
|
"aarch64-darwin"
|
||
|
"x86_64-darwin"
|
||
|
];
|
||
|
pkgsFor = forAllSystems (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: {
|
||
|
tcc-mob = final.callPackage ./nix/tinycc.nix {
|
||
|
stdenv = final.gcc13Stdenv;
|
||
|
};
|
||
|
chicken = final.callPackage ./nix/chicken.nix {
|
||
|
stdenv = final.gcc13Stdenv;
|
||
|
version = version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
||
|
};
|
||
|
sdl3 = final.callPackage ./nix/sdl3.nix {
|
||
|
stdenv = final.gcc13Stdenv;
|
||
|
version = "2.99.0+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
|
||
|
devShells = forAllSystems (system: {
|
||
|
default = let
|
||
|
pkgs = import nixpkgs {
|
||
|
overlays = [ self.overlays.chicken ];
|
||
|
};
|
||
|
in pkgs.mkShell {
|
||
|
packages = with pkgs; [ pkg-config rlwrap tcc-mob chicken sdl3 ];
|
||
|
shellHook = ''
|
||
|
export CC=${pkgs.tcc-mob}/bin/tcc
|
||
|
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"
|
||
|
'';
|
||
|
};
|
||
|
});
|
||
|
};
|
||
|
}
|