-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
flake.nix
55 lines (51 loc) · 1.43 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
{
description = "Semantic linter for Nixpkgs using tree-sitter";
inputs = {
naersk = {
url = "github:nix-community/naersk/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, utils, naersk, ... }:
let
inherit (nixpkgs) lib;
nixpkgsLintLambda = pkgs':
let
pkgs = pkgs'.__splicedPackages;
naersk-lib = pkgs.callPackage naersk { };
in
naersk-lib.buildPackage {
pname = "nixpkgs-lint";
root = ./.;
};
in
utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages = {
default = self.packages."${system}".nixpkgs-lint;
nixpkgs-lint = nixpkgsLintLambda pkgs;
};
apps.default = utils.lib.mkApp {
drv = self.packages."${system}".default;
};
devShells.default = with pkgs; mkShell {
nativeBuildInputs = [ cargo cargo-edit rustc rustfmt rustPackages.clippy fzy ];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
})
// {
overlays.default = _: prev: {
nixpkgs-lint = nixpkgsLintLambda prev;
};
};
}