Skip to content

Commit

Permalink
neohtop: init at 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesGitH committed Nov 18, 2024
1 parent 52c82a3 commit ff162e7
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions pkgs/by-name/ne/neohtop/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
rustPlatform,
cargo-tauri,
nodejs,
jq,
stdenv,
importNpmLock,
zsh,
fetchFromGitHub,
}:

let
tauri = cargo-tauri;
in

rustPlatform.buildRustPackage rec {
name = "neohtop";
pname = name;
version = "1.1.1";

src = fetchFromGitHub {
owner = "abdenasser";
repo = "neohtop";
rev = "v${version}";
hash = "sha256-TM1QxYuJHhx7tgXqg3+sD1nXnEv1Oghk7fwwAHFFoZ4";
};
nativeBuildInputs = [ tauri.hook npmConfigHook nodejs ];
cargoRoot = "src-tauri";
sourceRoot = "source/${cargoRoot}";
cargoHash = "";
npmDeps = importNpmLock {
npmRoot = src;
};
# remove macOS signing
postConfigure = ''
${jq}/bin/jq 'del(.bundle.macOS.signingIdentity, .bundle.macOS.hardenedRuntime)' src-tauri/tauri.conf.json > tmp.json
mv tmp.json src-tauri/tauri.conf.json
'';
npmConfigHook = importNpmLock.npmConfigHook;
checkPhase = "true"; # idk why checks fail, todo
installPhase = let path = "${cargoRoot}/target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/bundle"; in
if stdenv.isDarwin then ''
mkdir -p $out/bin
mv ${path}/macos $out/Applications
echo "#!${zsh}/bin/zsh" >> $out/bin/${name}
echo "open -a $out/Applications/${name}.app" >> $out/bin/${name}
chmod +x $out/bin/${name}
'' else ''
mv ${path}/deb/*/data/usr $out
'';
}

0 comments on commit ff162e7

Please sign in to comment.