-
Notifications
You must be signed in to change notification settings - Fork 40
/
flake.nix
73 lines (64 loc) · 1.93 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
61
62
63
64
65
66
67
68
69
70
71
72
73
{
description = "Linter for PostgreSQL, focused on migrations";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ overlay ];
};
overlay = (final: prev:
let
inherit (prev) lib;
in
{
squawk = final.rustPlatform.buildRustPackage {
pname = "squawk";
version = "1.4.0";
cargoLock = {
lockFile = ./Cargo.lock;
};
src = ./.;
nativeBuildInputs = with final; [
pkg-config
rustPlatform.bindgenHook
];
buildInputs = with final; [
libiconv
openssl
] ++ lib.optionals final.stdenv.isDarwin (with final.darwin.apple_sdk.frameworks; [
CoreFoundation
Security
]);
LIBPG_QUERY_PATH = final.libpg_query;
meta = with lib; {
description = "Linter for PostgreSQL, focused on migrations";
homepage = "https://github.com/sbdchd/squawk";
license = licenses.gpl3Only;
platforms = platforms.all;
};
};
});
in
{
packages = {
squawk = pkgs.squawk;
};
defaultPackage = self.packages.${system}.squawk;
checks = self.packages;
# for debugging
inherit pkgs;
devShell = pkgs.squawk.overrideAttrs (old: {
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
nativeBuildInputs = old.nativeBuildInputs ++ (with pkgs; [
cargo-insta
clippy
rustfmt
]);
});
});
}