Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
88 lines
2.0 KiB
Nix
88 lines
2.0 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
rustPlatform,
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
pkg-config,
|
|
alsa-lib,
|
|
versionCheckHook,
|
|
bacon,
|
|
buildPackages,
|
|
nix-update-script,
|
|
|
|
withSound ? false,
|
|
}:
|
|
|
|
let
|
|
soundDependencies =
|
|
lib.optionals stdenv.hostPlatform.isLinux [
|
|
alsa-lib
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
# bindgenHook is only included on darwin as it is needed to build `coreaudio-sys`, a darwin-specific crate
|
|
rustPlatform.bindgenHook
|
|
];
|
|
in
|
|
|
|
rustPlatform.buildRustPackage (finalAttrs: {
|
|
pname = "bacon";
|
|
version = "3.18.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Canop";
|
|
repo = "bacon";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-YdlNJWsKGkXvpcA8un3eNfLVBlU6nalVyO/dhDAQF9k=";
|
|
};
|
|
|
|
cargoHash = "sha256-vGrWs8OkoqPO/oEiGZXrMxIKVA3u4gsaXgF1QUQT3kw=";
|
|
|
|
buildFeatures = lib.optionals withSound [
|
|
"sound"
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
]
|
|
++ lib.optionals withSound [
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = lib.optionals withSound soundDependencies;
|
|
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
versionCheckProgramArg = "--version";
|
|
doInstallCheck = true;
|
|
|
|
postInstall =
|
|
let
|
|
bacon = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/bacon";
|
|
in
|
|
lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
|
|
installShellCompletion --cmd bacon \
|
|
--bash <(COMPLETE=bash ${bacon}) \
|
|
--fish <(COMPLETE=fish ${bacon}) \
|
|
--zsh <(COMPLETE=zsh ${bacon})
|
|
'';
|
|
|
|
passthru = {
|
|
tests = {
|
|
withSound = bacon.override { withSound = true; };
|
|
};
|
|
updateScript = nix-update-script { };
|
|
};
|
|
|
|
meta = {
|
|
description = "Background rust code checker";
|
|
mainProgram = "bacon";
|
|
homepage = "https://github.com/Canop/bacon";
|
|
changelog = "https://github.com/Canop/bacon/blob/v${finalAttrs.version}/CHANGELOG.md";
|
|
license = lib.licenses.agpl3Only;
|
|
maintainers = with lib.maintainers; [
|
|
FlorianFranzen
|
|
matthiasbeyer
|
|
];
|
|
};
|
|
})
|