first commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
```
|
||||
nix build .#packages.x86_64-linux.default
|
||||
|
||||
|
||||
nix profile add ./result
|
||||
```
|
||||
Generated
+27
@@ -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
|
||||
}
|
||||
@@ -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 ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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)"
|
||||
Reference in New Issue
Block a user