-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflake.nix
More file actions
89 lines (79 loc) · 2.17 KB
/
flake.nix
File metadata and controls
89 lines (79 loc) · 2.17 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
description = "Aperture – Dynamic CLI generator for OpenAPI specifications";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs =
{ self, nixpkgs }:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
mkAperture =
pkgs:
{ pname ? "aperture", features ? [ ] }:
pkgs.rustPlatform.buildRustPackage rec {
inherit pname;
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
src = pkgs.lib.cleanSource ./.;
cargoLock.lockFile = ./Cargo.lock;
buildFeatures = features;
# Tests require network access (wiremock) which is unavailable
# in the Nix build sandbox. They are validated separately in CI.
doCheck = false;
meta = {
description = "Dynamic CLI generator for OpenAPI specifications";
homepage = "https://github.com/kioku/aperture";
license = pkgs.lib.licenses.mit;
mainProgram = "aperture";
};
};
in
{
packages = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
build = mkAperture pkgs;
in
{
default = build { };
aperture-jq = build {
pname = "aperture-jq";
features = [ "jq" ];
};
aperture-openapi31 = build {
pname = "aperture-openapi31";
features = [ "openapi31" ];
};
aperture-full = build {
pname = "aperture-full";
features = [
"jq"
"openapi31"
];
};
}
);
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell {
buildInputs = [
pkgs.rustc
pkgs.cargo
pkgs.clippy
pkgs.rustfmt
];
};
}
);
};
}