From 11ed152b8fba5e77cd29aff7780220e99939f331 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Tue, 4 Mar 2025 16:23:41 -0700 Subject: [PATCH] much --- configuration-desktop.nix | 12 +++ configuration.nix | 10 +++ overlays/packages.nix | 1 + pkgs/idapro9.nix | 148 ++++++++++++++++++++++++++++++++++ sites/daisy/configuration.nix | 5 ++ 5 files changed, 176 insertions(+) create mode 100644 pkgs/idapro9.nix diff --git a/configuration-desktop.nix b/configuration-desktop.nix index 176ef4e..875c343 100644 --- a/configuration-desktop.nix +++ b/configuration-desktop.nix @@ -41,5 +41,17 @@ element-desktop slack obs-studio + + kdePackages.plasma-thunderbolt ]; + + systemd.services.clear-downloads = { + description = "Wipe downloads on boot"; + script = '' + rm -rf /home/audrey/Downloads + mkdir /home/audrey/Downloads + chown audrey:users /home/audrey/Downloads + ''; + wantedBy = [ "multi-user.target" ]; + }; } diff --git a/configuration.nix b/configuration.nix index 74a23e8..6dadcef 100644 --- a/configuration.nix +++ b/configuration.nix @@ -27,6 +27,8 @@ users.defaultUserShell = pkgs.zsh; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.audrey = { + uid = 1000; + description = "Audrey Dutcher"; isNormalUser = true; extraGroups = [ "wheel" "docker" ]; packages = with pkgs; [ ]; @@ -34,9 +36,14 @@ environment.systemPackages = with pkgs; [ wget + ripgrep + fd curl btop nixfmt-rfc-style + file + stdenv.cc + patchelf # language servers nil @@ -156,5 +163,8 @@ # Enable the OpenSSH daemon. services.openssh.enable = true; + + services.fwupd.enable = true; + services.hardware.bolt.enable = true; } diff --git a/overlays/packages.nix b/overlays/packages.nix index 44bdd74..f6b5d0d 100644 --- a/overlays/packages.nix +++ b/overlays/packages.nix @@ -10,6 +10,7 @@ let overlay = final: prev: { hash = "sha256-vwGHiLKSjJor4A+r599DlvSHXkDuuLSSQ4/tWFALMKU="; })]; }); + idapro9 = pkgs.callPackage ../pkgs/idapro9.nix {}; }; in { diff --git a/pkgs/idapro9.nix b/pkgs/idapro9.nix new file mode 100644 index 0000000..5e9b1fc --- /dev/null +++ b/pkgs/idapro9.nix @@ -0,0 +1,148 @@ +{ + lib, + stdenv, + requireFile, + fetchurl, + autoPatchelfHook, + copyDesktopItems, + python3, + libsForQt5, + cairo, + dbus, + fontconfig, + freetype, + glib, + gtk3, + libdrm, + libGL, + libkrb5, + libsecret, + libunwind, + libxkbcommon, + openssl, + gcc, + clang, + xorg, + zlib, + curl, + makeDesktopItem, + makeWrapper, +}: + +let + pythonForIDA = python3.withPackages (ps: with ps; [ rpyc ]); +in +# https://github.com/msanft/ida-pro-overlay/blob/main/packages/ida-pro.nix +stdenv.mkDerivation (self: { + pname = "idapro"; + version = "9.0.241217"; + src = requireFile { + name = "idapro-9.0.241217.tar.xz"; + hash = "sha256-V6RYQlwY8qYlASkyUZx2NgIkuQhf2fTd1tA7MFpOqLc="; + message = '' + Please run nix store add-file idapro-9.0.241217.tar.xz + Its sha256sum should be 57a458425c18f2a625012932519c76360224b9085fd9f4ddd6d03b305a4ea8b7 + ''; + }; + + nativeBuildInputs = [ + autoPatchelfHook + copyDesktopItems + makeWrapper + ]; + + # Add everything to the RPATH, in case IDA decides to dlopen things. + runtimeDependencies = [ + cairo + dbus + fontconfig + freetype + glib + gtk3 + libdrm + libGL + libkrb5 + libsecret + libunwind + libxkbcommon + openssl.out + (if stdenv.cc.isGNU then gcc else clang).cc + xorg.libICE + xorg.libSM + xorg.libX11 + xorg.libXau + xorg.libxcb + xorg.libXext + xorg.libXi + xorg.libXrender + xorg.xcbutilimage + xorg.xcbutilkeysyms + xorg.xcbutilrenderutil + xorg.xcbutilwm + zlib + curl.out + pythonForIDA + ]; + buildInputs = self.runtimeDependencies; + + qtWrapperArgs = [ + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/opt $out/lib $out/bin + cp ${libsForQt5.qtbase.out}/lib/libQt5EglFSDeviceIntegration.so.5 . + cp -a * $out/opt + + # Link the exported libraries to the output. + for lib in $out/opt/libida*; do + ln -s $lib $out/lib/$(basename $lib) + done + + ln -s $out/opt/ida $out/bin/ida + ln -s ida $out/bin/ida64 + + runHook postInstall + ''; + + preFixup = '' + patchelf --shrink-rpath --allowed-rpath-prefixes $(patchelf --print-rpath $out/opt/libQt5EglFSDeviceIntegration.so.5 | sed 's/:/\n/g' | grep -v qtbase | paste -s -d: -) $out/opt/libQt5EglFSDeviceIntegration.so.5 + # Some libraries come with the installer. + addAutoPatchelfSearchPath $out/opt + + # Manually patch libraries that dlopen stuff. + patchelf --add-needed libpython3.12.so $out/lib/libida.so + patchelf --add-needed libcrypto.so $out/lib/libida.so + + wrapProgram "$out/opt/ida" \ + --prefix PYTHONPATH : $out/opt/idalib/python \ + --prefix PATH : ${pythonForIDA}/bin + ''; + #--prefix QT_PLUGIN_PATH : $out/opt/plugins/platforms \ + + desktopItem = makeDesktopItem { + name = "ida-pro"; + exec = "ida"; + icon = fetchurl { + url = "https://www.xzji.com/upload/y20/07x15/1518115f0eadb3d25ab.png"; + name = "appico.png"; + hash = "sha256-mso/8F4AT5Ry1RHG3plo03rssRRUw9xBwu3fjh8PqYc"; + }; + comment = self.meta.description; + desktopName = "IDA Pro"; + genericName = "Interactive Disassembler"; + categories = [ "Development" ]; + startupWMClass = "IDA"; + }; + desktopItems = [ self.desktopItem ]; + + + meta = with lib; { + description = "The world's smartest and most feature-full disassembler"; + homepage = "https://hex-rays.com/ida-pro/"; + mainProgram = "ida"; + platforms = [ "x86_64-linux" ]; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + }; +}) diff --git a/sites/daisy/configuration.nix b/sites/daisy/configuration.nix index e6e2b47..67e4599 100644 --- a/sites/daisy/configuration.nix +++ b/sites/daisy/configuration.nix @@ -22,4 +22,9 @@ networking.firewall.allowedUDPPorts = [ 1337 ]; system.stateVersion = "24.11"; + services.immich.enable = true; + + environment.systemPackages = [ + pkgs.idapro9 + ]; }