Lints and suggestions for the Nix programming language
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix flake builds

Akshay a1886854 e4c4a77d

+96 -104
+23 -54
flake.lock
··· 16 16 "type": "github" 17 17 } 18 18 }, 19 + "import-cargo": { 20 + "locked": { 21 + "lastModified": 1594305518, 22 + "narHash": "sha256-frtArgN42rSaEcEOYWg8sVPMUK+Zgch3c+wejcpX3DY=", 23 + "owner": "edolstra", 24 + "repo": "import-cargo", 25 + "rev": "25d40be4a73d40a2572e0cc233b83253554f06c5", 26 + "type": "github" 27 + }, 28 + "original": { 29 + "owner": "edolstra", 30 + "repo": "import-cargo", 31 + "type": "github" 32 + } 33 + }, 19 34 "mozillapkgs": { 20 35 "flake": false, 21 36 "locked": { ··· 32 47 "type": "github" 33 48 } 34 49 }, 35 - "naersk": { 36 - "inputs": { 37 - "nixpkgs": "nixpkgs" 38 - }, 39 - "locked": { 40 - "lastModified": 1631004250, 41 - "narHash": "sha256-LGh0CjAZwh13AVkTi9w9lITEC7x6bwSQyFViOZ6HyNo=", 42 - "owner": "nmattia", 43 - "repo": "naersk", 44 - "rev": "08afb3d1dbfe016108b72e05b02ba0f6ecb3c8e1", 45 - "type": "github" 46 - }, 47 - "original": { 48 - "owner": "nmattia", 49 - "repo": "naersk", 50 - "type": "github" 51 - } 52 - }, 53 50 "nixpkgs": { 54 51 "locked": { 55 - "lastModified": 1631279684, 56 - "narHash": "sha256-IxRRCEW+8crDkbYj+uzwkfjZ8swugtnAmfRpPOpKq6I=", 57 - "owner": "NixOS", 52 + "lastModified": 1633422745, 53 + "narHash": "sha256-gA6Ok64nPbkjHk3Oanq4641EeYkjcKhisDF9wBjLxEk=", 54 + "owner": "nixos", 58 55 "repo": "nixpkgs", 59 - "rev": "ded7b6cb1bf3d6d03328b3f592069f2c4956a97f", 56 + "rev": "8e1eab9eae4278c9bb1dcae426848a581943db5a", 60 57 "type": "github" 61 58 }, 62 59 "original": { 63 - "id": "nixpkgs", 64 - "type": "indirect" 65 - } 66 - }, 67 - "nixpkgs_2": { 68 - "locked": { 69 - "lastModified": 1631279684, 70 - "narHash": "sha256-IxRRCEW+8crDkbYj+uzwkfjZ8swugtnAmfRpPOpKq6I=", 71 - "owner": "NixOS", 60 + "owner": "nixos", 61 + "ref": "nixpkgs-unstable", 72 62 "repo": "nixpkgs", 73 - "rev": "ded7b6cb1bf3d6d03328b3f592069f2c4956a97f", 74 63 "type": "github" 75 - }, 76 - "original": { 77 - "id": "nixpkgs", 78 - "type": "indirect" 79 64 } 80 65 }, 81 66 "root": { 82 67 "inputs": { 83 68 "flake-compat": "flake-compat", 69 + "import-cargo": "import-cargo", 84 70 "mozillapkgs": "mozillapkgs", 85 - "naersk": "naersk", 86 - "nixpkgs": "nixpkgs_2", 87 - "utils": "utils" 88 - } 89 - }, 90 - "utils": { 91 - "locked": { 92 - "lastModified": 1629481132, 93 - "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", 94 - "owner": "numtide", 95 - "repo": "flake-utils", 96 - "rev": "997f7efcb746a9c140ce1f13c72263189225f482", 97 - "type": "github" 98 - }, 99 - "original": { 100 - "owner": "numtide", 101 - "repo": "flake-utils", 102 - "type": "github" 71 + "nixpkgs": "nixpkgs" 103 72 } 104 73 } 105 74 },
+72 -50
flake.nix
··· 1 1 { 2 2 inputs = { 3 - utils.url = "github:numtide/flake-utils"; 4 - naersk.url = "github:nmattia/naersk"; 3 + 4 + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 5 + 5 6 mozillapkgs = { 6 7 url = "github:mozilla/nixpkgs-mozilla"; 7 8 flake = false; 8 9 }; 10 + 9 11 flake-compat = { 10 12 url = "github:edolstra/flake-compat"; 11 13 flake = false; 12 14 }; 15 + 16 + import-cargo.url = github:edolstra/import-cargo; 17 + 13 18 }; 14 19 15 20 outputs = 16 21 { self 17 22 , nixpkgs 18 - , utils 19 - , naersk 20 23 , mozillapkgs 24 + , import-cargo 21 25 , ... 22 26 }: 23 - utils.lib.eachDefaultSystem (system: 24 27 let 25 - pkgs = nixpkgs.legacyPackages."${system}"; 26 - 27 - # Get a specific rust version 28 - mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") { }; 28 + inherit (import-cargo.builders) importCargo; 29 + supportedSystems = [ "x86_64-linux" ]; 30 + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 31 + nixpkgsFor = forAllSystems (system: 32 + import nixpkgs { 33 + inherit system; 34 + overlays = [ self.overlay ]; 35 + }); 36 + mozilla = p: p.callPackage (mozillapkgs + "/package-set.nix") { }; 29 37 chanspec = { 30 - date = "2021-03-31"; 38 + date = "2021-09-30"; 31 39 channel = "nightly"; 32 - sha256 = "oK5ebje09MRn988saJMT3Zze/tRE7u9zTeFPV1CEeLc="; # set zeros after modifying channel or date 40 + sha256 = "Elqn7GDBDE/QT1XTDyj0EvivbC//uwjWX8d+J3Pi0dY="; # set zeros after modifying channel or date 33 41 }; 42 + in 43 + { 34 44 35 - rustChannel = mozilla.rustChannelOf chanspec; 36 - rust = rustChannel.rust; 37 - rust-src = rustChannel.rust-src; 45 + overlay = final: prev: 46 + let 47 + rustChannel = (mozilla final.pkgs).rustChannelOf chanspec; 48 + inherit (rustChannel) rust rustc rust-src; 49 + in 50 + { 38 51 39 - naersk-lib = naersk.lib."${system}".override { 40 - cargo = rust; 41 - rustc = rust; 42 - }; 52 + statix = with final; pkgs.stdenv.mkDerivation { 53 + pname = "statix"; 54 + version = "v0.1.0"; 55 + src = ./.; 56 + nativeBuildInputs = [ 57 + (importCargo { lockFile = ./Cargo.lock; inherit pkgs; }).cargoHome 58 + rust 59 + cargo 60 + ]; 61 + buildPhase = '' 62 + cargo build -p statix --release --offline 63 + ''; 64 + installPhase = '' 65 + install -Dm775 ./target/release/statix $out/bin/statix 66 + ''; 67 + }; 43 68 44 - nativeBuildInputs = with pkgs; [ ]; 69 + }; 45 70 46 - in 47 - rec { 48 - packages.statix = naersk-lib.buildPackage { 49 - pname = "statix"; 50 - version = "0.1.0"; 51 - root = ./.; 52 - inherit nativeBuildInputs; 53 - }; 71 + packages = forAllSystems (system: { 72 + inherit (nixpkgsFor."${system}") statix; 73 + }); 74 + 75 + defaultPackage = 76 + forAllSystems (system: self.packages."${system}".statix); 54 77 55 - defaultPackage = packages.statix; 56 - apps.statix = utils.lib.mkApp { 57 - drv = packages.statix; 58 - }; 78 + devShell = forAllSystems (system: 79 + let 80 + pkgs = nixpkgsFor.${system}; 81 + rustChannel = (mozilla pkgs).rustChannelOf chanspec; 82 + in 83 + with pkgs; 84 + mkShell rec { 85 + buildInputs = 86 + (with pkgs; [ 87 + rust-analyzer 88 + rustfmt 89 + cargo 90 + cargo-watch 91 + ]) ++ (with rustChannel; [ 92 + rust 93 + rust-src 94 + ]); 95 + RUST_SRC_PATH = "${rustChannel.rust-src}/lib/rustlib/src/rust/library"; 96 + RUST_LOG = "info"; 97 + RUST_BACKTRACE = 1; 98 + }); 59 99 60 - apps.check = { 61 - type = "app"; 62 - program = "${pkgs.cargo-watch}/bin/cargo-watch"; 63 - }; 64 100 65 - defaultApp = apps.statix; 66 - devShell = pkgs.mkShell { 67 - nativeBuildInputs = nativeBuildInputs ++ [ 68 - rust 69 - rust-src 70 - pkgs.rust-analyzer 71 - pkgs.rustfmt 72 - pkgs.cargo 73 - pkgs.cargo-watch 74 - ]; 75 - RUST_SRC_PATH = "${rust-src}/lib/rustlib/src/rust/library"; 76 - RUST_LOG = "info"; 77 - RUST_BACKTRACE = 1; 78 - }; 79 - }); 101 + }; 80 102 }
+1
notes.txt
··· 8 8 - load files to be read as VFS 9 9 - path interner 10 10 - traits to go from Report to text/errfmt 11 + - offline documentation/explaination for lints 11 12 12 13 Fix 13 14 ---