27 lines
809 B
Nix
27 lines
809 B
Nix
{
|
|
description = "My cute Rust crate!";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
utils.url = "github:numtide/flake-utils";
|
|
naersk.url = "github:nmattia/naersk";
|
|
naersk.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, utils, naersk }:
|
|
let
|
|
cargoToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml));
|
|
in
|
|
utils.lib.eachDefaultSystem (system: let
|
|
pkgs = nixpkgs.legacyPackages."${system}";
|
|
naersk-lib = naersk.lib."${system}";
|
|
in rec {
|
|
packages."${cargoToml.package.name}" = naersk-lib.buildPackage {
|
|
pname = "${cargoToml.package.name}";
|
|
root = ./.;
|
|
buildInputs = [ pkgs.openssl pkgs.pkgconfig ];
|
|
};
|
|
defaultPackage = packages."${cargoToml.package.name}";
|
|
});
|
|
}
|