2023-10-14 21:19:20 -05:00
|
|
|
{
|
|
|
|
description = "iperf watcher";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs = {
|
|
|
|
url = "nixpkgs/nixos-unstable";
|
|
|
|
};
|
|
|
|
flake-utils = {
|
|
|
|
url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
bash = {
|
|
|
|
url = "git+https://git.ocjtech.us/jeff/nixos-bash-prompt-builder.git";
|
|
|
|
};
|
|
|
|
make-shell = {
|
|
|
|
url = "github:ursi/nix-make-shell";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-10-14 22:28:08 -05:00
|
|
|
outputs = { self, nixpkgs, flake-utils, bash, ... }@inputs:
|
2023-10-14 21:19:20 -05:00
|
|
|
flake-utils.lib.eachDefaultSystem
|
|
|
|
(system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
devShells.default =
|
|
|
|
let
|
|
|
|
project = "iperf-watcher";
|
|
|
|
prompt = (
|
|
|
|
bash.build_ps1_prompt
|
|
|
|
bash.ansi_normal_blue
|
|
|
|
"${project} - ${bash.username}@${bash.hostname_short}: ${bash.current_working_directory}"
|
|
|
|
"${project}:${bash.current_working_directory}"
|
|
|
|
);
|
|
|
|
make-shell = import inputs.make-shell {
|
|
|
|
inherit system;
|
|
|
|
pkgs = pkgs;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
make-shell {
|
|
|
|
packages = [
|
|
|
|
pkgs.iperf3
|
|
|
|
pkgs.zon2nix
|
|
|
|
pkgs.zig_0_11
|
|
|
|
pkgs.zls
|
|
|
|
];
|
|
|
|
env = {
|
|
|
|
PS1 = prompt;
|
|
|
|
};
|
|
|
|
setup = ''
|
|
|
|
export PATH=$(pwd)/.venv/bin:$PATH
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
packages = {
|
|
|
|
iperf-watcher = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "iperf-watcher";
|
|
|
|
src = ./.;
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgs.zig_0_11.hook
|
|
|
|
];
|
|
|
|
postPatch = ''
|
|
|
|
ln -s ${pkgs.callPackage ./deps.nix { }} $ZIG_GLOBAL_CACHE_DIR/p
|
|
|
|
'';
|
2023-10-14 23:04:32 -05:00
|
|
|
dontStrip = true;
|
2023-10-14 21:19:20 -05:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|