sdl3/flake.nix

62 lines
1.5 KiB
Nix
Raw Normal View History

2024-09-22 21:46:26 +00:00
{
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)
]);
2024-09-24 14:55:41 +00:00
version = "5.4.0";
2024-09-22 21:46:26 +00:00
in {
overlays = {
2024-09-24 14:55:41 +00:00
default = self.overlays.sdl3;
2024-09-22 21:46:26 +00:00
2024-09-24 14:55:41 +00:00
sdl3 = final: prev: {
2024-09-22 21:46:26 +00:00
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 {
2024-09-24 14:55:41 +00:00
overlays = [ self.overlays.sdl3 ];
2024-09-22 21:46:26 +00:00
};
in pkgs.mkShell {
2024-09-24 14:55:41 +00:00
packages = with pkgs; [
pkg-config rlwrap sdl3
chicken chickenPackages_5.chickenEggs.apropos
] ++ (with pkgs.chickenPackages_5.chickenEggs; [
apropos chicken-doc srfi-1 srfi-18 lsp-server
r7rs srfi-152
]);
2024-09-22 21:46:26 +00:00
};
});
};
}