You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.2 KiB

{
inputs.nixpkgs.url = "nixpkgs";
outputs = {
self,
nixpkgs,
...
}: let
version = builtins.substring 0 7 self.lastModifiedDate;
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
packageFn = pkgs:
pkgs.rustPlatform.buildRustPackage {
pname = "e4vc";
inherit version;
src = builtins.path {
name = "source";
path = ./.;
};
cargoSha256 = "sha256-YZHQCFojC8Ch9jcyxXLKEVsMNtI4ufzbCPUPLbUkMCI=";
};
in rec {
packages = forAllSystems (s: let
pkgs = nixpkgsFor.${s};
in rec {
e4vc = packageFn pkgs;
default = e4vc;
});
devShells = forAllSystems (s: let
pkgs = nixpkgsFor.${s};
inherit (pkgs) mkShell;
in {
default = mkShell {
packages = with pkgs; [rustc cargo rustfmt];
};
});
dockerImage = forAllSystems (s: let
pkgs = nixpkgsFor.${s};
in pkgs.dockerTools.buildImage {
name = "e4vc";
tag = "latest";
config = {
Cmd = ["${packageFn pkgs}/bin/e4vc"];
};
});
};
}