iso7010-a-day/flake.nix

27 lines
809 B
Nix
Raw Normal View History

2021-10-24 13:36:13 +01:00
{
description = "My cute Rust crate!";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2021-11-17 22:55:49 +00:00
utils.url = "github:numtide/flake-utils";
2021-10-24 13:36:13 +01:00
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "nixpkgs";
};
2021-11-17 22:55:49 +00:00
outputs = { self, nixpkgs, utils, naersk }:
2021-10-24 13:36:13 +01:00
let
cargoToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml));
in
2021-11-17 22:55:49 +00:00
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 = ./.;
2021-11-17 23:19:16 +00:00
buildInputs = [ pkgs.openssl pkgs.pkgconfig ];
2021-10-24 13:36:13 +01:00
};
2021-11-17 22:55:49 +00:00
defaultPackage = packages."${cargoToml.package.name}";
});
}