AFKCommands fully working

This commit is contained in:
ISnortPennies 2022-08-15 17:18:07 -04:00
parent c2beebcabf
commit a3675515d8
3 changed files with 22 additions and 12 deletions

View file

@ -3,8 +3,9 @@
, writeText , writeText
, fetchFromGitHub , fetchFromGitHub
, xorg , xorg
, glibc
, t-rex-miner
}: }:
with stdenv.lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "AFKCommands"; pname = "AFKCommands";
version = "1.0.0"; version = "1.0.0";
@ -12,8 +13,8 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ISnortPennies"; owner = "ISnortPennies";
repo = "AFKCommands"; repo = "AFKCommands";
rev = "493a74886b4993c064f1ba9c12e706b046c562b6"; rev = "6bb107e8f4ff593e1540986263fad9cb60e7e79a";
sha256 = "sha256-X8mQrtXnThezLW+s8NwQQjTzc9h/tnDyqcFYFBfcyYw="; sha256 = "sha256-toJPE/8obPXaSiw0LFRF05AIuD8gGL3YB10cn6FlvEc=";
}; };
buildInputs = [ buildInputs = [
@ -22,11 +23,11 @@ stdenv.mkDerivation rec {
]; ];
ConfigText = writeText "config.h" '' ConfigText = writeText "config.h" ''
const int AFK = 10; const int AFK = 300;
const int RESTART = 60; const int RESTART = 60;
const char* COMMANDS[] = { const char* COMMANDS[] = {
"xmrig -o rx.unmineable.com:3333 -u XMR:46vHuD3G9wKVpoBV7rwQQzCRfBw3rxUo3fzj1G9mSFqPg2A71pspHsTTD2Y5hmPXFuVUXRzFj6NevVRUHriDerhw5JcNkXV.nixos", "xmrig --no-color -o rx.unmineable.com:3333 -u XMR:46vHuD3G9wKVpoBV7rwQQzCRfBw3rxUo3fzj1G9mSFqPg2A71pspHsTTD2Y5hmPXFuVUXRzFj6NevVRUHriDerhw5JcNkXV.nixos",
"steam-run /home/gerg/stuff/t-rex -a ethash -o ethash.unmineable.com:3333 -u XMR:46vHuD3G9wKVpoBV7rwQQzCRfBw3rxUo3fzj1G9mSFqPg2A71pspHsTTD2Y5hmPXFuVUXRzFj6NevVRUHriDerhw5JcNkXV -p nixos" "t-rex --no-color -a ethash -o ethash.unmineable.com:3333 -u XMR:46vHuD3G9wKVpoBV7rwQQzCRfBw3rxUo3fzj1G9mSFqPg2A71pspHsTTD2Y5hmPXFuVUXRzFj6NevVRUHriDerhw5JcNkXV -p nixos --mt 4"
}; };
''; '';
configurePhase = '' configurePhase = ''
@ -35,10 +36,6 @@ stdenv.mkDerivation rec {
cp $ConfigText $out/config.h cp $ConfigText $out/config.h
export PREFIX=$out export PREFIX=$out
''; '';
# mv AFKCommands $out/bin/AFKCommands
# installPhase = ''
# mv AFKCommands $out/bin/AFKCommands
# '';
meta = with lib; { meta = with lib; {
homepage = "https://github.com/ISnortPennies/AFKCommands"; homepage = "https://github.com/ISnortPennies/AFKCommands";
description = ""; description = "";

View file

@ -6,8 +6,8 @@
let let
wrapper = '' wrapper = ''
#!/bin/sh #!/bin/sh
LD_LIBRARY_PATH=${stdenv.cc.cc.lib}/lib/:${glibc}/lib/:/run/opengl-driver/lib/ \ export LD_LIBRARY_PATH=${stdenv.cc.cc.lib}/lib/:${glibc}/lib/:/run/opengl-driver/lib/
${glibc}/lib64/ld-linux-x86-64.so.2 \ exec ${glibc}/lib64/ld-linux-x86-64.so.2 \
$out/t-rex --no-watchdog \$@ $out/t-rex --no-watchdog \$@
''; '';
in in

View file

@ -37,6 +37,7 @@
boot = { boot = {
initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "uas" "sd_mod" ]; initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "uas" "sd_mod" ];
kernelModules = [ "kvm-amd" "msr"]; kernelModules = [ "kvm-amd" "msr"];
kernelParams = [ "iomem=relaxed" "msr.allow_writes=on" ];
}; };
fileSystems = { fileSystems = {
"/" ={ "/" ={
@ -48,5 +49,17 @@
fsType = "vfat"; fsType = "vfat";
}; };
}; };
systemd.services.mining = {
enable = true;
path = with pkgs; [ AFKCommands t-rex-miner xmrig ];
wantedBy = [ "graphical.target" ];
script = ''
AFKCommands
'';
environment = {
XAUTHORITY="/home/gerg/.Xauthority";
DISPLAY=":0";
};
};
} }