commit fc8483bc4031dbd109714a1ebdd8e58231a10375 Author: EmilCh Date: Fri Sep 4 10:04:58 2026 +0200 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..a51c530 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ + + + + + + +``` +nix build .#packages.x86_64-linux.default + + +nix profile add ./result +``` diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4e641bd --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1788316716, + "narHash": "sha256-bc7rSpXIdn9QWGNqfWcPZWOhEVF8NoeAZkWq0XWnf/k=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3ed67ec0a4d3c7ab4ae1f04f8ee8df07bfa506a2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "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 0000000..327951c --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "DNS benchmarking tool written in Rust"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; # Adjust if you are on a different architecture (e.g., aarch64-linux) + pkgs = nixpkgs.legacyPackages.${system}; + in + { + packages.${system}.default = pkgs.rustPlatform.buildRustPackage { + pname = "dns-bench"; + version = "0.14.0"; # Match the latest tag or version from GitHub + + src = pkgs.fetchFromGitHub { + owner = "qwerty541"; + repo = "dns-bench"; + rev = "v0.14.0"; # Or a specific commit hash + sha256 = "sha256-xkTCKIZF/ma0veWZ7L7tepUAgXnHOW/pKfcpg4sQcbQ="; # Leave placeholder first, Nix will tell you the correct hash on build + }; + + cargoHash = "sha256-mHUmggC04/+dryl8fUH57UMBc1fqNI5Uchbhowfe1ow="; # Leave placeholder first + + doCheck = false; + + nativeBuildInputs = [ pkgs.pkg-config ]; + buildInputs = [ pkgs.openssl ]; + }; + }; +} diff --git a/remote.sh b/remote.sh new file mode 100755 index 0000000..c076cd9 --- /dev/null +++ b/remote.sh @@ -0,0 +1,8 @@ +# 1. Build locally +nix --extra-experimental-features nix-command --extra-experimental-features flakes build .#packages.x86_64-linux.default + +# 2. Copy the store path over SSH to the target machine +nix copy --to ssh://$1 ./result + +# 3. Add to user profile on the target machine +ssh $1 "nix --extra-experimental-features flakes --extra-experimental-features nix-command profile add $(readlink -f ./result)"