Compare commits
18 commits
173f43aeb0
...
7fa7351aa7
| Author | SHA1 | Date | |
|---|---|---|---|
| 7fa7351aa7 | |||
| db6b064662 | |||
| 8087397b99 | |||
| a2e09699a6 | |||
| b58418b849 | |||
| a612e5f447 | |||
| 5d957231ba | |||
| dcce2af4aa | |||
| 62f5e27dea | |||
| 2a93c20be2 | |||
| 40bcae409d | |||
| 91fb4b5fbe | |||
| 3cdc6bf978 | |||
| c1916d3fb8 | |||
| 93fa0158eb | |||
| 6e63bb0a90 | |||
| 20828a09fc | |||
| 0b9c676fc4 |
9 changed files with 964 additions and 248 deletions
|
|
@ -178,7 +178,7 @@
|
|||
gamescope
|
||||
telegram-desktop
|
||||
ladybird
|
||||
# krita # BOOST BROKE, FUCK
|
||||
krita
|
||||
meld
|
||||
pavucontrol
|
||||
pwvucontrol
|
||||
|
|
|
|||
|
|
@ -4,19 +4,26 @@
|
|||
kernel-src,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
linuxMainline = import ./kernel.nix { inherit pkgs lib kernel-src; };
|
||||
in
|
||||
{
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackagesFor linuxMainline;
|
||||
kernelPackages = pkgs.linuxPackagesFor (
|
||||
pkgs.callPackage ./kernel.nix {
|
||||
inherit lib kernel-src;
|
||||
structuredExtraConfig = { };
|
||||
kernelPatches = [ ];
|
||||
extraConfig = "";
|
||||
features = { };
|
||||
randstructSeed = null;
|
||||
}
|
||||
);
|
||||
kernelPatches = [
|
||||
{
|
||||
name = "gpu";
|
||||
name = "cpu";
|
||||
structuredExtraConfig = (
|
||||
with lib.kernel;
|
||||
{
|
||||
PROCESSOR_SELECT = yes;
|
||||
#
|
||||
CPU_SUP_INTEL = no;
|
||||
CPU_SUP_HYGON = no;
|
||||
CPU_SUP_CENTAUR = no;
|
||||
|
|
@ -77,11 +84,12 @@ in
|
|||
);
|
||||
}
|
||||
{
|
||||
name = "network";
|
||||
name = "network and wireless";
|
||||
structuredExtraConfig = (
|
||||
with lib.kernel;
|
||||
{
|
||||
# VLAN_8021Q = no;
|
||||
BT = no;
|
||||
HAMRADIO = lib.mkForce no;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -95,6 +103,29 @@ in
|
|||
}
|
||||
);
|
||||
}
|
||||
{
|
||||
name = "garbo";
|
||||
structuredExtraConfig = (
|
||||
with lib.kernel;
|
||||
{
|
||||
IIO = no;
|
||||
#
|
||||
GNSS = no;
|
||||
#
|
||||
GOOGLE_FIRMWARE = lib.mkForce no;
|
||||
#
|
||||
TRACING = lib.mkForce no;
|
||||
FTRACE = lib.mkForce no;
|
||||
FUNCTION_GRAPH_TRACER = lib.mkForce no;
|
||||
DYNAMIC_FTRACE = lib.mkForce no;
|
||||
FUNCTION_PROFILER = lib.mkForce no;
|
||||
FUNCTION_TRACER = lib.mkForce no;
|
||||
CONTEXT_SWITCH_TRACER = lib.mkForce no;
|
||||
SCHED_TRACER = lib.mkForce no;
|
||||
STACK_TRACER = lib.mkForce no;
|
||||
}
|
||||
);
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,17 +2,23 @@
|
|||
pkgs,
|
||||
lib,
|
||||
kernel-src,
|
||||
buildLinux,
|
||||
structuredExtraConfig ? { },
|
||||
kernelPatches ? [ ],
|
||||
extraConfig ? "",
|
||||
sccacheDir ? "/var/cache/sccache",
|
||||
sccacheDir ? "/var/cache/sccache/nix-builds/kernel",
|
||||
sccacheServerUds ? null,
|
||||
enforceSccache ? true,
|
||||
features ? { },
|
||||
randstructSeed ? null,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
makefile = builtins.readFile "${kernel-src}/Makefile";
|
||||
lines = lib.splitString "\n" makefile;
|
||||
normalizeKernelPatch = p: p // { patch = p.patch or null; };
|
||||
kernelPatches' = map normalizeKernelPatch kernelPatches;
|
||||
|
||||
get =
|
||||
name:
|
||||
|
|
@ -30,149 +36,162 @@ let
|
|||
|
||||
kver = "${V}.${P}.${S}${E}";
|
||||
in
|
||||
pkgs.callPackage (
|
||||
{ buildLinux, ... }@args:
|
||||
let
|
||||
llvm = pkgs.llvmPackages_latest;
|
||||
rust = pkgs.rustc-unwrapped;
|
||||
let
|
||||
args = {
|
||||
inherit
|
||||
buildLinux
|
||||
features
|
||||
randstructSeed
|
||||
;
|
||||
};
|
||||
llvm = pkgs.llvmPackages_latest;
|
||||
rust = pkgs.rustc-unwrapped;
|
||||
|
||||
buildPkgs = args.buildPackages or pkgs.buildPackages;
|
||||
buildLlvm = buildPkgs.llvmPackages_latest;
|
||||
llvmBuildPackages = buildPkgs // {
|
||||
stdenv = buildLlvm.stdenv;
|
||||
};
|
||||
buildPkgs = args.buildPackages or pkgs.buildPackages;
|
||||
buildLlvm = buildPkgs.llvmPackages_latest;
|
||||
llvmBuildPackages = buildPkgs // {
|
||||
stdenv = buildLlvm.stdenv;
|
||||
};
|
||||
|
||||
realClang = lib.getExe llvm.clang-unwrapped;
|
||||
realLd = lib.getExe' llvm.lld "ld.lld";
|
||||
realAr = lib.getExe' llvm.llvm "llvm-ar";
|
||||
realNm = lib.getExe' llvm.llvm "llvm-nm";
|
||||
realStrip = lib.getExe' llvm.llvm "llvm-strip";
|
||||
realObjcopy = lib.getExe' llvm.llvm "llvm-objcopy";
|
||||
realObjdump = lib.getExe' llvm.llvm "llvm-objdump";
|
||||
realReadelf = lib.getExe' llvm.llvm "llvm-readelf";
|
||||
realClang = lib.getExe llvm.clang-unwrapped;
|
||||
realLd = lib.getExe' llvm.lld "ld.lld";
|
||||
realAr = lib.getExe' llvm.llvm "llvm-ar";
|
||||
realNm = lib.getExe' llvm.llvm "llvm-nm";
|
||||
realStrip = lib.getExe' llvm.llvm "llvm-strip";
|
||||
realObjcopy = lib.getExe' llvm.llvm "llvm-objcopy";
|
||||
realObjdump = lib.getExe' llvm.llvm "llvm-objdump";
|
||||
realReadelf = lib.getExe' llvm.llvm "llvm-readelf";
|
||||
|
||||
realHostCC = lib.getExe' buildLlvm.stdenv.cc "${buildLlvm.stdenv.cc.targetPrefix}cc";
|
||||
realHostCXX = lib.getExe' buildLlvm.stdenv.cc "${buildLlvm.stdenv.cc.targetPrefix}c++";
|
||||
realHostAr = lib.getExe' buildLlvm.llvm "llvm-ar";
|
||||
realHostLd = lib.getExe' buildLlvm.lld "ld.lld";
|
||||
realRustc = lib.getExe' rust "rustc";
|
||||
realHostRustc = realRustc;
|
||||
realHostCC = lib.getExe' buildLlvm.stdenv.cc "${buildLlvm.stdenv.cc.targetPrefix}cc";
|
||||
realHostCXX = lib.getExe' buildLlvm.stdenv.cc "${buildLlvm.stdenv.cc.targetPrefix}c++";
|
||||
realHostAr = lib.getExe' buildLlvm.llvm "llvm-ar";
|
||||
realHostLd = lib.getExe' buildLlvm.lld "ld.lld";
|
||||
realRustc = lib.getExe' rust "rustc";
|
||||
realHostRustc = realRustc;
|
||||
sccacheConfig = pkgs.writeText "kernel-sccache.conf" ''
|
||||
[cache.disk]
|
||||
dir = "${sccacheDir}"
|
||||
size = "100G"
|
||||
'';
|
||||
sccacheSetup = lib.optionalString enforceSccache ''
|
||||
mkdir -p ${lib.escapeShellArg sccacheDir} 2>/dev/null || true
|
||||
export SCCACHE_CONF=${lib.escapeShellArg sccacheConfig}
|
||||
${lib.optionalString (sccacheServerUds != null) "export SCCACHE_SERVER_UDS=${lib.escapeShellArg sccacheServerUds}"}
|
||||
'';
|
||||
|
||||
mkSccacheWrapper =
|
||||
name: compiler:
|
||||
pkgs.writeShellScriptBin name ''
|
||||
set -euo pipefail
|
||||
export SCCACHE_DIR=${lib.escapeShellArg sccacheDir}
|
||||
${lib.optionalString (sccacheServerUds != null) "export SCCACHE_SERVER_UDS=${lib.escapeShellArg sccacheServerUds}"}
|
||||
if [ -n "''${SCCACHE_ENFORCE_MARKER-}" ]; then
|
||||
: > "''${SCCACHE_ENFORCE_MARKER}"
|
||||
fi
|
||||
exec ${pkgs.sccache}/bin/sccache ${compiler} "$@"
|
||||
'';
|
||||
|
||||
clangSccache = mkSccacheWrapper "clang" realClang;
|
||||
hostccSccache = mkSccacheWrapper "cc" realHostCC;
|
||||
hostcxxSccache = mkSccacheWrapper "c++" realHostCXX;
|
||||
rustcSccache = pkgs.writeShellScriptBin "rustc" ''
|
||||
mkSccacheWrapper =
|
||||
name: compiler:
|
||||
pkgs.writeShellScriptBin name ''
|
||||
set -euo pipefail
|
||||
export SCCACHE_DIR=${lib.escapeShellArg sccacheDir}
|
||||
mkdir -p ${lib.escapeShellArg sccacheDir} 2>/dev/null || true
|
||||
export SCCACHE_CONF=${lib.escapeShellArg sccacheConfig}
|
||||
${lib.optionalString (sccacheServerUds != null) "export SCCACHE_SERVER_UDS=${lib.escapeShellArg sccacheServerUds}"}
|
||||
if [ -n "''${SCCACHE_ENFORCE_MARKER-}" ]; then
|
||||
: > "''${SCCACHE_ENFORCE_MARKER}"
|
||||
fi
|
||||
exec ${pkgs.sccache}/bin/sccache ${realRustc} "$@"
|
||||
exec ${pkgs.sccache}/bin/sccache ${compiler} "$@"
|
||||
'';
|
||||
|
||||
hostrustcSccache = pkgs.writeShellScriptBin "rustc" ''
|
||||
set -euo pipefail
|
||||
export SCCACHE_DIR=${lib.escapeShellArg sccacheDir}
|
||||
${lib.optionalString (sccacheServerUds != null) "export SCCACHE_SERVER_UDS=${lib.escapeShellArg sccacheServerUds}"}
|
||||
if [ -n "''${SCCACHE_ENFORCE_MARKER-}" ]; then
|
||||
: > "''${SCCACHE_ENFORCE_MARKER}"
|
||||
fi
|
||||
exec ${pkgs.sccache}/bin/sccache ${realHostRustc} "$@"
|
||||
'';
|
||||
clangSccache = mkSccacheWrapper "clang" realClang;
|
||||
hostccSccache = mkSccacheWrapper "cc" realHostCC;
|
||||
hostcxxSccache = mkSccacheWrapper "c++" realHostCXX;
|
||||
rustcSccache = pkgs.writeShellScriptBin "rustc" ''
|
||||
set -euo pipefail
|
||||
mkdir -p ${lib.escapeShellArg sccacheDir} 2>/dev/null || true
|
||||
export SCCACHE_CONF=${lib.escapeShellArg sccacheConfig}
|
||||
${lib.optionalString (sccacheServerUds != null) "export SCCACHE_SERVER_UDS=${lib.escapeShellArg sccacheServerUds}"}
|
||||
if [ -n "''${SCCACHE_ENFORCE_MARKER-}" ]; then
|
||||
: > "''${SCCACHE_ENFORCE_MARKER}"
|
||||
fi
|
||||
exec ${pkgs.sccache}/bin/sccache ${realRustc} "$@"
|
||||
'';
|
||||
|
||||
structuredExtraConfig' =
|
||||
(with lib.kernel; {
|
||||
LTO_CLANG_THIN = yes;
|
||||
# LTO_CLANG_FULL = no;
|
||||
# LTO_NONE = no;
|
||||
})
|
||||
// structuredExtraConfig;
|
||||
in
|
||||
buildLinux (
|
||||
args
|
||||
// {
|
||||
inherit kernelPatches extraConfig;
|
||||
hostrustcSccache = pkgs.writeShellScriptBin "rustc" ''
|
||||
set -euo pipefail
|
||||
mkdir -p ${lib.escapeShellArg sccacheDir} 2>/dev/null || true
|
||||
export SCCACHE_CONF=${lib.escapeShellArg sccacheConfig}
|
||||
${lib.optionalString (sccacheServerUds != null) "export SCCACHE_SERVER_UDS=${lib.escapeShellArg sccacheServerUds}"}
|
||||
if [ -n "''${SCCACHE_ENFORCE_MARKER-}" ]; then
|
||||
: > "''${SCCACHE_ENFORCE_MARKER}"
|
||||
fi
|
||||
exec ${pkgs.sccache}/bin/sccache ${realHostRustc} "$@"
|
||||
'';
|
||||
|
||||
version = kver;
|
||||
modDirVersion = kver;
|
||||
src = kernel-src;
|
||||
structuredExtraConfig' =
|
||||
(with lib.kernel; {
|
||||
LTO_CLANG_THIN = yes;
|
||||
# LTO_CLANG_FULL = no;
|
||||
# LTO_NONE = no;
|
||||
})
|
||||
// structuredExtraConfig;
|
||||
in
|
||||
buildLinux (
|
||||
args
|
||||
// {
|
||||
kernelPatches = kernelPatches';
|
||||
inherit extraConfig;
|
||||
|
||||
stdenv = llvm.stdenv;
|
||||
buildPackages = llvmBuildPackages;
|
||||
version = kver;
|
||||
modDirVersion = kver;
|
||||
src = kernel-src;
|
||||
|
||||
extraMakeFlags =
|
||||
(args.extraMakeFlags or [ ])
|
||||
++ [
|
||||
"LLVM=1"
|
||||
"LLVM_IAS=1"
|
||||
"CC=${if enforceSccache then lib.getExe clangSccache else realClang}"
|
||||
"LD=${realLd}"
|
||||
"AR=${realAr}"
|
||||
"NM=${realNm}"
|
||||
"STRIP=${realStrip}"
|
||||
"OBJCOPY=${realObjcopy}"
|
||||
"OBJDUMP=${realObjdump}"
|
||||
"READELF=${realReadelf}"
|
||||
"HOSTCC=${if enforceSccache then lib.getExe hostccSccache else realHostCC}"
|
||||
"HOSTCXX=${if enforceSccache then lib.getExe hostcxxSccache else realHostCXX}"
|
||||
"HOSTAR=${realHostAr}"
|
||||
"HOSTLD=${realHostLd}"
|
||||
"RUSTC=${if enforceSccache then lib.getExe rustcSccache else realRustc}"
|
||||
"HOSTRUSTC=${if enforceSccache then lib.getExe hostrustcSccache else realHostRustc}"
|
||||
]
|
||||
;
|
||||
stdenv = llvm.stdenv;
|
||||
buildPackages = llvmBuildPackages;
|
||||
|
||||
preBuild =
|
||||
(args.preBuild or "")
|
||||
+ lib.optionalString enforceSccache ''
|
||||
export SCCACHE_DIR=${lib.escapeShellArg sccacheDir}
|
||||
${lib.optionalString (sccacheServerUds != null) "export SCCACHE_SERVER_UDS=${lib.escapeShellArg sccacheServerUds}"}
|
||||
'';
|
||||
extraMakeFlags =
|
||||
(args.extraMakeFlags or [ ])
|
||||
++ [
|
||||
"LLVM=1"
|
||||
"LLVM_IAS=1"
|
||||
"CC=${if enforceSccache then lib.getExe clangSccache else realClang}"
|
||||
"LD=${realLd}"
|
||||
"AR=${realAr}"
|
||||
"NM=${realNm}"
|
||||
"STRIP=${realStrip}"
|
||||
"OBJCOPY=${realObjcopy}"
|
||||
"OBJDUMP=${realObjdump}"
|
||||
"READELF=${realReadelf}"
|
||||
"HOSTCC=${if enforceSccache then lib.getExe hostccSccache else realHostCC}"
|
||||
"HOSTCXX=${if enforceSccache then lib.getExe hostcxxSccache else realHostCXX}"
|
||||
"HOSTAR=${realHostAr}"
|
||||
"HOSTLD=${realHostLd}"
|
||||
"RUSTC=${if enforceSccache then lib.getExe rustcSccache else realRustc}"
|
||||
"HOSTRUSTC=${if enforceSccache then lib.getExe hostrustcSccache else realHostRustc}"
|
||||
]
|
||||
;
|
||||
|
||||
buildPhase =
|
||||
if enforceSccache then
|
||||
''
|
||||
runHook preBuild
|
||||
export SCCACHE_DIR=${lib.escapeShellArg sccacheDir}
|
||||
${lib.optionalString (sccacheServerUds != null) "export SCCACHE_SERVER_UDS=${lib.escapeShellArg sccacheServerUds}"}
|
||||
export SCCACHE_ENFORCE_MARKER="$NIX_BUILD_TOP/.sccache-used"
|
||||
rm -f "$SCCACHE_ENFORCE_MARKER"
|
||||
make "''${makeFlags[@]}" "''${buildFlags[@]}"
|
||||
if [ ! -e "$SCCACHE_ENFORCE_MARKER" ]; then
|
||||
echo "FATAL: sccache enforcement failed during buildPhase: compiler wrappers were not invoked."
|
||||
echo "This means the build stage did not use your CC/HOSTCC/HOSTCXX/RUSTC/HOSTRUSTC overrides."
|
||||
exit 1
|
||||
fi
|
||||
${pkgs.sccache}/bin/sccache --show-stats --stats-format text || true
|
||||
runHook postBuild
|
||||
''
|
||||
else
|
||||
(args.buildPhase or ''
|
||||
runHook preBuild
|
||||
make "''${makeFlags[@]}" "''${buildFlags[@]}"
|
||||
runHook postBuild
|
||||
'');
|
||||
preConfigure = (args.preConfigure or "") + sccacheSetup;
|
||||
|
||||
postBuild = args.postBuild or "";
|
||||
preBuild = (args.preBuild or "") + sccacheSetup;
|
||||
|
||||
structuredExtraConfig = structuredExtraConfig';
|
||||
buildPhase =
|
||||
if enforceSccache then
|
||||
''
|
||||
runHook preBuild
|
||||
export SCCACHE_ENFORCE_MARKER="$NIX_BUILD_TOP/.sccache-used"
|
||||
rm -f "$SCCACHE_ENFORCE_MARKER"
|
||||
make "''${makeFlags[@]}" "''${buildFlags[@]}"
|
||||
if [ ! -e "$SCCACHE_ENFORCE_MARKER" ]; then
|
||||
echo "FATAL: sccache enforcement failed during buildPhase: compiler wrappers were not invoked."
|
||||
echo "This means the build stage did not use your CC/HOSTCC/HOSTCXX/RUSTC/HOSTRUSTC overrides."
|
||||
exit 1
|
||||
fi
|
||||
${pkgs.sccache}/bin/sccache --show-stats --stats-format text || true
|
||||
runHook postBuild
|
||||
''
|
||||
else
|
||||
(args.buildPhase or ''
|
||||
runHook preBuild
|
||||
make "''${makeFlags[@]}" "''${buildFlags[@]}"
|
||||
runHook postBuild
|
||||
'');
|
||||
|
||||
ignoreConfigErrors = true;
|
||||
postBuild = args.postBuild or "";
|
||||
|
||||
extraMeta.branch = "${V}.${P}";
|
||||
}
|
||||
)
|
||||
) { }
|
||||
structuredExtraConfig = structuredExtraConfig';
|
||||
|
||||
ignoreConfigErrors = true;
|
||||
|
||||
extraMeta.branch = "${V}.${P}";
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,407 @@
|
|||
final: prev:
|
||||
let
|
||||
winePkg = final.wineWow64Packages.full;
|
||||
sandboxSccacheDir = "/var/cache/sccache/nix-builds/packages";
|
||||
sharedSccacheConfig = final.writeText "sccache.conf" ''
|
||||
[cache.disk]
|
||||
dir = "${sandboxSccacheDir}"
|
||||
size = "100G"
|
||||
'';
|
||||
versionBumpAttrs =
|
||||
oldVersion: version: attrs:
|
||||
if final.lib.versionOlder oldVersion version then attrs else { };
|
||||
modify =
|
||||
target: f:
|
||||
if target ? overridePythonAttrs then
|
||||
target.overridePythonAttrs f
|
||||
else if target ? overrideAttrs then
|
||||
target.overrideAttrs f
|
||||
else if target ? overrideScope then
|
||||
target.overrideScope f
|
||||
else
|
||||
throw "modify: target does not support overridePythonAttrs, overrideAttrs, or overrideScope";
|
||||
mkRealCompilerBasePath =
|
||||
{
|
||||
name,
|
||||
toolchain,
|
||||
}:
|
||||
final.runCommand name { } ''
|
||||
resolve_orig_cc_root() {
|
||||
local current_root="$1"
|
||||
local next_root
|
||||
|
||||
while [ -r "$current_root/nix-support/orig-cc" ]; do
|
||||
next_root="$(tr -d '\n' < "$current_root/nix-support/orig-cc")"
|
||||
if [ -z "$next_root" ] || [ "$next_root" = "$current_root" ]; then
|
||||
break
|
||||
fi
|
||||
current_root="$next_root"
|
||||
done
|
||||
|
||||
printf '%s\n' "$current_root"
|
||||
}
|
||||
|
||||
wrapped_clang="$(readlink -f ${toolchain}/bin/clang)"
|
||||
wrapped_root="$(dirname "$(dirname "$wrapped_clang")")"
|
||||
orig_cc_root="$(resolve_orig_cc_root "$wrapped_root")"
|
||||
|
||||
if [ -z "$orig_cc_root" ] || [ ! -d "$orig_cc_root/bin" ]; then
|
||||
echo "mkRealCompilerBasePath: invalid orig-cc root: $orig_cc_root" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -x "$orig_cc_root/bin/clang" ] || [ ! -x "$orig_cc_root/bin/clang++" ]; then
|
||||
echo "mkRealCompilerBasePath: clang or clang++ missing in $orig_cc_root/bin" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$out/bin"
|
||||
|
||||
for executable in ${toolchain}/bin/*; do
|
||||
executable_name="$(basename "$executable")"
|
||||
case "$executable_name" in
|
||||
clang|clang++|cc|c++)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
ln -s "$executable" "$out/bin/$executable_name"
|
||||
done
|
||||
|
||||
ln -s "$orig_cc_root/bin/clang" "$out/bin/clang"
|
||||
ln -s "$orig_cc_root/bin/clang++" "$out/bin/clang++"
|
||||
ln -s clang "$out/bin/cc"
|
||||
ln -s clang++ "$out/bin/c++"
|
||||
|
||||
for path in ${toolchain}/*; do
|
||||
path_name="$(basename "$path")"
|
||||
if [ "$path_name" != bin ]; then
|
||||
ln -s "$path" "$out/$path_name"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
mkSccacheLauncher =
|
||||
{
|
||||
name,
|
||||
sccacheDir ? null,
|
||||
sccacheServerUds ? null,
|
||||
sccacheCacheSize ? "100G",
|
||||
noDaemon ? false,
|
||||
passthroughWrappedCompiler ? false,
|
||||
extraSetup ? "",
|
||||
}:
|
||||
let
|
||||
sccacheConfig = final.writeText "${name}-config" ''
|
||||
[cache.disk]
|
||||
dir = "${if sccacheDir != null then sccacheDir else sandboxSccacheDir}"
|
||||
size = "${sccacheCacheSize}"
|
||||
'';
|
||||
effectiveSccacheConfig =
|
||||
if sccacheDir == null && sccacheCacheSize == "100G" then sharedSccacheConfig else sccacheConfig;
|
||||
in
|
||||
final.writeShellScriptBin name ''
|
||||
is_cmake_derivation() {
|
||||
case " ''${nativeBuildInputs:-} ''${propagatedNativeBuildInputs:-} " in
|
||||
*"/cmake-"*) return 0 ;;
|
||||
esac
|
||||
|
||||
[ -n "''${cmakeFlags:-}" ] || [ -n "''${cmakeDir:-}" ] || [ -n "''${cmakeBuildType:-}" ]
|
||||
}
|
||||
|
||||
is_cmake_probe_invocation() {
|
||||
local arg response_file
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
*CMakeFiles/*CompilerId*|*CMakeFiles/CMakeTmp/*|*CMakeScratch/*)
|
||||
return 0
|
||||
;;
|
||||
@*)
|
||||
response_file="''${arg#@}"
|
||||
if [ -f "$response_file" ] && grep -Eq 'CMakeFiles/.+CompilerId|CMakeFiles/CMakeTmp|CMakeScratch' "$response_file"; then
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
export SCCACHE_CONF=${final.lib.escapeShellArg effectiveSccacheConfig}
|
||||
unset SCCACHE_START_SERVER
|
||||
${final.lib.optionalString noDaemon ''
|
||||
export SCCACHE_NO_DAEMON=1
|
||||
unset SCCACHE_SERVER_UDS
|
||||
''}
|
||||
${final.lib.optionalString (!noDaemon && sccacheServerUds != null) ''
|
||||
export SCCACHE_SERVER_UDS=${final.lib.escapeShellArg sccacheServerUds}
|
||||
''}
|
||||
${extraSetup}
|
||||
if [ "$#" -eq 0 ] || [ "''${1#-}" != "$1" ]; then
|
||||
exec ${final.sccache}/bin/sccache "$@"
|
||||
fi
|
||||
|
||||
compiler="$1"
|
||||
shift
|
||||
|
||||
if [ "''${SCCACHE_WRAPPED_COMPILER_PASSTHROUGH:-}" = 1 ] || {
|
||||
is_cmake_derivation && is_cmake_probe_invocation "$@"
|
||||
}; then
|
||||
exec "$compiler" "$@"
|
||||
fi
|
||||
|
||||
${final.lib.optionalString passthroughWrappedCompiler ''
|
||||
export SCCACHE_WRAPPED_COMPILER_PASSTHROUGH=1
|
||||
''}
|
||||
exec ${final.sccache}/bin/sccache "$compiler" "$@"
|
||||
'';
|
||||
buildSccacheLauncher = mkSccacheLauncher {
|
||||
name = "build-sccache";
|
||||
};
|
||||
mkBuildSccacheAttrs =
|
||||
old:
|
||||
{
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ buildSccacheLauncher ];
|
||||
|
||||
preConfigure = (old.preConfigure or "") + ''
|
||||
|
||||
mkdir -p ${final.lib.escapeShellArg sandboxSccacheDir}
|
||||
export SCCACHE_SERVER_UDS="$TMPDIR/sccache/server.sock"
|
||||
export SCCACHE_IDLE_TIMEOUT=0
|
||||
unset SCCACHE_NO_DAEMON
|
||||
mkdir -p "$(dirname "$SCCACHE_SERVER_UDS")"
|
||||
if ! ${buildSccacheLauncher}/bin/build-sccache --show-stats >/dev/null 2>&1; then
|
||||
rm -f "$SCCACHE_SERVER_UDS"
|
||||
if ! ${buildSccacheLauncher}/bin/build-sccache --start-server >/tmp/sccache-start.log 2>&1; then
|
||||
if ! grep -Fq "Address already in use" /tmp/sccache-start.log; then
|
||||
cat /tmp/sccache-start.log >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
|
||||
postBuild = (old.postBuild or "") + ''
|
||||
|
||||
${buildSccacheLauncher}/bin/build-sccache --show-stats --stats-format text || true
|
||||
${buildSccacheLauncher}/bin/build-sccache --stop-server || true
|
||||
'';
|
||||
};
|
||||
mkCmakeSccacheAttrs =
|
||||
old:
|
||||
let
|
||||
sccacheLauncher = mkSccacheLauncher {
|
||||
name = "cmake-sccache";
|
||||
passthroughWrappedCompiler = true;
|
||||
};
|
||||
in
|
||||
{
|
||||
cmakeFlags = (old.cmakeFlags or [ ]) ++ [
|
||||
"-DCMAKE_C_COMPILER_LAUNCHER=${sccacheLauncher}/bin/cmake-sccache"
|
||||
"-DCMAKE_CXX_COMPILER_LAUNCHER=${sccacheLauncher}/bin/cmake-sccache"
|
||||
];
|
||||
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ sccacheLauncher ];
|
||||
|
||||
preConfigure = (old.preConfigure or "") + ''
|
||||
mkdir -p ${final.lib.escapeShellArg sandboxSccacheDir}
|
||||
export SCCACHE_WRAPPED_COMPILER_PASSTHROUGH=1
|
||||
export SCCACHE_SERVER_UDS="$TMPDIR/sccache/server.sock"
|
||||
export SCCACHE_IDLE_TIMEOUT=0
|
||||
unset SCCACHE_NO_DAEMON
|
||||
mkdir -p "$(dirname "$SCCACHE_SERVER_UDS")"
|
||||
if ! ${sccacheLauncher}/bin/cmake-sccache --show-stats >/dev/null 2>&1; then
|
||||
rm -f "$SCCACHE_SERVER_UDS"
|
||||
if ! ${sccacheLauncher}/bin/cmake-sccache --start-server >/tmp/sccache-start.log 2>&1; then
|
||||
if ! grep -Fq "Address already in use" /tmp/sccache-start.log; then
|
||||
cat /tmp/sccache-start.log >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
|
||||
postConfigure = (old.postConfigure or "") + ''
|
||||
unset SCCACHE_WRAPPED_COMPILER_PASSTHROUGH
|
||||
'';
|
||||
|
||||
postBuild = (old.postBuild or "") + ''
|
||||
|
||||
${sccacheLauncher}/bin/cmake-sccache --show-stats --stats-format text || true
|
||||
${sccacheLauncher}/bin/cmake-sccache --stop-server || true
|
||||
'';
|
||||
};
|
||||
mkSccacheExtraConfig =
|
||||
{
|
||||
sccacheDir ? sandboxSccacheDir,
|
||||
extraConfig ? "",
|
||||
}:
|
||||
''
|
||||
mkdir -p ${final.lib.escapeShellArg sccacheDir}
|
||||
export SCCACHE_CONF=${final.lib.escapeShellArg (
|
||||
final.writeText "sccache-stdenv.conf" ''
|
||||
[cache.disk]
|
||||
dir = "${sccacheDir}"
|
||||
size = "100G"
|
||||
''
|
||||
)}
|
||||
export SCCACHE_NO_DAEMON=1
|
||||
unset SCCACHE_SERVER_UDS
|
||||
${extraConfig}
|
||||
'';
|
||||
mkWrappedCcForSccache =
|
||||
{
|
||||
cc,
|
||||
extraConfig ? "",
|
||||
}:
|
||||
let
|
||||
wrappedCompiler = final.sccache.links {
|
||||
inherit extraConfig;
|
||||
unwrappedCC = cc.cc;
|
||||
};
|
||||
overrideArgs = cc.override.__functionArgs or { };
|
||||
in
|
||||
if overrideArgs ? cc then
|
||||
cc.override { cc = wrappedCompiler; }
|
||||
else if overrideArgs ? llvm then
|
||||
cc.override { llvm = wrappedCompiler; }
|
||||
else
|
||||
throw "mkWrappedCcForSccache: unsupported compiler wrapper override interface";
|
||||
mkSccacheStdenv =
|
||||
{
|
||||
stdenv,
|
||||
sccacheDir ? "/var/cache/sccache/nix-builds/packages",
|
||||
extraConfig ? "",
|
||||
}:
|
||||
final.overrideCC stdenv (
|
||||
mkWrappedCcForSccache {
|
||||
inherit (stdenv) cc;
|
||||
extraConfig = mkSccacheExtraConfig {
|
||||
inherit extraConfig sccacheDir;
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
sccache = modify prev.sccache (old: {
|
||||
postPatch = (old.postPatch or "") + ''
|
||||
substituteInPlace src/compiler/gcc.rs \
|
||||
--replace-fail \
|
||||
' take_arg!("-isystem", PathBuf, CanBeSeparated, PreprocessorArgumentPath),' \
|
||||
' take_arg!("-isystem", PathBuf, CanBeSeparated, PreprocessorArgumentPath),
|
||||
take_arg!("-cxx-isystem", PathBuf, CanBeSeparated, PreprocessorArgumentPath),'
|
||||
'';
|
||||
passthru = (old.passthru or { }) // {
|
||||
links =
|
||||
{ unwrappedCC, extraConfig ? "" }:
|
||||
let
|
||||
sccacheLauncher = mkSccacheLauncher {
|
||||
name = "wrapped-sccache";
|
||||
noDaemon = true;
|
||||
extraSetup = extraConfig;
|
||||
};
|
||||
in
|
||||
final.stdenv.mkDerivation {
|
||||
pname = "sccache-links";
|
||||
inherit (old) version;
|
||||
passthru = {
|
||||
isClang = unwrappedCC.isClang or false;
|
||||
isGNU = unwrappedCC.isGNU or false;
|
||||
isSccache = true;
|
||||
dev = unwrappedCC.dev or null;
|
||||
lib = unwrappedCC.lib or (final.lib.getLib unwrappedCC);
|
||||
} // final.lib.optionalAttrs (unwrappedCC ? rsrc) {
|
||||
inherit (unwrappedCC) rsrc;
|
||||
};
|
||||
dev = unwrappedCC.dev or null;
|
||||
lib = unwrappedCC.lib or (final.lib.getLib unwrappedCC);
|
||||
rsrc = unwrappedCC.rsrc or null;
|
||||
nativeBuildInputs = [ final.makeWrapper ];
|
||||
buildCommand =
|
||||
let
|
||||
targetPrefix =
|
||||
if unwrappedCC.isClang or false then
|
||||
""
|
||||
else
|
||||
(final.lib.optionalString (
|
||||
unwrappedCC ? targetConfig && unwrappedCC.targetConfig != null && unwrappedCC.targetConfig != ""
|
||||
) "${unwrappedCC.targetConfig}-");
|
||||
in
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/nix-support
|
||||
|
||||
wrap() {
|
||||
local cname="${targetPrefix}$1"
|
||||
if [ -x "${unwrappedCC}/bin/$cname" ]; then
|
||||
makeWrapper ${sccacheLauncher}/bin/wrapped-sccache $out/bin/$cname \
|
||||
--add-flags ${unwrappedCC}/bin/$cname
|
||||
fi
|
||||
}
|
||||
|
||||
wrap cc
|
||||
wrap c++
|
||||
wrap gcc
|
||||
wrap g++
|
||||
wrap clang
|
||||
wrap clang++
|
||||
|
||||
for executable in $(ls ${unwrappedCC}/bin); do
|
||||
if [ ! -x "$out/bin/$executable" ]; then
|
||||
ln -s ${unwrappedCC}/bin/$executable $out/bin/$executable
|
||||
fi
|
||||
done
|
||||
for file in $(ls ${unwrappedCC} | grep -vw bin); do
|
||||
ln -s ${unwrappedCC}/$file $out/$file
|
||||
done
|
||||
|
||||
printf '%s\n' "${unwrappedCC}" > $out/nix-support/orig-cc
|
||||
'';
|
||||
meta = final.lib.optionalAttrs (unwrappedCC.meta ? mainProgram) {
|
||||
inherit (unwrappedCC.meta) mainProgram;
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
sccacheWrapper =
|
||||
final.lib.makeOverridable (
|
||||
{
|
||||
extraConfig ? "",
|
||||
cc,
|
||||
}:
|
||||
mkWrappedCcForSccache {
|
||||
inherit cc extraConfig;
|
||||
}
|
||||
) {
|
||||
extraConfig = "";
|
||||
inherit (final.stdenv) cc;
|
||||
};
|
||||
sccacheStdenv = final.lib.lowPrio (
|
||||
final.lib.makeOverridable (
|
||||
{
|
||||
stdenv,
|
||||
...
|
||||
}@extraArgs:
|
||||
final.overrideCC stdenv (
|
||||
final.buildPackages.sccacheWrapper.override (
|
||||
{ inherit (stdenv) cc; }
|
||||
// final.lib.optionalAttrs (builtins.hasAttr "extraConfig" extraArgs) {
|
||||
extraConfig = extraArgs.extraConfig;
|
||||
}
|
||||
)
|
||||
)
|
||||
) {
|
||||
inherit (final) stdenv;
|
||||
}
|
||||
);
|
||||
sccache-config = sharedSccacheConfig;
|
||||
intel-sycl = modify prev."intel-sycl" (
|
||||
syFinal: syPrev: {
|
||||
llvm = modify syPrev.llvm mkCmakeSccacheAttrs;
|
||||
lld = modify syPrev.lld mkCmakeSccacheAttrs;
|
||||
stdenv = mkSccacheStdenv {
|
||||
stdenv = syPrev.stdenv;
|
||||
};
|
||||
}
|
||||
);
|
||||
# xdg-desktop-portal-cosmic = prev.xdg-desktop-portal-cosmic.overrideAttrs (old: {
|
||||
# postPatch = (old.postPatch or "") + ''
|
||||
# unitDir="$out/lib/systemd/user"
|
||||
|
|
@ -11,29 +410,34 @@ in
|
|||
# '';
|
||||
# });
|
||||
# );
|
||||
codex = prev.codex.overrideAttrs (
|
||||
codex = modify prev.codex (
|
||||
old:
|
||||
let
|
||||
version = "0.114.0";
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "openai";
|
||||
repo = "codex";
|
||||
tag = "rust-v${version}";
|
||||
hash = "sha256-7t+mVwP4+YrG1ciI+OLqsK7TUM9SrDbPsJNrt26iy9c=";
|
||||
#hash = "";
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit version src;
|
||||
sourceRoot = "${src.name}/codex-rs";
|
||||
|
||||
cargoDeps = prev.rustPlatform.fetchCargoVendor {
|
||||
inherit src;
|
||||
(versionBumpAttrs old.version version (
|
||||
let
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "openai";
|
||||
repo = "codex";
|
||||
tag = "rust-v${version}";
|
||||
hash = "sha256-7t+mVwP4+YrG1ciI+OLqsK7TUM9SrDbPsJNrt26iy9c=";
|
||||
#hash = "";
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit version src;
|
||||
sourceRoot = "${src.name}/codex-rs";
|
||||
hash = "sha256-XThIexu3V18JG4OtyvYmybaRMctYpDuBLLH+lUvrtt8=";
|
||||
#hash = prev.lib.fakeHash;
|
||||
};
|
||||
|
||||
cargoDeps = prev.rustPlatform.fetchCargoVendor {
|
||||
inherit src;
|
||||
sourceRoot = "${src.name}/codex-rs";
|
||||
hash = "sha256-XThIexu3V18JG4OtyvYmybaRMctYpDuBLLH+lUvrtt8=";
|
||||
#hash = prev.lib.fakeHash;
|
||||
};
|
||||
}
|
||||
))
|
||||
// {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ prev.libcap ];
|
||||
|
||||
preBuild = (old.preBuild or "") + ''
|
||||
|
|
@ -42,28 +446,207 @@ in
|
|||
'';
|
||||
}
|
||||
);
|
||||
llama-cpp = prev.llama-cpp.overrideAttrs (old: rec {
|
||||
version = "8124";
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "ggml-org";
|
||||
repo = "llama.cpp";
|
||||
tag = "b${version}";
|
||||
hash = old.src.hash;
|
||||
};
|
||||
# nativeBuildInputs = old.nativeBuildInputs ++ [ prev.pkgs.curl ];
|
||||
});
|
||||
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
||||
(pyFinal: pyPrev: {
|
||||
haystack-ai = pyPrev.haystack-ai.overridePythonAttrs (old: rec {
|
||||
version = "2.24.1";
|
||||
electron_39 =
|
||||
let
|
||||
angleLib = final.lib.getLib final.angle;
|
||||
realElectronClangBasePath = mkRealCompilerBasePath {
|
||||
name = "electron-real-clang-base";
|
||||
toolchain = prev.electron_39.passthru.unwrapped.llvmCcAndBintools;
|
||||
};
|
||||
electronUnwrapped = modify prev.electron_39.passthru.unwrapped (
|
||||
old:
|
||||
let
|
||||
buildSccacheAttrs = mkBuildSccacheAttrs old;
|
||||
oldClangBasePath = "clang_base_path=\"${old.llvmCcAndBintools}\"";
|
||||
newClangBasePath = "clang_base_path=\"${realElectronClangBasePath}\"";
|
||||
baseGnFlags = builtins.replaceStrings
|
||||
[ oldClangBasePath ]
|
||||
[ newClangBasePath ]
|
||||
(old.gnFlags or "");
|
||||
electronGnFlags =
|
||||
"${baseGnFlags} cc_wrapper=\"${buildSccacheLauncher}/bin/build-sccache\"";
|
||||
in
|
||||
buildSccacheAttrs
|
||||
// {
|
||||
gnFlags = electronGnFlags;
|
||||
configurePhase = builtins.replaceStrings
|
||||
[ old.gnFlags or "" ]
|
||||
[ electronGnFlags ]
|
||||
(old.configurePhase or "");
|
||||
patches = builtins.filter (
|
||||
patch: builtins.baseNameOf (toString patch) != "39-angle-patchdir.patch"
|
||||
) (old.patches or [ ]);
|
||||
postPatch = ''
|
||||
substituteInPlace electron/patches/config.json \
|
||||
--replace-fail '"repo": "src/third_party/angle/src"' '"repo": "src/third_party/angle"'
|
||||
'' + (old.postPatch or "");
|
||||
postFixup = (old.postFixup or "") + ''
|
||||
|
||||
src = final.fetchFromGitHub {
|
||||
owner = "deepset-ai";
|
||||
repo = "haystack";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-tlQ3Bp+HcIsmoUoOMkm2APUSgNcdsujMUnSx+un/r8c=";
|
||||
for angleLibName in \
|
||||
libEGL.so \
|
||||
libEGL_vulkan_secondaries.so \
|
||||
libGLESv1_CM.so \
|
||||
libGLESv2.so \
|
||||
libGLESv2_vulkan_secondaries.so \
|
||||
libGLESv2_with_capture.so \
|
||||
libVkICD_mock_icd.so \
|
||||
libfeature_support.so
|
||||
do
|
||||
if [ -e "$libExecPath/$angleLibName" ] || [ -L "$libExecPath/$angleLibName" ]; then
|
||||
rm -f "$libExecPath/$angleLibName"
|
||||
fi
|
||||
ln -s ${angleLib}/lib/"$angleLibName" "$libExecPath/$angleLibName"
|
||||
done
|
||||
'';
|
||||
}
|
||||
);
|
||||
in
|
||||
prev.electron_39.override {
|
||||
electron-unwrapped = electronUnwrapped;
|
||||
};
|
||||
oneapi-ccl = modify (prev.oneapi-ccl.override {
|
||||
intel-sycl = final."intel-sycl";
|
||||
}) (
|
||||
old:
|
||||
let
|
||||
version = "2021.17.2";
|
||||
intelSycl = final."intel-sycl".llvm;
|
||||
intelSyclDev = final.lib.getDev intelSycl;
|
||||
intelSyclLib = final.lib.getLib intelSycl;
|
||||
levelZero = final.lib.getDev final.level-zero;
|
||||
openclHeaders = final.opencl-headers;
|
||||
cmakeSccacheAttrs = mkCmakeSccacheAttrs old;
|
||||
in
|
||||
(versionBumpAttrs old.version version {
|
||||
inherit version;
|
||||
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "uxlfoundation";
|
||||
repo = "oneCCL";
|
||||
rev = version;
|
||||
hash = "sha256-dV1PadrcJSdwwpNxXAK1fo/B5p26Lvd36wqC+xM5KJM=";
|
||||
};
|
||||
})
|
||||
// cmakeSccacheAttrs
|
||||
// {
|
||||
setOutputFlags = false;
|
||||
|
||||
postPatch = (old.postPatch or "") + ''
|
||||
mkdir -p deps/level_zero
|
||||
rm -rf deps/level_zero/include
|
||||
ln -s ${levelZero}/include/level_zero deps/level_zero/include
|
||||
|
||||
sed -i '/^#if defined(SYCL_LANGUAGE_VERSION) && defined (__INTEL_LLVM_COMPILER)$/,/^#endif$/c\
|
||||
#cmakedefine CCL_ENABLE_SYCL\
|
||||
#cmakedefine CCL_ENABLE_ZE' include/oneapi/ccl/config.h.in
|
||||
|
||||
sed -i 's/^#define ICPX_VERSION 0$/#define ICPX_VERSION 140000/' src/common/utils/sycl_utils.hpp
|
||||
|
||||
sed -i '/^inline sycl::event get_last_event(const sycl::queue &q) {$/, /^inline sycl::event submit_wait_on_events(sycl::queue q, const std::vector<sycl::event> &deps) {$/c\
|
||||
inline sycl::event get_last_event(const sycl::queue &q) {\
|
||||
auto last_event_opt = q.ext_oneapi_get_last_event();\
|
||||
if (last_event_opt.has_value()) {\
|
||||
return last_event_opt.value();\
|
||||
}\
|
||||
return sycl::event{};\
|
||||
}\
|
||||
\
|
||||
inline sycl::event submit_wait_on_events(sycl::queue q, const std::vector<sycl::event> \&deps) {' src/coll/algorithms/utils/sycl_coll_base.hpp
|
||||
|
||||
find src -type f \( -name '*.hpp' -o -name '*.cpp' \) \
|
||||
-exec sed -i 's/reqd_sub_group_size(sg_size)/reqd_sub_group_size(32)/g' {} +
|
||||
|
||||
awk '
|
||||
pending {
|
||||
if ($0 ~ /^[[:space:]]*send_buf, new_send_count,/) {
|
||||
sub(/send_buf, new_send_count,/, "q, send_buf, new_send_count,")
|
||||
}
|
||||
pending = 0
|
||||
}
|
||||
/^[[:space:]]*e = allgatherv_large\($/ {
|
||||
pending = 1
|
||||
}
|
||||
{ print }
|
||||
' src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp \
|
||||
> src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp.tmp
|
||||
mv src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp.tmp \
|
||||
src/coll/algorithms/allgatherv/sycl/allgatherv_sycl.cpp
|
||||
'';
|
||||
|
||||
cmakeFlags = (cmakeSccacheAttrs.cmakeFlags or [ ]) ++ [
|
||||
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
||||
"-DINTEL_SYCL_INCLUDE_DIRS=${intelSyclDev}/include"
|
||||
"-DINTEL_SYCL_LIBRARIES=${intelSyclLib}/lib/libsycl.so"
|
||||
];
|
||||
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ openclHeaders ];
|
||||
|
||||
meta = (old.meta or { }) // {
|
||||
broken = false;
|
||||
};
|
||||
}
|
||||
);
|
||||
oneapi-math-sycl-blas = modify prev.oneapi-math-sycl-blas (
|
||||
old: mkCmakeSccacheAttrs old
|
||||
);
|
||||
oneapi-math = modify prev.oneapi-math (
|
||||
old: mkCmakeSccacheAttrs old
|
||||
);
|
||||
oneapi-dpl =
|
||||
let
|
||||
version = "2022.11.1";
|
||||
in
|
||||
modify prev.oneapi-dpl (old:
|
||||
(versionBumpAttrs old.version version {
|
||||
inherit version;
|
||||
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "uxlfoundation";
|
||||
repo = "oneDPL";
|
||||
rev = "oneDPL-${version}-release";
|
||||
hash = "sha256-NfyV34mdKfCxlU+l6ETKWcC9MwvVEgwcBedtLe6WCV4=";
|
||||
};
|
||||
|
||||
meta = (old.meta or { }) // {
|
||||
changelog = "https://github.com/uxlfoundation/oneDPL/releases/tag/oneDPL-${version}-release";
|
||||
};
|
||||
})
|
||||
// (mkCmakeSccacheAttrs old)
|
||||
);
|
||||
llama-cpp = modify prev.llama-cpp (
|
||||
old:
|
||||
let
|
||||
version = "8124";
|
||||
in
|
||||
(versionBumpAttrs old.version version {
|
||||
inherit version;
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "ggml-org";
|
||||
repo = "llama.cpp";
|
||||
tag = "b${version}";
|
||||
hash = old.src.hash;
|
||||
};
|
||||
})
|
||||
// (mkCmakeSccacheAttrs old)
|
||||
);
|
||||
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
||||
(pyFinal: pyPrev: {
|
||||
haystack-ai = modify pyPrev.haystack-ai (
|
||||
old:
|
||||
let
|
||||
version = "2.24.1";
|
||||
in
|
||||
(versionBumpAttrs old.version version {
|
||||
inherit version;
|
||||
|
||||
src = final.fetchFromGitHub {
|
||||
owner = "deepset-ai";
|
||||
repo = "haystack";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-tlQ3Bp+HcIsmoUoOMkm2APUSgNcdsujMUnSx+un/r8c=";
|
||||
};
|
||||
})
|
||||
// {
|
||||
propagatedBuildInputs =
|
||||
(old.propagatedBuildInputs or [ ])
|
||||
++ (with pyPrev; [
|
||||
|
|
@ -79,8 +662,9 @@ in
|
|||
meta = (old.meta or { }) // {
|
||||
broken = false;
|
||||
};
|
||||
});
|
||||
sseclient-py = pyPrev.sseclient-py.overridePythonAttrs (old: rec {
|
||||
}
|
||||
);
|
||||
sseclient-py = modify pyPrev.sseclient-py (old: rec {
|
||||
format = "pyproject";
|
||||
nativeBuildInputs =
|
||||
(old.nativeBuildInputs or [ ])
|
||||
|
|
@ -91,24 +675,31 @@ in
|
|||
]);
|
||||
doCheck = false;
|
||||
});
|
||||
vllm = pyPrev.vllm.overridePythonAttrs (old: rec {
|
||||
version = "0.17.1";
|
||||
vllm = modify pyPrev.vllm (
|
||||
old:
|
||||
let
|
||||
version = "0.17.1";
|
||||
in
|
||||
versionBumpAttrs old.version version {
|
||||
inherit version;
|
||||
|
||||
src = final.fetchFromGitHub {
|
||||
owner = "vllm-project";
|
||||
repo = "vllm";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-EZozwA+GIjN8/CBNhtdeM3HsPhVdx1/J0B9gvvn2qKU=";
|
||||
};
|
||||
});
|
||||
src = final.fetchFromGitHub {
|
||||
owner = "vllm-project";
|
||||
repo = "vllm";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-EZozwA+GIjN8/CBNhtdeM3HsPhVdx1/J0B9gvvn2qKU=";
|
||||
};
|
||||
}
|
||||
);
|
||||
})
|
||||
];
|
||||
lutris-unwrapped = prev.lutris-unwrapped.overrideAttrs (
|
||||
lutris-unwrapped = modify prev.lutris-unwrapped (
|
||||
old:
|
||||
let
|
||||
version = "0.5.22";
|
||||
in
|
||||
{
|
||||
versionBumpAttrs old.version version {
|
||||
inherit version;
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "lutris";
|
||||
repo = "lutris";
|
||||
|
|
@ -117,12 +708,10 @@ in
|
|||
};
|
||||
}
|
||||
);
|
||||
winetricks = final.symlinkJoin {
|
||||
name = "winetricks-${prev.winetricks.version}";
|
||||
paths = [ prev.winetricks ];
|
||||
nativeBuildInputs = [ final.makeWrapper ];
|
||||
winetricks = modify prev.winetricks (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ final.makeWrapper ];
|
||||
|
||||
postBuild = ''
|
||||
postFixup = (old.postFixup or "") + ''
|
||||
wrapProgram "$out/bin/winetricks" \
|
||||
--prefix PATH : "${final.lib.makeBinPath [ winePkg ]}" \
|
||||
--set-default WINE "${winePkg}/bin/wine" \
|
||||
|
|
@ -130,9 +719,7 @@ in
|
|||
--run ': "''${WINE_BIN:=$wine_dir/.wine}"' \
|
||||
--run 'export WINE WINESERVER WINE_BIN WINESERVER_BIN'
|
||||
'';
|
||||
|
||||
meta = prev.winetricks.meta;
|
||||
};
|
||||
});
|
||||
# winetricks = prev.winetricks.overrideAttrs (
|
||||
# old:
|
||||
# let
|
||||
|
|
|
|||
18
devenv.lock
18
devenv.lock
|
|
@ -3,11 +3,11 @@
|
|||
"devenv": {
|
||||
"locked": {
|
||||
"dir": "src/modules",
|
||||
"lastModified": 1773254376,
|
||||
"narHash": "sha256-r83T23qeZej7Wvr60Od/0qHTmhQc9VzKFTAFRtOKr4k=",
|
||||
"lastModified": 1773937316,
|
||||
"narHash": "sha256-1Ou0hiagyj7urRqWZgPW51VdcaCcM3GUwrMBHQ27stU=",
|
||||
"owner": "cachix",
|
||||
"repo": "devenv",
|
||||
"rev": "bb0de08e03d5ff271dbd8c9ecb795dc67d22ffdc",
|
||||
"rev": "450735a11ddd934e923aaea8b693336d31e7df32",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -22,11 +22,11 @@
|
|||
"nixpkgs-src": "nixpkgs-src"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1772749504,
|
||||
"narHash": "sha256-eqtQIz0alxkQPym+Zh/33gdDjkkch9o6eHnMPnXFXN0=",
|
||||
"lastModified": 1773704619,
|
||||
"narHash": "sha256-LKtmit8Sr81z8+N2vpIaN/fyiQJ8f7XJ6tMSKyDVQ9s=",
|
||||
"owner": "cachix",
|
||||
"repo": "devenv-nixpkgs",
|
||||
"rev": "08543693199362c1fddb8f52126030d0d374ba2e",
|
||||
"rev": "906534d75b0e2fe74a719559dfb1ad3563485f43",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -39,11 +39,11 @@
|
|||
"nixpkgs-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1772173633,
|
||||
"narHash": "sha256-MOH58F4AIbCkh6qlQcwMycyk5SWvsqnS/TCfnqDlpj4=",
|
||||
"lastModified": 1773597492,
|
||||
"narHash": "sha256-hQ284SkIeNaeyud+LS0WVLX+WL2rxcVZLFEaK0e03zg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c0f3d81a7ddbc2b1332be0d8481a672b4f6004d6",
|
||||
"rev": "a07d4ce6bee67d7c838a8a5796e75dff9caa21ef",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
68
flake.lock
generated
68
flake.lock
generated
|
|
@ -46,11 +46,11 @@
|
|||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1773421907,
|
||||
"narHash": "sha256-TN8Qf8RhmOX7TAwhdjGaE/clgAxzfHwsOjGSxz0Bz/0=",
|
||||
"lastModified": 1773961521,
|
||||
"narHash": "sha256-enhjd1AcHHU+3RCRdSWVQj6TIqRXkJUbQSFVXzC6xLo=",
|
||||
"owner": "sadjow",
|
||||
"repo": "claude-code-nix",
|
||||
"rev": "4746a848ccb3e1ba1a1c99fd063bf998045b81ac",
|
||||
"rev": "1519be1f77ed017ae4a88916ac54529cef885573",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -176,11 +176,11 @@
|
|||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1773118123,
|
||||
"narHash": "sha256-uwU+JTxjzveJgepaA84gyi28cx/akT7RE/qH8s7qMjk=",
|
||||
"lastModified": 1773921118,
|
||||
"narHash": "sha256-ZBb59LTDi00YbqtEv4WGELVQp1OVUuIKsH1OFj3ccJs=",
|
||||
"owner": "imaviso",
|
||||
"repo": "dwproton-flake",
|
||||
"rev": "2279531470e2d98febfe0ad7433bcbd7dc83c9aa",
|
||||
"rev": "f32d216870fcbc4a3a24764f39bbbaa3991f7f53",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -451,11 +451,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1773422513,
|
||||
"narHash": "sha256-MPjR48roW7CUMU6lu0+qQGqj92Kuh3paIulMWFZy+NQ=",
|
||||
"lastModified": 1774007980,
|
||||
"narHash": "sha256-FOnZjElEI8pqqCvB6K/1JRHTE8o4rer8driivTpq2uo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "ef12a9a2b0f77c8fa3dda1e7e494fca668909056",
|
||||
"rev": "9670de2921812bc4e0452f6e3efd8c859696c183",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -540,16 +540,16 @@
|
|||
"kernel-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1773006395,
|
||||
"narHash": "sha256-f3IzNvzYFskEwgQZi2v0g5tcKabCUZfpDHn2x5dpNIU=",
|
||||
"lastModified": 1773844285,
|
||||
"narHash": "sha256-vOF2HIA1J5Ktzt2aYqGPBv3AEQb0ziORKRQIOj+6h04=",
|
||||
"ref": "refs/heads/drm-tip",
|
||||
"rev": "6884fe03ff2bc5a2f501ba4710f950dd4933ac84",
|
||||
"rev": "61409ba11a36fa5aff4ce0f0086a6026a43c5bce",
|
||||
"shallow": true,
|
||||
"type": "git",
|
||||
"url": "https://gitlab.freedesktop.org/drm/tip.git"
|
||||
},
|
||||
"original": {
|
||||
"rev": "6884fe03ff2bc5a2f501ba4710f950dd4933ac84",
|
||||
"rev": "61409ba11a36fa5aff4ce0f0086a6026a43c5bce",
|
||||
"shallow": true,
|
||||
"type": "git",
|
||||
"url": "https://gitlab.freedesktop.org/drm/tip.git"
|
||||
|
|
@ -611,11 +611,11 @@
|
|||
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1773390002,
|
||||
"narHash": "sha256-0RVjh9h0sgPHngxEs/Wd2/xdGsgKgZWjxFu5JsX3ASw=",
|
||||
"lastModified": 1773889880,
|
||||
"narHash": "sha256-cu23CGP+mD2wKPKaoGM7evZ1dXfjd+cjryqqqx2HloE=",
|
||||
"owner": "sodiboo",
|
||||
"repo": "niri-flake",
|
||||
"rev": "adc63b19724247f947385381481effd225a6e2fc",
|
||||
"rev": "63767d4572eb2e3da5e68f68de77d8f2cdeca8dd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -680,11 +680,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1772945408,
|
||||
"narHash": "sha256-PMt48sEQ8cgCeljQ9I/32uoBq/8t8y+7W/nAZhf72TQ=",
|
||||
"lastModified": 1773552174,
|
||||
"narHash": "sha256-mHSRNrT1rjeYBgkAlj07dW3+1nFEgAd8Gu6lgyfT9DU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-index-database",
|
||||
"rev": "1c1d8ea87b047788fd7567adf531418c5da321ec",
|
||||
"rev": "8faeb68130df077450451b6734a221ba0d6cde42",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -695,11 +695,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1773231277,
|
||||
"narHash": "sha256-Xy3WEpUAbpsz8ydgvVAQAGGB/WB+8cNA5cshiL0McTI=",
|
||||
"lastModified": 1773628058,
|
||||
"narHash": "sha256-hpXH0z3K9xv0fHaje136KY872VT2T5uwxtezlAskQgY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "75690239f08f885ca9b0267580101f60d10fbe62",
|
||||
"rev": "f8573b9c935cfaa162dd62cc9e75ae2db86f85df",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -726,11 +726,11 @@
|
|||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1773222311,
|
||||
"narHash": "sha256-BHoB/XpbqoZkVYZCfXJXfkR+GXFqwb/4zbWnOr2cRcU=",
|
||||
"lastModified": 1773814637,
|
||||
"narHash": "sha256-GNU+ooRmrHLfjlMsKdn0prEKVa0faVanm0jrgu1J/gY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0590cd39f728e129122770c029970378a79d076a",
|
||||
"rev": "fea3b367d61c1a6592bc47c72f40a9f3e6a53e96",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -787,11 +787,11 @@
|
|||
},
|
||||
"nixpkgs_5": {
|
||||
"locked": {
|
||||
"lastModified": 1773282481,
|
||||
"narHash": "sha256-b/GV2ysM8mKHhinse2wz+uP37epUrSE+sAKXy/xvBY4=",
|
||||
"lastModified": 1773821835,
|
||||
"narHash": "sha256-TJ3lSQtW0E2JrznGVm8hOQGVpXjJyXY2guAxku2O9A4=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "fe416aaedd397cacb33a610b33d60ff2b431b127",
|
||||
"rev": "b40629efe5d6ec48dd1efba650c797ddbd39ace0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -1015,11 +1015,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1772751120,
|
||||
"narHash": "sha256-4cBOTPXv6Pkqa6qL1SH3UZTShciQWpyKJy3c3cQEU8I=",
|
||||
"lastModified": 1773852796,
|
||||
"narHash": "sha256-aEriBf9qkKeUoICKuxOj9e1GE8PZEnKke83+TzXpBT8=",
|
||||
"owner": "mozilla",
|
||||
"repo": "sccache",
|
||||
"rev": "2b65ac80ed3a3ff63c41711d65ae10106a163a09",
|
||||
"rev": "8d6cab9ee9356ff4054409c60f7a607cb798de03",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -1288,11 +1288,11 @@
|
|||
"xwayland-satellite-unstable": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1772429643,
|
||||
"narHash": "sha256-M+bAeCCcjBnVk6w/4dIVvXvpJwOKnXjwi/lDbaN6Yws=",
|
||||
"lastModified": 1773622265,
|
||||
"narHash": "sha256-wToKwH7IgWdGLMSIWksEDs4eumR6UbbsuPQ42r0oTXQ=",
|
||||
"owner": "Supreeeme",
|
||||
"repo": "xwayland-satellite",
|
||||
"rev": "10f985b84cdbcc3bbf35b3e7e43d1b2a84fa9ce2",
|
||||
"rev": "a879e5e0896a326adc79c474bf457b8b99011027",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
20
flake.nix
20
flake.nix
|
|
@ -23,8 +23,8 @@
|
|||
intel-hw.url = "github:MordragT/nixos";
|
||||
nix-flatpak.url = "github:gmodena/nix-flatpak/latest";
|
||||
kernel-src = {
|
||||
# url = "git+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git?ref=master";
|
||||
url = "git+https://gitlab.freedesktop.org/drm/tip.git?rev=6884fe03ff2bc5a2f501ba4710f950dd4933ac84&shallow=1";
|
||||
# url = "git+https://gitlab.freedesktop.org/drm/tip.git?shallow=1";
|
||||
url = "git+https://gitlab.freedesktop.org/drm/tip.git?rev=61409ba11a36fa5aff4ce0f0086a6026a43c5bce&shallow=1";
|
||||
flake = false;
|
||||
};
|
||||
sccache = {
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
let
|
||||
system = "x86_64-linux";
|
||||
# pkgs = nixpkgs.${system}.packages;
|
||||
pkgs = nixpkgs {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
sccache.overlays.default
|
||||
|
|
@ -101,6 +101,12 @@
|
|||
intel-ocl
|
||||
vpl-gpu-rt
|
||||
intel-compute-runtime
|
||||
### intel-hw
|
||||
oneapi-ccl
|
||||
oneapi-dpl
|
||||
oneapi-math
|
||||
oneapi-tbb
|
||||
unified-memory-framework
|
||||
]
|
||||
);
|
||||
# ++ (with inputs.intel-hw.packages."${system}"; [
|
||||
|
|
@ -122,12 +128,18 @@
|
|||
extra-sandbox-paths = [
|
||||
"/run/sccache"
|
||||
"/var/cache/sccache"
|
||||
"/var/cache/sccache/nix-builds"
|
||||
"/var/cache/sccache/nix-builds/packages"
|
||||
"/var/cache/sccache/nix-builds/kernel"
|
||||
];
|
||||
download-buffer-size = 160000000;
|
||||
};
|
||||
systemd.tmpfiles.rules = [
|
||||
# setgid, чтобы файлы/папки сохраняли группу nixbld
|
||||
"d /var/cache/sccache 2770 root nixbld - -"
|
||||
"d /var/cache/sccache/nix-builds 2770 root nixbld - -"
|
||||
"d /var/cache/sccache/nix-builds/packages 2770 root nixbld - -"
|
||||
"d /var/cache/sccache/nix-builds/kernel 2770 root nixbld - -"
|
||||
];
|
||||
systemd.services.sccache = {
|
||||
description = "Shared sccache server for Nix builds";
|
||||
|
|
@ -145,7 +157,7 @@
|
|||
RestartSec = 2;
|
||||
};
|
||||
environment = {
|
||||
SCCACHE_DIR = "/var/cache/sccache";
|
||||
SCCACHE_CONF = pkgs."sccache-config";
|
||||
SCCACHE_SERVER_UDS = "/run/sccache/server.sock";
|
||||
SCCACHE_IDLE_TIMEOUT = "0";
|
||||
SCCACHE_START_SERVER = "1";
|
||||
|
|
|
|||
43
home.nix
43
home.nix
|
|
@ -122,13 +122,21 @@
|
|||
};
|
||||
sessionVariablesExtra = ''
|
||||
if [ -r /run/agenix/openrouter-open.key.age ]; then
|
||||
export OPENROUTER_API_KEY="$(cat /run/agenix/openrouter-open.key.age)"
|
||||
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"
|
||||
|
||||
export \
|
||||
ANTHROPIC_BASE_URL="https://openrouter.ai/api" \
|
||||
OPENROUTER_API_KEY="$(cat /run/agenix/openrouter-open.key.age)" \
|
||||
OPENROUTER_BASE_URL="https://openrouter.ai/api"
|
||||
|
||||
# anthropic api
|
||||
export \
|
||||
ANTHROPIC_BASE_URL="$OPENROUTER_BASE_URL" \
|
||||
ANTHROPIC_API_KEY="" \
|
||||
ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY" \
|
||||
ANTHROPIC_MODEL="openrouter/free"
|
||||
|
||||
# openai api
|
||||
# export \
|
||||
# OPENAI_API_BASE="$OPENROUTER_BASE_URL" \
|
||||
# OPENAI_API_KEY="$OPENROUTER_API_KEY"
|
||||
fi
|
||||
'';
|
||||
file = {
|
||||
|
|
@ -390,8 +398,10 @@
|
|||
"mcp-server-qdrant"
|
||||
];
|
||||
enabled = true;
|
||||
timeout = 5000;
|
||||
timeout = 15000;
|
||||
environment = {
|
||||
# NumPy from uvx needs libstdc++.so.6 on NixOS.
|
||||
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.stdenv.cc.cc ];
|
||||
QDRANT_URL = "http://127.0.0.1:6333";
|
||||
COLLECTION_NAME = "opencode_memory";
|
||||
|
||||
|
|
@ -447,11 +457,23 @@
|
|||
autoupdate = false;
|
||||
share = "manual";
|
||||
|
||||
server = {
|
||||
port = 4096;
|
||||
hostname = "127.0.0.1";
|
||||
};
|
||||
# server = {
|
||||
# port = 4096;
|
||||
# hostname = "127.0.0.1";
|
||||
# };
|
||||
provider = {
|
||||
"openrouter" = {
|
||||
# npm = "@ai-sdk/openai-compatible";
|
||||
# name = "openrouter/free";
|
||||
# options = {
|
||||
# baseURL = "https://openrouter.ai/api/v1";
|
||||
# };
|
||||
models = {
|
||||
"openrouter/free" = {
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
"ollama" = {
|
||||
npm = "@ai-sdk/openai-compatible";
|
||||
name = "Ollama (local)";
|
||||
|
|
@ -900,6 +922,9 @@
|
|||
extraConfig = ''
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
keys = { { key = 'F', mods = 'CTRL|SHIFT', action = wezterm.action.Search({ CaseInSensitiveString = "" }) } }
|
||||
|
||||
|
||||
local config = wezterm.config_builder()
|
||||
|
||||
config.default_prog = { "fish", "--login" --, "-c", "tmux attach -t dev || tmux new -s dev"
|
||||
|
|
|
|||
42
todo.md
Normal file
42
todo.md
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# Todo
|
||||
|
||||
## Sccache Stdenv Direction
|
||||
|
||||
- Goal: move `sccache` to the same structural layer as `ccacheStdenv`, meaning between the Nix cc-wrapper and the real compiler, instead of wrapping the cc-wrapper script itself.
|
||||
- Reason: this should preserve normal compiler identity and wrapper semantics while still allowing cached compilations.
|
||||
- Constraint: prefer direct local-disk cache access for sandboxed builds and avoid depending on the external `sccache` client/server socket model.
|
||||
|
||||
## Current Implementation State
|
||||
|
||||
- Added a local patch to `sccache` so its GCC/Clang parser treats `-cxx-isystem <dir>` like `-isystem <dir>`.
|
||||
- Added `sccache.links`, modeled after nixpkgs `ccache.links`, to generate `cc`/`c++`/`gcc`/`g++`/`clang`/`clang++` wrappers that call `sccache` with the real compiler path.
|
||||
- Added `sccacheWrapper`, modeled after nixpkgs `ccacheWrapper`.
|
||||
- Added `sccacheStdenv`, modeled after nixpkgs `ccacheStdenv`.
|
||||
- Reworked `mkSccacheStdenv` to delegate to `sccacheWrapper` instead of patching cc-wrapper scripts directly.
|
||||
- Kept direct-disk cache configuration through generated `SCCACHE_CONF` and `SCCACHE_NO_DAEMON=1`.
|
||||
- Adjusted the wrapper override helper so it can handle both normal cc-wrappers (`cc = ...`) and Intel SYCL wrappers (`llvm = ...`).
|
||||
- Forwarded Intel-expected outputs/attrs like `.dev`, `.lib`, and `.rsrc` through `sccache.links`.
|
||||
|
||||
## Verified Findings
|
||||
|
||||
- The previous direct insertion into cc-wrapper final exec did not break hello-world compilation.
|
||||
- That previous attempt was not cache-effective because `sccache` interpreted wrapper-emitted `-cxx-isystem` arguments as extra input files and returned `multiple input files`.
|
||||
- The exact problematic arguments were confirmed with a direct `sccache clang ...` probe using the wrapper-emitted argv.
|
||||
- The new ccache-style `sccacheWrapper` / `sccacheStdenv` path evaluates successfully.
|
||||
- `intel-sycl.stdenv.cc` now also evaluates successfully with the ccache-style `sccache.links` replacement in place.
|
||||
- The custom kernel helper now normalizes config-only `kernelPatches` entries to `{ patch = null; ... }` before calling `buildLinux`, which fixes `devenv shell -- build` failing during kernel evaluation.
|
||||
- The kernel build does invoke `sccache` during live builds, but relying on the in-sandbox wrapper to create `/var/cache/sccache/nix-builds/kernel` made host-side observation ambiguous.
|
||||
- The host NixOS config should create and expose `/var/cache/sccache/nix-builds/{packages,kernel}` explicitly so sandboxed builds and host-side inspection see the same cache paths.
|
||||
- The kernel `fentry` failure was caused by tracing options being enabled indirectly. Forcing `TRACING`, `FTRACE`, `FUNCTION_TRACER`, `FUNCTION_GRAPH_TRACER`, `DYNAMIC_FTRACE`, `FUNCTION_PROFILER`, `CONTEXT_SWITCH_TRACER`, `SCHED_TRACER`, and `STACK_TRACER` to `no` got the build past the old `Compiler does not support fentry?` stop and into real kernel compilation.
|
||||
|
||||
## Next Checks
|
||||
|
||||
- `electron-real-clang-base` should stay store-pure: synthesize its output tree from symlinks only and never `cp`/`rm` against copied toolchain store content.
|
||||
- `mkCmakeSccacheAttrs` should not force raw compilers into CMake; the `sccache.links` wrappers should bypass CMake probe invocations while keeping the normal wrapper-selected compiler environment.
|
||||
- The probe bypass must inspect `@responseFile` arguments as well, because the cc-wrapper often hides `CMakeFiles/CompilerId` paths inside response files before the inner `wrapped-sccache` sees them.
|
||||
- For CMake packages, the practical fallback is to export `SCCACHE_WRAPPED_COMPILER_PASSTHROUGH=1` for the whole `configurePhase` and unset it in `postConfigure`; caching matters in `buildPhase`, not in compiler-ID probes.
|
||||
- Apply the shared CMake helper to stalled subpackages too, not just top-level wrappers. `oneapi-math-sycl-blas` is one such case.
|
||||
- The same helper may also be needed on the outer package if the subpackage is fixed but the wrapper package then stalls at its own CMake configure.
|
||||
- Run a minimal hello-world derivation with the new `sccacheStdenv` and confirm repeated compiles produce cache hits.
|
||||
- If that works, switch current consumers to the ccache-style path and remove obsolete wrapper-patching logic.
|
||||
- After the host Nix daemon picks up the new sandbox path config, re-check kernel cache growth under `/var/cache/sccache/nix-builds/kernel` during a bounded kernel build.
|
||||
Loading…
Add table
Add a link
Reference in a new issue