-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
{
description = "An OpenTTD-like game written in Lean";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs =
{ self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.${system}.default = pkgs.leanPackages.buildLakePackage {
pname = "leanttd";
src = self;
version = "0.1";
lakeHash = "sha256-d5tV9nqv5XwBKNBBxsnEPujbjpR9TgdTp5NUV3bX10g=";
buildInputs = [ pkgs.raylib ];
# This fixes a linker error
hardeningDisable = [ "bindnow" ];
postConfigure = ''
# Make sure the linker can find libraylib.so
substituteInPlace lakefile.toml --replace-fail \
'["-lraylib"]' \
'["-L${pkgs.raylib}/lib", "-lraylib"]'
# Patch Raylean to fix a compilation error
cd .lake/packages/raylean
patch -p1 < ../../../raylean.patch
cd -
'';
};
apps.${system}.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/leanttd";
};
formatter.${system} = pkgs.nixfmt-tree;
};
}