about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/admin/afterburn/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/admin/afterburn/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/admin/afterburn/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/admin/afterburn/default.nix b/nixpkgs/pkgs/tools/admin/afterburn/default.nix
new file mode 100644
index 000000000000..0d3cd957324b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/admin/afterburn/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, openssl, pkg-config, fetchFromGitHub, rustPlatform }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "afterburn";
+  version = "4.6.0";
+
+  src = fetchFromGitHub {
+    owner = "coreos";
+    repo = "afterburn";
+    rev = "v${version}";
+    sha256 = "1afy9spm8g8bq2pw44dkrkfz4aimhdz4h5lg9iafby832v5dxbqj";
+  };
+
+  cargoSha256 = "035k55l0hs39a87iq8yxx4i87829kzvvmlgph0adjfmsppz5b8k1";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ openssl ];
+
+  patchPhase = ''
+    substituteInPlace ./systemd/afterburn-checkin.service --replace /usr/bin $out/bin
+    substituteInPlace ./systemd/afterburn-firstboot-checkin.service --replace /usr/bin $out/bin
+    substituteInPlace ./systemd/afterburn-sshkeys@.service.in --replace /usr/bin $out/bin
+    substituteInPlace ./systemd/afterburn.service --replace /usr/bin $out/bin
+  '';
+
+  postInstall = ''
+    DEFAULT_INSTANCE=root PREFIX= DESTDIR=$out make install-units
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/coreos/ignition";
+    description = "This is a small utility, typically used in conjunction with Ignition, which reads metadata from a given cloud-provider and applies it to the system.";
+    license = licenses.asl20;
+    maintainers = [ maintainers.arianvp ];
+    platforms = [ "x86_64-linux" ];
+  };
+}