journal-forwarder 1.183.0

Utility for forward systemd-journald logs to an HTTP endpoint.
{
	nixpkgs ? import <nixpkgs> {},

	lib ? nixpkgs.lib,
	pkgs ? nixpkgs.pkgs,

	commit ? builtins.getEnv "CI_COMMIT_SHA",
	version ? if commit == "" then "dev" else lib.substring 0 8 commit,
}: let
	buildInputs = with pkgs; [
		openssl
		systemd
	];
	nativeBuildInputs = with pkgs; [
		pkg-config
	];
in {
	rust = pkgs.rustPlatform.buildRustPackage {
		pname = "journal-forwarder";
		version = version;

		cargoLock.lockFile = ./Cargo.lock;
		src = lib.fileset.toSource {
			root = ./.;
			fileset = lib.fileset.unions [
				./Cargo.lock
				./Cargo.toml
				./src
			];
		};

		inherit buildInputs nativeBuildInputs;
	};

	shell = pkgs.mkShell {
		buildInputs = buildInputs;
		nativeBuildInputs = nativeBuildInputs ++ (with pkgs; [
			cargo
		]);
	};
}