mirror of
https://github.com/nerdypepper/statix.git
synced 2024-08-16 08:50:25 +03:00
simplify flake
This commit is contained in:
parent
c2f0582d19
commit
05b11f14b7
@ -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 {
|
||||
|
21
flake.nix
21
flake.nix
@ -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;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user