nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 installShellFiles,
5 makeBinaryWrapper,
6 nix,
7 nix-update-script,
8 rustPlatform,
9 versionCheckHook,
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "nix-forecast";
14 version = "0.4.0";
15
16 src = fetchFromGitHub {
17 owner = "getchoo";
18 repo = "nix-forecast";
19 tag = "v${version}";
20 hash = "sha256-GTINiV+oHmu1/DmQsE7UjfAFFtH26LK35TveW437lPA=";
21 };
22
23 cargoHash = "sha256-FQph9QOc0JrVjdilUxjRc77/obICK7fgzcDuqAoE2cs=";
24
25 nativeBuildInputs = [
26 installShellFiles
27 makeBinaryWrapper
28 ];
29
30 # TODO: Re-enable next update
31 # doInstallCheck = true;
32 nativeInstallCheckInputs = [ versionCheckHook ];
33
34 # NOTE: Yes, we specifically need Nix. Lix does not have the newer
35 # `path-info --json` output used internally
36 postInstall = ''
37 wrapProgram $out/bin/nix-forecast --prefix PATH : ${lib.makeBinPath [ nix ]}
38
39 installShellCompletion --cmd nix-forecast \
40 --bash completions/nix-forecast.bash \
41 --fish completions/nix-forecast.fish \
42 --zsh completions/_nix-forecast
43 '';
44
45 env = {
46 COMPLETION_DIR = "completions";
47 };
48
49 passthru = {
50 updateScript = nix-update-script { };
51 };
52
53 meta = {
54 description = "Check the forecast for today's Nix builds";
55 homepage = "https://github.com/getchoo/nix-forecast";
56 changelog = "https://github.com/getchoo/nix-forecast/releases/tag/v${version}";
57 license = lib.licenses.mpl20;
58 maintainers = with lib.maintainers; [ getchoo ];
59 mainProgram = "nix-forecast";
60 };
61}