39 lines
906 B
Nix
39 lines
906 B
Nix
{
|
|
description = "collection of simple unix tools";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, utils }: let
|
|
cargoData = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
|
pname = cargoData.package.name;
|
|
version = cargoData.package.version;
|
|
in utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
};
|
|
in rec {
|
|
packages.${pname} = pkgs.rustPlatform.buildRustPackage {
|
|
inherit pname version;
|
|
src = ./.;
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
};
|
|
|
|
packages.default = packages.${pname};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
nativeBuildInputs = with pkgs; [
|
|
rustc
|
|
cargo
|
|
cargo-audit
|
|
clippy
|
|
rustfmt
|
|
];
|
|
};
|
|
}
|
|
);
|
|
}
|