2 files changed,
+37,
-7
+18,
-1
1@@ -161,7 +161,8 @@
2 "bug": "bug",
3 "concurrently": "concurrently",
4 "nixpkgs": "nixpkgs_3",
5- "vibe": "vibe"
6+ "vibe": "vibe",
7+ "ygo": "ygo"
8 }
9 },
10 "systems": {
11@@ -227,6 +228,22 @@
12 "type": "git",
13 "url": "https://git.kilimanjaro.io/vibe"
14 }
15+ },
16+ "ygo": {
17+ "flake": false,
18+ "locked": {
19+ "lastModified": 1779927401,
20+ "narHash": "sha256-XMx/WwFjSbUB4nXxOqlVUb29SyBsw6AhHU7TccrVO9s=",
21+ "ref": "refs/heads/main",
22+ "rev": "078700e025b98da8c37770c8081a9e1311e8ecf2",
23+ "revCount": 26,
24+ "type": "git",
25+ "url": "https://git.kilimanjaro.io/ygo"
26+ },
27+ "original": {
28+ "type": "git",
29+ "url": "https://git.kilimanjaro.io/ygo"
30+ }
31 }
32 },
33 "root": "root",
+19,
-6
1@@ -6,11 +6,15 @@
2 bug.url = "git+https://git.kilimanjaro.io/bug";
3 concurrently.url = "git+https://git.kilimanjaro.io/concurrently";
4 vibe.url = "git+https://git.kilimanjaro.io/vibe";
5+ ygo = {
6+ url = "git+https://git.kilimanjaro.io/ygo";
7+ flake = false;
8+ };
9 };
10
11- outputs = { self, nixpkgs, bug, concurrently, vibe }:
12+ outputs = { self, nixpkgs, bug, concurrently, vibe, ygo }:
13 let
14- systems = [ "x86_64-linux" "aarch64-linux" ];
15+ systems = [ "x86_64-linux" ];
16 forEachSystem = nixpkgs.lib.genAttrs systems;
17
18 y-sweet-package = { pkgs, lib, fetchFromGitHub, rustPlatform }:
19@@ -42,7 +46,7 @@
20 };
21 };
22
23- rtw-package = { pkgs, lib, buildGoModule, ... }:
24+ rtw-package = { pkgs, lib, buildGoModule, ygo }:
25 buildGoModule {
26 pname = "rtw";
27 version = "0.1.0";
28@@ -59,13 +63,14 @@
29 # Build only the server command
30 subPackages = [ "cmd/rtw" ];
31
32- # Disable workspace so ygo is fetched from proxy, not ../ygo
33+ # Disable workspace so Go ignores ../waldo and ../ygo paths that
34+ # don't exist in the Nix sandbox.
35 GOWORK = "off";
36 env.CGO_ENABLED = "1";
37
38 # Compute by running: nix build .#rtw
39 # Then copy the hash from the error message
40- vendorHash = "sha256-EzV57oX4Wgvn1KITyoBwycE0pt3QMj6IpK+8v6ndczs=";
41+ vendorHash = lib.fakeHash;
42
43 doCheck = false;
44
45@@ -73,6 +78,14 @@
46 GOWORK = "off";
47 };
48
49+ preBuild = ''
50+ # go mod vendor does not copy the ygo lib/ directory (C headers and
51+ # static libraries) because it contains no Go files. We inject them
52+ # from the full git source here so CGo can find libyrs.h and libyrs.a.
53+ mkdir -p vendor/git.kilimanjaro.io/ygo/lib
54+ cp -r ${ygo}/lib/* vendor/git.kilimanjaro.io/ygo/lib/
55+ '';
56+
57 meta = {
58 description = "RTW adventure motorcycle trip planning server";
59 license = lib.licenses.mit;
60@@ -87,7 +100,7 @@
61 in
62 {
63 y-sweet = pkgs.callPackage y-sweet-package {};
64- rtw = pkgs.callPackage rtw-package {};
65+ rtw = pkgs.callPackage rtw-package { inherit ygo; };
66 default = self.packages.${system}.rtw;
67 }
68 );