Skip to content

Commit 94e7e16

Browse files
committed
countryfetch: init at 0.1.9
1 parent 81fd4c6 commit 94e7e16

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+
rustPlatform,
4+
fetchFromGitHub,
5+
yq,
6+
pkg-config,
7+
openssl,
8+
versionCheckHook,
9+
nix-update-script,
10+
}:
11+
12+
rustPlatform.buildRustPackage (finalAttrs: {
13+
pname = "countryfetch";
14+
version = "0.1.9";
15+
16+
src = fetchFromGitHub {
17+
owner = "nik-rev";
18+
repo = "countryfetch";
19+
tag = "v${finalAttrs.version}";
20+
hash = "sha256-KdFgY54vXLmq6IZfJzZ1IeZ2eQuNJoCRZUV3rVuPpcY=";
21+
};
22+
23+
postPatch = ''
24+
tomlq -ti '.dependencies.openssl.features[] |= select(.!="vendored")' countryfetch/Cargo.toml
25+
'';
26+
27+
useFetchCargoVendor = true;
28+
cargoHash = "sha256-XJI9k/5hdak8p0/J/x9u6lqJu/DIbX93Wwm3LALkAAw=";
29+
30+
env.RUSTC_BOOTSTRAP = 1;
31+
32+
nativeBuildInputs = [
33+
pkg-config
34+
yq # for `tomlq`
35+
];
36+
37+
buildInputs = [ openssl ];
38+
39+
cargoBuildFlags = [ "--package=countryfetch" ];
40+
41+
nativeInstallCheckInputs = [ versionCheckHook ];
42+
versionCheckProgramArg = "--version";
43+
doInstallCheck = true;
44+
45+
passthru.updateScript = nix-update-script { };
46+
47+
meta = {
48+
description = "Command-line tool similar to Neofetch for obtaining information about your country";
49+
homepage = "https://github.com/nik-rev/countryfetch";
50+
changelog = "https://github.com/nik-rev/countryfetch/blob/v${finalAttrs.version}/CHANGELOG.md";
51+
license = lib.licenses.mit;
52+
maintainers = with lib.maintainers; [ defelo ];
53+
mainProgram = "countryfetch";
54+
};
55+
})

0 commit comments

Comments
 (0)