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

Make it possible to not rebuild deploy-rs #207

Merged
merged 1 commit into from May 11, 2023

Conversation

Flakebi
Copy link
Contributor

@Flakebi Flakebi commented Apr 19, 2023

Use the deploy-rs from the final packages set. This can avoid rebuilding deploy-rs when using it in a nixos config. It can use the version cached in nixpkgs.

Also add instructions to the readme on how to craft an overlay that uses nixpkgs deploy-rs.

This should fix #163.

Use the deploy-rs from the final packages set. This can avoid rebuilding
deploy-rs when using it in a nixos config. It can use the version cached
in nixpkgs.

Also add instructions to the readme on how to craft an overlay that uses
nixpkgs deploy-rs.
@rvem
Copy link
Member

rvem commented May 11, 2023

Thanks!

@rvem rvem merged commit c801899 into serokell:master May 11, 2023
@Flakebi Flakebi deleted the nixpkgs-cache branch May 11, 2023 09:33
@Stunkymonkey
Copy link

I am seeing the checks are disabled. Is this intentional? Or does it not make sense?

@rvem
Copy link
Member

rvem commented May 22, 2023

Is this intentional?

Hmm, not really, not sure why checks weren't triggered for external contributor PR

@wmertens
Copy link

wmertens commented Jun 14, 2023

@Flakebi question, how does this overlay work? So there's the overlay from the flake and then there's this expression:

  (self: super: { deploy-rs = { inherit (pkgs) deploy-rs; lib = super.deploy-rs.lib; }; })

the way I read the spec is that this function should return an attrset of packages, however it's returning {deploy-rs; lib} as a "package". Is this an undocumented feature of overlays?

@Flakebi
Copy link
Contributor Author

Flakebi commented Jun 14, 2023

There is nothing undocumented There is no hidden feature of overlays here.
The “package”, which is actually a set, not a derivation, as you noticed, is the structure defined in this flake.
The overlay defines the same set as this flake, keeping the lib attribute intact and overriding the deploy-rs attribute, which is the actual package.

This structure is defined here in the flake:

deploy-rs/flake.nix

Lines 31 to 42 in 724463b

deploy-rs = {
deploy-rs = final.rustPlatform.buildRustPackage (darwinOptions // {
pname = "deploy-rs";
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
}) // { meta.description = "A Simple multi-profile Nix-flake deploy tool"; };
lib = rec {

@wmertens
Copy link

Thank you for the clarification. That's mighty confusing 😅

@teutat3s
Copy link

teutat3s commented Jan 11, 2024

Thank you for this!

Is there a way to make this work when deploy host system != target host system? Currently the overlay is hard-coded to x86_64-linux and that causes an "exec format error" when trying to deploy to a aarch64-linux host.

Or is using the flake the only way in such a case?

@rvem
Copy link
Member

rvem commented Jan 11, 2024

Is there a way to make this work when deploy host system != target host system?

I think the only viable way at the moment is to use --remote-build if the target server is powerful enough to perform the profile rebuild

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

Successfully merging this pull request may close these issues.

Have an officially hosted and/or endorsed binary cache for deploy-rs
5 participants