-
Notifications
You must be signed in to change notification settings - Fork 19
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
cross-systems usage with colmena & --build-on-host #6
Comments
Oh good point, I haven't actually run into this myself since I usually build on my local machine.
Copying all secret derivations to your own substituter would also work, but that may or may not be desirable depending on your infrastructure setup.
Certainly, contributions are always welcome! :D I can think of either extending the UPDATE: The resulting derivation can now be targeted via |
I think I'm running into a similar issue when deploying from |
@NyCodeGHG Your issue is probably the following: Your local system must build the derivation containing the rekeyed secrets for your target host, since it's the only system that has access to your secret key. But initiating the true build process on the remote means that the remote doesn't know about your local system at all, so naturally it cannot fetch the rekeyed secrets in any way. There are several workarounds/solutions to this:
There may also exist other solutions that I haven't thought about yet. Also please beware that manual copying can lead to caveats when a rekeyed derivation is rebuild without changing it's hash. This may happen if you choose to use a dummy secret value and later rekeying again to use the true secrets. In that case any existing derivations must be replaced in the store, which agenix-rekey does automatically for your local machine but it can't do that for your target machine since it doesn't know about them. This means in certain rare situations you might need to delete and re-copy the derivation to your remote. I seem to mostly stick to options 1/2 on my local infrastructure. I'll build locally what I can, and if I need more build power I add the remotes as builders to my local machine. |
@phaer @NyCodeGHG There's been a development in this regard, I've introduced a new local storage mode for rekeyed secrets. When using this new local storage mode, all rekeyed secrets will be stored locally in your flake's repository which removes the requirement to build a derivation at all, meaning there should be no more shenanigans with remote builders or CI/CD. You can refer to the Storage Modes in the readme if you want to try this :) |
Hello,
Thanks for this interesting project & and your general work in the Nix ecosystem!
I am deploying from
aarch64-darwin
tox86_64-linux
with colmena andforceRekeyOnSystem = "aarch64-darwin"
, and ran into the problem that--build-on-target
stops working as colmena wouldn't copy rekeyed secret.Curios if others here found better workarounds than me?
It works if I either use a remote-builder and leave out ´--build-on-target
or if I copy the secrets manually via
nix copy. While doing so, I found that it's hard to know which derivation belongs to which host in the output of
nix run .#rekey -- --show-out-paths`. Would a PR for that be welcome?The text was updated successfully, but these errors were encountered: