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

nix configuration for CLI plugin #2

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
# arion-compose.nix.
mongodb-connector-workspace = final.callPackage ./nix/mongodb-connector-workspace.nix { }; # builds all packages in this repo
mongodb-connector = final.mongodb-connector-workspace.override { package = "mongodb-connector"; }; # override `package` to build one specific crate
mongodb-cli-plugin = final.mongodb-connector-workspace.override { package = "mongodb-cli-plugin"; };
v3-engine = final.callPackage ./nix/v3-engine.nix { src = v3-engine-source; };
v3-e2e-testing = final.callPackage ./nix/v3-e2e-testing.nix { src = v3-e2e-testing-source; database-to-test = "mongodb"; };
inherit v3-e2e-testing-source; # include this source so we can read files from it in arion-compose configs
Expand Down Expand Up @@ -170,6 +171,16 @@
architecture = "arm64";
};

# CLI plugin packages with cross-compilation options
mongodb-cli-plugin = pkgs.mongodb-cli-plugin.override { staticallyLinked = true; };
mongodb-cli-plugin-x86_64-linux = pkgs.pkgsCross.x86_64-linux.mongodb-cli-plugin.override { staticallyLinked = true; };
mongodb-cli-plugin-aarch64-linux = pkgs.pkgsCross.aarch64-linux.mongodb-cli-plugin.override { staticallyLinked = true; };

# CLI plugin docker images
mongodb-cli-plugin-docker = pkgs.callPackage ./nix/docker-cli-plugin.nix { };
mongodb-cli-plugin-docker-x86_64-linux = pkgs.pkgsCross.x86_64-linux.callPackage ./nix/docker-cli-plugin.nix { };
mongodb-cli-plugin-docker-aarch64-linux = pkgs.pkgsCross.aarch64-linux.callPackage ./nix/docker-cli-plugin.nix { };

publish-docker-image = pkgs.writeShellApplication {
name = "publish-docker-image";
runtimeInputs = with pkgs; [ coreutils skopeo ];
Expand Down
12 changes: 12 additions & 0 deletions nix/docker-cli-plugin.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ name ? "ghcr.io/hasura/mongodb-cli-plugin"
, mongodb-cli-plugin
, dockerTools
}:

dockerTools.buildLayeredImage {
inherit name;
created = "now";
config = {
Entrypoint = [ "${mongodb-cli-plugin}/bin/hasura-mongodb" ];
};
}
Loading