Skip to content

Commit

Permalink
feat: Allow passing arbitrary build arguments to crane
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Apr 17, 2024
1 parent 8c8aee6 commit 5bf77e5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions nix/modules/flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ in
options = {
perSystem = mkPerSystemOption
({ config, self', pkgs, system, ... }: {
imports = [
{
options.rust-project.crane.args = lib.mkOption {
default = { };
type = lib.types.submodule {
freeformType = lib.types.attrsOf lib.types.raw;
};
description = ''
Aguments to pass to crane's `buildPackage` and `buildDepOnly`
'';
};
}
];
options = {
# TODO: Multiple projects
# TODO: Workspace crates
Expand Down Expand Up @@ -62,9 +75,8 @@ in

# Crane builder
craneBuild = rec {
args = {
args = crane.args // {
inherit src;
inherit (crane.args) buildInputs nativeBuildInputs;
pname = name;
version = version;
# glib-sys fails to build on linux without this
Expand Down

0 comments on commit 5bf77e5

Please sign in to comment.