Skip to content

Commit 0a816e1

Browse files
authored
omnix: init at 1.0.3 (NixOS#385761)
2 parents e5dde66 + 84f6e47 commit 0a816e1

File tree

1 file changed

+135
-0
lines changed

1 file changed

+135
-0
lines changed

pkgs/by-name/om/omnix/package.nix

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
lib,
3+
rustPlatform,
4+
fetchFromGitHub,
5+
pkg-config,
6+
installShellFiles,
7+
openssl,
8+
cachix,
9+
versionCheckHook,
10+
nix-update-script,
11+
}:
12+
rustPlatform.buildRustPackage (finalAttrs: {
13+
pname = "omnix";
14+
version = "1.0.3";
15+
16+
src = fetchFromGitHub {
17+
owner = "juspay";
18+
repo = "omnix";
19+
tag = finalAttrs.version;
20+
hash = "sha256-vpjYVfs3gS+gkMSgeR3BH4hTLmi/fkWHmCKvSjFq7cg=";
21+
};
22+
23+
useFetchCargoVendor = true;
24+
cargoHash = "sha256-Yv5X/lZdQ2vdxLzSPeLx5TNapKtCIQNc6Wy0I+4q4CI=";
25+
26+
nativeBuildInputs = [
27+
installShellFiles
28+
pkg-config
29+
];
30+
31+
buildInputs = [
32+
openssl
33+
];
34+
35+
# Note: The ENVs below will have to be kept in sync with <https://github.com/juspay/omnix/blob/main/nix/envs/default.nix>
36+
env = {
37+
OMNIX_SOURCE = finalAttrs.src;
38+
CACHIX_BIN = lib.getExe cachix;
39+
OM_INIT_REGISTRY = "path:${finalAttrs.src}/crates/omnix-init/registry";
40+
DEVOUR_FLAKE = fetchFromGitHub {
41+
owner = "srid";
42+
repo = "devour-flake";
43+
rev = "9fe4db872c107ea217c13b24527b68d9e4a4c01b";
44+
hash = "sha256-R7MHvTh5fskzxNLBe9bher+GQBZ8ZHjz75CPQG3fSRI=";
45+
};
46+
NIX_SYSTEMS =
47+
let
48+
x86_64-linux = fetchFromGitHub {
49+
owner = "nix-systems";
50+
repo = "x86_64-linux";
51+
rev = "2ecfcac5e15790ba6ce360ceccddb15ad16d08a8";
52+
hash = "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=";
53+
};
54+
aarch64-linux = fetchFromGitHub {
55+
owner = "nix-systems";
56+
repo = "aarch64-linux";
57+
rev = "aa1ce1b64c822dff925d63d3e771113f71ada1bb";
58+
hash = "sha256-1Zp7TRYLXj4P5FLhQ8jBChrgAmQxR3iTypmWf9EFTnc=";
59+
};
60+
x86_64-darwin = fetchFromGitHub {
61+
owner = "nix-systems";
62+
repo = "x86_64-darwin";
63+
rev = "db0463cce4cd60fb791f33a83d29a1ed53edab9b";
64+
hash = "sha256-+xT9B1ZbhMg/zpJqd00S06UCZb/A2URW9bqqrZ/JTOg=";
65+
};
66+
aarch64-darwin = fetchFromGitHub {
67+
owner = "nix-systems";
68+
repo = "aarch64-darwin";
69+
rev = "75e6c6912484d28ebba5769b794ffa4aff653ba2";
70+
hash = "sha256-PHVNQ7y0EQYzujQRYoRdb96K0m1KSeAjSrbz2b75S6Q=";
71+
};
72+
in
73+
builtins.toJSON {
74+
inherit
75+
x86_64-linux
76+
aarch64-linux
77+
x86_64-darwin
78+
aarch64-darwin
79+
;
80+
};
81+
FALSE_FLAKE = fetchFromGitHub {
82+
owner = "boolean-option";
83+
repo = "false";
84+
rev = "d06b4794a134686c70a1325df88a6e6768c6b212";
85+
hash = "sha256-vLy8GQr0noEcoA+jX24FgUVBA/poV36zDWAUChN3hIY=";
86+
};
87+
TRUE_FLAKE = fetchFromGitHub {
88+
owner = "boolean-option";
89+
repo = "true";
90+
rev = "6ecb49143ca31b140a5273f1575746ba93c3f698";
91+
hash = "sha256-L9eyTL7njtPBUYmZRYFKCzQFDgua9U9oE7UwCzjZfl8=";
92+
};
93+
INSPECT_FLAKE = fetchFromGitHub {
94+
owner = "juspay";
95+
repo = "inspect";
96+
rev = "e82e65949d2ba5283865609b8728c50ebe7573e3";
97+
hash = "sha256-GTxRovvYWYn2/LDvjA73YttGuqvtKaOFZfOR9YxtST0=";
98+
};
99+
DEFAULT_FLAKE_SCHEMAS = "path:${finalAttrs.src}/nix/flake-schemas";
100+
FLAKE_METADATA = "path:${finalAttrs.src}/crates/nix_rs/src/flake/functions/metadata";
101+
FLAKE_ADDSTRINGCONTEXT = "path:${finalAttrs.src}/crates/nix_rs/src/flake/functions/addstringcontext";
102+
};
103+
104+
# Requires networking and/or nix sandbox disabled
105+
doCheck = false;
106+
107+
postInstall = ''
108+
installShellCompletion --cmd om \
109+
--bash <($out/bin/om completion bash) \
110+
--fish <($out/bin/om completion fish) \
111+
--zsh <($out/bin/om completion zsh)
112+
'';
113+
114+
nativeInstallCheckInputs = [
115+
versionCheckHook
116+
];
117+
versionCheckProgram = "${placeholder "out"}/bin/om";
118+
versionCheckProgramArg = "--version";
119+
doInstallCheck = true;
120+
121+
passthru = {
122+
updateScript = nix-update-script { };
123+
};
124+
125+
meta = {
126+
description = "Nix companion to improve developer experience";
127+
homepage = "https://omnix.page";
128+
changelog = "https://omnix.page/history.html#${finalAttrs.version}";
129+
maintainers = with lib.maintainers; [
130+
shivaraj-bh
131+
];
132+
license = lib.licenses.agpl3Only;
133+
mainProgram = "om";
134+
};
135+
})

0 commit comments

Comments
 (0)