diff --git a/.gitignore b/.gitignore index 53d2b9d3..4e438431 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ wallet/db .idea/ .vscode/ /node* +result diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 96300796..488b6d0f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,7 +31,7 @@ variables: jobs: - job: linux pool: - vmImage: ubuntu-18.04 + vmImage: ubuntu-22.04 strategy: matrix: servers: diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..58138436 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1681411673, + "narHash": "sha256-23S0skJVstbQtrhy+65Bi4Jrdw74hY1OYbBnuuQausc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "80d54821fffaffbc90409a1262ea91071e0dff8f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..44a631fd --- /dev/null +++ b/flake.nix @@ -0,0 +1,46 @@ +{ + description = "THE MIMBLEWIMBLE BLOCKCHAIN."; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/release-22.11"; + }; + + outputs = { self, nixpkgs, }: + let + forAllSystems = with nixpkgs; + lib.genAttrs lib.systems.flakeExposed; + + nixpkgsFor = forAllSystems (system: import nixpkgs + { inherit system; overlays = [ self.overlay ]; } + ); + in + { + overlay = final: prev: + with final; + { + grin = pkgs.rustPlatform.buildRustPackage { + pname = "grin"; + version = "5.2.0-alpha.2"; + src = ./.; + + cargoLock = { + lockFile = ./Cargo.lock; + }; + + nativeBuildInputs = [ pkgs.llvmPackages_latest.clang ]; + buildInputs = [ pkgs.ncurses ]; + LIBCLANG_PATH = + "${pkgs.llvmPackages_latest.libclang.lib}/lib"; + + # do not let test results block the build process + doCheck = false; + }; + }; + + packages = forAllSystems ( + system: { + default = nixpkgsFor.${system}.grin; + } + ); + }; +}