move optimizeWithFlags
This commit is contained in:
parent
aa5c015099
commit
b764d2de45
16
flake.nix
16
flake.nix
@ -144,6 +144,22 @@
|
|||||||
inputs
|
inputs
|
||||||
serviceMountDeps
|
serviceMountDeps
|
||||||
;
|
;
|
||||||
|
|
||||||
|
# stolen from: https://stackoverflow.com/a/42398526
|
||||||
|
optimizeWithFlags =
|
||||||
|
pkg: flags:
|
||||||
|
nixpkgs.lib.overrideDerivation pkg (
|
||||||
|
old:
|
||||||
|
let
|
||||||
|
newflags = nixpkgs.lib.foldl' (acc: x: "${acc} ${x}") "" flags;
|
||||||
|
oldflags =
|
||||||
|
if (nixpkgs.lib.hasAttr "NIX_CFLAGS_COMPILE" old) then "${old.NIX_CFLAGS_COMPILE}" else "";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
NIX_CFLAGS_COMPILE = "${oldflags} ${newflags}";
|
||||||
|
# stdenv = pkgs.clang19Stdenv;
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
modules =
|
modules =
|
||||||
[
|
[
|
||||||
|
|||||||
@ -3,24 +3,9 @@
|
|||||||
service_configs,
|
service_configs,
|
||||||
config,
|
config,
|
||||||
inputs,
|
inputs,
|
||||||
|
optimizeWithFlags,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
# stolen from: https://stackoverflow.com/a/42398526
|
|
||||||
optimizeWithFlags =
|
|
||||||
pkg: flags:
|
|
||||||
pkgs.lib.overrideDerivation pkg (
|
|
||||||
old:
|
|
||||||
let
|
|
||||||
newflags = pkgs.lib.foldl' (acc: x: "${acc} ${x}") "" flags;
|
|
||||||
oldflags = if (pkgs.lib.hasAttr "NIX_CFLAGS_COMPILE" old) then "${old.NIX_CFLAGS_COMPILE}" else "";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
NIX_CFLAGS_COMPILE = "${oldflags} ${newflags}";
|
|
||||||
stdenv = pkgs.clang19Stdenv;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
services.llama-cpp = {
|
services.llama-cpp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user