should be the last stage

This commit is contained in:
alsaiduq-lab 2025-04-03 19:24:22 -06:00
parent fe9a07fad0
commit d6fe9e9f5f
6 changed files with 36 additions and 33 deletions

6
flake.lock generated
View file

@ -25,11 +25,11 @@
]
},
"locked": {
"lastModified": 1743648554,
"narHash": "sha256-23JFd+zd2GamTTdnGuFVeIg8x8C3hLpQJRh/PGTORzo=",
"lastModified": 1743717835,
"narHash": "sha256-LJm6FoIcUoBw3w25ty12/sBfut4zZuNGdN0phYj/ekU=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "107352dde4ff3c01cb5a0b3fe17f5beef37215bc",
"rev": "66a6ec65f84255b3defb67ff45af86c844dd451b",
"type": "github"
},
"original": {

View file

@ -123,14 +123,15 @@
"-DUSE_PULSEAUDIO=ON"
"-DUSE_LIBEVDEV=ON"
"-DUSE_SYSTEM_ZSTD=ON"
"-DUSE_DISCORD_RPC=ON"
"-DCMAKE_VERBOSE_MAKEFILE=ON"
"-DCMake_MESSAGE_LOG_LEVEL=TRACE"
"-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 >&2
if [ ! -f 3rdparty/hidapi/hidapi/CMakeLists.txt ]; then
echo "ERROR: hidapi submodule not fetched correctly" >&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
@ -144,7 +145,7 @@
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 >&2
ls -lR 3rdparty/hidapi 3rdparty/glslang 3rdparty/yaml-cpp 3rdparty/cubeb 3rdparty/zstd 3rdparty/discord-rpc >&2
'';
});
};
@ -158,27 +159,36 @@
rpcs3_latest = pkgs.rpcs3.overrideAttrs (oldAttrs: {
src = pkgs.fetchgit {
url = "https://github.com/RPCS3/rpcs3.git";
rev = inputs.rpcs3-latest.rev; # Should be 37dbd77628f44cdef3228bdfc03127365ec7383b per flake.lock
sha256 = "sha256-Yx0Qsc0r+5C0BqqsbJCv47QPeaNbaIut8s6Hcysy2mo="; # Confirmed for 37dbd77628f44cdef3228bdfc03127365ec7383b with submodules
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;};
specialArgs = {inherit inputs rpcs3_latest;};
modules = [
{nixpkgs.overlays = [customPkgsOverlay];}
./hosts/configuration.nix
];
};
};
homeConfigurations = {
"cobray" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;

View file

@ -1,4 +1,8 @@
{pkgs, ...}: {
{
pkgs,
rpcs3_latest,
...
}: {
imports = [
./modules/dunst.nix
./modules/fish.nix
@ -30,5 +34,6 @@
btop
nvtopPackages.full
arandr
rpcs3_latest
];
}

View file

@ -1,12 +1,4 @@
{
pkgs,
inputs,
...
}: let
rpcs3_latest = pkgs.rpcs3.overrideAttrs (oldAttrs: {
src = inputs.rpcs3-latest;
});
in {
{pkgs, ...}: {
home.packages = with pkgs; [
mgba
desmume
@ -18,11 +10,5 @@ in {
retroarch
mednafen
joycond
# uses latest commit, but in case of errors (if there were any in the first place) to fallback to snapshot nix package in case it failed (even if not)
(
if (builtins.tryEval rpcs3_latest).success
then rpcs3_latest
else rpcs3
)
];
}

View file

@ -1,9 +1,7 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running 'nixos-help').
{
...
}: {
{...}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix

View file

@ -1,4 +1,8 @@
{inputs, ...}: {
{
inputs,
rpcs3_latest,
...
}: {
imports = [
inputs.home-manager.nixosModules.home-manager
];
@ -6,7 +10,7 @@
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
inherit inputs rpcs3_latest;
};
users.cobray = import ../home-manager/cobray.nix;
};