Build with LLVM and musl
This commit is contained in:
parent
3f8acc3a4b
commit
4e0045a4da
|
@ -95,7 +95,7 @@
|
|||
overlays = load ./overlay "overlay";
|
||||
legacyPackages = eachSystem (system: platform:
|
||||
import nixpkgs {
|
||||
localSystem = builtins.currentSystem or platform;
|
||||
localSystem = builtins.currentSystem or system;
|
||||
crossSystem = platform;
|
||||
overlays = [ self.overlays.default ];
|
||||
config.allowUnsupportedSystem = true;
|
||||
|
@ -120,6 +120,13 @@
|
|||
targetHost = config.networking.fqdnOrHostName;
|
||||
targetUser = null;
|
||||
};
|
||||
|
||||
nixpkgs = let
|
||||
platform = self.lib.platforms.x86_64-linux;
|
||||
in {
|
||||
buildPlatform = builtins.currentSystem or platform.system;
|
||||
hostPlatform = platform;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,13 +4,22 @@ let inherit (nixpkgs) lib;
|
|||
in lib.mapAttrs (system: platform: lib.systems.elaborate platform) {
|
||||
"x86_64-linux" = {
|
||||
system = "x86_64-linux";
|
||||
config = "x86_64-unknown-linux-musl";
|
||||
useLLVM = true;
|
||||
linker = "lld";
|
||||
};
|
||||
|
||||
"aarch64-linux" = {
|
||||
system = "aarch64-linux";
|
||||
config = "aarch64-unknown-linux-musl";
|
||||
useLLVM = true;
|
||||
linker = "lld";
|
||||
};
|
||||
|
||||
"riscv64-linux" = {
|
||||
system = "riscv64-linux";
|
||||
config = "riscv64-unknown-linux-musl";
|
||||
useLLVM = true;
|
||||
linker = "lld";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
iosched
|
||||
kernel
|
||||
locale-en_EU
|
||||
musl
|
||||
network
|
||||
nix
|
||||
openssh
|
||||
|
|
7
nixos/module/musl.nix
Normal file
7
nixos/module/musl.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ ...}: { modulesPath, ... }: {
|
||||
disabledModules = [
|
||||
(modulesPath + "/config/ldso.nix")
|
||||
(modulesPath + "/programs/nix-ld.nix")
|
||||
(modulesPath + "/config/stub-ld.nix")
|
||||
];
|
||||
}
|
|
@ -3,6 +3,14 @@ let
|
|||
inherit (nixpkgs.lib) optionalAttrs toList;
|
||||
inherit (prev.stdenv) hostPlatform;
|
||||
in {
|
||||
netbsd = prev.netbsd.overrideScope (final: prev: {
|
||||
compatIfNeeded = [ final.compat ];
|
||||
|
||||
compat = prev.compat.overrideAttrs (prevAttrs: {
|
||||
makeFlags = prevAttrs.makeFlags ++ [ "OBJCOPY=:" ];
|
||||
});
|
||||
});
|
||||
|
||||
numactl = prev.numactl.overrideAttrs (prevAttrs: {
|
||||
patches = prevAttrs.patches or [ ] ++ [
|
||||
(final.fetchpatch {
|
||||
|
@ -12,26 +20,18 @@ in {
|
|||
];
|
||||
});
|
||||
|
||||
python3 = prev.python3.overrideAttrs (prevAttrs: {
|
||||
postFixup = prevAttrs.postFixup + ''
|
||||
pushd "$out/lib/${prevAttrs.passthru.libPrefix}"
|
||||
test -e "$sysconfigdataName" || ln -s _sysconfigdata__linux_.py "$sysconfigdataName.py"
|
||||
popd
|
||||
'';
|
||||
});
|
||||
|
||||
redis = prev.redis.overrideAttrs ({
|
||||
doCheck = false;
|
||||
});
|
||||
|
||||
python312 = prev.python312.override {
|
||||
packageOverrides = final: prev: {
|
||||
pywebview = prev.pywebview.overrideAttrs ({
|
||||
doCheck = false;
|
||||
doInstallCheck = false;
|
||||
});
|
||||
} // optionalAttrs hostPlatform.isRiscV64 {
|
||||
psutil = prev.psutil.overrideAttrs (prevAttrs: {
|
||||
disabledTests = prevAttrs.disabledTests or [ ] ++ [
|
||||
"net_if_addrs"
|
||||
"net_if_stats"
|
||||
];
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
sioyek = prev.sioyek.overrideAttrs (prevAttrs: {
|
||||
env = prevAttrs.env or { } // {
|
||||
NIX_CFLAGS_COMPILE = toList prevAttrs.env.NIX_CFLAGS_COMPILE or [ ]
|
||||
|
@ -39,6 +39,14 @@ in {
|
|||
};
|
||||
});
|
||||
|
||||
time = prev.time.overrideAttrs (prevAttrs: {
|
||||
env = prevAttrs.env or { } // {
|
||||
CFLAGS = toList prevAttrs.env.CFLAGS or [ ] ++ [
|
||||
"-Wno-error=implicit-function-declaration"
|
||||
] |> toString;
|
||||
};
|
||||
});
|
||||
|
||||
zeromq = prev.zeromq.overrideAttrs (prevAttrs: {
|
||||
postPatch = prevAttrs.postPatch or "" + ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
|
|
Loading…
Reference in a new issue