File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ { inputs , ... } :
2+ {
3+ perSystem = _ : {
4+ nixpkgs . overlays = [
5+ ( _ : prev : {
6+ crate2nixTools = prev . callPackage "${ inputs . crate2nix } /tools.nix" { } ;
7+ } )
8+ ] ;
9+ } ;
10+ }
Original file line number Diff line number Diff line change 1+ { ... } :
12{
23 gitignore = [ "/target" ] ;
34 perSystem =
45 { pkgs , ... } :
56 {
67 make-shells . default = {
7- inputsFrom = [ pkgs . statix ] ;
88 packages = [
9+ pkgs . cargo
10+ pkgs . rustc
11+ pkgs . clippy
912 pkgs . bacon
1013 pkgs . cargo-insta
1114 pkgs . rust-analyzer
Original file line number Diff line number Diff line change 1+ {
2+ root ,
3+ ...
4+ } :
15{
26 perSystem =
37 { pkgs , ... } :
8+ let
9+ statixBuild = pkgs . statix-workspace . workspaceMembers . statix . build ;
10+ in
411 {
512 treefmt . settings . global . excludes = [ "bin/tests/data/*.nix" ] ;
6- checks . build = pkgs . statix ;
13+ checks = {
14+ inherit ( pkgs ) statix ;
15+ statix-tests = statixBuild . override {
16+ runTests = true ;
17+ testPreRun = ''
18+ export INSTA_SNAPSHOT_DIR=${ root } /bin/tests/snapshots
19+ '' ;
20+ } ;
21+ clippy = statixBuild . override {
22+ crateOverrides = pkgs . defaultCrateOverrides // {
23+ statix = _ : {
24+ useClippy = true ;
25+ RUSTFLAGS = "-D warnings" ;
26+ } ;
27+ } ;
28+ } ;
29+ } ;
730 } ;
831}
Original file line number Diff line number Diff line change 11{
22 nixConfig = {
33 abort-on-warn = true ;
4- allow-import-from-derivation = false ;
54 } ;
65
76 inputs = {
109 inputs . nixpkgs-lib . follows = "nixpkgs" ;
1110 } ;
1211
12+ crate2nix = {
13+ url = "github:nix-community/crate2nix" ;
14+ flake = false ;
15+ } ;
1316 import-tree = {
1417 url = "github:denful/import-tree" ;
1518 flake = false ;
Original file line number Diff line number Diff line change 11final : prev : {
2+ statix-cargo-nix = prev . callPackage ./packages/cargo-nix.nix { } ;
23 statix = prev . callPackage ./packages/statix.nix { } ;
4+ statix-workspace = prev . callPackage ./packages/statix-workspace.nix { } ;
35 statix-vim = prev . callPackage ./packages/statix-vim.nix { } ;
46}
Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ crate2nixTools ,
4+ } :
5+ crate2nixTools . generatedCargoNix {
6+ name = "statix" ;
7+ src = lib . fileset . toSource {
8+ root = ../. ;
9+ fileset = lib . fileset . unions [
10+ ( lib . fileset . fileFilter (
11+ file :
12+ lib . any lib . id [
13+ ( file . name == "Cargo.toml" )
14+ ( file . hasExt "rs" )
15+ ( file . hasExt "snap" )
16+ ]
17+ ) ../. )
18+ ../Cargo.lock
19+ ../insta.yaml
20+ ] ;
21+ } ;
22+ }
Original file line number Diff line number Diff line change 1+ {
2+ callPackage ,
3+ statix-cargo-nix ,
4+ } :
5+ callPackage statix-cargo-nix { }
Original file line number Diff line number Diff line change 11{
2- rustPlatform ,
32 lib ,
4- clippy ,
3+ callPackage ,
4+ statix-cargo-nix ,
55} :
6- rustPlatform . buildRustPackage {
7- pname = "statix" ;
8- version = "0.6.0-git" ;
9- src = lib . fileset . toSource {
10- root = ../. ;
11- fileset = lib . fileset . unions [
12- ( lib . fileset . fileFilter (
13- file :
14- lib . any lib . id [
15- ( file . name == "Cargo.toml" )
16- ( file . hasExt "rs" )
17- ( file . hasExt "snap" )
18- ]
19- ) ../. )
20- ../Cargo.lock
21- ../insta.yaml
22- ] ;
23- } ;
24- RUSTFLAGS = "-D warnings" ;
25-
26- nativeBuildInputs = [ clippy ] ;
27-
28- checkPhase = ''
29- runHook preCheck
30-
31- cargo clippy --all-targets --all-features
32- cargoCheckHook
33-
34- runHook postCheck
35- '' ;
36-
37- cargoLock . lockFile = ../Cargo.lock ;
6+ ( callPackage statix-cargo-nix { } ) . workspaceMembers . statix . build . overrideAttrs ( _ : {
387 meta = {
398 mainProgram = "statix" ;
409 description = "Lints and suggestions for the Nix programming language" ;
4110 homepage = "https://github.com/molybdenumsoftware/statix" ;
4211 license = lib . licenses . mit ;
4312 } ;
44- }
13+ } )
You can’t perform that action at this time.
0 commit comments