os/pkgs/uhk-agent.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1 KiB
Nix
Raw Normal View History

2023-01-28 20:49:10 +00:00
self:
with self; let
2021-05-30 19:10:28 +00:00
uhk-agent-bin = stdenv.mkDerivation rec {
pname = "uhk-agent-bin";
version = "1.5.14";
src = builtins.fetchurl {
url = "https://github.com/UltimateHackingKeyboard/agent/releases/download/v1.5.14/UHK.Agent-1.5.14-linux-x86_64.AppImage";
sha256 = "sha256:1yzh4ixy0cqg02xf84vcqj3h67mkxyzs6jf1h935ay582n70nyqg";
};
2023-01-28 20:49:10 +00:00
phases = ["installPhase" "patchPhase"];
2021-05-30 19:10:28 +00:00
installPhase = ''
mkdir -p $out/bin
cp $src $out/bin/uhk-agent
chmod +x $out/bin/uhk-agent
'';
};
script = ''
#!${bash}/bin/bash
${appimage-run}/bin/appimage-run ${uhk-agent-bin}/bin/uhk-agent
'';
in
2023-01-28 20:49:10 +00:00
stdenv.mkDerivation rec {
pname = "uhk-agent";
version = "1.5.14";
buildInputs = [
bash
uhk-agent-bin
appimage-run
];
2021-05-30 19:10:28 +00:00
2023-01-28 20:49:10 +00:00
phases = ["buildPhase" "installPhase" "patchPhase"];
2021-05-30 19:10:28 +00:00
2023-01-28 20:49:10 +00:00
buildPhase = ''
echo "${script}" >> uhk-agent
'';
2021-05-30 19:10:28 +00:00
2023-01-28 20:49:10 +00:00
installPhase = ''
mkdir -p $out/bin
cp uhk-agent $out/bin/uhk-agent
chmod +x $out/bin/uhk-agent
'';
}