45 lines
1.2 KiB
Nix
45 lines
1.2 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
nci = {
|
|
url = "github:yusdacra/nix-cargo-integration";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
flake-parts = {
|
|
url = "github:hercules-ci/flake-parts";
|
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
|
};
|
|
};
|
|
outputs =
|
|
inputs@{ flake-parts, nci, ... }:
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"aarch64-darwin"
|
|
"x86_64-darwin"
|
|
];
|
|
imports = [
|
|
nci.flakeModule
|
|
./crates.nix
|
|
];
|
|
perSystem =
|
|
{ pkgs, config, ... }:
|
|
let
|
|
crateName = "my-crate";
|
|
crateOutputs = config.nci.outputs.${crateName};
|
|
in
|
|
{
|
|
devShells.default = crateOutputs.devShell;
|
|
packages.default = crateOutputs.packages.release;
|
|
packages.container = pkgs.dockerTools.streamLayeredImage {
|
|
name = crateName;
|
|
tag = "latest";
|
|
contents = [ ];
|
|
config = {
|
|
Cmd = [ "${crateOutputs.packages.release}/bin/my-crate" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|