Merge branch 'riscv-limitations'

Changed files
+17 -16
lib
nixos
modules
system
boot
pkgs
development
libraries
libseccomp
os-specific
linux
kexectools
systemd
stdenv
generic
tools
package-management
top-level
+2
lib/meta.nix
···
then { system = elem; }
else { parsed = elem; };
in lib.matchAttrs pattern platform;
+
+
enableIfAvailable = p: if p.meta.available or true then [ p ] else [];
}
-4
lib/systems/inspect.nix
···
isAndroid = [ { abi = abis.android; } { abi = abis.androideabi; } ];
isMusl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ];
-
isKexecable = map (family: { kernel = kernels.linux; cpu.family = family; })
-
[ "x86" "arm" "aarch64" "mips" ];
isEfi = map (family: { cpu.family = family; })
[ "x86" "arm" "aarch64" ];
-
isSeccomputable = map (family: { kernel = kernels.linux; cpu.family = family; })
-
[ "x86" "arm" "aarch64" "mips" ];
};
matchAnyAttrs = patterns:
+1 -1
nixos/modules/system/boot/kexec.nix
···
{ config, pkgs, lib, ... }:
{
-
config = lib.mkIf (pkgs.kexectools != null) {
+
config = lib.mkIf (pkgs.kexectools.meta.available) {
environment.systemPackages = [ pkgs.kexectools ];
systemd.services."prepare-kexec" =
+1
pkgs/development/libraries/libseccomp/default.nix
···
homepage = "https://github.com/seccomp/libseccomp";
license = licenses.lgpl21;
platforms = platforms.linux;
+
badPlatforms = platforms.riscv;
maintainers = with maintainers; [ thoughtpolice wkennington ];
};
}
+1
pkgs/os-specific/linux/kexectools/default.nix
···
homepage = http://horms.net/projects/kexec/kexec-tools;
description = "Tools related to the kexec Linux feature";
platforms = platforms.linux;
+
badPlatforms = platforms.riscv;
};
}
+4 -1
pkgs/os-specific/linux/systemd/default.nix
···
buildInputs =
[ linuxHeaders libcap kmod xz pam acl
/* cryptsetup */ libuuid glib libgcrypt libgpgerror libidn2
-
libmicrohttpd kexectools libseccomp libffi audit lz4 bzip2 libapparmor
+
libmicrohttpd ] ++
+
stdenv.lib.meta.enableIfAvailable kexectools ++
+
stdenv.lib.meta.enableIfAvailable libseccomp ++
+
[ libffi audit lz4 bzip2 libapparmor
iptables gnu-efi
# This is actually native, but we already pull it from buildPackages
pythonLxmlEnv
+4 -2
pkgs/stdenv/generic/check-meta.nix
···
isFcitxEngine = bool;
isIbusEngine = bool;
isGutenprint = bool;
+
badPlatforms = platforms;
};
checkMetaAttr = k: v:
···
checkMeta = meta: if shouldCheckMeta then lib.remove null (lib.mapAttrsToList checkMetaAttr meta) else [];
checkPlatform = attrs:
-
lib.any (lib.meta.platformMatch hostPlatform) attrs.meta.platforms;
+
(!(attrs ? meta.platforms) || lib.any (lib.meta.platformMatch hostPlatform) attrs.meta.platforms) &&
+
(!(attrs ? meta.badPlatforms && lib.any (lib.meta.platformMatch hostPlatform) attrs.meta.badPlatforms));
# Check if a derivation is valid, that is whether it passes checks for
# e.g brokenness or license.
···
{ valid = false; reason = "blacklisted"; errormsg = "has a blacklisted license (‘${showLicense attrs.meta.license}’)"; }
else if !allowBroken && attrs.meta.broken or false then
{ valid = false; reason = "broken"; errormsg = "is marked as broken"; }
-
else if !allowUnsupportedSystem && !allowBroken && attrs.meta.platforms or null != null && !(checkPlatform attrs) then
+
else if !allowUnsupportedSystem && !allowBroken && !(checkPlatform attrs) then
{ valid = false; reason = "broken"; errormsg = "is not supported on ‘${hostPlatform.config}’"; }
else if !(hasAllowedInsecure attrs) then
{ valid = false; reason = "insecure"; errormsg = "is marked as insecure"; }
+2 -2
pkgs/tools/package-management/nix/default.nix
···
buildInputs = [ curl openssl sqlite xz bzip2 ]
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
++ lib.optionals is20 [ brotli ] # Since 1.12
-
++ lib.optional (hostPlatform.isSeccomputable) libseccomp
+
++ lib.meta.enableIfAvailable libseccomp
++ lib.optional ((stdenv.isLinux || stdenv.isDarwin) && is20)
(aws-sdk-cpp.override {
apis = ["s3"];
···
hostPlatform != buildPlatform && hostPlatform ? nix && hostPlatform.nix ? system
) ''--with-system=${hostPlatform.nix.system}''
# RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
-
++ lib.optional (!hostPlatform.isSeccomputable) "--disable-seccomp-sandboxing";
+
++ lib.optional (!libseccomp.meta.available) "--disable-seccomp-sandboxing";
makeFlags = "profiledir=$(out)/etc/profile.d";
+2 -6
pkgs/top-level/all-packages.nix
···
keepalived = callPackage ../tools/networking/keepalived { };
-
kexectools = if hostPlatform.isKexecable
-
then callPackage ../os-specific/linux/kexectools { }
-
else null;
+
kexectools = callPackage ../os-specific/linux/kexectools { };
keybase = callPackage ../tools/security/keybase { };
···
libgroove = callPackage ../development/libraries/libgroove { };
-
libseccomp = if hostPlatform.isSeccomputable
-
then callPackage ../development/libraries/libseccomp { }
-
else null;
+
libseccomp = callPackage ../development/libraries/libseccomp { };
libsecret = callPackage ../development/libraries/libsecret { };