simplify flake

This commit is contained in:
Akshay 2021-10-23 13:18:03 +05:30
parent c2f0582d19
commit 05b11f14b7
2 changed files with 14 additions and 9 deletions

View File

@ -11,7 +11,7 @@ use vfs::ReadOnlyVfs;
use crate::err::ConfigErr;
/// Static analysis and linting for the nix programming language
/// Lints and suggestions for the Nix programming language
#[derive(Clap, Debug)]
#[clap(version = "0.1.0", author = "Akshay <nerdy@peppe.rs>")]
pub struct Opts {

View File

@ -21,6 +21,7 @@
}:
let
inherit (import-cargo.builders) importCargo;
supportedSystems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system:
@ -28,26 +29,31 @@
inherit system;
overlays = [ self.overlay ];
});
mozilla = p: p.callPackage (mozillapkgs + "/package-set.nix") { };
chanspec = {
date = "2021-09-30";
channel = "nightly";
sha256 = "Elqn7GDBDE/QT1XTDyj0EvivbC//uwjWX8d+J3Pi0dY="; # set zeros after modifying channel or date
};
rustChannel = p: (mozilla p).rustChannelOf chanspec;
in
{
overlay = final: prev:
let
rustChannel = (mozilla final.pkgs).rustChannelOf chanspec;
inherit (rustChannel) rust rustc rust-src;
inherit (rustChannel final.pkgs) rust rust-src;
in
{
statix = with final; pkgs.stdenv.mkDerivation {
pname = "statix";
version = "v0.1.0";
src = ./.;
src = builtins.path {
path = ./.;
name = "statix";
};
nativeBuildInputs = [
(importCargo { lockFile = ./Cargo.lock; inherit pkgs; }).cargoHome
rust
@ -73,21 +79,20 @@
devShell = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
rustChannel = (mozilla pkgs).rustChannelOf chanspec;
inherit (rustChannel pkgs) rust rust-src;
in
with pkgs;
mkShell rec {
buildInputs =
(with pkgs; [
[
rust-analyzer
rustfmt
cargo
cargo-watch
]) ++ (with rustChannel; [
rust
rust-src
]);
RUST_SRC_PATH = "${rustChannel.rust-src}/lib/rustlib/src/rust/library";
];
RUST_SRC_PATH = "${rust-src}/lib/rustlib/src/rust/library";
RUST_LOG = "info";
RUST_BACKTRACE = 1;
});