2022-12-01 14:41:23 +00:00
|
|
|
{
|
|
|
|
description = "A very basic flake";
|
|
|
|
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/a3073c49bc0163fea6a121c276f526837672b555";
|
|
|
|
inputs.cargo2nix = {
|
|
|
|
# As of 2022-10-18: two small patches over unstable branch, one for clippy and one to fix feature detection
|
|
|
|
url = "github:Alexis211/cargo2nix/a7a61179b66054904ef6a195d8da736eaaa06c36";
|
2023-10-02 11:28:40 +00:00
|
|
|
|
|
|
|
# Rust overlay as of 2023-04-25
|
|
|
|
inputs.rust-overlay.url =
|
|
|
|
"github:oxalica/rust-overlay/74f1a64dd28faeeb85ef081f32cad2989850322c";
|
|
|
|
|
2022-12-01 14:41:23 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, cargo2nix }:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
overlays = [ cargo2nix.overlays.default ];
|
|
|
|
};
|
|
|
|
packageFun = import ./Cargo.nix;
|
2023-10-02 11:28:40 +00:00
|
|
|
rustVersion = "1.68.0";
|
2022-12-01 16:05:32 +00:00
|
|
|
|
|
|
|
compile = args: compileMode:
|
|
|
|
let
|
|
|
|
packageSet = pkgs.rustBuilder.makePackageSet ({
|
|
|
|
inherit packageFun rustVersion;
|
|
|
|
} // args);
|
|
|
|
in
|
|
|
|
packageSet.workspace.tricot {
|
|
|
|
inherit compileMode;
|
|
|
|
};
|
2022-12-01 14:41:23 +00:00
|
|
|
in
|
|
|
|
{
|
2022-12-01 16:05:32 +00:00
|
|
|
test.x86_64-linux.tricot = compile { release = false; } "test";
|
|
|
|
debug.x86_64-linux.tricot = compile { release = false; } "build";
|
|
|
|
packages.x86_64-linux.tricot = compile { release = true; } "build";
|
|
|
|
packages.x86_64-linux.default = self.packages.x86_64-linux.tricot;
|
2022-12-01 14:41:23 +00:00
|
|
|
};
|
|
|
|
}
|