generated from ElnuDev/rust-project
Switch to flakes
This commit is contained in:
parent
90a2c6d4a4
commit
f1d2e59b89
5 changed files with 175 additions and 22 deletions
44
flake.nix
Normal file
44
flake.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
description = "Miscellaneous utility APIs hosted on jichan.org";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, rust-overlay, flake-utils }:
|
||||
let
|
||||
overlays = [ (import rust-overlay) ];
|
||||
pkgs = import nixpkgs {
|
||||
inherit overlays;
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
rustSettings = with pkgs; {
|
||||
src = ./.;
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ openssl ];
|
||||
cargoHash = nixpkgs.lib.fakeHash;
|
||||
};
|
||||
in
|
||||
with pkgs; rec {
|
||||
devShells.x86_64-linux.default = mkShell {
|
||||
packages = [ bacon ];
|
||||
inputsFrom = [
|
||||
packages.x86_64-linux.tatoeba
|
||||
packages.x86_64-linux.images
|
||||
];
|
||||
};
|
||||
packages.x86_64-linux.tatoeba = rustPlatform.buildRustPackage (rustSettings // {
|
||||
pname = "tatoeba";
|
||||
version = "0.1.0";
|
||||
buildAndTestSubdir = "tatoeba";
|
||||
cargoHash = "sha256-74Jq3saaUyPvNm/0croVOBuMtpN8xT3S4z37nutJdw4=";
|
||||
});
|
||||
packages.x86_64-linux.images = rustPlatform.buildRustPackage (rustSettings // {
|
||||
pname = "images";
|
||||
version = "0.1.0";
|
||||
buildAndTestSubdir = "images";
|
||||
cargoHash = "sha256-fKmTZTcJj/eYCQE9cjiXB/Pt6BdJNZ/e5cSRgbuPIJs=";
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue