diff --git a/hosts/puter/default.nix b/hosts/puter/default.nix index 90b165b..a01970d 100644 --- a/hosts/puter/default.nix +++ b/hosts/puter/default.nix @@ -25,6 +25,8 @@ ../../modules/common/libvirt.nix ../../modules/common/keyd.nix ../../modules/common/unbound-cloud.nix + + (callPackage .../../modules/common/rustnet.nix {}) ]; networking.hostName = "puter"; # This will be overridden by system/default.nix diff --git a/modules/common/rustnet.nix b/modules/common/rustnet.nix new file mode 100644 index 0000000..f48eb1f --- /dev/null +++ b/modules/common/rustnet.nix @@ -0,0 +1,28 @@ +{ pkgs ? import {} }: + +pkgs.stdenv.mkDerivation rec { + pname = "rustnet"; + version = "0.18.0"; + + src = pkgs.fetchurl { + url = "https://github.com/domcyrus/rustnet/releases/download/v${version}/rustnet-v${version}-x86_64-unknown-linux-musl.tar.gz"; + hash = "sha256-yAjemn3Qi0GjTG5u7UEXHBJFTCd6ctVacV5UoAX7bWA="; + }; + + sourceRoot = "rustnet-v${version}-x86_64-unknown-linux-musl"; + + installPhase = '' + runHook preInstall + # 1. Install the binary + install -m755 -D rustnet $out/bin/rustnet + runHook postInstall + ''; + + meta = with pkgs.lib; { + description = "A cross-platform network monitoring terminal UI tool built with Rust."; + #maintainers = lib.maintainers.0x545a; + #license = lib.licenses.asl20; + homepage = "https://github.com/domcyrus/rustnet"; + platforms = [ "x86_64-linux" ]; + }; +}