retronix/pkgs/overlay.nix
2024-01-11 02:07:28 +01:00

32 lines
1,002 B
Nix

final: prev: {
joy2keyd = final.python3.pkgs.callPackage ./joy2keyd {};
retropieSetup = final.callPackage ./retropie-setup.nix {};
joy2key = final.callPackage ./joy2key.nix {};
runcommand = final.callPackage ./runcommand.nix {};
emulationstationPatched = final.emulationStation.overrideAttrs (_: previous: {
patches = previous.patches ++ [ ./emulationstation.patch ];
});
symlinkJoinSubdir =
args_@{ name
, paths
, subdir ? ""
, preferLocalBuild ? true
, allowSubstitutes ? false
, postBuild ? ""
, ...
}:
let
args = removeAttrs args_ [ "name" "postBuild" ]
// {
inherit preferLocalBuild allowSubstitutes;
passAsFile = [ "paths" ];
}; # pass the defaults
in final.runCommand name args
''
mkdir -p $out
for i in $(cat $pathsPath); do
${final.xorg.lndir}/bin/lndir -silent $i $out/${subdir}
done
${postBuild}
'';
}