neosyn/overlays/modern.nix
2024-12-04 23:41:39 +01:00

213 lines
4.6 KiB
Nix

final: prev:
let
inherit (builtins) match;
inherit (final) stdenv;
inherit (stdenv) hostPlatform;
inherit (prev) lib;
inherit (lib)
extendDrvAttrs extendDrvEnv
optionals;
isZen = hostPlatform.isx86 && match "znver[12345]" hostPlatform.gcc.arch or "" != null;
in {
# booleans
enableAlsa = false;
enableGUI = false;
enableGui = false;
enableJack = false;
enableX11 = false;
enableXWayland = false;
alsaSupport = false;
gssSupport = false;
sndioSupport = false;
x11Support = false;
xineramaSupport = false;
withAlsa = false;
withBluray = false;
withCdio = false;
withDvdnav = false;
withDvdread = false;
withGui = false;
withJack = false;
withLibao = false;
withSdl2 = false;
withXcb = false;
withXlib = false;
withXorg = false;
# disabled packages
SDL1 = null;
aalib = null;
gtk2 = null;
iptables-legacy = null;
jack1 = null;
jack2 = null;
libao = null;
libapparmor = null;
libcaca = null;
libjack = null;
libjack2 = null;
libselinux = null;
pulseaudioFull = null;
sndio = null;
texinfo = null;
xwayland = null;
bind = prev.bind.override { enableGSSAPI = false; };
curl = prev.curl.override {
scpSupport = false;
zstdSupport = true;
};
blas = prev.blas.override {
blasProvider = if isZen then final.amd-blis else final.blis;
};
blis = prev.blis.override {
withArchitecture =
if hostPlatform.isRiscV then "rv64i"
else if hostPlatform.isAarch then "arm64"
else if hostPlatform.isx86 then "x86_64"
else "generic";
};
boost = prev.boost.override {
stdenv = final.clangStdenv;
};
cpio = final.runCommand "libarchive-cpio" {
preferLocalBuild = true;
meta.mainProgram = "cpio";
} ''
mkdir -p "$out/bin"
ln -s "${lib.getExe' final.libarchive "bsdcpio"}" "$out/bin/cpio"
'';
electron = prev.electron.override {
electron-unwrapped = prev.electron.unwrapped |> extendDrvAttrs {
gnFlags = ''
# Disable X11
ozone_platform_x11 = false
# Disable internal memory allocator
use_partition_alloc_as_malloc = false
enable_backup_ref_ptr_support = false
enable_pointer_compression_support = false
'';
};
};
ffmpeg = prev.ffmpeg.override {
withSsh = false;
};
ffmpeg-headless = prev.ffmpeg-headless.override {
withSsh = false;
};
ffmpeg-browser = final.ffmpeg-headless.override {
withAmf = false;
withAom = false;
withCodec2 = true;
withDrm = false;
withGnutls = false;
withMp3lame = false;
withTwolame = false;
withV4l2 = false;
withXvid = false;
withNetwork = false;
withBin = false;
withLib = true;
withDocumentation = false;
withStripping = true;
};
jdk = final.jdk_headless;
jre = final.jre_headless;
lapack = prev.lapack.override {
lapackProvider = if isZen then final.amd-libflame else final.openblas;
};
lix = prev.lix.override { enableGC = true; };
mesa = let
mesa = prev.mesa.overrideAttrs (prevAttrs: {
outputs = prevAttrs.outputs |> lib.remove "spirv2dxil";
});
in mesa.override {
galliumDrivers = [
"llvmpipe"
"nouveau"
"radeonsi"
"virgl"
"zink"
];
vulkanDrivers = [
"amd"
"intel"
"nouveau"
"swrast"
"virtio"
];
};
minizip = final.minizip-ng;
qemu = prev.qemu.override {
hostCpuTargets = lib.mapCartesianProduct ({arch, mach}: "${arch}-${mach}") {
arch = [ "riscv64" "aarch64" "x86_64" ];
mach = [ "softmmu" "linux-user" ];
};
};
mpv = final.mpv-unwrapped.wrapper { mpv = final.mpv-unwrapped; };
mpv-unwrapped = prev.mpv-unwrapped.override {
cacaSupport = false;
openalSupport = false;
sdl2Support = false;
};
nix = final.lix;
pulseaudio = prev.pulseaudio.override {
libOnly = true;
ossWrapper = false;
};
sqlite = prev.sqlite |> extendDrvEnv {
NIX_CFLAGS_COMPILE = [
"-DSQLITE_THREADSAFE=2"
"-DSQLITE_OMIT_LOOKASIDE"
"-DSQLITE_DEFAULT_MMAP_SIZE=281474976710656"
"-DSQLITE_MAX_MMAP_SIZE=281474976710656"
"-DSQLITE_DEFAULT_FILE_PERMISSIONS=0600"
"-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1"
"-DSQLITE_DEFAULT_WORKER_THREADS=4"
"-USQLITE_SECURE_DELETE"
"-DSQLITE_ENABLE_NULL_TRIM"
];
};
svt-av1 = final.svt-av1-psy;
systemd = prev.systemd.override {
withApparmor = false;
withIptables = false;
};
wrapFirefox = prev.wrapFirefox.override {
ffmpeg = final.ffmpeg-decode;
};
xorg = prev.xorg.overrideScope (final: prev: {
libXScrnSaver = null;
libXinerama = null;
libXv = null;
libXvMC = null;
});
}