Merge pull request #1211 from lightpanda-io/zigdom-nix

`zigdom` building on NixOS
This commit is contained in:
Karl Seguin
2025-11-17 23:30:48 +08:00
committed by GitHub
3 changed files with 60 additions and 10 deletions

View File

@@ -87,7 +87,7 @@ pub fn build(b: *Build) !void {
.sanitize_c = enable_csan,
.sanitize_thread = enable_tsan,
.imports = &.{
.{.name = "lightpanda", .module = lightpanda_module},
.{ .name = "lightpanda", .module = lightpanda_module },
},
}),
});
@@ -105,6 +105,7 @@ pub fn build(b: *Build) !void {
// test
const tests = b.addTest(.{
.root_module = lightpanda_module,
.use_llvm = true,
.test_runner = .{ .path = b.path("src/test_runner.zig"), .mode = .simple },
});
const run_tests = b.addRunArtifact(tests);
@@ -125,7 +126,7 @@ pub fn build(b: *Build) !void {
.sanitize_c = enable_csan,
.sanitize_thread = enable_tsan,
.imports = &.{
.{.name = "lightpanda", .module = lightpanda_module},
.{ .name = "lightpanda", .module = lightpanda_module },
},
}),
});
@@ -151,7 +152,7 @@ pub fn build(b: *Build) !void {
.sanitize_c = enable_csan,
.sanitize_thread = enable_tsan,
.imports = &.{
.{.name = "lightpanda", .module = lightpanda_module},
.{ .name = "lightpanda", .module = lightpanda_module },
},
}),
});
@@ -658,6 +659,8 @@ fn buildCurl(b: *Build, m: *Build.Module) !void {
curl.addIncludePath(b.path(root ++ "lib"));
curl.addIncludePath(b.path(root ++ "include"));
curl.addIncludePath(b.path("vendor/zlib"));
curl.addCSourceFiles(.{
.flags = &.{},
.files = &.{

51
flake.lock generated
View File

@@ -1,5 +1,26 @@
{
"nodes": {
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1763016383,
"narHash": "sha256-eYmo7FNvm3q08iROzwIi8i9dWuUbJJl3uLR3OLnSmdI=",
"owner": "nix-community",
"repo": "fenix",
"rev": "0fad5c0e5c531358e7174cd666af4608f08bc3ba",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@@ -75,11 +96,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1756822655,
"narHash": "sha256-xQAk8xLy7srAkR5NMZFsQFioL02iTHuuEIs3ohGpgdk=",
"lastModified": 1763043403,
"narHash": "sha256-DgCTbHdIpzbXSlQlOZEWj8oPt2lrRMlSk03oIstvkVQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4bdac60bfe32c41103ae500ddf894c258291dd61",
"rev": "75e04ecd084f93d4105ce68c07dac7656291fe2e",
"type": "github"
},
"original": {
@@ -91,12 +112,30 @@
},
"root": {
"inputs": {
"fenix": "fenix",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"zigPkgs": "zigPkgs",
"zlsPkg": "zlsPkg"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1762860488,
"narHash": "sha256-rMfWMCOo/pPefM2We0iMBLi2kLBAnYoB9thi4qS7uk4=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "2efc80078029894eec0699f62ec8d5c1a56af763",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
@@ -136,11 +175,11 @@
]
},
"locked": {
"lastModified": 1756555914,
"narHash": "sha256-7yoSPIVEuL+3Wzf6e7NHuW3zmruHizRrYhGerjRHTLI=",
"lastModified": 1762907712,
"narHash": "sha256-VNW/+VYIg6N4b9Iq+F0YZmm22n74IdFS7hsPLblWuOY=",
"owner": "mitchellh",
"repo": "zig-overlay",
"rev": "d0df3a2fd0f11134409d6d5ea0e510e5e477f7d6",
"rev": "d16453ee78765e49527c56d23386cead799b6b53",
"type": "github"
},
"original": {

View File

@@ -11,6 +11,11 @@
zlsPkg.inputs.zig-overlay.follows = "zigPkgs";
zlsPkg.inputs.nixpkgs.follows = "nixpkgs";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
@@ -19,6 +24,7 @@
nixpkgs,
zigPkgs,
zlsPkg,
fenix,
flake-utils,
...
}:
@@ -36,6 +42,8 @@
inherit system overlays;
};
rustToolchain = fenix.packages.${system}.stable.toolchain;
# We need crtbeginS.o for building.
crtFiles = pkgs.runCommand "crt-files" { } ''
mkdir -p $out/lib
@@ -51,6 +59,7 @@
# Build Tools
zigpkgs."0.15.2"
zls
rustToolchain
python3
pkg-config
cmake
@@ -66,7 +75,6 @@
glib.dev
glibc.dev
zlib
zlib.dev
];
};
in