Merge pull request #142 from input-output-hk/use-rust-nix
use rust.nix so we never have to update hashes again
use rust.nix so we never have to update hashes again
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1610565421,
"narHash": "sha256-8gUzX5p/MAbRBroaWOv2v9sup2qBnQVkdyy6Id/1lec=",
"lastModified": 1613582597,
"narHash": "sha256-6LvipIvFuhyorHpUqK3HjySC5Y6gshXHFBhU9EJ4DoM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e41f385b1c196a4b2a6daee2a9a3295593ed6455",
"rev": "6b1057b452c55bb3b463f0d7055bc4ec3fd1f381",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"rust-nix": "rust-nix",
"utils": "utils"
}
},
"rust-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1613148821,
"narHash": "sha256-DfzLE4HNVuLnKYJfe4FDuNTZEGbiGBv6sbNQmwFWN5g=",
"owner": "input-output-hk",
"repo": "rust.nix",
"rev": "14f7bccda47d9c7ea9cbd647a75e3446085f458f",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"ref": "work",
"repo": "rust.nix",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1610051610,
"narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=",
"owner": "numtide",
"lastModified": 1613500319,
"narHash": "sha256-ybAq6pImFCSnwyhhmnnvV567JM4GuhCEG/PHBkSS86U=",
"owner": "kreisys",
"repo": "flake-utils",
"rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc",
"rev": "28e72370213c9bc2cf094ab07b8ac95f3c6bb60f",
"type": "github"
},
"original": {
"owner": "numtide",
"owner": "kreisys",
"repo": "flake-utils",
"type": "github"
}
{
inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:kreisys/flake-utils";
rust-nix.url = "github:input-output-hk/rust.nix/work";
rust-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, utils }:
utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
let
overlay = self: super: {
vit-servicing-station = self.callPackage (
{ lib, rustPlatform, fetchFromGitHub, pkg-config, openssl, protobuf, rustfmt }:
rustPlatform.buildRustPackage rec {
pname = "vit-servicing-station";
version = "HEAD";
src = ./.;
cargoSha256 = "sha256-Y8bh+m3AzkCzL3ZfFDUXjnX6lFiR4f0xHVGDiojjbCw=";
nativeBuildInputs = [ pkg-config protobuf rustfmt ];
buildInputs = [ openssl ];
configurePhase =''
cc=$CC
'';
doCheck = false;
doInstallCheck = false;
PROTOC="${protobuf}/bin/protoc";
PROTOC_INCLUDE="${protobuf}/include";
}
) {};
outputs = { self, nixpkgs, utils, rust-nix }:
let
workspaceCargo = builtins.fromTOML (builtins.readFile ./Cargo.toml);
inherit (workspaceCargo.workspace) members;
in utils.lib.simpleFlake {
inherit nixpkgs;
systems = [ "x86_64-linux" "aarch64-linux" ];
preOverlays = [ rust-nix ];
overlay = final: prev:
let lib = prev.lib;
in lib.listToAttrs (lib.forEach members (member:
lib.nameValuePair member (final.rust-nix.buildPackage {
inherit ((builtins.fromTOML
(builtins.readFile (./. + "/${member}/Cargo.toml"))).package)
name version;
root = ./.;
nativeBuildInputs = with final; [ pkg-config protobuf rustfmt ];
buildInputs = with final; [ openssl ];
PROTOC = "${final.protobuf}/bin/protoc";
PROTOC_INCLUDE = "${final.protobuf}/include";
})));
packages = { vit-servicing-station-cli, vit-servicing-station-lib
, vit-servicing-station-server, vit-servicing-station-tests }@pkgs:
pkgs;
devShell = { mkShell, rustc, cargo, pkg-config, openssl, protobuf }:
mkShell {
PROTOC = "${protobuf}/bin/protoc";
PROTOC_INCLUDE = "${protobuf}/include";
buildInputs = [ rustc cargo pkg-config openssl protobuf ];
};
};
pkgs = import nixpkgs { inherit system; overlays = [ overlay ]; };
in {
packages.vit-servicing-station = pkgs.vit-servicing-station;
inherit overlay;
});
}
Transaction rewrite
We will only use the tracing infrastructure in the run function, and for messages that can't cause the node to exit
Add tests for native tokens with empty asset names
Do not try to run `pkgs.nixos` when on darwin
We only want to log errors in the env initialization