-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathflake.nix
More file actions
60 lines (54 loc) · 1.86 KB
/
Copy pathflake.nix
File metadata and controls
60 lines (54 loc) · 1.86 KB
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.3.1";
src = pkgs.fetchzip {
stripRoot = false;
url = "https://github.com/akiomik/mado/releases/download/v${version}/mado-${os}-${arch}.tar.gz";
sha256 =
{
x86_64-linux = "1nwmvgl3dy89n543mip9y9rdrw70rrakz196706lnvphy87q2r79";
aarch64-linux = "0phxxgfz7ddvlxjry2216k2sjfsbv7ma9v6w9h57f1aa8gxk7q15";
x86_64-darwin = "0f0mfv152xfq4cg41bf9fnzpjgbxbn1m0aflm7kzph4yh38msl3c";
aarch64-darwin = "0dfdg2d8znnvzwvf1qrkk0iv9jndc8ksqyi81vdzkzlifqjy2p0i";
}
.${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;
}
);
}