Skip to content

Commit b5f67ac

Browse files
authored
nix-forecast: init at 0.1.0 (#354661)
2 parents e79b717 + f323f1c commit b5f67ac

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
lib,
3+
fetchFromGitHub,
4+
installShellFiles,
5+
makeBinaryWrapper,
6+
nix,
7+
rustPlatform,
8+
versionCheckHook,
9+
}:
10+
11+
rustPlatform.buildRustPackage rec {
12+
pname = "nix-forecast";
13+
version = "0.1.0";
14+
15+
src = fetchFromGitHub {
16+
owner = "getchoo";
17+
repo = "nix-forecast";
18+
rev = "refs/tags/v${version}";
19+
hash = "sha256-jfS7DXEIVHihC0/kH9W8ZJDOjoWuxdRvLMfzknElvrg=";
20+
};
21+
22+
cargoHash = "sha256-EHqHdcMI1K7DqhmFfr0ipfAsyM7cP9/22bMs4uIV2To=";
23+
24+
nativeBuildInputs = [
25+
installShellFiles
26+
makeBinaryWrapper
27+
];
28+
29+
doInstallCheck = true;
30+
nativeInstallCheckInputs = [ versionCheckHook ];
31+
32+
# NOTE: Yes, we specifically need Nix. Lix does not have the newer
33+
# `path-info --json` output used internally
34+
postInstall = ''
35+
wrapProgram $out/bin/nix-forecast --prefix PATH : ${lib.makeBinPath [ nix ]}
36+
37+
installShellCompletion --cmd nix-forecast \
38+
--bash completions/nix-forecast.bash \
39+
--fish completions/nix-forecast.fish \
40+
--zsh completions/_nix-forecast
41+
'';
42+
43+
env = {
44+
COMPLETION_DIR = "completions";
45+
};
46+
47+
meta = {
48+
description = "Check the forecast for today's Nix builds";
49+
homepage = "https://github.com/getchoo/nix-forecast";
50+
changelog = "https://github.com/getchoo/nix-forecast/releases/tag/${version}";
51+
license = lib.licenses.mpl20;
52+
maintainers = with lib.maintainers; [ getchoo ];
53+
mainProgram = "nix-forecast";
54+
};
55+
}

0 commit comments

Comments
 (0)