Compiling and linking with sword

This commit is contained in:
Greg Hellings
2025-02-24 15:59:24 -06:00
parent c8dfcc61e2
commit 1a6e51579b
9 changed files with 251 additions and 53 deletions
+22 -3
View File
@@ -5,8 +5,14 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-root.url = "github:srid/flake-root";
hooks.url = "github:cachix/git-hooks.nix";
naersk.url = "github:nix-community/naersk";
hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@@ -49,6 +55,10 @@
buildInputs = self'.checks.pre-commit.enabledPackages;
nativeBuildInputs = with pkgs; [
pkg-config
];
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
inherit (self'.checks.pre-commit) shellHook;
@@ -87,7 +97,16 @@
# This is not special, this is just flakes
packages = rec {
default = rustpkg;
rustpkg = naersk-lib.buildPackage ./.;
rustpkg = naersk-lib.buildPackage {
src = ./.;
buildInputs = with pkgs; [
sword
];
nativeBuildInputs = with pkgs; [
pkg-config
];
doCheck = true;
};
};
};
};