From f749641e688e8e5af1c8c046444d57b22676cf32 Mon Sep 17 00:00:00 2001 From: alsaiduq-lab Date: Sat, 24 May 2025 18:05:54 -0600 Subject: [PATCH] version bump to 25.05 --- flake.lock | 286 +++--------------------- flake.nix | 219 ++++-------------- home-manager/cobray.nix | 4 +- home-manager/modules/emulators.nix | 6 +- home-manager/modules/ffmpeg.nix | 5 +- hosts/configuration.nix | 5 + hosts/local-packages.nix | 14 +- manual-cleanup.txt | 3 + modules/audio.nix | 1 - modules/default.nix | 6 - modules/env.nix | 2 +- modules/ffmpeg.nix | 5 - modules/fonts.nix | 7 +- modules/home-manager.nix | 11 +- modules/i3-xfce.nix | 2 +- modules/python.nix | 17 +- modules/steam.nix | 1 - pkgs/default.nix | 51 +---- pkgs/python-opencv-headless/default.nix | 72 +++--- pkgs/python-pymatting/default.nix | 9 +- pkgs/python-rembg/default.nix | 14 +- pkgs/rpcs3/default.nix | 90 ++++++++ 22 files changed, 254 insertions(+), 576 deletions(-) delete mode 100644 modules/ffmpeg.nix create mode 100644 pkgs/rpcs3/default.nix diff --git a/flake.lock b/flake.lock index fe3f8a0..34d1bde 100644 --- a/flake.lock +++ b/flake.lock @@ -1,114 +1,15 @@ { "nodes": { - "determinate": { - "inputs": { - "determinate-nixd-aarch64-darwin": "determinate-nixd-aarch64-darwin", - "determinate-nixd-aarch64-linux": "determinate-nixd-aarch64-linux", - "determinate-nixd-x86_64-darwin": [ - "determinate", - "determinate-nixd-aarch64-darwin" - ], - "determinate-nixd-x86_64-linux": "determinate-nixd-x86_64-linux", - "nix": "nix", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1743626375, - "narHash": "sha256-4wo3tMgnqvWDSjM1+p0rowOtxXfSYmcyv/VVA2ezpOE=", - "rev": "8d0d8b5624db222f5eac8c81ca250ecf51b154e9", - "revCount": 217, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/3.2.1/0195f83d-5008-71dc-b7a1-ea791584fd3f/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/DeterminateSystems/determinate/%2A" - } - }, - "determinate-nixd-aarch64-darwin": { - "flake": false, - "locked": { - "narHash": "sha256-qJbDwSo+bOguk/Lb+ZQs4sWpdvQrnoRmilsLOrLkymQ=", - "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.2.1/macOS" - }, - "original": { - "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.2.1/macOS" - } - }, - "determinate-nixd-aarch64-linux": { - "flake": false, - "locked": { - "narHash": "sha256-1EAbjeqiX7RJDfrxesLLqwJbR2AsmDqRrDSygVFh+u8=", - "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.2.1/aarch64-linux" - }, - "original": { - "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.2.1/aarch64-linux" - } - }, - "determinate-nixd-x86_64-linux": { - "flake": false, - "locked": { - "narHash": "sha256-yi1T7JFH+eoeLDImaRVJuLXxtXqNOmGcjGPUyDbntK0=", - "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.2.1/x86_64-linux" - }, - "original": { - "type": "file", - "url": "https://install.determinate.systems/determinate-nixd/tag/v3.2.1/x86_64-linux" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "determinate", - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_2": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1741352980, - "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { @@ -117,41 +18,6 @@ "type": "github" } }, - "git-hooks-nix": { - "inputs": { - "flake-compat": [ - "determinate", - "nix" - ], - "gitignore": [ - "determinate", - "nix" - ], - "nixpkgs": [ - "determinate", - "nix", - "nixpkgs" - ], - "nixpkgs-stable": [ - "determinate", - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1734279981, - "narHash": "sha256-NdaCraHPp8iYMWzdXAt5Nv6sA3MUzlCiGiR586TCwo0=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "aa9f40c906904ebd83da78e7f328cd8aeaeae785", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -159,52 +25,33 @@ ] }, "locked": { - "lastModified": 1743717835, - "narHash": "sha256-LJm6FoIcUoBw3w25ty12/sBfut4zZuNGdN0phYj/ekU=", + "lastModified": 1747556831, + "narHash": "sha256-Qb84nbYFFk0DzFeqVoHltS2RodAYY5/HZQKE8WnBDsc=", "owner": "nix-community", "repo": "home-manager", - "rev": "66a6ec65f84255b3defb67ff45af86c844dd451b", + "rev": "d0bbd221482c2713cccb80220f3c9d16a6e20a33", "type": "github" }, "original": { "owner": "nix-community", + "ref": "release-25.05", "repo": "home-manager", "type": "github" } }, - "nix": { - "inputs": { - "flake-compat": "flake-compat", - "flake-parts": "flake-parts", - "git-hooks-nix": "git-hooks-nix", - "nixpkgs": "nixpkgs", - "nixpkgs-23-11": "nixpkgs-23-11", - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1743623616, - "narHash": "sha256-e6rgsNCMzWYpRxSC+tcsrdlVfxITy666PKs2TdOpVUI=", - "rev": "63d41e72f4895fb9f19aa9029bf08e2361959a07", - "revCount": 19952, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nix-src/3.2.1/0195f838-0040-7334-ad8e-0a1fa2e9bbf7/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/DeterminateSystems/nix-src/%2A" - } - }, "nix-gaming": { "inputs": { - "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_3" + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1743644846, - "narHash": "sha256-I217zRnDlSdWzoZi4sHaRKdY+x60tLOo8TyRshkyUBM=", + "lastModified": 1747965612, + "narHash": "sha256-koAXv7H+cZBMOZkOekO7AIan0e75/ptPqkiOkO3x9lM=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "a6fac721ece856f5dd4690b41b92e7ba3a71d033", + "rev": "10e16d55b14d6d2f86d636d546be5130c0827933", "type": "github" }, "original": { @@ -215,43 +62,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1734359947, - "narHash": "sha256-1Noao/H+N8nFB4Beoy8fgwrcOQLVm9o4zKW1ODaqK9E=", + "lastModified": 1747953325, + "narHash": "sha256-y2ZtlIlNTuVJUZCqzZAhIw5rrKP4DOSklev6c8PyCkQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "48d12d5e70ee91fe8481378e540433a7303dbf6a", + "rev": "55d1f923c480dadce40f5231feb472e81b0bab48", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-24.11", + "ref": "nixos-25.05", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-23-11": { - "locked": { - "lastModified": 1717159533, - "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", - "type": "github" - } - }, "nixpkgs-lib": { "locked": { - "lastModified": 1740877520, - "narHash": "sha256-oiwv/ZK/2FhGxrCkQkB83i7GnWXPPLzoqFHpDD3uYpk=", + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "147dee35aab2193b174e4c0868bd80ead5ce755c", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", "type": "github" }, "original": { @@ -260,85 +91,22 @@ "type": "github" } }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1742206328, - "narHash": "sha256-q+AQ///oMnyyFzzF4H9ShSRENt3Zsx37jTiRkLkXXE0=", - "rev": "096478927c360bc18ea80c8274f013709cf7bdcd", - "revCount": 769586, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nixpkgs-weekly/0.1.769586%2Brev-096478927c360bc18ea80c8274f013709cf7bdcd/0195a7c1-66e1-7e6a-9a81-ea18d238a253/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0.1.tar.gz" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1743076231, - "narHash": "sha256-yQugdVfi316qUfqzN8JMaA2vixl+45GxNm4oUfXlbgw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6c5963357f3c1c840201eda129a99d455074db04", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1743576891, - "narHash": "sha256-vXiKURtntURybE6FMNFAVpRPr8+e8KoLPrYs9TGuAKc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "44a69ed688786e98a101f02b712c313f1ade37ab", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { - "determinate": "determinate", "home-manager": "home-manager", "nix-gaming": "nix-gaming", - "nixpkgs": "nixpkgs_4", - "rpcs3-latest": "rpcs3-latest" + "nixpkgs": "nixpkgs", + "rpcs3_latest": "rpcs3_latest" } }, - "rpcs3-latest": { + "rpcs3_latest": { "flake": false, "locked": { - "lastModified": 1743659989, - "narHash": "sha256-qrzu2BGzaaCnUMjpqe4O/amr3fPzASUiyc8wYU5pnQQ=", + "lastModified": 1748103898, + "narHash": "sha256-HlLFleqkEVs2StNBw1WG9lVuH5kNaZyYFpgMVOvQCMc=", "owner": "RPCS3", "repo": "rpcs3", - "rev": "37dbd77628f44cdef3228bdfc03127365ec7383b", + "rev": "3e674a896f9e70ee7112c89c0a2a07f0df4d2326", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d015ad5..1a5522c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,204 +1,69 @@ -# TODO: remodulate the rpcs3 stuff somewhere else, clunky here { description = "NixOS configuration for Cobray"; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; home-manager = { - url = "github:nix-community/home-manager"; + url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; nix-gaming = { url = "github:fufexan/nix-gaming"; + inputs.nixpkgs.follows = "nixpkgs"; }; - rpcs3-latest = { + rpcs3_latest = { url = "github:RPCS3/rpcs3"; flake = false; }; - determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/*"; }; - outputs = { self, nixpkgs, home-manager, nix-gaming, - rpcs3-latest, - determinate, + rpcs3_latest, ... } @ inputs: let system = "x86_64-linux"; - customPkgsOverlay = final: prev: let - customPkgs = import ./pkgs { - pkgs = prev; - lib = prev.lib; - }; - in - customPkgs - // { - pugixml = prev.pugixml.overrideAttrs (oldAttrs: rec { - version = "1.15"; - src = prev.fetchurl { - url = "https://github.com/zeux/pugixml/releases/download/v${version}/pugixml-${version}.tar.gz"; - sha256 = "sha256-ZVreV/pwP7QhwuuaARO1BkvdsUXUFd0fiMeTU9kNURo="; - }; - }); - SDL3 = prev.stdenv.mkDerivation rec { - pname = "SDL3"; - version = "3.1.3"; - src = prev.fetchFromGitHub { - owner = "libsdl-org"; - repo = "SDL"; - rev = "preview-${version}"; - sha256 = "sha256-S7yRcLHMPgq6+gec8l+ESxp2dJ+6Po/UNsBUXptQzMQ="; - }; - nativeBuildInputs = [prev.cmake]; - buildInputs = [ - prev.libGL - prev.xorg.libX11 - prev.xorg.libXext - prev.alsa-lib - ]; - cmakeFlags = [ - "-DSDL_STATIC=OFF" - "-DSDL_SHARED=ON" - "-DSDL_CMAKE_DEBUG_POSTFIX=" - "-DSDL_INSTALL_CMAKEDIR=${placeholder "out"}/lib/cmake/SDL3" - ]; - postInstall = '' - echo "SDL3 contents:" >&2 - ls -lR $out >&2 - if [ -f "$out/lib/cmake/SDL3/SDL3Config.cmake" ]; then - echo "SDL3Config.cmake:" >&2 - cat $out/lib/cmake/SDL3/SDL3Config.cmake >&2 - else - echo "ERROR: SDL3Config.cmake not found" >&2 - exit 1 - fi - ''; - }; - rpcs3 = prev.rpcs3.overrideAttrs (oldAttrs: { - nativeBuildInputs = - (oldAttrs.nativeBuildInputs or []) - ++ [ - prev.llvmPackages_18.llvm.dev - prev.llvmPackages_18.clang - prev.pkg-config - prev.qt6.qmake - prev.qt6.full - prev.xxd - prev.wayland-scanner - ]; - buildInputs = - (oldAttrs.buildInputs or []) - ++ [ - prev.llvmPackages_18.llvm - prev.llvmPackages_18.libclang - final.SDL3 - prev.qt6.full - prev.vulkan-loader - prev.vulkan-tools - prev.wayland - prev.wayland-protocols - prev.libxkbcommon - prev.libpulseaudio - prev.libevdev - prev.udev - prev.glew - prev.libpng - prev.zstd - ]; - cmakeFlags = - (oldAttrs.cmakeFlags or []) - ++ [ - "-DCMAKE_PREFIX_PATH=${final.SDL3};${prev.qt6.full};${prev.wayland}" - "-DSDL3_DIR=${final.SDL3}/lib/cmake/SDL3" - "-DSDL3_INCLUDE_DIR=${final.SDL3}/include/SDL3" - "-DSDL3_LIBRARY=${final.SDL3}/lib/libSDL3.so" - "-DQt6_DIR=${prev.qt6.full}/lib/cmake/Qt6" - "-DWAYLAND_SCANNER=${prev.wayland-scanner}/bin/wayland-scanner" - "-DUSE_SYSTEM_FFMPEG=ON" - "-DUSE_SYSTEM_CURL=ON" - "-DUSE_SYSTEM_WOLFSSL=ON" - "-DUSE_QT=ON" - "-DUSE_VULKAN=ON" - "-DUSE_WAYLAND=ON" - "-DUSE_PULSEAUDIO=ON" - "-DUSE_LIBEVDEV=ON" - "-DUSE_SYSTEM_ZSTD=ON" - "-DUSE_DISCORD_RPC=ON" - "-DCMAKE_VERBOSE_MAKEFILE=ON" - "-DCMAKE_MESSAGE_LOG_LEVEL=TRACE" - ]; - preConfigure = '' - echo "Verifying submodule directories:" >&2 - ls -l 3rdparty/hidapi/hidapi 3rdparty/glslang/glslang 3rdparty/yaml-cpp/yaml-cpp 3rdparty/zstd/zstd 3rdparty/discord-rpc >&2 - if [ ! -f 3rdparty/hidapi/hidapi/CMakeLists.txt ] || [ ! -f 3rdparty/discord-rpc/CMakeLists.txt ]; then - echo "ERROR: Submodules (hidapi or discord-rpc) not fetched correctly" >&2 - exit 1 - fi - echo "Original 3rdparty/CMakeLists.txt:" >&2 - cat 3rdparty/CMakeLists.txt >&2 - sed -i '/find_package(SDL3/ { - s/find_package(SDL3.*)/set(SDL3_FOUND TRUE)/ - a set(SDL3_INCLUDE_DIRS "${final.SDL3}/include/SDL3") - a set(SDL3_LIBRARIES "${final.SDL3}/lib/libSDL3.so") - }' 3rdparty/CMakeLists.txt - sed -i 's/message(FATAL_ERROR "SDL3 is not available on this system")/# Patched: SDL3 assumed available/' 3rdparty/CMakeLists.txt - echo "Patched 3rdparty/CMakeLists.txt:" >&2 - cat 3rdparty/CMakeLists.txt >&2 - echo "Checking submodules:" >&2 - ls -lR 3rdparty/hidapi 3rdparty/glslang 3rdparty/yaml-cpp 3rdparty/cubeb 3rdparty/zstd 3rdparty/discord-rpc >&2 - ''; - }); - }; - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - overlays = [customPkgsOverlay]; + customPkgs = import "${self}/pkgs" { + pkgs = nixpkgs.legacyPackages.${system}; + lib = nixpkgs.lib; + inherit rpcs3_latest; }; - lib = nixpkgs.lib; - - rpcs3_latest = pkgs.rpcs3.overrideAttrs (oldAttrs: { - src = pkgs.fetchgit { - url = "https://github.com/RPCS3/rpcs3.git"; - rev = inputs.rpcs3-latest.rev; - sha256 = "Yx0Qsc0r+5C0BqqsbJCv47QPeaNbaIut8s6Hcysy2mo="; - fetchSubmodules = true; - }; - nativeBuildInputs = oldAttrs.nativeBuildInputs; - buildInputs = oldAttrs.buildInputs; - cmakeFlags = - oldAttrs.cmakeFlags - ++ [ - "-DUSE_DISCORD_RPC=ON" - ]; - preUnpack = '' - echo "Source rev: ${inputs.rpcs3-latest.rev}" >&2 - echo "Expected rev: 37dbd77628f44cdef3228bdfc03127365ec7383b" >&2 - ''; - }); in { - packages.${system} = { - rpcs3_latest = rpcs3_latest; - }; - nixosConfigurations = { - nixos = lib.nixosSystem { - inherit system; - specialArgs = {inherit inputs rpcs3_latest;}; - modules = [ - {nixpkgs.overlays = [customPkgsOverlay];} - ./hosts/configuration.nix - determinate.nixosModules.default - ]; - }; - }; - homeConfigurations = { - "cobray" = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = {inherit inputs rpcs3_latest;}; - modules = [./home-manager/cobray.nix]; + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs customPkgs; + lib = nixpkgs.lib; }; + modules = [ + { + nixpkgs.config.allowUnfree = true; + nixpkgs.overlays = [ + (final: prev: { + inherit + (customPkgs) + fish-rust + pugixml + SDL3 + rpcs3_latest + ; + }) + ]; + } + ./hosts/configuration.nix + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { + inherit inputs customPkgs; + }; + users.cobray = import ./home-manager/cobray.nix; + }; + } + ]; }; }; } diff --git a/home-manager/cobray.nix b/home-manager/cobray.nix index ceae72f..e7049e9 100644 --- a/home-manager/cobray.nix +++ b/home-manager/cobray.nix @@ -1,6 +1,6 @@ { pkgs, - rpcs3_latest, + inputs, ... }: { imports = [ @@ -23,6 +23,7 @@ home.stateVersion = "24.11"; programs.home-manager.enable = true; home.enableNixpkgsReleaseCheck = false; + xdg.mime.enable = false; home.packages = with pkgs; [ coreutils @@ -34,6 +35,5 @@ btop nvtopPackages.full arandr - rpcs3_latest ]; } diff --git a/home-manager/modules/emulators.nix b/home-manager/modules/emulators.nix index 87d7615..83fad93 100644 --- a/home-manager/modules/emulators.nix +++ b/home-manager/modules/emulators.nix @@ -1,4 +1,7 @@ -{pkgs, ...}: { +{ + pkgs, + ... +}: { home.packages = with pkgs; [ mgba desmume @@ -12,5 +15,6 @@ joycond waydroid shadps4 + rpcs3_latest ]; } diff --git a/home-manager/modules/ffmpeg.nix b/home-manager/modules/ffmpeg.nix index d1a2adb..7e99a26 100644 --- a/home-manager/modules/ffmpeg.nix +++ b/home-manager/modules/ffmpeg.nix @@ -1,8 +1,5 @@ {pkgs, ...}: { home.packages = with pkgs; [ - (ffmpeg.override { - withXcb = true; - withXlib = true; - }) + ffmpeg_7-full ]; } diff --git a/hosts/configuration.nix b/hosts/configuration.nix index 6f6e365..8703537 100644 --- a/hosts/configuration.nix +++ b/hosts/configuration.nix @@ -14,6 +14,11 @@ dates = "weekly"; options = "--delete-older-than 30d"; }; + + nix.settings = { + warn-dirty = false; + }; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It's perfectly fine and recommended to leave diff --git a/hosts/local-packages.nix b/hosts/local-packages.nix index a0bc684..6b32c76 100644 --- a/hosts/local-packages.nix +++ b/hosts/local-packages.nix @@ -1,11 +1,5 @@ # TODO: cleanout and repopulate individual packages better -{ - pkgs, - lib, - ... -}: let - customPkgs = import ../pkgs {inherit pkgs lib;}; -in { +{pkgs, ...}: { python.enable = true; npm.enable = true; @@ -111,7 +105,6 @@ in { tree mesa libglvnd - mesa.drivers socat gnused gawk @@ -127,7 +120,6 @@ in { fzf jq bash - customPkgs.fish-rust xorg.xdpyinfo slop dunst @@ -156,5 +148,9 @@ in { xorg.libXtst xorg.libXi xorg.xorgproto + texlive.combined.scheme-full + imagemagick + poppler_utils + ghostscript ]; } diff --git a/manual-cleanup.txt b/manual-cleanup.txt index 1f3c821..e30290e 100644 --- a/manual-cleanup.txt +++ b/manual-cleanup.txt @@ -10,3 +10,6 @@ sudo nix-collect-garbage -d # As a separation of concerns - you will need to run this command to clean out boot sudo /run/current-system/bin/switch-to-configuration boot + +# bonus: in case you're stuck in some limbo state +sudo /run/current-system/sw/bin/nixos-rebuild switch --flake . diff --git a/modules/audio.nix b/modules/audio.nix index 58ac736..ae50b29 100644 --- a/modules/audio.nix +++ b/modules/audio.nix @@ -15,7 +15,6 @@ alsa-utils portaudio alsa-lib - ffmpeg pavucontrol clang ]; diff --git a/modules/default.nix b/modules/default.nix index 10f0225..f0b5542 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -6,7 +6,6 @@ ./docker.nix ./env.nix ./fonts.nix - ./home-manager.nix ./i3-xfce.nix ./net.nix ./nixos.nix @@ -18,7 +17,6 @@ ./npm.nix ./tailscale.nix ./udiskie.nix - ./ffmpeg.nix # ./ollama.nix ]; @@ -32,8 +30,4 @@ enable = true; enableSSHSupport = true; }; - - environment.systemPackages = with pkgs; [ - home-manager - ]; } diff --git a/modules/env.nix b/modules/env.nix index 8025ac8..ba50b91 100644 --- a/modules/env.nix +++ b/modules/env.nix @@ -20,7 +20,7 @@ LUA_PATH = "${pkgs.luajit}/share/lua/5.1/?.lua;${pkgs.luajit}/share/lua/5.1/?/init.lua;;"; LUA_CPATH = "${pkgs.luajit}/lib/lua/5.1/?.so;;"; PKG_CONFIG_PATH = lib.makeSearchPath "lib/pkgconfig" [ - pkgs.mesa.drivers + pkgs.mesa pkgs.openssl.dev pkgs.libxml2.dev pkgs.zlib.dev diff --git a/modules/ffmpeg.nix b/modules/ffmpeg.nix deleted file mode 100644 index 9a32e95..0000000 --- a/modules/ffmpeg.nix +++ /dev/null @@ -1,5 +0,0 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [ - ffmpeg_7-full - ]; -} diff --git a/modules/fonts.nix b/modules/fonts.nix index 32d3d04..f1ce123 100644 --- a/modules/fonts.nix +++ b/modules/fonts.nix @@ -18,7 +18,12 @@ in { noto-fonts-cjk-sans noto-fonts-cjk-serif noto-fonts-emoji - (nerdfonts.override {fonts = ["0xProto" "FiraCode" "JetBrainsMono" "Hack" "Noto" "NerdFontsSymbolsOnly"];}) + nerd-fonts._0xproto + nerd-fonts.fira-code + nerd-fonts.jetbrains-mono + nerd-fonts.hack + nerd-fonts.noto + nerd-fonts.symbols-only ipafont kochi-substitute clear-sans diff --git a/modules/home-manager.nix b/modules/home-manager.nix index bd3ca97..3390c40 100644 --- a/modules/home-manager.nix +++ b/modules/home-manager.nix @@ -1,17 +1,12 @@ -{ - inputs, - rpcs3_latest, - ... -}: { +{ inputs, pkgs, lib, rpcs3_latest, ... }: { imports = [ inputs.home-manager.nixosModules.home-manager ]; home-manager = { useGlobalPkgs = true; useUserPackages = true; - extraSpecialArgs = { - inherit inputs rpcs3_latest; + users.cobray = import ../home-manager/cobray.nix { + inherit pkgs lib rpcs3_latest; }; - users.cobray = import ../home-manager/cobray.nix; }; } diff --git a/modules/i3-xfce.nix b/modules/i3-xfce.nix index 7074326..0c6b9c1 100644 --- a/modules/i3-xfce.nix +++ b/modules/i3-xfce.nix @@ -162,7 +162,7 @@ in { xsettingsd hicolor-icon-theme adwaita-icon-theme - breeze-icons + kdePackages.breeze-icons gnome-themes-extra ]; diff --git a/modules/python.nix b/modules/python.nix index ed35850..2c2bcc6 100644 --- a/modules/python.nix +++ b/modules/python.nix @@ -4,26 +4,15 @@ lib, ... }: let - customPkgs = pkgs.callPackage ../pkgs {inherit pkgs lib;}; py = pkgs.python311Packages; - pipConf = pkgs.writeText "pip.conf" '' - [global] - no-cache-dir = false - [install] - ignore-installed = false - [packages] - numpy = "<2.0.0" - ''; - gccLibPath = "${pkgs.gcc-unwrapped.lib}/lib"; nvidiaLibPath = "${pkgs.linuxPackages.nvidia_x11}/lib"; cudaLibPath = "${pkgs.cudatoolkit}/lib"; glvndLibPath = "${pkgs.libglvnd}/lib"; ldLibraryPath = "${gccLibPath}:${nvidiaLibPath}:${cudaLibPath}:${glvndLibPath}"; - pythonEnv = pkgs.python311.buildEnv.override { extraLibs = with py; [ - customPkgs.python-rembg + numpy i3ipc requests ipython @@ -45,7 +34,6 @@ --prefix LD_LIBRARY_PATH : "${ldLibraryPath}" ''; }; - custom-UV = pkgs.symlinkJoin { name = "uv"; paths = [pkgs.uv]; @@ -69,8 +57,5 @@ in { stdenv.cc.cc.lib python311 ]; - environment.variables = { - PIP_CONFIG_FILE = "${pipConf}"; - }; }; } diff --git a/modules/steam.nix b/modules/steam.nix index 3a38319..74a2bff 100644 --- a/modules/steam.nix +++ b/modules/steam.nix @@ -28,7 +28,6 @@ piper portaudio alsa-lib - ffmpeg stdenv.cc.cc.lib libglvnd ]; diff --git a/pkgs/default.nix b/pkgs/default.nix index 458bc28..bc04500 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,51 +1,12 @@ { - pkgs ? import {}, - lib ? pkgs.lib, + pkgs, + lib, + rpcs3_latest, }: let - numpy-1 = pkgs.python311Packages.numpy.overridePythonAttrs (oldAttrs: rec { - version = "1.26.4"; - src = pkgs.fetchPypi { - pname = "numpy"; - inherit version; - sha256 = "0410j6jfz1yzm5s0v0yrc1j0q6ih4322357and7arr0jxnlsn0ia"; - }; - }); - - customPython = pkgs.python311.override { - packageOverrides = self: super: { - numpy = numpy-1; - }; + rpcs3Pkgs = pkgs.callPackage ./rpcs3 { + inherit lib rpcs3_latest; }; - customPythonPackages = customPython.pkgs; in { - inherit numpy-1 customPythonPackages; - + inherit (rpcs3Pkgs) pugixml SDL3 rpcs3 rpcs3_latest; fish-rust = pkgs.callPackage ./fish-rust {}; - - python-rembg = pkgs.callPackage ./python-rembg { - inherit lib; - fetchPypi = pkgs.fetchPypi; - python311Packages = customPythonPackages; - python-pymatting = pkgs.callPackage ./python-pymatting { - inherit lib; - fetchPypi = pkgs.fetchPypi; - python311Packages = customPythonPackages; - }; - python-opencv-headless = pkgs.callPackage ./python-opencv-headless { - inherit lib; - fetchPypi = pkgs.fetchPypi; - cmake = pkgs.cmake; - pkg-config = pkgs.pkg-config; - stdenv = pkgs.stdenv; - makeWrapper = pkgs.makeWrapper; - python311Packages = customPythonPackages; - }; - }; - - # removing for now since it seems to work, will leave just in case - # python-ngx-lsp = pkgs.callPackage ./python-nginx-language-server { - # inherit lib; - # fetchFromGitHub = pkgs.fetchFromGitHub; - # python311Packages = customPythonPackages; - #}; } diff --git a/pkgs/python-opencv-headless/default.nix b/pkgs/python-opencv-headless/default.nix index d32abf8..3346050 100644 --- a/pkgs/python-opencv-headless/default.nix +++ b/pkgs/python-opencv-headless/default.nix @@ -6,50 +6,70 @@ makeWrapper, cmake, pkg-config, + cudaPackages, + enableCuda ? false, }: python311Packages.buildPythonPackage rec { pname = "opencv-python-headless"; version = "4.11.0.86"; - format = "setuptools"; - + format = "other"; src = fetchPypi { pname = "opencv-python-headless"; inherit version; - format = "setuptools"; sha256 = "mW6ygspLQ+xqOXJBTeDiMx9dnNorQQkaSXOcGfuEN5g="; }; - - nativeBuildInputs = with python311Packages; [ - cmake - pkg-config - makeWrapper - scikit-build - ]; - - buildInputs = with python311Packages; [ - scikit-build - ]; - + nativeBuildInputs = with python311Packages; + [ + cmake + pkg-config + makeWrapper + scikit-build + ] + ++ lib.optionals enableCuda (with cudaPackages; [ + cudatoolkit + ]); + buildInputs = with python311Packages; + [ + scikit-build + ] + ++ lib.optionals enableCuda (with cudaPackages; [ + cudatoolkit + cudnn + ]); propagatedBuildInputs = with python311Packages; [ setuptools numpy ]; - dontUseCmakeConfigure = true; - - doCheck = false; - - pythonImportsCheck = ["cv2"]; - - postFixup = '' - wrapPythonProgramsIn "$out/lib/python3.11/site-packages" "${stdenv.cc.cc.lib}" + SKBUILD_CMAKE_ARGS = + [ + "-DCMAKE_BUILD_TYPE=Release" + "-DBUILD_opencv_apps=OFF" + "-DBUILD_EXAMPLES=OFF" + "-DBUILD_TESTS=OFF" + "-DBUILD_PERF_TESTS=OFF" + "-DBUILD_DOCS=OFF" + "-DOPENCV_GENERATE_PKGCONFIG=ON" + "-DCMAKE_BUILD_PARALLEL_LEVEL=$(nproc)" + ] + ++ lib.optionals enableCuda [ + "-DWITH_CUDA=ON" + "-DCUDA_TOOLKIT_ROOT_DIR=${cudaPackages.cudatoolkit}" + "-DWITH_CUDNN=ON" + ]; + postPatch = lib.optionalString enableCuda '' + export LD_LIBRARY_PATH=${cudaPackages.cudatoolkit.lib}/lib:$LD_LIBRARY_PATH + ''; + doCheck = false; + pythonImportsCheck = ["cv2"]; + postFixup = '' + wrapPythonProgramsIn "$out/lib/python3.11/site-packages" "${stdenv.cc.cc.lib}${lib.optionalString enableCuda ":${cudaPackages.cudatoolkit.lib}/lib"}" ''; - meta = with lib; { - description = "Wrapper package for OpenCV python bindings (headless)"; + description = "Wrapper package for OpenCV python bindings (headless)${lib.optionalString enableCuda " with CUDA support"}"; homepage = "https://github.com/opencv/opencv-python"; license = licenses.mit; platforms = platforms.linux; - maintainers = with maintainers; ["Cobray"]; + maintainers = ["Cobray"]; }; } diff --git a/pkgs/python-pymatting/default.nix b/pkgs/python-pymatting/default.nix index 889cce7..ff38b40 100644 --- a/pkgs/python-pymatting/default.nix +++ b/pkgs/python-pymatting/default.nix @@ -7,33 +7,28 @@ python311Packages.buildPythonPackage rec { pname = "pymatting"; version = "1.1.13"; format = "pyproject"; - src = fetchPypi { inherit pname version; hash = "sha256-LNt8S++s3e9Netwt6ONKJy3mOdYIrlwKCGE9+kJTgQE="; }; - nativeBuildInputs = with python311Packages; [ setuptools poetry-core ]; - propagatedBuildInputs = with python311Packages; [ + numpy scipy pillow numba ]; - buildInputs = [ ]; - doCheck = false; - meta = with lib; { description = "A library for alpha matting"; homepage = "https://github.com/pymatting/pymatting"; license = licenses.mit; platforms = platforms.all; - maintainers = with maintainers; ["Cobray"]; + maintainers = ["Cobray"]; }; } diff --git a/pkgs/python-rembg/default.nix b/pkgs/python-rembg/default.nix index 0a2d792..648777f 100644 --- a/pkgs/python-rembg/default.nix +++ b/pkgs/python-rembg/default.nix @@ -3,15 +3,15 @@ python311Packages, fetchPypi, python-pymatting, - python-opencv-headless, + enableCuda ? false, }: python311Packages.buildPythonPackage rec { pname = "rembg"; - version = "2.0.50"; + version = "2.0.66"; format = "pyproject"; src = fetchPypi { inherit pname version; - sha256 = "bMt/GbplRawFZUqoXq37zAq1dribnu/ZlIYTuUIS+DU="; + sha256 = "sha256-hRBoq0zMY6artJs69z/cZntx41tmWGM9E/0HSFWPvZk="; }; nativeBuildInputs = with python311Packages; [ poetry-core @@ -27,20 +27,22 @@ python311Packages.buildPythonPackage rec { tqdm aiohttp pytorch-bin + (opencv4.override {enableCuda = enableCuda;}) ] ++ [ - python-opencv-headless python-pymatting ]; pythonRemoveDeps = ["opencv-python-headless"]; dontPrecompilePages = true; doInstallCheck = false; doCheck = false; + dontCheck = true; + checkPhase = "echo 'Skipping tests'"; meta = with lib; { - description = "Tool to remove image backgrounds"; + description = "Tool to remove image backgrounds${lib.optionalString enableCuda " with CUDA support"}"; homepage = "https://github.com/danielgatis/rembg"; license = licenses.mit; platforms = platforms.all; - maintainers = with maintainers; ["Cobray"]; + maintainers = ["Cobray"]; }; } diff --git a/pkgs/rpcs3/default.nix b/pkgs/rpcs3/default.nix new file mode 100644 index 0000000..9da3e21 --- /dev/null +++ b/pkgs/rpcs3/default.nix @@ -0,0 +1,90 @@ +{ + pkgs, + rpcs3_latest, + ... +}: { + pugixml = pkgs.pugixml.overrideAttrs (oldAttrs: rec { + version = "1.15"; + src = pkgs.fetchurl { + url = "https://github.com/zeux/pugixml/releases/download/v${version}/pugixml-${version}.tar.gz"; + sha256 = "sha256-ZVreV/pwP7QhwuuaARO1BkvdsUXUFd0fiMeTU9kNURo="; + }; + }); + SDL3 = pkgs.stdenv.mkDerivation rec { + pname = "SDL3"; + version = "3.1.3"; + src = pkgs.fetchFromGitHub { + owner = "libsdl-org"; + repo = "SDL"; + rev = "preview-${version}"; + sha256 = "sha256-S7yRcLHMPgq6+gec8l+ESxp2dJ+6Po/UNsBUXptQzMQ="; + }; + nativeBuildInputs = [pkgs.cmake]; + buildInputs = [pkgs.libGL pkgs.xorg.libX11 pkgs.xorg.libXext pkgs.alsa-lib]; + cmakeFlags = [ + "-DSDL_STATIC=OFF" + "-DSDL_SHARED=ON" + "-DSDL_INSTALL_CMAKEDIR=${placeholder "out"}/lib/cmake/SDL3" + ]; + }; + rpcs3_latest = pkgs.rpcs3.overrideAttrs (oldAttrs: { + meta = { + maintainers = ["Cobray"]; + description = "Latest build of PS3 emulator"; + homepage = "https://rpcs3.net/"; + license = pkgs.lib.licenses.gpl2; + }; + src = pkgs.fetchgit { + url = "https://github.com/RPCS3/rpcs3.git"; + rev = rpcs3_latest.rev; + sha256 = "sha256-0TDxSNMk9L4+ouxYzWFNi3XxPAyD43Xl32hz1T4lFIc="; + fetchSubmodules = true; + }; + patches = []; + nativeBuildInputs = + (oldAttrs.nativeBuildInputs or []) + ++ [ + pkgs.llvmPackages_19.llvm.dev + pkgs.llvmPackages_19.clang + pkgs.pkg-config + pkgs.qt6.qmake + pkgs.qt6.full + pkgs.xxd + pkgs.wayland-scanner + ]; + buildInputs = + (oldAttrs.buildInputs or []) + ++ [ + pkgs.llvmPackages_19.llvm + pkgs.llvmPackages_19.libclang + pkgs.qt6.full + pkgs.vulkan-loader + pkgs.vulkan-tools + pkgs.wayland + pkgs.wayland-protocols + pkgs.libxkbcommon + pkgs.libpulseaudio + pkgs.libevdev + pkgs.udev + pkgs.glew + pkgs.libpng + pkgs.zstd + ]; + cmakeFlags = + (oldAttrs.cmakeFlags or []) + ++ [ + "-DCMAKE_PREFIX_PATH=${pkgs.qt6.full}:${pkgs.wayland}" + "-DUSE_SYSTEM_FFMPEG=ON" + "-DUSE_SYSTEM_CURL=ON" + "-DUSE_SYSTEM_WOLFSSL=ON" + "-DUSE_QT=ON" + "-DUSE_VULKAN=ON" + "-DUSE_WAYLAND=ON" + "-DUSE_PULSEAUDIO=ON" + "-DUSE_LIBEVDEV=ON" + "-DUSE_SYSTEM_ZSTD=ON" + "-DUSE_DISCORD_RPC=ON" + "-DUSE_SDL=OFF" + ]; + }); +}