Add nix derivation

This commit is contained in:
2024-05-13 11:45:48 +02:00
parent 7d84ef9064
commit 8083faa28c
4 changed files with 402 additions and 215 deletions

2
.gitignore vendored
View File

@@ -1,5 +1,5 @@
/target /target
**/*.rs.bk **/*.rs.bk
proptest-regressions/ proptest-regressions/
Cargo.lock
.idea/ .idea/
result

576
Cargo.lock generated

File diff suppressed because it is too large Load Diff

35
default.nix Normal file
View File

@@ -0,0 +1,35 @@
{ pkgs ? import <nixpkgs> {
overlays = [
(import (fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
];
}
}:
with pkgs;
let
agent = callPackage "${fetchgit {
url = "https://gitea.rixxc.de/rixxc/agent_harness.git";
rev = "d2154ade95b88fe90709cdb12a35da50e0ddb5ee";
hash = "sha256-low2S2z5vaFSS6ZdDVaxJdwBZk+mjXaG2zhConCWQPQ=";
}}/default.nix"
{ inherit pkgs; };
in
rustPlatform.buildRustPackage
{
name = "wireguard-agent";
src = nix-gitignore.gitignoreSource [ ] ./.;
nativeBuildInputs = [
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
agent
];
cargoLock = {
lockFile = ./Cargo.lock;
};
doCheck = false;
AGENT_PATH = "${agent}/bin/agent_harness";
KEY_FILE = "keyfile";
RUST_LOG = "debug";
}

2
rust-toolchain.toml Normal file
View File

@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly"