Skip to content

--file argument analogous to nix build & friends #320

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stuebinm
Copy link
Contributor

@stuebinm stuebinm commented May 4, 2025

This adds a --file option, which allows using deploy in repositories which are not nix flakes. deploy-rs already has support for falling back to a non-flake version of its logic in case the nix available in $PATH doesn't have the flake experimental feature flag enabled. However, that's an "if and only if"-situation: if the nix is flakes-enabled, there's no way to use the non-flake version. This works well for setups which use nix flakes, but provides a flake-compat default.nix fallback, but prevents use of deploy-rs in setups which do not use flakes at all but rely on another source-managing tool such as niv or npins.

--file takes as argument a path, and --targets and other options continue to work as expected; remote builds also work assuming a new enough nix on the target host. I've also added tests for local & remote builds (and fixed the name of the non-flake-build test; looks like i forgot that when I introduced it in #272)

stuebinm added 3 commits May 4, 2025 19:19
Adds a --file option, which forces the non-flake build logic to always
run, regardless of whether or not the current nix is flake-enabled.

This allows using deploy-rs with repositories which do not use flakes
at all but use an external source-managing tool such as niv or npins
(the previous behaviour could only really support flake-based
repositories with a flake-compat fallback defined in default.nix).
This does two things:
 - lift the restriction on remote builds with legacy nix; the logic
   remains the same and we use `nix --experimental-features nix-command'
   to call Nix
 - change the logic on build drivers: if we do a remote build, use
   the nix-command setup even if we're not using a flake-enabled
   nix (this still assumes the remote host has a nix version > 2.4)
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.

1 participant