-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
60 lines (54 loc) · 1.86 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
description = "Flake for building Mado packages";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
os = if pkgs.stdenv.hostPlatform.isDarwin then "macOS" else "Linux-gnu";
arch = if pkgs.stdenv.hostPlatform.isAarch64 then "arm64" else "x86_64";
in
{
packages = {
mado = pkgs.stdenv.mkDerivation rec {
pname = "mado";
version = "0.2.2";
src = pkgs.fetchzip {
stripRoot = false;
url = "https://github.com/akiomik/mado/releases/download/v${version}/mado-${os}-${arch}.tar.gz";
sha256 =
{
x86_64-linux = "1lbh7fz7971ci3rlh65i466jxif63zk84lnb5dy9dh3kwggx66w2";
aarch64-linux = "1cjvynal6sw2dbmdjlij7mw2y7bjf1sny11zf3kjx6xldxi1bp6j";
x86_64-darwin = "1r2amqjqq3arkigvyyy7psgqr9yvjb800g9i1mwhh9j141pcwmks";
aarch64-darwin = "0rr482k9w1w5lhfn0si5qg1cabwf16n1nzqzyd1mi3rszf6974d7";
}
.${system} or (throw "unsupported system ${system}");
};
installPhase = ''
mkdir -p $out/bin
cp mado $out/bin/
'';
meta = with pkgs.lib; {
homepage = "https://github.com/akiomik/mado";
description = "A fast Markdown linter written in Rust";
license = licenses.asl20;
sourceProvenance = [ sourceTypes.binaryNativeCode ];
};
};
default = self.packages.${system}.mado;
};
formatter = pkgs.nixfmt-rfc-style;
}
);
}