-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: prototype ifwifi performance for larva
- Loading branch information
Showing
2 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
fetchFromGitHub, | ||
rustPlatform, | ||
darwin, | ||
iw, | ||
networkmanager, | ||
Security, | ||
makeWrapper, | ||
}: | ||
rustPlatform.buildRustPackage rec { | ||
pname = "ifwifi"; | ||
version = "1.0.3"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "araujobsd"; | ||
repo = "ifwifi"; | ||
rev = "${version}"; | ||
sha256 = "sha256-RYxBlqG8yV7ZhqTkWbzrGI/ZJRF55JN+kUlqFj/Bs7s="; | ||
}; | ||
|
||
cargoSha256 = "sha256-ys4tXP46pTXj9LSVISBRX+9xj7ijJddS86YzHHzK+jQ="; | ||
|
||
nativeBuildInputs = [makeWrapper]; | ||
buildInputs = lib.optional stdenv.isDarwin Security; | ||
|
||
postInstall = '' | ||
wrapProgram "$out/bin/ifwifi" \ | ||
--prefix PATH : "${ | ||
lib.makeBinPath ([ | ||
# `ifwifi` runtime dep | ||
networkmanager | ||
] | ||
# `wifiscanner` crate's runtime deps | ||
++ (lib.optional stdenv.isLinux iw)) | ||
# ++ (lib.optional stdenv.isDarwin airport) # airport isn't packaged | ||
}" | ||
''; | ||
|
||
doCheck = true; | ||
|
||
meta = with lib; { | ||
description = "A simple wrapper over nmcli using wifiscanner made in rust"; | ||
longDescription = '' | ||
In the author's words: | ||
I felt bothered because I never remember the long and tedious command | ||
line to setup my wifi interface. So, I wanted to develop something | ||
using rust to simplify the usage of nmcli, and I met the wifiscanner | ||
project that gave me almost everything I wanted to create this tool. | ||
''; | ||
homepage = "https://github.com/araujobsd/ifwifi"; | ||
license = with licenses; [bsd2]; | ||
maintainers = with maintainers; [blaggacao]; | ||
platforms = platforms.linux; | ||
}; | ||
} |