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

View file

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

View file

@ -4,8 +4,8 @@
... ...
}: { }: {
pkgs, pkgs,
config,
lib, lib,
config,
... ...
}: }:
###TAKEN FROM HERE:https://github.com/NixOS/nixpkgs/blob/4787ebf7ae2ab071389be7ff86cf38edeee7e9f8/nixos/modules/services/x11/xserver.nix#L106-L136 ###TAKEN FROM HERE:https://github.com/NixOS/nixpkgs/blob/4787ebf7ae2ab071389be7ff86cf38edeee7e9f8/nixos/modules/services/x11/xserver.nix#L106-L136
@ -18,18 +18,12 @@ let
pkgs.xorg.fontadobe100dpi pkgs.xorg.fontadobe100dpi
pkgs.xorg.fontadobe75dpi pkgs.xorg.fontadobe75dpi
]; ];
in
pkgs.runCommand "xserverbase"
{
fontpath = fontpath =
lib.optionalString (xcfg.fontPath != null) lib.optionalString (xcfg.fontPath != null)
''FontPath "${xcfg.fontPath}"''; ''FontPath "${xcfg.fontPath}"'';
inherit (xcfg) config; in ''
preferLocalBuild = true;
}
''
echo 'Section "Files"' >> $out echo 'Section "Files"' >> $out
echo $fontpath >> $out echo ${fontpath} >> $out
for i in ${toString fontsForXServer}; do for i in ${toString fontsForXServer}; do
if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then
for j in $(find $i -name fonts.dir); do for j in $(find $i -name fonts.dir); do
@ -46,9 +40,12 @@ let
echo 'EndSection' >> $out echo 'EndSection' >> $out
echo >> $out echo >> $out
''; '';
oneMonitor = pkgs.writeText "1-monitor.conf" (lib.concatStrings [(builtins.readFile xserverbase) (builtins.readFile "${self}/misc/1-monitor.conf")]); ###END OF TAKEN PART
twoMonitor = pkgs.writeText "2-monitor.conf" (lib.concatStrings [(builtins.readFile xserverbase) (builtins.readFile "${self}/misc/2-monitor.conf")]);
in { 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 ####VM SOUND BORKED
services.pipewire.package = pipewire_fix.legacyPackages.${pkgs.system}.pipewire; services.pipewire.package = pipewire_fix.legacyPackages.${pkgs.system}.pipewire;
boot = { boot = {
@ -106,9 +103,9 @@ in {
users.users.gerg.extraGroups = ["kvm" "libvirtd"]; 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 '' 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 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 xrandr --output HDMI-A-1-0 --auto --mode 1920x1080 --rate 144 --set TearFree on --pos 3440x360
xset -dpms xset -dpms
@ -130,7 +127,7 @@ in {
systemctl set-property --runtime -- user.slice AllowedCPUs=8-15,24-31 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 -- system.slice AllowedCPUs=8-15,24-31
systemctl set-property --runtime -- init.scope 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 touch /tmp/ONE_MONITOR
systemctl start display-manager.service systemctl start display-manager.service
fi 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_0
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_1 ${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_1
modprobe -a nvidia_uvm nvidia_drm nvidia nvidia_modeset 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 rm /tmp/ONE_MONITOR
systemctl start display-manager.service systemctl start display-manager.service
fi fi
fi fi
''; '';
in [ 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/hooks/qemu - - - - ${qemuHook}"
"L+ /var/lib/libvirt/qemu/Windows.xml - - - - ${self}/misc/Windows.xml" "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,20 +10,16 @@
ffmpeg, ffmpeg,
makeWrapper, makeWrapper,
}: }:
# yt-dlp and ffmpeg required at runtime rustPlatform.buildRustPackage
let {
pname = "parrot";
version = "1.6.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "aquelemiguel"; owner = "aquelemiguel";
repo = "parrot"; repo = "parrot";
rev = "6b1df01bd9cce1c0d8446dea720c4a32ff935514"; rev = "6b1df01bd9cce1c0d8446dea720c4a32ff935514";
hash = "sha256-f6YAdsq2ecsOCvk+A8wsUu+ywQnW//gCAkVLF0HTn8c="; hash = "sha256-f6YAdsq2ecsOCvk+A8wsUu+ywQnW//gCAkVLF0HTn8c=";
}; };
in
rustPlatform.buildRustPackage
{
pname = "parrot";
version = "1.6.0";
inherit src;
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config pkg-config
@ -43,7 +39,6 @@ in
ffmpeg ffmpeg
]}''; ]}'';
cargoLock.lockFile = "${src}/Cargo.lock"; cargoHash = "sha256-e4NHgwoNkZ0//rugHrP0gU3pntaMeBJsV/YSzJfD8r4=";
RUSTC_BOOTSTRAP = 1; RUSTC_BOOTSTRAP = 1;
} }

View file

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