diff --git a/.gitignore b/.gitignore index 6180ff0..b67d6b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ +/result /target *.csv -*.png *.data *.old *.log \ No newline at end of file diff --git a/README.md b/README.md index 64d07ce..a674184 100644 --- a/README.md +++ b/README.md @@ -205,4 +205,8 @@ The help message can be shown with `udperf --help`. ## System Design The most important components of udperf are shown in the following component diagram. -![udperf Component Diagram](doc/figures/udperf-component.svg) \ No newline at end of file +![udperf Component Diagram](doc/figures/udperf-component.svg) + +## Run with nix + +`nix run github:PickingUpPieces/udperf -- [OPTIONS] [MODE]` diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0136f65 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1726243404, + "narHash": "sha256-sjiGsMh+1cWXb53Tecsm4skyFNag33GPbVgCdfj3n9I=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "345c263f2f53a3710abe117f28a5cb86d0ba4059", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ae811e3 --- /dev/null +++ b/flake.nix @@ -0,0 +1,62 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = + { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { + inherit system; + }; + manifest = (pkgs.lib.importTOML ./Cargo.toml).package; + rust-toolchain = pkgs.symlinkJoin { + name = "rust-toolchain"; + paths = with pkgs; [ + rustc + cargo + rustPlatform.rustcSrc + ]; + }; + in + { + packages.default = pkgs.rustPlatform.buildRustPackage rec { + pname = manifest.name; + version = manifest.version; + cargoLock = { + lockFile = ./Cargo.lock; + outputHashes = { + # explicit hashes required for cargo git dependencies + "csv-1.1.5" = "sha256-IGfThZankbhI2LsQzJ0TdLhrw3fNlEB2P5pidvPUIxg="; + "io-uring-0.6.3" = "sha256-dAlKSPniUAJdme9HvTg/lr9Zqkl1yOC7xIGoAanl4z8="; + }; + }; + src = pkgs.lib.cleanSource ./.; + nativeBuildInputs = with pkgs; [ + pkg-config + ]; + buildInputs = with pkgs; [ + hwloc + ]; + doCheck = false; # do not run tests + }; + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + clippy + rustfmt + rust-analyzer + rust-toolchain + pkg-config + hwloc + ]; + RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; + }; + } + ); +}