-
Notifications
You must be signed in to change notification settings - Fork 8
/
flake.nix
37 lines (31 loc) · 1.15 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
{
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};
lastMod = self.lastModifiedDate or self.lastModified or "19700101";
in rec {
devShells.default = pkgs.mkShell { packages = with pkgs; [ nodejs ]; };
packages.default = pkgs.buildNpmPackage rec {
pname = "sweater-comb";
version = builtins.substring 0 8 lastMod;
src = ./.;
npmDepsHash = "sha256-IMHX8KqW8kGdFxHgU0JcBwKByVw9U78pNDug12x63r0=";
npmBuildScript = "build";
nativeBuildInputs = [ pkgs.nodePackages.node-gyp pkgs.python3 ];
postInstall = ''
mv $out/bin/@snyk/sweater-comb $out/bin
rmdir $out/bin/@snyk
'';
meta = {
description = "OpenAPI linting rules for Snyk APIs";
homepage = "https://github.com/snyk/sweater-comb";
platforms = flake-utils.lib.defaultSystems;
};
};
});
}