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
Afterburn module #68702
Afterburn module #68702
Conversation
@@ -0,0 +1,39 @@ | |||
{ stdenv, lib, openssl, pkg-config, fetchCrate, rustPlatform }: | |||
|
|||
(rustPlatform.buildRustPackage rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to avoid the use of buildRustPackage
in Nixpkgs. It abuses fixed-output derivations and may stop working in the future (NixOS/nix#2270).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some kind of cargo2nix tool I can use instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is carnix, which has different problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TenX has a cargo2nix tool https://github.com/tenx-tech/cargo2nix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edolstra now that Nix also uses some rust, do you have some new insights in how you would like to see these kind of things one in a reproducible manner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arianvp This isn't a nixpkgs-maintainer perspective, but FWIW, I've had the best experience with crate2nix, which uses the nixpkgs buildRustCrate
and seems to work a lot better than carnix. The other tool I've seen people have good experiences with is naersk (builds on top of cargo, unlike crate2nix). I think crate2nix output should be suitable for upstreaming to nixpkgs.
I will close this PR. I don't see a clear way forward how to package this, and no alternatives were given by the reviewers |
I actually think it does not matter if we have one |
needsFirstBootCheckin = provider: provider == "packet"; | ||
in | ||
{ | ||
options = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- options
+ options.services.afterburn
@@ -0,0 +1,48 @@ | |||
{ config, pkgs, lib }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- { config, pkgs, lib }:
+ { config, pkgs, lib, ... }:
If you are still interested in having this PR merged, I'd like to help review and merge it. Given that https://github.com/NixOS/nixpkgs/search?q=buildRustPackage has 241 matches, and new |
cc @arianvp |
Thanks. I will have a look again. |
@arianvp can you rebase this to latest master (which includes the |
This adds the services.afterburn.{enable,provider} options.
(cherry picked from commit 444790a5383e2f4192338eab59144e2e95153984)
2b1c854
to
e336178
Compare
I rebased this to master, and started dogfooding the openstack image config with it. It doesn't work yet, and I'm not sure if/how we're gonna use the upstream-provided systemd units. Also, there's the I'm very much in favour of using something like this over our own, semistable and slightly differing-per-provider metadata server fetcher shellscripts - also, it's less bloated than cloud-init, making it more suitable for minimal images. |
I marked this as stale due to inactivity. → More info |
Currently based on #68680
will rebase once that is merged.
This is also WIP. I probably want to add some tests.
Afterburn will allow us to unify the virtual machine setup code for all our cloud provider images.
It allows us to get metadata in a unified way, set ssh keys in a unified way and generate systemd-networkd network configs on the fly.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @