Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Only put common stuff in the templated default.nix #456

Open
NickLarsenNZ opened this issue Oct 29, 2024 · 1 comment
Open

chore: Only put common stuff in the templated default.nix #456

NickLarsenNZ opened this issue Oct 29, 2024 · 1 comment

Comments

@NickLarsenNZ
Copy link
Member

NickLarsenNZ commented Oct 29, 2024

note(non-blocking): We should only put common stuff in the templated default.nix. All other operator-specific stuff should not be templated and should live in the operator repositories. @NickLarsenNZ will look into that.

Originally posted by @Techassi in #455 (comment)

@NickLarsenNZ
Copy link
Member Author

We currently have a bunch of operator-specific overrides here:

defaultCrateOverrides = pkgs.defaultCrateOverrides // {
prost-build = attrs: {
buildInputs = [ pkgs.protobuf ];
};
tonic-reflection = attrs: {
buildInputs = [ pkgs.rustfmt ];
};
csi-grpc = attrs: {
nativeBuildInputs = [ pkgs.protobuf ];
};
stackable-secret-operator = attrs: {
buildInputs = [ pkgs.protobuf pkgs.rustfmt ];
};
krb5-sys = attrs: {
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.krb5 ];
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
# Clang's resource directory is located at ${pkgs.clang.cc.lib}/lib/clang/<version>.
# Starting with Clang 16, only the major version is used for the resource directory,
# whereas the full version was used in prior Clang versions (see
# https://github.com/llvm/llvm-project/commit/e1b88c8a09be25b86b13f98755a9bd744b4dbf14).
# The clang wrapper ${pkgs.clang} provides a symlink to the resource directory, which
# we use instead.
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang}/resource-root/include";
};
libgssapi-sys = attrs: {
buildInputs = [ pkgs.krb5 ];
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang}/resource-root/include";
};
};

Hopefully there is a way we can just include them from another non-templated file (eg: overides.nix), and if it doesn't exist, default to {}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant