removed IFD's

made t-rex slightly less scuffed

deleted afk-cmds
This commit is contained in:
Gerg-L 2023-07-03 15:31:07 -04:00
parent 04522f424d
commit 8d1ac4c573
7 changed files with 80 additions and 147 deletions

18
flake.lock generated
View file

@ -74,11 +74,11 @@
},
"master": {
"locked": {
"lastModified": 1688340214,
"narHash": "sha256-QKnnAJc7nYHBnLb6fhkSGkXlb1maQ4Y7umCFPHeg2Tg=",
"lastModified": 1688405892,
"narHash": "sha256-Xmpvm7lzuVTWIA/9IfILwBpL1ipmAuioJaM4C0FVXJ4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "60fa9e3f4f266dcdbb39de4dcc687ee94deeeb24",
"rev": "73a8ca16748f510cfc5be5f66f12332b8b56f187",
"type": "github"
},
"original": {
@ -128,11 +128,11 @@
},
"nixlib": {
"locked": {
"lastModified": 1687654967,
"narHash": "sha256-ki8vItcjn8Z8n+QD9NEoCQbbbG7VzWy71hyOkFFwCkM=",
"lastModified": 1688259758,
"narHash": "sha256-CYVbYQfIm3vwciCf6CCYE+WOOLE3vcfxfEfNHIfKUJQ=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "b3ec8fb525fc0c8f08eff5ef93c684b4c6d0e777",
"rev": "a92befce80a487380ea5e92ae515fe33cebd3ac6",
"type": "github"
},
"original": {
@ -149,11 +149,11 @@
]
},
"locked": {
"lastModified": 1688003049,
"narHash": "sha256-5oSxbv8OVSg2dOvycJ9eisacxF8e52N0PVUFryWWJmE=",
"lastModified": 1688349424,
"narHash": "sha256-/wRCJP2d9ZmfZKrREWthpDHIx/F02Z1J2bytbC+gUiU=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "bde0bc291c95b710dd63d5e5c422e47f760a1406",
"rev": "cf341a2c94338eed91c35df291931ea775b31e99",
"type": "github"
},
"original": {

View file

@ -53,6 +53,9 @@
xautoclick
webcord
prismlauncher
deadnix
statix
alejandra
;
inherit (nvim-flake.packages.${pkgs.system}) neovim;
};
@ -60,6 +63,7 @@
"jdks/17".source = "${pkgs.openjdk17}/bin";
"jdks/8".source = "${pkgs.openjdk8}/bin";
};
shellAliases.lint = "deadnix -e && statix fix && alejandra ./";
};
services.udev.packages = [

View file

@ -4,8 +4,8 @@
...
}: {
pkgs,
config,
lib,
config,
...
}:
###TAKEN FROM HERE:https://github.com/NixOS/nixpkgs/blob/4787ebf7ae2ab071389be7ff86cf38edeee7e9f8/nixos/modules/services/x11/xserver.nix#L106-L136
@ -18,37 +18,34 @@ let
pkgs.xorg.fontadobe100dpi
pkgs.xorg.fontadobe75dpi
];
in
pkgs.runCommand "xserverbase"
{
fontpath =
lib.optionalString (xcfg.fontPath != null)
''FontPath "${xcfg.fontPath}"'';
inherit (xcfg) config;
preferLocalBuild = true;
}
''
echo 'Section "Files"' >> $out
echo $fontpath >> $out
for i in ${toString fontsForXServer}; do
if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then
for j in $(find $i -name fonts.dir); do
echo " FontPath \"$(dirname $j)\"" >> $out
done
fi
done
for i in $(find ${toString xcfg.modules} -type d); do
if test $(echo $i/*.so* | wc -w) -ne 0; then
echo " ModulePath \"$i\"" >> $out
fi
done
echo '${xcfg.filesSection}' >> $out
echo 'EndSection' >> $out
echo >> $out
'';
oneMonitor = pkgs.writeText "1-monitor.conf" (lib.concatStrings [(builtins.readFile xserverbase) (builtins.readFile "${self}/misc/1-monitor.conf")]);
twoMonitor = pkgs.writeText "2-monitor.conf" (lib.concatStrings [(builtins.readFile xserverbase) (builtins.readFile "${self}/misc/2-monitor.conf")]);
fontpath =
lib.optionalString (xcfg.fontPath != null)
''FontPath "${xcfg.fontPath}"'';
in ''
echo 'Section "Files"' >> $out
echo ${fontpath} >> $out
for i in ${toString fontsForXServer}; do
if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then
for j in $(find $i -name fonts.dir); do
echo " FontPath \"$(dirname $j)\"" >> $out
done
fi
done
for i in $(find ${toString xcfg.modules} -type d); do
if test $(echo $i/*.so* | wc -w) -ne 0; then
echo " ModulePath \"$i\"" >> $out
fi
done
echo '${xcfg.filesSection}' >> $out
echo 'EndSection' >> $out
echo >> $out
'';
###END OF TAKEN PART
in {
environment.etc = {
"Xorg/1_mon".source = pkgs.runCommand "1_mon" {} (xserverbase + "cat '${self}/misc/1-monitor.conf' >> $out");
"Xorg/2_mon".source = pkgs.runCommand "2_mon" {} (xserverbase + "cat '${self}/misc/2-monitor.conf' >> $out");
};
####VM SOUND BORKED
services.pipewire.package = pipewire_fix.legacyPackages.${pkgs.system}.pipewire;
boot = {
@ -106,9 +103,9 @@ in {
users.users.gerg.extraGroups = ["kvm" "libvirtd"];
services.xserver.displayManager.xserverArgs = lib.mkAfter ["-config /tmp/xorg.conf"];
services.xserver.displayManager.xserverArgs = lib.mkAfter ["-config /etc/Xorg/current"];
services.xserver.displayManager.sessionCommands = lib.mkBefore ''
if ! (test -e "/tmp/ONE_MONITOR"); then
if ! [ -e "/tmp/ONE_MONITOR" ] ; then
xrandr --output DP-0 --auto --mode 3440x1440 --rate 120 --primary --pos 0x0
xrandr --output HDMI-A-1-0 --auto --mode 1920x1080 --rate 144 --set TearFree on --pos 3440x360
xset -dpms
@ -130,7 +127,7 @@ in {
systemctl set-property --runtime -- user.slice AllowedCPUs=8-15,24-31
systemctl set-property --runtime -- system.slice AllowedCPUs=8-15,24-31
systemctl set-property --runtime -- init.scope AllowedCPUs=8-15,24-31
ln -fs ${oneMonitor} /tmp/xorg.conf
ln -fs /etc/Xorg/1_mon /etc/Xorg/current
touch /tmp/ONE_MONITOR
systemctl start display-manager.service
fi
@ -142,14 +139,14 @@ in {
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_0
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_1
modprobe -a nvidia_uvm nvidia_drm nvidia nvidia_modeset
ln -fs ${twoMonitor} /tmp/xorg.conf
ln -fs /etc/Xorg/2_mon /etc/Xorg/current
rm /tmp/ONE_MONITOR
systemctl start display-manager.service
fi
fi
'';
in [
"L /tmp/xorg.conf - - - - ${twoMonitor}"
"L /etc/Xorg/current - - - - /etc/Xorg/2_mon"
"L+ /var/lib/libvirt/hooks/qemu - - - - ${qemuHook}"
"L+ /var/lib/libvirt/qemu/Windows.xml - - - - ${self}/misc/Windows.xml"
];

View file

@ -1,53 +0,0 @@
{
lib,
rustPlatform,
wrapGAppsHook,
libX11,
libXScrnSaver,
pkg-config,
cairo,
glib,
gdk-pixbuf,
gtkmm3,
pango,
libappindicator-gtk3,
atk,
fetchFromGitHub,
}: let
buildInputs = [
libX11
libXScrnSaver
cairo
glib
gdk-pixbuf
gtkmm3
pango
libappindicator-gtk3
atk
];
in
rustPlatform.buildRustPackage {
name = "afk-cmds";
src = fetchFromGitHub {
owner = "Gerg-L";
repo = "afk-cmds";
rev = "b345d5a038a86c6ca31d3bd8800ac759da912a22";
sha256 = "sha256-yleq8bg3ZnilbYTNXRteBALiJ/fIXOxXxqf966OokqQ=";
};
inherit buildInputs;
nativeBuildInputs = [
pkg-config
wrapGAppsHook
];
postFixup = ''
wrapProgram $out/bin/afk-cmds \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs}
mkdir -p $out/share/icons/hicolor/256x256/apps/
cp $src/afk-icon.png $out/share/icons/hicolor/256x256/apps/afk-icon.png
'';
cargoSha256 = "sha256-r20g5Tkj2ft1ho/fghg+qwiGOUay8HCIrBbg+y8kQXQ=";
}

View file

@ -10,40 +10,35 @@
ffmpeg,
makeWrapper,
}:
# yt-dlp and ffmpeg required at runtime
let
rustPlatform.buildRustPackage
{
pname = "parrot";
version = "1.6.0";
src = fetchFromGitHub {
owner = "aquelemiguel";
repo = "parrot";
rev = "6b1df01bd9cce1c0d8446dea720c4a32ff935514";
hash = "sha256-f6YAdsq2ecsOCvk+A8wsUu+ywQnW//gCAkVLF0HTn8c=";
};
in
rustPlatform.buildRustPackage
{
pname = "parrot";
version = "1.6.0";
inherit src;
nativeBuildInputs = [
pkg-config
cmake
makeWrapper
];
nativeBuildInputs = [
pkg-config
cmake
makeWrapper
];
buildInputs = [
libopus
openssl
];
buildInputs = [
libopus
openssl
];
postInstall = ''
wrapProgram $out/bin/parrot \
--prefix PATH ${lib.makeBinPath [
yt-dlp
ffmpeg
]}'';
postInstall = ''
wrapProgram $out/bin/parrot \
--prefix PATH ${lib.makeBinPath [
yt-dlp
ffmpeg
]}'';
cargoLock.lockFile = "${src}/Cargo.lock";
RUSTC_BOOTSTRAP = 1;
}
cargoHash = "sha256-e4NHgwoNkZ0//rugHrP0gU3pntaMeBJsV/YSzJfD8r4=";
RUSTC_BOOTSTRAP = 1;
}

View file

@ -1,28 +1,18 @@
{
stdenv,
writeShellScriptBin,
fetchzip,
glibc,
}: let
wrapper = ''
#!/bin/sh
export LD_LIBRARY_PATH=${stdenv.cc.cc.lib}/lib/:${glibc}/lib/:/run/opengl-driver/lib/
exec ${glibc}/lib64/ld-linux-x86-64.so.2 \
$out/t-rex --no-watchdog \$@
'';
src = fetchzip {
url = "https://github.com/trexminer/T-Rex/releases/download/0.26.8/t-rex-0.26.8-linux.tar.gz";
sha256 = "sha256-qM/YIMqcntVYD8zJGCORQgIn1h4J4CDobyXwcdK3li8=";
stripRoot = false;
};
in
stdenv.mkDerivation (finalAttrs: {
version = "0.26.5";
pname = "t-rex-miner";
src = fetchzip {
url = "https://github.com/trexminer/T-Rex/releases/download/${finalAttrs.version}/t-rex-${finalAttrs.version}-linux.tar.gz";
sha256 = "sha256-eGOTfb03R2ck/6GMY6tPmTifYT9aVv3dNDQ5jRVlz58=";
stripRoot = false;
};
installPhase = ''
install -Dm555 $src/t-rex $out/t-rex
mkdir -p $out/bin
touch $out/bin/t-rex
echo "${wrapper}" > $out/bin/t-rex
chmod +x $out/bin/t-rex
'';
})
writeShellScriptBin "t-rex"
''
LD_LIBRARY_PATH=${stdenv.cc.cc.lib}/lib/:${glibc}/lib/:/run/opengl-driver/lib/
exec ${glibc}/lib64/ld-linux-x86-64.so.2 \
${src}/t-rex --no-watchdog "$@"
''