about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-12-06 19:57:55 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-08 13:48:30 +0000
commitbf3aadfdd39aa197e18bade671fab6726349ffa4 (patch)
tree698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/os-specific
parentf4afc5a01d9539ce09e47494e679c51f80723d07 (diff)
parent99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff)
downloadnixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/os-specific')
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix33
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-sdk/frameworks.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix18
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/headers.txt2
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/bsdmake/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/default.nix10
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix14
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/top/default.nix3
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix29
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/headers-arm64.txt1486
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/headers-x86_64.txt (renamed from nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/headers.txt)0
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/dockutil/default.nix27
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/goku/default.nix16
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/iproute2mac/default.nix11
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/kwm/default.nix1
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/m-cli/default.nix7
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/mas/default.nix41
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/moltenvk/MoltenVK.xcodeproj.patch58
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/moltenvk/MoltenVKShaderConverter.xcodeproj.patch96
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/moltenvk/createDylib.patch13
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/moltenvk/default.nix201
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/moltenvk/dxvk-moltenvk-compat.patch59
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/moltenvk/gitRevHeaderStability.patch14
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/pngpaste/default.nix37
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/sketchybar/default.nix8
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/spacebar/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/adcli/default.nix68
-rw-r--r--nixpkgs/pkgs/os-specific/linux/akvcam/default.nix1
-rw-r--r--nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-firmware/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-lib/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-plugins/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-ucm-conf/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-utils/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/anbox/kmod.nix42
-rw-r--r--nixpkgs/pkgs/os-specific/linux/apfs/default.nix8
-rw-r--r--nixpkgs/pkgs/os-specific/linux/apparmor/default.nix31
-rw-r--r--nixpkgs/pkgs/os-specific/linux/atop/default.nix33
-rw-r--r--nixpkgs/pkgs/os-specific/linux/audit/default.nix15
-rw-r--r--nixpkgs/pkgs/os-specific/linux/autofs/default.nix13
-rw-r--r--nixpkgs/pkgs/os-specific/linux/autosuspend/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/ax99100/default.nix29
-rw-r--r--nixpkgs/pkgs/os-specific/linux/batman-adv/default.nix7
-rw-r--r--nixpkgs/pkgs/os-specific/linux/batman-adv/version.nix8
-rw-r--r--nixpkgs/pkgs/os-specific/linux/bbswitch/default.nix15
-rw-r--r--nixpkgs/pkgs/os-specific/linux/bcc/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/bionic-prebuilt/default.nix50
-rw-r--r--nixpkgs/pkgs/os-specific/linux/bluez/default.nix25
-rw-r--r--nixpkgs/pkgs/os-specific/linux/bolt/default.nix22
-rw-r--r--nixpkgs/pkgs/os-specific/linux/bpftools/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/bpftrace/btf-dump-new-0.6.0.patch39
-rw-r--r--nixpkgs/pkgs/os-specific/linux/bpftrace/default.nix44
-rw-r--r--nixpkgs/pkgs/os-specific/linux/broadcom-sta/default.nix5
-rw-r--r--nixpkgs/pkgs/os-specific/linux/broadcom-sta/i686-build-failure.patch4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-4.7.patch4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-5.17.patch80
-rw-r--r--nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-5.18.patch71
-rw-r--r--nixpkgs/pkgs/os-specific/linux/broadcom-sta/pedantic-fix.patch94
-rw-r--r--nixpkgs/pkgs/os-specific/linux/busybox/default.nix19
-rw-r--r--nixpkgs/pkgs/os-specific/linux/can-isotp/default.nix1
-rw-r--r--nixpkgs/pkgs/os-specific/linux/cfs-zen-tweaks/default.nix43
-rw-r--r--nixpkgs/pkgs/os-specific/linux/checksec/default.nix64
-rw-r--r--nixpkgs/pkgs/os-specific/linux/cifs-utils/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/conky/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/conspy/default.nix3
-rw-r--r--nixpkgs/pkgs/os-specific/linux/cpuid/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/cpupower-gui/default.nix10
-rw-r--r--nixpkgs/pkgs/os-specific/linux/criu/default.nix31
-rw-r--r--nixpkgs/pkgs/os-specific/linux/cryptsetup/default.nix8
-rw-r--r--nixpkgs/pkgs/os-specific/linux/cshatag/default.nix21
-rw-r--r--nixpkgs/pkgs/os-specific/linux/cshatag/deps.nix21
-rw-r--r--nixpkgs/pkgs/os-specific/linux/dddvb/default.nix15
-rw-r--r--nixpkgs/pkgs/os-specific/linux/device-tree/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/digimend/default.nix20
-rw-r--r--nixpkgs/pkgs/os-specific/linux/directvnc/default.nix13
-rw-r--r--nixpkgs/pkgs/os-specific/linux/disk-indicator/default.nix29
-rw-r--r--nixpkgs/pkgs/os-specific/linux/displaylink/default.nix14
-rw-r--r--nixpkgs/pkgs/os-specific/linux/dmidecode/default.nix51
-rw-r--r--nixpkgs/pkgs/os-specific/linux/dpdk-kmods/default.nix3
-rw-r--r--nixpkgs/pkgs/os-specific/linux/dpdk/default.nix5
-rw-r--r--nixpkgs/pkgs/os-specific/linux/dropwatch/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/ell/default.nix7
-rw-r--r--nixpkgs/pkgs/os-specific/linux/ena/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/erofs-utils/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/evdi/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/facetimehd/default.nix30
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firejail/default.nix5
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware-cutter/default.nix5
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix7
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix10
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix7
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/facetimehd-calibration/default.nix62
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/facetimehd-firmware/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/firmware-updater/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/fwupd-efi/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/fwupd/add-option-for-installation-sysconfdir.patch108
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/fwupd/default.nix79
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/fwupd/efi-app-path.patch8
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch26
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch24
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/intel2200BGFirmware/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/libreelec-dvb-firmware/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/linux-firmware/default.nix13
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix29
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/raspberrypi/default.nix15
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/rt5677/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/rtl8723bs-firmware/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/rtl8761b-firmware/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/sof-firmware/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/system76-firmware/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/xow_dongle-firmware/default.nix20
-rw-r--r--nixpkgs/pkgs/os-specific/linux/firmware/zd1211/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/fsverity-utils/default.nix51
-rw-r--r--nixpkgs/pkgs/os-specific/linux/fsverity-utils/remove-dynamic-libs.patch27
-rw-r--r--nixpkgs/pkgs/os-specific/linux/fuse/common.nix10
-rw-r--r--nixpkgs/pkgs/os-specific/linux/fuse/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/g15daemon/default.nix5
-rw-r--r--nixpkgs/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/gt/default.nix11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/hd-idle/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/hdparm/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/hid-ite8291r3/default.nix35
-rw-r--r--nixpkgs/pkgs/os-specific/linux/hwdata/default.nix11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/ima-evm-utils/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/intel-cmt-cat/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/intel-compute-runtime/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/intel-ocl/default.nix13
-rw-r--r--nixpkgs/pkgs/os-specific/linux/intel-speed-select/default.nix1
-rw-r--r--nixpkgs/pkgs/os-specific/linux/iproute/default.nix12
-rw-r--r--nixpkgs/pkgs/os-specific/linux/iproute/mptcp.nix17
-rw-r--r--nixpkgs/pkgs/os-specific/linux/iptables/default.nix35
-rw-r--r--nixpkgs/pkgs/os-specific/linux/irqbalance/default.nix15
-rw-r--r--nixpkgs/pkgs/os-specific/linux/it87/default.nix15
-rw-r--r--nixpkgs/pkgs/os-specific/linux/ithc/default.nix35
-rw-r--r--nixpkgs/pkgs/os-specific/linux/iwd/default.nix5
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kbd/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel-headers/default.nix9
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/common-config.nix34
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/4.11.patch4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/4.9.patch4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/README.md2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/generate-config.pl2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/generic.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/gpio-utils.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/hardened/patches.json60
-rwxr-xr-xnixpkgs/pkgs/os-specific/linux/kernel/hardened/update.py9
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/htmldocs.nix85
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-4.14.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-4.19.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-4.9.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-5.10.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-5.15.nix8
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-5.18.nix (renamed from nixpkgs/pkgs/os-specific/linux/kernel/linux-5.16.nix)4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-5.19.nix (renamed from nixpkgs/pkgs/os-specific/linux/kernel/linux-5.17.nix)4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-5.4.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix10
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-libre.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-lqx.nix26
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-rpi.nix9
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix7
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-testing.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-xanmod.nix68
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/linux-zen.nix36
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/manual-config.nix31
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/perf/5.19-binutils-2.39-support.patch352
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/perf/default.nix (renamed from nixpkgs/pkgs/os-specific/linux/kernel/perf.nix)23
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/randstruct-provide-seed-5.19.patch13
-rwxr-xr-xnixpkgs/pkgs/os-specific/linux/kernel/update-zen.py97
-rwxr-xr-xnixpkgs/pkgs/os-specific/linux/kernel/update-zen.sh21
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/xanmod-kernels.nix84
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kernel/zen-kernels.nix45
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kexec-tools/default.nix10
-rw-r--r--nixpkgs/pkgs/os-specific/linux/keyutils/default.nix14
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kmod/darwin.patch138
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kmod/default.nix43
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kmscube/default.nix11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kvdo/default.nix32
-rw-r--r--nixpkgs/pkgs/os-specific/linux/kvmfr/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/latencytop/default.nix10
-rw-r--r--nixpkgs/pkgs/os-specific/linux/ledger-udev-rules/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/libbpf/default.nix11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/libcap-ng/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/libcap/default.nix12
-rw-r--r--nixpkgs/pkgs/os-specific/linux/libnl/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/libnss-mysql/default.nix30
-rw-r--r--nixpkgs/pkgs/os-specific/linux/libpsm2/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/libsepol/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/libtraceevent/default.nix7
-rw-r--r--nixpkgs/pkgs/os-specific/linux/libtracefs/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/light/default.nix12
-rw-r--r--nixpkgs/pkgs/os-specific/linux/linux-wifi-hotspot/default.nix101
-rw-r--r--nixpkgs/pkgs/os-specific/linux/lockdep/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/logitech-udev-rules/default.nix19
-rw-r--r--nixpkgs/pkgs/os-specific/linux/lttng-modules/default.nix37
-rw-r--r--nixpkgs/pkgs/os-specific/linux/lvm2/2_03.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/lvm2/common.nix34
-rw-r--r--nixpkgs/pkgs/os-specific/linux/lvm2/fix-blkdeactivate.patch51
-rw-r--r--nixpkgs/pkgs/os-specific/linux/lxc/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/lxcfs/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/mbpfan/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/mdadm/default.nix8
-rw-r--r--nixpkgs/pkgs/os-specific/linux/mdadm/no-self-references.patch30
-rw-r--r--nixpkgs/pkgs/os-specific/linux/mdevd/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/microcode/amd.nix7
-rw-r--r--nixpkgs/pkgs/os-specific/linux/microcode/intel.nix7
-rw-r--r--nixpkgs/pkgs/os-specific/linux/miraclecast/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/mmc-utils/default.nix27
-rw-r--r--nixpkgs/pkgs/os-specific/linux/multipath-tools/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/musl-obstack/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/musl/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/mwprocapture/default.nix3
-rw-r--r--nixpkgs/pkgs/os-specific/linux/netatop/default.nix1
-rw-r--r--nixpkgs/pkgs/os-specific/linux/new-lg4ff/default.nix36
-rw-r--r--nixpkgs/pkgs/os-specific/linux/nftables/default.nix36
-rw-r--r--nixpkgs/pkgs/os-specific/linux/nix-ld/default.nix101
-rwxr-xr-xnixpkgs/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh7
-rw-r--r--nixpkgs/pkgs/os-specific/linux/nmon/default.nix4
-rwxr-xr-xnixpkgs/pkgs/os-specific/linux/nvidia-x11/builder.sh9
-rw-r--r--nixpkgs/pkgs/os-specific/linux/nvidia-x11/default.nix98
-rw-r--r--nixpkgs/pkgs/os-specific/linux/nvidia-x11/generic.nix11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/nvidia-x11/open.nix40
-rw-r--r--nixpkgs/pkgs/os-specific/linux/nvidia-x11/settings.nix29
-rw-r--r--nixpkgs/pkgs/os-specific/linux/nvidiabl/default.nix3
-rw-r--r--nixpkgs/pkgs/os-specific/linux/oci-seccomp-bpf-hook/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/odp-dpdk/default.nix10
-rw-r--r--nixpkgs/pkgs/os-specific/linux/open-iscsi/default.nix16
-rw-r--r--nixpkgs/pkgs/os-specific/linux/openrazer/driver.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pam_gnupg/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pam_mount/default.nix10
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pam_mysql/default.nix24
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pam_tmpdir/default.nix36
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pam_u2f/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pam_usb/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pam_ussh/default.nix67
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pam_ussh/go.mod15
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pax-utils/default.nix29
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pflask/default.nix12
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pipework/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pktgen/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/ply/default.nix1
-rw-r--r--nixpkgs/pkgs/os-specific/linux/plymouth/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pommed-light/default.nix11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/power-profiles-daemon/default.nix74
-rw-r--r--nixpkgs/pkgs/os-specific/linux/power-profiles-daemon/installed-tests-path.patch37
-rw-r--r--nixpkgs/pkgs/os-specific/linux/powercap/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/prl-tools/default.nix175
-rw-r--r--nixpkgs/pkgs/os-specific/linux/pscircle/default.nix11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/psmisc/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/qc71_laptop/default.nix34
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rasdaemon/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rdma-core/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/read-edid/default.nix9
-rw-r--r--nixpkgs/pkgs/os-specific/linux/read-edid/fno-common.patch22
-rw-r--r--nixpkgs/pkgs/os-specific/linux/reap/default.nix27
-rw-r--r--nixpkgs/pkgs/os-specific/linux/reptyr/default.nix15
-rw-r--r--nixpkgs/pkgs/os-specific/linux/restool/default.nix23
-rw-r--r--nixpkgs/pkgs/os-specific/linux/roccat-tools/default.nix9
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rt-tests/default.nix34
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtl8188eus-aircrack/default.nix33
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtl8189es/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtl8189fs/default.nix22
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtl8192eu/default.nix8
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtl8723bs/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtl8812au/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtl8814au/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtl8821ce/default.nix12
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtl8821cu/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtl88x2bu/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtl88xxau-aircrack/default.nix1
-rw-r--r--nixpkgs/pkgs/os-specific/linux/rtw88/default.nix10
-rw-r--r--nixpkgs/pkgs/os-specific/linux/ryzenadj/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/s6-linux-init/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/s6-linux-utils/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/sasutils/default.nix28
-rw-r--r--nixpkgs/pkgs/os-specific/linux/sch_cake/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/sdnotify-wrapper/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/sgx/psw/default.nix27
-rw-r--r--nixpkgs/pkgs/os-specific/linux/sgx/samples/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/sgx/sdk/default.nix15
-rw-r--r--nixpkgs/pkgs/os-specific/linux/sgx/ssl/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/shadow/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/speedometer/default.nix26
-rw-r--r--nixpkgs/pkgs/os-specific/linux/sssd/default.nix17
-rw-r--r--nixpkgs/pkgs/os-specific/linux/sysdig/default.nix39
-rw-r--r--nixpkgs/pkgs/os-specific/linux/syslinux/default.nix112
-rw-r--r--nixpkgs/pkgs/os-specific/linux/sysstat/default.nix5
-rw-r--r--nixpkgs/pkgs/os-specific/linux/system76-io/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0001-Start-device-units-for-uninitialised-encrypted-devic.patch7
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0002-Don-t-try-to-unmount-nix-or-nix-store.patch11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0003-Fix-NixOS-containers.patch17
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0004-Look-for-fsck-in-the-right-place.patch9
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0005-Add-some-NixOS-specific-unit-directories.patch27
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0006-Get-rid-of-a-useless-message-in-user-sessions.patch11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0007-hostnamed-localed-timedated-disable-methods-that-cha.patch29
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0008-Fix-hwdb-paths.patch11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0009-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch33
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0010-localectl-use-etc-X11-xkb-for-list-x11.patch11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0011-build-don-t-create-statedir-and-don-t-touch-prefixdi.patch15
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0012-add-rootprefix-to-lookup-dir-paths.patch (renamed from nixpkgs/pkgs/os-specific/linux/systemd/0013-add-rootprefix-to-lookup-dir-paths.patch)9
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0012-inherit-systemd-environment-when-calling-generators.patch44
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0013-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch (renamed from nixpkgs/pkgs/os-specific/linux/systemd/0014-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch)13
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0014-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch (renamed from nixpkgs/pkgs/os-specific/linux/systemd/0015-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch)12
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0015-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch (renamed from nixpkgs/pkgs/os-specific/linux/systemd/0017-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch)9
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0016-kmod-static-nodes.service-Update-ConditionFileNotEmp.patch32
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0016-pkg-config-derive-prefix-from-prefix.patch (renamed from nixpkgs/pkgs/os-specific/linux/systemd/0018-pkg-config-derive-prefix-from-prefix.patch)9
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0017-inherit-systemd-environment-when-calling-generators.patch39
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/0019-core-handle-lookup-paths-being-symlinks.patch80
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/default.nix326
-rw-r--r--nixpkgs/pkgs/os-specific/linux/systemd/musl.diff12
-rw-r--r--nixpkgs/pkgs/os-specific/linux/teensy-udev-rules/default.nix34
-rw-r--r--nixpkgs/pkgs/os-specific/linux/teensy-udev-rules/teensy.rules39
-rw-r--r--nixpkgs/pkgs/os-specific/linux/tinyalsa/default.nix37
-rw-r--r--nixpkgs/pkgs/os-specific/linux/tiptop/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/tiscamera/0001-cmake-find-aravis-fix-pkg-cfg-include-dirs.patch25
-rw-r--r--nixpkgs/pkgs/os-specific/linux/tiscamera/0001-tcamconvert-tcamsrc-add-missing-include-lib-dirs.patch70
-rw-r--r--nixpkgs/pkgs/os-specific/linux/tiscamera/0001-udev-rules-fix-install-location.patch25
-rw-r--r--nixpkgs/pkgs/os-specific/linux/tiscamera/default.nix125
-rw-r--r--nixpkgs/pkgs/os-specific/linux/trace-cmd/default.nix31
-rw-r--r--nixpkgs/pkgs/os-specific/linux/trinity/default.nix11
-rw-r--r--nixpkgs/pkgs/os-specific/linux/tuigreet/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/uclibc-ng/default.nix (renamed from nixpkgs/pkgs/os-specific/linux/uclibc/default.nix)67
-rw-r--r--nixpkgs/pkgs/os-specific/linux/udisks-glue/default.nix26
-rw-r--r--nixpkgs/pkgs/os-specific/linux/udisks/1-default.nix78
-rw-r--r--nixpkgs/pkgs/os-specific/linux/udisks/2-default.nix17
-rw-r--r--nixpkgs/pkgs/os-specific/linux/udisks/glibc.patch25
-rw-r--r--nixpkgs/pkgs/os-specific/linux/udisks/no-pci-db.patch13
-rw-r--r--nixpkgs/pkgs/os-specific/linux/udisks/purity.patch57
-rw-r--r--nixpkgs/pkgs/os-specific/linux/uhk-agent/default.nix39
-rw-r--r--nixpkgs/pkgs/os-specific/linux/uhk-udev-rules/default.nix20
-rw-r--r--nixpkgs/pkgs/os-specific/linux/unscd/0001-adjust-socket-paths-for-nixos.patch41
-rw-r--r--nixpkgs/pkgs/os-specific/linux/unscd/default.nix76
-rw-r--r--nixpkgs/pkgs/os-specific/linux/upower/default.nix55
-rw-r--r--nixpkgs/pkgs/os-specific/linux/usbip/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/usbrelay/daemon.nix36
-rw-r--r--nixpkgs/pkgs/os-specific/linux/usbrelay/default.nix37
-rw-r--r--nixpkgs/pkgs/os-specific/linux/usbrelay/python.nix12
-rw-r--r--nixpkgs/pkgs/os-specific/linux/usbrelay/test.nix63
-rw-r--r--nixpkgs/pkgs/os-specific/linux/usbtop/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/linux/util-linux/default.nix40
-rw-r--r--nixpkgs/pkgs/os-specific/linux/v4l-utils/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/vdo/default.nix64
-rw-r--r--nixpkgs/pkgs/os-specific/linux/vendor-reset/default.nix15
-rw-r--r--nixpkgs/pkgs/os-specific/linux/vmm_clock/default.nix1
-rw-r--r--nixpkgs/pkgs/os-specific/linux/vmware/default.nix47
-rw-r--r--nixpkgs/pkgs/os-specific/linux/waydroid/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/wireguard/default.nix6
-rw-r--r--nixpkgs/pkgs/os-specific/linux/wpa_supplicant/default.nix7
-rw-r--r--nixpkgs/pkgs/os-specific/linux/xf86-input-wacom/default.nix4
-rw-r--r--nixpkgs/pkgs/os-specific/linux/xmm7360-pci/default.nix31
-rw-r--r--nixpkgs/pkgs/os-specific/linux/xone/default.nix10
-rw-r--r--nixpkgs/pkgs/os-specific/linux/xp-pen-drivers/deco-01-v2/default.nix81
-rw-r--r--nixpkgs/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix39
-rw-r--r--nixpkgs/pkgs/os-specific/linux/xpadneo/default.nix8
-rw-r--r--nixpkgs/pkgs/os-specific/linux/zenpower/default.nix8
-rw-r--r--nixpkgs/pkgs/os-specific/linux/zfs/default.nix20
-rw-r--r--nixpkgs/pkgs/os-specific/solo5/default.nix18
-rw-r--r--nixpkgs/pkgs/os-specific/solo5/fix_paths.patch29
-rw-r--r--nixpkgs/pkgs/os-specific/solo5/test_sleep.patch22
-rw-r--r--nixpkgs/pkgs/os-specific/windows/default.nix2
-rw-r--r--nixpkgs/pkgs/os-specific/windows/mingw-w64/default.nix1
-rw-r--r--nixpkgs/pkgs/os-specific/windows/npiperelay/default.nix23
370 files changed, 6919 insertions, 2971 deletions
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix b/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix
index 228a084d250f..05340642f8d0 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix
@@ -168,8 +168,8 @@ in rec {
   bareFrameworks = (
     lib.mapAttrs framework (import ./frameworks.nix {
       inherit frameworks libs;
-      inherit (pkgs.darwin) libobjc Libsystem;
-      inherit (pkgs.darwin.apple_sdk) libnetwork;
+      inherit (pkgs.darwin.apple_sdk_11_0) libnetwork Libsystem;
+      libobjc = pkgs.darwin.apple_sdk_11_0.objc4;
     })
   ) // (
     lib.mapAttrs privateFramework (import ./private-frameworks.nix {
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix
index 44b119e1a23e..b29a36177a82 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix
@@ -1,4 +1,5 @@
-{ stdenvNoCC, fetchurl, newScope, pkgs
+{ stdenvNoCC, fetchurl, newScope, lib, pkgs
+, stdenv, overrideCC
 , xar, cpio, python3, pbzx }:
 
 let
@@ -54,5 +55,35 @@ let
     # questionable aliases
     configd = pkgs.darwin.apple_sdk.frameworks.SystemConfiguration;
     IOKit = pkgs.darwin.apple_sdk.frameworks.IOKit;
+
+    callPackage = newScope (lib.optionalAttrs stdenv.isDarwin rec {
+      inherit (pkgs.darwin.apple_sdk_11_0) stdenv;
+      darwin = pkgs.darwin.overrideScope (_: prev: {
+        inherit (prev.darwin.apple_sdk_11_0) Libsystem LibsystemCross libcharset libunwind objc4 configd IOKit Security;
+        apple_sdk = prev.darwin.apple_sdk_11_0;
+        CF = prev.darwin.apple_sdk_11_0.CoreFoundation;
+      });
+      xcodebuild = pkgs.xcbuild.override {
+        inherit (pkgs.darwin.apple_sdk_11_0.frameworks) CoreServices CoreGraphics ImageIO;
+        inherit stdenv;
+      };
+      xcbuild = xcodebuild;
+    });
+
+    stdenv =
+      let
+        clang = stdenv.cc.override {
+          bintools = stdenv.cc.bintools.override { libc = packages.Libsystem; };
+          libc = packages.Libsystem;
+        };
+      in
+      if stdenv.isAarch64 then stdenv
+      else
+        (overrideCC stdenv clang).override {
+          targetPlatform = stdenv.targetPlatform // {
+            darwinMinVersion = "10.12";
+            darwinSdkVersion = "11.0";
+          };
+        };
   };
 in packages
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix b/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix
index 96c0475c087e..e9121b021164 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix
@@ -89,6 +89,8 @@
   IOBluetooth                      = { inherit CoreBluetooth IOKit; };
   IOBluetoothUI                    = { inherit IOBluetooth; };
   IOKit                            = {};
+  # `IOSurface` should depend on `Libsystem` (in place of `xpc`) but this currently causes build
+  # issues due to incompatibility issues between `Libsystem` and `libcxx`.
   IOSurface                        = { inherit IOKit xpc; };
   IOUSBHost                        = {};
   IdentityLookup                   = {};
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-sdk/frameworks.nix b/nixpkgs/pkgs/os-specific/darwin/apple-sdk/frameworks.nix
index d3b00e6a6a68..0c70d9bc258f 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-sdk/frameworks.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-sdk/frameworks.nix
@@ -1,4 +1,4 @@
-# Current as of 10.9
+# Current as of 10.12
 # Epic weird knot-tying happening here.
 # TODO: clean up the process for generating this and include it
 
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix
index 085d223bd04d..b413744677d2 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix
@@ -183,7 +183,7 @@ appleDerivation' stdenv {
   '';
 
   meta = with lib; {
-    maintainers = with maintainers; [ joelteon copumpkin ];
+    maintainers = with maintainers; [ copumpkin ];
     platforms   = platforms.darwin;
     license     = licenses.apsl20;
   };
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
index 86c91e9b55cc..6f8124dbac4c 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, buildPackages
-, appleDerivation', cpio, xnu, Libc, Libm, libdispatch, Libinfo
+, appleDerivation', xnu, Libc, Libm, libdispatch, Libinfo
 , dyld, Csu, architecture, libclosure, CarbonHeaders, ncurses, CommonCrypto
 , copyfile, removefile, libresolvHeaders, libresolv, Libnotify, libplatform, libpthread
 , mDNSResponder, launchd, libutilHeaders, hfsHeaders, darling, darwin-stubs
@@ -11,15 +11,21 @@ appleDerivation' stdenv {
   dontBuild = true;
   dontFixup = true;
 
-  nativeBuildInputs = [ cpio ];
-
   installPhase = ''
     export NIX_ENFORCE_PURITY=
 
     mkdir -p $out/lib $out/include
 
+    function copyHierarchy () {
+      mkdir -p $1
+      while read f; do
+        mkdir -p $1/$(dirname $f)
+        cp --parents -pn $f $1
+      done
+    }
+
     # Set up our include directories
-    (cd ${xnu}/include && find . -name '*.h' -or -name '*.defs' | cpio -pdm $out/include)
+    (cd ${xnu}/include && find . -name '*.h' -or -name '*.defs' | copyHierarchy $out/include)
     cp ${xnu}/Library/Frameworks/Kernel.framework/Versions/A/Headers/Availability*.h $out/include
     cp ${xnu}/Library/Frameworks/Kernel.framework/Versions/A/Headers/stdarg.h        $out/include
 
@@ -28,10 +34,10 @@ appleDerivation' stdenv {
                ${CommonCrypto} ${copyfile} ${removefile} ${libresolvHeaders} \
                ${Libnotify} ${libplatform} ${mDNSResponder} ${launchd} \
                ${libutilHeaders} ${libpthread} ${hfsHeaders}; do
-      (cd $dep/include && find . -name '*.h' | cpio -pdm $out/include)
+      (cd $dep/include && find . -name '*.h' | copyHierarchy $out/include)
     done
 
-    (cd ${buildPackages.darwin.cctools.dev}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o)
+    (cd ${buildPackages.darwin.cctools.dev}/include/mach-o && find . -name '*.h' | copyHierarchy $out/include/mach-o)
 
     mkdir -p $out/include/os
 
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/headers.txt b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/headers.txt
index 09b0ab410459..cdca44c7292c 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/headers.txt
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/Libsystem/headers.txt
@@ -71,6 +71,7 @@ architecture/i386/table.h
 architecture/i386/tss.h
 arpa/ftp.h
 arpa/inet.h
+arpa/nameser.h
 arpa/nameser_compat.h
 arpa/telnet.h
 arpa/tftp.h
@@ -956,6 +957,7 @@ mpool.h
 msgcat.h
 nameser.h
 nc_tparm.h
+ncurses.h
 ncurses_dll.h
 ndbm.h
 net/bpf.h
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/bsdmake/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/bsdmake/default.nix
index 6f666019c3b3..214aa5dfad9e 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/bsdmake/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/bsdmake/default.nix
@@ -20,6 +20,12 @@ appleDerivation {
       --replace '-o ''${''${group}OWN_''${.ALLSRC:T}}' "" \
       --replace '-g ''${''${group}GRP_''${.ALLSRC:T}}' "" \
       --replace '-o ''${''${group}OWN} -g ''${''${group}GRP}' ""
+
+    # Workaround for https://github.com/NixOS/nixpkgs/issues/103172
+    # Prevents bsdmake from failing on systems that already had default limits
+    # increased.
+    substituteInPlace main.c \
+      --replace 'err(2, "setrlimit");' 'warn("setrlimit");'
   '';
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/default.nix
index d2d21cc9d6cb..df47d53514ab 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/default.nix
@@ -280,9 +280,11 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // {
     objc4           = applePackage "objc4"             "osx-10.12.6"     "1cj1vhbcs9pkmag2ms8wslagicnq9bxi2qjkszmp3ys7z7ccrbwz" {};
     ppp             = applePackage "ppp"               "osx-10.12.6"     "1kcc2nc4x1kf8sz0a23i6nfpvxg381kipi0qdisrp8x9z2gbkxb8" {};
     removefile      = applePackage "removefile"        "osx-10.12.6"     "0jzjxbmxgjzhssqd50z7kq9dlwrv5fsdshh57c0f8mdwcs19bsyx" {};
-    xnu             = applePackage "xnu"               "osx-10.12.6"     "1sjb0i7qzz840v2h4z3s4jyjisad4r5yyi6sg8pakv3wd81i5fg5" {
+    xnu             = if stdenv.isx86_64 then
+    applePackage "xnu"               "osx-10.12.6"     "1sjb0i7qzz840v2h4z3s4jyjisad4r5yyi6sg8pakv3wd81i5fg5" {
       python3 = pkgs.buildPackages.buildPackages.python3; # TODO(@Ericson2314) this shouldn't be needed.
-    };
+    }
+    else macosPackages_11_0_1.xnu;
     hfs             = applePackage "hfs"               "osx-10.12.6"     "1mj3xvqpq1mgd80b6kl1s04knqnap7hccr0gz8rjphalq14rbl5g" {};
     Librpcsvc       = applePackage "Librpcsvc"         "osx-10.11.6"     "1zwfwcl9irxl1dlnf2b4v30vdybp0p0r6n6g1pd14zbdci1jcg2k" {};
     adv_cmds        = applePackage "adv_cmds"          "osx-10.11.6"    "12gbv35i09aij9g90p6b3x2f3ramw43qcb2gjrg8lzkzmwvcyw9q" {};
@@ -291,7 +293,9 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // {
     diskdev_cmds    = applePackage "diskdev_cmds"      "osx-10.11.6"     "1ssdyiaq5m1zfy96yy38yyknp682ki6bvabdqd5z18fa0rv3m2ar" {
       macosPackages_11_0_1 = macosPackages_11_0_1;
     };
-    network_cmds    = applePackage "network_cmds"      "osx-10.11.6"     "0lhi9wz84qr1r2ab3fb4nvmdg9gxn817n5ldg7zw9gnf3wwn42kw" {};
+    network_cmds    = if stdenv.isx86_64 then
+      applePackage "network_cmds" "osx-10.11.6" "0lhi9wz84qr1r2ab3fb4nvmdg9gxn817n5ldg7zw9gnf3wwn42kw" {}
+    else macosPackages_11_0_1.network_cmds;
     file_cmds       = applePackage "file_cmds"         "osx-10.11.6"     "1zfxbmasps529pnfdjvc13p7ws2cfx8pidkplypkswyff0nff4wp" {};
     shell_cmds      = applePackage "shell_cmds"        "osx-10.11.6"     "0084k271v66h4jqp7q7rmjvv7w4mvhx3aq860qs8jbd30canm86n" {};
     system_cmds     = applePackage "system_cmds"       "osx-10.11.6"     "1h46j2c5v02pkv5d9fyv6cpgyg0lczvwicrx6r9s210cl03l77jl" {};
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix
index f2c4ec32146f..18233cfc5227 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix
@@ -16,6 +16,10 @@ appleDerivation {
       --replace "/usr/bin/cpp" "$out/bin/clang-cpp"
   '';
 
+  # Workaround build failure on -fno-common toolchains:
+  #   duplicate symbol '_btype_2' in:args.o pr_comment.o
+  NIX_CFLAGS_COMPILE = "-fcommon";
+
   # temporary install phase until xcodebuild has "install" support
   installPhase = ''
     for f in Products/Release/*; do
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix
index 3e7e89642c26..1f13cbef9fc9 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix
@@ -4,7 +4,9 @@
 appleDerivation {
   nativeBuildInputs = [ xcbuildHook flex bison fixDarwinDylibNames ];
   buildInputs = [ CoreSymbolication darling xnu ];
-  NIX_CFLAGS_COMPILE = "-DCTF_OLD_VERSIONS -DPRIVATE -DYYDEBUG=1 -I${xnu}/Library/Frameworks/System.framework/Headers -Wno-error=implicit-function-declaration";
+  # -fcommon: workaround build failure on -fno-common toolchains:
+  #   duplicate symbol '_kCSRegionMachHeaderName' in: libproc.o dt_module_apple.o
+  NIX_CFLAGS_COMPILE = "-DCTF_OLD_VERSIONS -DPRIVATE -DYYDEBUG=1 -I${xnu}/Library/Frameworks/System.framework/Headers -Wno-error=implicit-function-declaration -fcommon";
   NIX_LDFLAGS = "-L./Products/Release";
   xcbuildFlags = [ "-target" "dtrace_frameworks" "-target" "dtrace" ];
 
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix
index 981e1370437d..cfa66d2c3536 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix
@@ -17,6 +17,10 @@ appleDerivation {
     sed -i -re "s/name = ([a-zA-Z]+);/name = \1; productName = \1;/" file_cmds.xcodeproj/project.pbxproj
   '';
 
+  # Workaround build failure on -fno-common toolchains:
+  #   duplicate symbol '_chdname' in: ar_io.o tty_subs.o
+  NIX_CFLAGS_COMPILE = "-fcommon";
+
   # temporary install phase until xcodebuild has "install" support
   installPhase = ''
     for f in Products/Release/*; do
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix
index dd3cf0309526..9a95eb04e6ef 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix
@@ -1,11 +1,13 @@
-{ lib, appleDerivation, xcbuildHook
-, openssl_1_0_2, Librpcsvc, xnu, libpcap, developer_cmds }:
+{ lib, appleDerivation, xcbuildHook, stdenv
+, libressl_3_4, Librpcsvc, xnu, libpcap, developer_cmds }:
 
 appleDerivation {
   nativeBuildInputs = [ xcbuildHook ];
-  buildInputs = [ openssl_1_0_2 xnu Librpcsvc libpcap developer_cmds ];
+  buildInputs = [ libressl_3_4 xnu Librpcsvc libpcap developer_cmds ];
 
-  NIX_CFLAGS_COMPILE = " -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/";
+  # Work around error from <stdio.h> on aarch64-darwin:
+  #     error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
+  NIX_CFLAGS_COMPILE = "-Wno-error=undef-prefix -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/";
 
   # "spray" requires some files that aren't compiling correctly in xcbuild.
   # "rtadvd" seems to fail with some missing constants.
@@ -16,6 +18,10 @@ appleDerivation {
       --replace "7216D34D0EE89FEC00AE70E4 /* PBXTargetDependency */," "" \
       --replace "72CD1D9C0EE8C47C005F825D /* PBXTargetDependency */," "" \
       --replace "7216D2C20EE89ADF00AE70E4 /* PBXTargetDependency */," ""
+  '' + lib.optionalString stdenv.isAarch64 ''
+    # "unbound" does not build on aarch64
+    substituteInPlace network_cmds.xcodeproj/project.pbxproj \
+      --replace "71D958C51A9455A000C9B286 /* PBXTargetDependency */," ""
   '';
 
   # temporary install phase until xcodebuild has "install" support
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/top/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/top/default.nix
index a2f912ca5782..ef766f7bd7f1 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/top/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/top/default.nix
@@ -3,6 +3,9 @@
 appleDerivation {
   nativeBuildInputs = [ xcbuildHook ];
   buildInputs = [ apple_sdk.frameworks.IOKit ncurses libutil ];
+  # Workaround build failure on -fno-common toolchains:
+  #   duplicate symbol '_tsamp' in: main.o top.o
+  NIX_CFLAGS_COMPILE = "-fcommon";
   NIX_LDFLAGS = "-lutil";
   installPhase = ''
     install -D Products/Release/libtop.a $out/lib/libtop.a
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
index 90f572d3940d..8b0d2054d58a 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
@@ -4,12 +4,15 @@
 , headersOnly ? true
 }:
 
-appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ({
+appleDerivation' (if headersOnly then stdenvNoCC else stdenv) (
+  let arch = if stdenv.isx86_64 then "x86_64" else "arm64";
+  in
+  {
   depsBuildBuild = [ buildPackages.stdenv.cc ];
 
   nativeBuildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl python3 ];
 
-  patches = [ ./python3.patch ];
+  patches = lib.optional stdenv.isx86_64 [ ./python3.patch ];
 
   postPatch = ''
     substituteInPlace Makefile \
@@ -41,9 +44,16 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ({
       --replace " -o 0" "" \
       --replace '$SRC/$mig' '-I$DSTROOT/include $SRC/$mig' \
       --replace '$SRC/servers/netname.defs' '-I$DSTROOT/include $SRC/servers/netname.defs' \
-      --replace '$BUILT_PRODUCTS_DIR/mig_hdr' '$BUILT_PRODUCTS_DIR'
+      --replace '$BUILT_PRODUCTS_DIR/mig_hdr' '$BUILT_PRODUCTS_DIR' \
+      --replace 'MACHINE_ARCH=armv7' 'MACHINE_ARCH=arm64' # this might break the comments saying 32-bit is required
 
     patchShebangs .
+  '' + lib.optionalString stdenv.isAarch64 ''
+    # iig is closed-sourced, we don't have it
+    # create an empty file to the header instead
+    # this line becomes: echo "" > $@; echo --header ...
+    substituteInPlace iokit/DriverKit/Makefile \
+      --replace '--def $<' '> $@; echo'
   '';
 
   PLATFORM = "MacOSX";
@@ -62,18 +72,22 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ({
   HOST_BISON = "bison";
   HOST_GM4 = "m4";
   MIGCC = "cc";
-  ARCHS = "x86_64";
+  ARCHS = arch;
+  ARCH_CONFIGS = arch;
 
   NIX_CFLAGS_COMPILE = "-Wno-error";
 
-  preBuild = ''
+  preBuild = let macosVersion =
+    "10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11" +
+    lib.optionalString stdenv.isAarch64 " 10.12 10.13 10.14 10.15 11.0";
+   in ''
     # This is a bit of a hack...
     mkdir -p sdk/usr/local/libexec
 
     cat > sdk/usr/local/libexec/availability.pl <<EOF
       #!$SHELL
       if [ "\$1" == "--macosx" ]; then
-        echo 10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11
+        echo ${macosVersion}
       elif [ "\$1" == "--ios" ]; then
         echo 2.0 2.1 2.2 3.0 3.1 3.2 4.0 4.1 4.2 4.3 5.0 5.1 6.0 6.1 7.0 8.0 9.0
       fi
@@ -132,7 +146,7 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ({
     mv $out/Library/Frameworks/IOKit.framework $out/Library/PrivateFrameworks
   '';
 
-  appleHeaders = builtins.readFile ./headers.txt;
+  appleHeaders = builtins.readFile (./. + "/headers-${arch}.txt");
 } // lib.optionalAttrs headersOnly {
   HOST_CODESIGN = "echo";
   HOST_CODESIGN_ALLOCATE = "echo";
@@ -142,4 +156,5 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ({
   CTFMERGE = "echo";
   CTFINSERT = "echo";
   NMEDIT = "echo";
+  IIG = "echo";
 })
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/headers-arm64.txt b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/headers-arm64.txt
new file mode 100644
index 000000000000..fe17d8784e41
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/headers-arm64.txt
@@ -0,0 +1,1486 @@
+AssertMacros.h
+_errno.h
+_libkernel_init.h
+arm/_limits.h
+arm/_mcontext.h
+arm/_param.h
+arm/_types.h
+arm/arch.h
+arm/endian.h
+arm/fasttrap_isa.h
+arm/limits.h
+arm/param.h
+arm/profile.h
+arm/signal.h
+arm/types.h
+arm/vmparam.h
+atm/atm_notification.defs
+atm/atm_types.defs
+atm/atm_types.h
+bank/bank_types.h
+bsd/arm/_limits.h
+bsd/arm/_mcontext.h
+bsd/arm/_param.h
+bsd/arm/_types.h
+bsd/arm/endian.h
+bsd/arm/limits.h
+bsd/arm/param.h
+bsd/arm/profile.h
+bsd/arm/signal.h
+bsd/arm/types.h
+bsd/arm/vmparam.h
+bsd/bsm/audit.h
+bsd/crypto/entropy/diag_entropy_sysctl.h
+bsd/dev/random/randomdev.h
+bsd/libkern/copyio.h
+bsd/libkern/libkern.h
+bsd/machine/_limits.h
+bsd/machine/_mcontext.h
+bsd/machine/_param.h
+bsd/machine/_types.h
+bsd/machine/byte_order.h
+bsd/machine/disklabel.h
+bsd/machine/endian.h
+bsd/machine/limits.h
+bsd/machine/param.h
+bsd/machine/profile.h
+bsd/machine/signal.h
+bsd/machine/types.h
+bsd/machine/vmparam.h
+bsd/miscfs/devfs/devfs.h
+bsd/miscfs/devfs/devfs_proto.h
+bsd/miscfs/devfs/devfsdefs.h
+bsd/miscfs/devfs/fdesc.h
+bsd/miscfs/fifofs/fifo.h
+bsd/miscfs/specfs/specdev.h
+bsd/miscfs/union/union.h
+bsd/net/bpf.h
+bsd/net/dlil.h
+bsd/net/ethernet.h
+bsd/net/if.h
+bsd/net/if_arp.h
+bsd/net/if_dl.h
+bsd/net/if_ether.h
+bsd/net/if_llc.h
+bsd/net/if_media.h
+bsd/net/if_mib.h
+bsd/net/if_types.h
+bsd/net/if_utun.h
+bsd/net/if_var.h
+bsd/net/init.h
+bsd/net/kext_net.h
+bsd/net/kpi_interface.h
+bsd/net/kpi_interfacefilter.h
+bsd/net/kpi_protocol.h
+bsd/net/ndrv.h
+bsd/net/net_kev.h
+bsd/net/pfkeyv2.h
+bsd/net/radix.h
+bsd/net/route.h
+bsd/netinet/bootp.h
+bsd/netinet/icmp6.h
+bsd/netinet/icmp_var.h
+bsd/netinet/if_ether.h
+bsd/netinet/igmp.h
+bsd/netinet/igmp_var.h
+bsd/netinet/in.h
+bsd/netinet/in_arp.h
+bsd/netinet/in_pcb.h
+bsd/netinet/in_systm.h
+bsd/netinet/in_var.h
+bsd/netinet/ip.h
+bsd/netinet/ip6.h
+bsd/netinet/ip_icmp.h
+bsd/netinet/ip_var.h
+bsd/netinet/kpi_ipfilter.h
+bsd/netinet/tcp.h
+bsd/netinet/tcp_fsm.h
+bsd/netinet/tcp_seq.h
+bsd/netinet/tcp_timer.h
+bsd/netinet/tcp_var.h
+bsd/netinet/tcpip.h
+bsd/netinet/udp.h
+bsd/netinet/udp_var.h
+bsd/netinet6/ah.h
+bsd/netinet6/esp.h
+bsd/netinet6/in6.h
+bsd/netinet6/in6_var.h
+bsd/netinet6/ipcomp.h
+bsd/netinet6/ipsec.h
+bsd/netinet6/nd6.h
+bsd/netinet6/raw_ip6.h
+bsd/netinet6/scope6_var.h
+bsd/netkey/keysock.h
+bsd/pthread/bsdthread_private.h
+bsd/pthread/priority_private.h
+bsd/pthread/workqueue_internal.h
+bsd/pthread/workqueue_syscalls.h
+bsd/pthread/workqueue_trace.h
+bsd/security/audit/audit.h
+bsd/security/audit/audit_bsd.h
+bsd/security/audit/audit_ioctl.h
+bsd/security/audit/audit_private.h
+bsd/sys/_endian.h
+bsd/sys/_select.h
+bsd/sys/_structs.h
+bsd/sys/_types.h
+bsd/sys/_types/_blkcnt_t.h
+bsd/sys/_types/_blksize_t.h
+bsd/sys/_types/_caddr_t.h
+bsd/sys/_types/_clock_t.h
+bsd/sys/_types/_ct_rune_t.h
+bsd/sys/_types/_dev_t.h
+bsd/sys/_types/_errno_t.h
+bsd/sys/_types/_fd_clr.h
+bsd/sys/_types/_fd_copy.h
+bsd/sys/_types/_fd_def.h
+bsd/sys/_types/_fd_isset.h
+bsd/sys/_types/_fd_set.h
+bsd/sys/_types/_fd_setsize.h
+bsd/sys/_types/_fd_zero.h
+bsd/sys/_types/_filesec_t.h
+bsd/sys/_types/_fsblkcnt_t.h
+bsd/sys/_types/_fsfilcnt_t.h
+bsd/sys/_types/_fsid_t.h
+bsd/sys/_types/_fsobj_id_t.h
+bsd/sys/_types/_gid_t.h
+bsd/sys/_types/_guid_t.h
+bsd/sys/_types/_id_t.h
+bsd/sys/_types/_in_addr_t.h
+bsd/sys/_types/_in_port_t.h
+bsd/sys/_types/_ino64_t.h
+bsd/sys/_types/_ino_t.h
+bsd/sys/_types/_int16_t.h
+bsd/sys/_types/_int32_t.h
+bsd/sys/_types/_int64_t.h
+bsd/sys/_types/_int8_t.h
+bsd/sys/_types/_intptr_t.h
+bsd/sys/_types/_iovec_t.h
+bsd/sys/_types/_key_t.h
+bsd/sys/_types/_mach_port_t.h
+bsd/sys/_types/_mbstate_t.h
+bsd/sys/_types/_mode_t.h
+bsd/sys/_types/_nlink_t.h
+bsd/sys/_types/_null.h
+bsd/sys/_types/_o_dsync.h
+bsd/sys/_types/_o_sync.h
+bsd/sys/_types/_off_t.h
+bsd/sys/_types/_offsetof.h
+bsd/sys/_types/_os_inline.h
+bsd/sys/_types/_pid_t.h
+bsd/sys/_types/_posix_vdisable.h
+bsd/sys/_types/_ptrdiff_t.h
+bsd/sys/_types/_rsize_t.h
+bsd/sys/_types/_rune_t.h
+bsd/sys/_types/_s_ifmt.h
+bsd/sys/_types/_sa_family_t.h
+bsd/sys/_types/_seek_set.h
+bsd/sys/_types/_sigaltstack.h
+bsd/sys/_types/_sigset_t.h
+bsd/sys/_types/_size_t.h
+bsd/sys/_types/_socklen_t.h
+bsd/sys/_types/_ssize_t.h
+bsd/sys/_types/_suseconds_t.h
+bsd/sys/_types/_time_t.h
+bsd/sys/_types/_timespec.h
+bsd/sys/_types/_timeval.h
+bsd/sys/_types/_timeval32.h
+bsd/sys/_types/_timeval64.h
+bsd/sys/_types/_u_char.h
+bsd/sys/_types/_u_int.h
+bsd/sys/_types/_u_int16_t.h
+bsd/sys/_types/_u_int32_t.h
+bsd/sys/_types/_u_int64_t.h
+bsd/sys/_types/_u_int8_t.h
+bsd/sys/_types/_u_short.h
+bsd/sys/_types/_ucontext.h
+bsd/sys/_types/_ucontext64.h
+bsd/sys/_types/_uid_t.h
+bsd/sys/_types/_uintptr_t.h
+bsd/sys/_types/_useconds_t.h
+bsd/sys/_types/_user32_itimerval.h
+bsd/sys/_types/_user32_ntptimeval.h
+bsd/sys/_types/_user32_timespec.h
+bsd/sys/_types/_user32_timeval.h
+bsd/sys/_types/_user32_timex.h
+bsd/sys/_types/_user64_itimerval.h
+bsd/sys/_types/_user64_ntptimeval.h
+bsd/sys/_types/_user64_timespec.h
+bsd/sys/_types/_user64_timeval.h
+bsd/sys/_types/_user64_timex.h
+bsd/sys/_types/_user_timespec.h
+bsd/sys/_types/_user_timeval.h
+bsd/sys/_types/_uuid_t.h
+bsd/sys/_types/_va_list.h
+bsd/sys/_types/_wchar_t.h
+bsd/sys/_types/_wint_t.h
+bsd/sys/appleapiopts.h
+bsd/sys/attr.h
+bsd/sys/bsdtask_info.h
+bsd/sys/buf.h
+bsd/sys/cdefs.h
+bsd/sys/codesign.h
+bsd/sys/commpage.h
+bsd/sys/conf.h
+bsd/sys/content_protection.h
+bsd/sys/cprotect.h
+bsd/sys/csr.h
+bsd/sys/decmpfs.h
+bsd/sys/dir.h
+bsd/sys/dirent.h
+bsd/sys/disk.h
+bsd/sys/disklabel.h
+bsd/sys/disktab.h
+bsd/sys/dkstat.h
+bsd/sys/doc_tombstone.h
+bsd/sys/domain.h
+bsd/sys/errno.h
+bsd/sys/ev.h
+bsd/sys/event.h
+bsd/sys/eventhandler.h
+bsd/sys/eventvar.h
+bsd/sys/fbt.h
+bsd/sys/fcntl.h
+bsd/sys/file.h
+bsd/sys/file_internal.h
+bsd/sys/filedesc.h
+bsd/sys/fileport.h
+bsd/sys/filio.h
+bsd/sys/fsctl.h
+bsd/sys/fsevents.h
+bsd/sys/fslog.h
+bsd/sys/guarded.h
+bsd/sys/imgact.h
+bsd/sys/ioccom.h
+bsd/sys/ioctl.h
+bsd/sys/ioctl_compat.h
+bsd/sys/ipc.h
+bsd/sys/kasl.h
+bsd/sys/kauth.h
+bsd/sys/kdebug.h
+bsd/sys/kdebug_kernel.h
+bsd/sys/kdebug_private.h
+bsd/sys/kern_control.h
+bsd/sys/kern_event.h
+bsd/sys/kern_memorystatus.h
+bsd/sys/kern_memorystatus_freeze.h
+bsd/sys/kern_memorystatus_notify.h
+bsd/sys/kern_sysctl.h
+bsd/sys/kernel.h
+bsd/sys/kernel_types.h
+bsd/sys/kpi_mbuf.h
+bsd/sys/kpi_private.h
+bsd/sys/kpi_socket.h
+bsd/sys/kpi_socketfilter.h
+bsd/sys/ktrace.h
+bsd/sys/linker_set.h
+bsd/sys/lock.h
+bsd/sys/lockf.h
+bsd/sys/mach_swapon.h
+bsd/sys/malloc.h
+bsd/sys/mbuf.h
+bsd/sys/md5.h
+bsd/sys/memory_maintenance.h
+bsd/sys/mman.h
+bsd/sys/monotonic.h
+bsd/sys/mount.h
+bsd/sys/mount_internal.h
+bsd/sys/msg.h
+bsd/sys/msgbuf.h
+bsd/sys/munge.h
+bsd/sys/namei.h
+bsd/sys/netport.h
+bsd/sys/param.h
+bsd/sys/paths.h
+bsd/sys/persona.h
+bsd/sys/pgo.h
+bsd/sys/pipe.h
+bsd/sys/posix_sem.h
+bsd/sys/posix_shm.h
+bsd/sys/priv.h
+bsd/sys/proc.h
+bsd/sys/proc_info.h
+bsd/sys/proc_internal.h
+bsd/sys/proc_require.h
+bsd/sys/protosw.h
+bsd/sys/pthread_internal.h
+bsd/sys/pthread_shims.h
+bsd/sys/queue.h
+bsd/sys/quota.h
+bsd/sys/random.h
+bsd/sys/reason.h
+bsd/sys/reboot.h
+bsd/sys/resource.h
+bsd/sys/resourcevar.h
+bsd/sys/sbuf.h
+bsd/sys/select.h
+bsd/sys/sem.h
+bsd/sys/sem_internal.h
+bsd/sys/semaphore.h
+bsd/sys/shm.h
+bsd/sys/shm_internal.h
+bsd/sys/signal.h
+bsd/sys/signalvar.h
+bsd/sys/socket.h
+bsd/sys/socketvar.h
+bsd/sys/sockio.h
+bsd/sys/spawn.h
+bsd/sys/spawn_internal.h
+bsd/sys/stackshot.h
+bsd/sys/stat.h
+bsd/sys/stdio.h
+bsd/sys/sys_domain.h
+bsd/sys/syscall.h
+bsd/sys/sysctl.h
+bsd/sys/syslimits.h
+bsd/sys/syslog.h
+bsd/sys/sysproto.h
+bsd/sys/systm.h
+bsd/sys/termios.h
+bsd/sys/time.h
+bsd/sys/timex.h
+bsd/sys/tree.h
+bsd/sys/tty.h
+bsd/sys/ttychars.h
+bsd/sys/ttycom.h
+bsd/sys/ttydefaults.h
+bsd/sys/ttydev.h
+bsd/sys/types.h
+bsd/sys/ubc.h
+bsd/sys/ucontext.h
+bsd/sys/ucred.h
+bsd/sys/uio.h
+bsd/sys/uio_internal.h
+bsd/sys/ulock.h
+bsd/sys/un.h
+bsd/sys/unicode.h
+bsd/sys/unistd.h
+bsd/sys/unpcb.h
+bsd/sys/user.h
+bsd/sys/utfconv.h
+bsd/sys/ux_exception.h
+bsd/sys/vfs_context.h
+bsd/sys/vm.h
+bsd/sys/vmmeter.h
+bsd/sys/vmparam.h
+bsd/sys/vnode.h
+bsd/sys/vnode_if.h
+bsd/sys/vnode_internal.h
+bsd/sys/vsock.h
+bsd/sys/vsock_domain.h
+bsd/sys/vsock_transport.h
+bsd/sys/wait.h
+bsd/sys/work_interval.h
+bsd/sys/xattr.h
+bsd/uuid/uuid.h
+bsd/vfs/vfs_disk_conditioner.h
+bsd/vfs/vfs_support.h
+bsd/vm/vnode_pager.h
+bsm/audit.h
+bsm/audit_domain.h
+bsm/audit_errno.h
+bsm/audit_fcntl.h
+bsm/audit_internal.h
+bsm/audit_kevents.h
+bsm/audit_record.h
+bsm/audit_socket_type.h
+corecrypto/cc.h
+corecrypto/cc_config.h
+corecrypto/cc_error.h
+corecrypto/cc_fault_canary.h
+corecrypto/cc_macros.h
+corecrypto/cc_priv.h
+corecrypto/cc_runtime_config.h
+corecrypto/ccaes.h
+corecrypto/ccasn1.h
+corecrypto/ccchacha20poly1305.h
+corecrypto/cccmac.h
+corecrypto/ccdes.h
+corecrypto/ccdigest.h
+corecrypto/ccdigest_priv.h
+corecrypto/ccdrbg.h
+corecrypto/ccdrbg_impl.h
+corecrypto/cchmac.h
+corecrypto/cckprng.h
+corecrypto/ccmd4.h
+corecrypto/ccmode.h
+corecrypto/ccmode_impl.h
+corecrypto/ccmode_siv.h
+corecrypto/ccmode_siv_hmac.h
+corecrypto/ccn.h
+corecrypto/ccpad.h
+corecrypto/ccrng.h
+corecrypto/ccrsa.h
+corecrypto/ccsha1.h
+corecrypto/ccsha2.h
+corecrypto/cczp.h
+corecrypto/fipspost_trace.h
+corpses/task_corpse.h
+default_pager/default_pager_types.h
+device/device.defs
+device/device_port.h
+device/device_types.defs
+device/device_types.h
+gethostuuid.h
+gethostuuid_private.h
+iokit/DriverKit/IOBufferMemoryDescriptor.h
+iokit/DriverKit/IODMACommand.h
+iokit/DriverKit/IODataQueueDispatchSource.h
+iokit/DriverKit/IODispatchQueue.h
+iokit/DriverKit/IODispatchSource.h
+iokit/DriverKit/IOInterruptDispatchSource.h
+iokit/DriverKit/IOKitKeys.h
+iokit/DriverKit/IOMemoryDescriptor.h
+iokit/DriverKit/IOMemoryMap.h
+iokit/DriverKit/IORPC.h
+iokit/DriverKit/IOReturn.h
+iokit/DriverKit/IOService.h
+iokit/DriverKit/IOServiceNotificationDispatchSource.h
+iokit/DriverKit/IOTypes.h
+iokit/DriverKit/IOUserClient.h
+iokit/DriverKit/IOUserServer.h
+iokit/DriverKit/OSAction.h
+iokit/DriverKit/OSObject.h
+iokit/IOKit/AppleKeyStoreInterface.h
+iokit/IOKit/IOBSD.h
+iokit/IOKit/IOBufferMemoryDescriptor.h
+iokit/IOKit/IOCPU.h
+iokit/IOKit/IOCatalogue.h
+iokit/IOKit/IOCommand.h
+iokit/IOKit/IOCommandGate.h
+iokit/IOKit/IOCommandPool.h
+iokit/IOKit/IOCommandQueue.h
+iokit/IOKit/IOConditionLock.h
+iokit/IOKit/IODMACommand.h
+iokit/IOKit/IODMAController.h
+iokit/IOKit/IODMAEventSource.h
+iokit/IOKit/IODataQueue.h
+iokit/IOKit/IODataQueueShared.h
+iokit/IOKit/IODeviceMemory.h
+iokit/IOKit/IODeviceTreeSupport.h
+iokit/IOKit/IOEventSource.h
+iokit/IOKit/IOFilterInterruptEventSource.h
+iokit/IOKit/IOHibernatePrivate.h
+iokit/IOKit/IOInterleavedMemoryDescriptor.h
+iokit/IOKit/IOInterruptAccounting.h
+iokit/IOKit/IOInterruptController.h
+iokit/IOKit/IOInterruptEventSource.h
+iokit/IOKit/IOInterrupts.h
+iokit/IOKit/IOKernelReportStructs.h
+iokit/IOKit/IOKernelReporters.h
+iokit/IOKit/IOKitDebug.h
+iokit/IOKit/IOKitDiagnosticsUserClient.h
+iokit/IOKit/IOKitKeys.h
+iokit/IOKit/IOKitKeysPrivate.h
+iokit/IOKit/IOKitServer.h
+iokit/IOKit/IOLib.h
+iokit/IOKit/IOLocks.h
+iokit/IOKit/IOLocksPrivate.h
+iokit/IOKit/IOMapper.h
+iokit/IOKit/IOMemoryCursor.h
+iokit/IOKit/IOMemoryDescriptor.h
+iokit/IOKit/IOMessage.h
+iokit/IOKit/IOMultiMemoryDescriptor.h
+iokit/IOKit/IONVRAM.h
+iokit/IOKit/IONotifier.h
+iokit/IOKit/IOPMGR.h
+iokit/IOKit/IOPlatformActions.h
+iokit/IOKit/IOPlatformExpert.h
+iokit/IOKit/IOPolledInterface.h
+iokit/IOKit/IORPC.h
+iokit/IOKit/IORangeAllocator.h
+iokit/IOKit/IORegistryEntry.h
+iokit/IOKit/IOReportMacros.h
+iokit/IOKit/IOReportTypes.h
+iokit/IOKit/IOReturn.h
+iokit/IOKit/IOService.h
+iokit/IOKit/IOServicePM.h
+iokit/IOKit/IOSharedDataQueue.h
+iokit/IOKit/IOSharedLock.h
+iokit/IOKit/IOStatistics.h
+iokit/IOKit/IOStatisticsPrivate.h
+iokit/IOKit/IOSubMemoryDescriptor.h
+iokit/IOKit/IOSyncer.h
+iokit/IOKit/IOTimeStamp.h
+iokit/IOKit/IOTimerEventSource.h
+iokit/IOKit/IOTypes.h
+iokit/IOKit/IOUserClient.h
+iokit/IOKit/IOUserServer.h
+iokit/IOKit/IOWorkLoop.h
+iokit/IOKit/OSMessageNotification.h
+iokit/IOKit/PassthruInterruptController.h
+iokit/IOKit/assert.h
+iokit/IOKit/nvram/IONVRAMController.h
+iokit/IOKit/platform/AppleMacIO.h
+iokit/IOKit/platform/AppleMacIODevice.h
+iokit/IOKit/platform/AppleNMI.h
+iokit/IOKit/platform/ApplePlatformExpert.h
+iokit/IOKit/platform/IOPlatformIO.h
+iokit/IOKit/power/IOPwrController.h
+iokit/IOKit/pwr_mgt/IOPM.h
+iokit/IOKit/pwr_mgt/IOPMLibDefs.h
+iokit/IOKit/pwr_mgt/IOPMPowerSource.h
+iokit/IOKit/pwr_mgt/IOPMPowerSourceList.h
+iokit/IOKit/pwr_mgt/IOPMpowerState.h
+iokit/IOKit/pwr_mgt/IOPowerConnection.h
+iokit/IOKit/pwr_mgt/RootDomain.h
+iokit/IOKit/rtc/IORTCController.h
+iokit/IOKit/system.h
+iokit/IOKit/system_management/IOWatchDogTimer.h
+kern/exc_guard.h
+kern/exc_resource.h
+kern/kcdata.h
+kern/kern_cdata.h
+libkern/OSByteOrder.h
+libkern/OSDebug.h
+libkern/OSKextLib.h
+libkern/OSReturn.h
+libkern/OSTypes.h
+libkern/_OSByteOrder.h
+libkern/arm/OSByteOrder.h
+libkern/firehose/chunk_private.h
+libkern/firehose/firehose_types_private.h
+libkern/firehose/ioctl_private.h
+libkern/firehose/tracepoint_private.h
+libkern/libkern/Block.h
+libkern/libkern/Block_private.h
+libkern/libkern/OSAtomic.h
+libkern/libkern/OSBase.h
+libkern/libkern/OSByteOrder.h
+libkern/libkern/OSDebug.h
+libkern/libkern/OSKextLib.h
+libkern/libkern/OSKextLibPrivate.h
+libkern/libkern/OSMalloc.h
+libkern/libkern/OSReturn.h
+libkern/libkern/OSSerializeBinary.h
+libkern/libkern/OSTypes.h
+libkern/libkern/_OSByteOrder.h
+libkern/libkern/arm/OSByteOrder.h
+libkern/libkern/c++/OSAllocation.h
+libkern/libkern/c++/OSArray.h
+libkern/libkern/c++/OSBoolean.h
+libkern/libkern/c++/OSBoundedArray.h
+libkern/libkern/c++/OSBoundedArrayRef.h
+libkern/libkern/c++/OSBoundedPtr.h
+libkern/libkern/c++/OSBoundedPtrFwd.h
+libkern/libkern/c++/OSCPPDebug.h
+libkern/libkern/c++/OSCollection.h
+libkern/libkern/c++/OSCollectionIterator.h
+libkern/libkern/c++/OSContainers.h
+libkern/libkern/c++/OSData.h
+libkern/libkern/c++/OSDictionary.h
+libkern/libkern/c++/OSEndianTypes.h
+libkern/libkern/c++/OSIterator.h
+libkern/libkern/c++/OSKext.h
+libkern/libkern/c++/OSLib.h
+libkern/libkern/c++/OSMetaClass.h
+libkern/libkern/c++/OSNumber.h
+libkern/libkern/c++/OSObject.h
+libkern/libkern/c++/OSOrderedSet.h
+libkern/libkern/c++/OSPtr.h
+libkern/libkern/c++/OSSerialize.h
+libkern/libkern/c++/OSSet.h
+libkern/libkern/c++/OSSharedPtr.h
+libkern/libkern/c++/OSString.h
+libkern/libkern/c++/OSSymbol.h
+libkern/libkern/c++/OSUnserialize.h
+libkern/libkern/c++/bounded_array.h
+libkern/libkern/c++/bounded_array_ref.h
+libkern/libkern/c++/bounded_ptr.h
+libkern/libkern/c++/bounded_ptr_fwd.h
+libkern/libkern/c++/intrusive_shared_ptr.h
+libkern/libkern/c++/safe_allocation.h
+libkern/libkern/crc.h
+libkern/libkern/crypto/aes.h
+libkern/libkern/crypto/aesxts.h
+libkern/libkern/crypto/chacha20poly1305.h
+libkern/libkern/crypto/crypto_internal.h
+libkern/libkern/crypto/des.h
+libkern/libkern/crypto/md5.h
+libkern/libkern/crypto/rand.h
+libkern/libkern/crypto/register_crypto.h
+libkern/libkern/crypto/rsa.h
+libkern/libkern/crypto/sha1.h
+libkern/libkern/crypto/sha2.h
+libkern/libkern/img4/interface.h
+libkern/libkern/kernel_mach_header.h
+libkern/libkern/kext_request_keys.h
+libkern/libkern/kxld.h
+libkern/libkern/kxld_types.h
+libkern/libkern/locks.h
+libkern/libkern/machine/OSByteOrder.h
+libkern/libkern/mkext.h
+libkern/libkern/prelink.h
+libkern/libkern/ptrauth_utils.h
+libkern/libkern/section_keywords.h
+libkern/libkern/stack_protector.h
+libkern/libkern/sysctl.h
+libkern/libkern/tree.h
+libkern/libkern/version.h
+libkern/libkern/zconf.h
+libkern/libkern/zlib.h
+libkern/machine/OSByteOrder.h
+libkern/os/atomic.h
+libkern/os/atomic_private.h
+libkern/os/atomic_private_arch.h
+libkern/os/atomic_private_impl.h
+libkern/os/base.h
+libkern/os/base_private.h
+libkern/os/cpp_util.h
+libkern/os/hash.h
+libkern/os/log.h
+libkern/os/log_private.h
+libkern/os/object.h
+libkern/os/overflow.h
+libkern/os/ptrtools.h
+libkern/os/reason_private.h
+libkern/os/refcnt.h
+libkern/os/refcnt_internal.h
+libkern/os/trace.h
+mach/arm/_structs.h
+mach/arm/asm.h
+mach/arm/boolean.h
+mach/arm/exception.h
+mach/arm/kern_return.h
+mach/arm/ndr_def.h
+mach/arm/processor_info.h
+mach/arm/rpc.h
+mach/arm/sdt_isa.h
+mach/arm/syscall_sw.h
+mach/arm/thread_state.h
+mach/arm/thread_status.h
+mach/arm/traps.h
+mach/arm/vm_param.h
+mach/arm/vm_types.h
+mach/arm64/asm.h
+mach/audit_triggers.defs
+mach/audit_triggers_types.h
+mach/boolean.h
+mach/bootstrap.h
+mach/clock.defs
+mach/clock.h
+mach/clock_priv.defs
+mach/clock_priv.h
+mach/clock_reply.defs
+mach/clock_reply.h
+mach/clock_types.defs
+mach/clock_types.h
+mach/dyld_kernel.h
+mach/error.h
+mach/exc.defs
+mach/exc.h
+mach/exception.h
+mach/exception_types.h
+mach/host_info.h
+mach/host_notify.h
+mach/host_notify_reply.defs
+mach/host_priv.defs
+mach/host_priv.h
+mach/host_reboot.h
+mach/host_security.defs
+mach/host_security.h
+mach/host_special_ports.h
+mach/kern_return.h
+mach/kmod.h
+mach/lock_set.defs
+mach/lock_set.h
+mach/mach.h
+mach/mach_error.h
+mach/mach_eventlink.h
+mach/mach_exc.defs
+mach/mach_host.defs
+mach/mach_host.h
+mach/mach_init.h
+mach/mach_interface.h
+mach/mach_param.h
+mach/mach_port.defs
+mach/mach_port.h
+mach/mach_port_internal.h
+mach/mach_right.h
+mach/mach_syscalls.h
+mach/mach_time.h
+mach/mach_traps.h
+mach/mach_types.defs
+mach/mach_types.h
+mach/mach_vm.defs
+mach/mach_vm.h
+mach/mach_vm_internal.h
+mach/mach_voucher.defs
+mach/mach_voucher.h
+mach/mach_voucher_attr_control.defs
+mach/mach_voucher_types.h
+mach/machine.h
+mach/machine/_structs.h
+mach/machine/asm.h
+mach/machine/boolean.h
+mach/machine/exception.h
+mach/machine/kern_return.h
+mach/machine/machine_types.defs
+mach/machine/ndr_def.h
+mach/machine/processor_info.h
+mach/machine/rpc.h
+mach/machine/sdt.h
+mach/machine/sdt_isa.h
+mach/machine/thread_state.h
+mach/machine/thread_status.h
+mach/machine/vm_param.h
+mach/machine/vm_types.h
+mach/memory_entry.defs
+mach/memory_entry.h
+mach/memory_object_types.h
+mach/message.h
+mach/mig.h
+mach/mig_errors.h
+mach/mig_strncpy_zerofill_support.h
+mach/mig_voucher_support.h
+mach/ndr.h
+mach/notify.defs
+mach/notify.h
+mach/policy.h
+mach/port.h
+mach/port_obj.h
+mach/processor.defs
+mach/processor.h
+mach/processor_info.h
+mach/processor_set.defs
+mach/processor_set.h
+mach/rpc.h
+mach/sdt.h
+mach/semaphore.h
+mach/shared_memory_server.h
+mach/shared_region.h
+mach/std_types.defs
+mach/std_types.h
+mach/sync.h
+mach/sync_policy.h
+mach/task.defs
+mach/task.h
+mach/task_access.defs
+mach/task_info.h
+mach/task_inspect.h
+mach/task_policy.h
+mach/task_special_ports.h
+mach/telemetry_notification.defs
+mach/thread_act.defs
+mach/thread_act.h
+mach/thread_act_internal.h
+mach/thread_info.h
+mach/thread_policy.h
+mach/thread_special_ports.h
+mach/thread_state.h
+mach/thread_status.h
+mach/thread_switch.h
+mach/time_value.h
+mach/vm_attributes.h
+mach/vm_behavior.h
+mach/vm_inherit.h
+mach/vm_map.defs
+mach/vm_map.h
+mach/vm_map_internal.h
+mach/vm_page_size.h
+mach/vm_param.h
+mach/vm_prot.h
+mach/vm_purgable.h
+mach/vm_region.h
+mach/vm_statistics.h
+mach/vm_sync.h
+mach/vm_task.h
+mach/vm_types.h
+mach_debug/hash_info.h
+mach_debug/ipc_info.h
+mach_debug/lockgroup_info.h
+mach_debug/mach_debug.h
+mach_debug/mach_debug_types.defs
+mach_debug/mach_debug_types.h
+mach_debug/page_info.h
+mach_debug/vm_info.h
+mach_debug/zone_info.h
+machine/_limits.h
+machine/_mcontext.h
+machine/_param.h
+machine/_types.h
+machine/byte_order.h
+machine/endian.h
+machine/fasttrap_isa.h
+machine/limits.h
+machine/param.h
+machine/profile.h
+machine/signal.h
+machine/types.h
+machine/vmparam.h
+machine_types.modulemap
+miscfs/devfs/devfs.h
+miscfs/specfs/specdev.h
+miscfs/union/union.h
+net/bpf.h
+net/dlil.h
+net/ethernet.h
+net/if.h
+net/if_arp.h
+net/if_dl.h
+net/if_llc.h
+net/if_media.h
+net/if_mib.h
+net/if_types.h
+net/if_utun.h
+net/if_var.h
+net/kext_net.h
+net/ndrv.h
+net/net_kev.h
+net/pfkeyv2.h
+net/route.h
+netinet/bootp.h
+netinet/icmp6.h
+netinet/icmp_var.h
+netinet/if_ether.h
+netinet/igmp.h
+netinet/igmp_var.h
+netinet/in.h
+netinet/in_pcb.h
+netinet/in_systm.h
+netinet/in_var.h
+netinet/ip.h
+netinet/ip6.h
+netinet/ip_icmp.h
+netinet/ip_var.h
+netinet/tcp.h
+netinet/tcp_fsm.h
+netinet/tcp_seq.h
+netinet/tcp_timer.h
+netinet/tcp_var.h
+netinet/tcpip.h
+netinet/udp.h
+netinet/udp_var.h
+netinet6/ah.h
+netinet6/esp.h
+netinet6/in6.h
+netinet6/in6_var.h
+netinet6/ipcomp.h
+netinet6/ipsec.h
+netinet6/nd6.h
+netinet6/raw_ip6.h
+netinet6/scope6_var.h
+netkey/keysock.h
+nfs/krpc.h
+nfs/nfs.h
+nfs/nfs_gss.h
+nfs/nfs_ioctl.h
+nfs/nfs_lock.h
+nfs/nfsdiskless.h
+nfs/nfsm_subs.h
+nfs/nfsmount.h
+nfs/nfsnode.h
+nfs/nfsproto.h
+nfs/nfsrvcache.h
+nfs/rpcv2.h
+nfs/xdr_subs.h
+os/atomic.h
+os/base.h
+os/overflow.h
+os/tsd.h
+osfmk/UserNotification/KUNCUserNotifications.h
+osfmk/UserNotification/UNDReply.defs
+osfmk/UserNotification/UNDRequest.defs
+osfmk/UserNotification/UNDTypes.defs
+osfmk/UserNotification/UNDTypes.h
+osfmk/arm/arch.h
+osfmk/arm/atomic.h
+osfmk/arm/caches_internal.h
+osfmk/arm/cpu_capabilities.h
+osfmk/arm/cpu_number.h
+osfmk/arm/cpu_x86_64_capabilities.h
+osfmk/arm/cpuid.h
+osfmk/arm/cpuid_internal.h
+osfmk/arm/dbgwrap.h
+osfmk/arm/io_map_entries.h
+osfmk/arm/lock.h
+osfmk/arm/locks.h
+osfmk/arm/machine_cpu.h
+osfmk/arm/machine_cpuid.h
+osfmk/arm/machine_kpc.h
+osfmk/arm/machine_routines.h
+osfmk/arm/memory_types.h
+osfmk/arm/monotonic.h
+osfmk/arm/pal_routines.h
+osfmk/arm/pmap_public.h
+osfmk/arm/proc_reg.h
+osfmk/arm/simple_lock.h
+osfmk/arm/smp.h
+osfmk/arm/thread.h
+osfmk/arm/trap.h
+osfmk/arm64/asm.h
+osfmk/arm64/lowglobals.h
+osfmk/arm64/machine_cpuid.h
+osfmk/arm64/machine_kpc.h
+osfmk/arm64/machine_remote_time.h
+osfmk/arm64/monotonic.h
+osfmk/arm64/pal_hibernate.h
+osfmk/arm64/pgtrace.h
+osfmk/arm64/proc_reg.h
+osfmk/arm64/tlb.h
+osfmk/atm/atm_internal.h
+osfmk/atm/atm_notification.defs
+osfmk/atm/atm_types.defs
+osfmk/atm/atm_types.h
+osfmk/bank/bank_types.h
+osfmk/console/serial_protos.h
+osfmk/console/video_console.h
+osfmk/corpses/task_corpse.h
+osfmk/default_pager/default_pager_types.h
+osfmk/device/device.defs
+osfmk/device/device_port.h
+osfmk/device/device_types.defs
+osfmk/device/device_types.h
+osfmk/gssd/gssd_mach.defs
+osfmk/gssd/gssd_mach.h
+osfmk/gssd/gssd_mach_types.h
+osfmk/ipc/ipc_types.h
+osfmk/kdp/kdp_callout.h
+osfmk/kdp/kdp_dyld.h
+osfmk/kdp/kdp_en_debugger.h
+osfmk/kern/affinity.h
+osfmk/kern/arcade.h
+osfmk/kern/arithmetic_128.h
+osfmk/kern/assert.h
+osfmk/kern/audit_sessionport.h
+osfmk/kern/backtrace.h
+osfmk/kern/bits.h
+osfmk/kern/block_hint.h
+osfmk/kern/btlog.h
+osfmk/kern/cambria_layout.h
+osfmk/kern/circle_queue.h
+osfmk/kern/clock.h
+osfmk/kern/coalition.h
+osfmk/kern/cpu_data.h
+osfmk/kern/cpu_number.h
+osfmk/kern/cpu_quiesce.h
+osfmk/kern/cs_blobs.h
+osfmk/kern/debug.h
+osfmk/kern/ecc.h
+osfmk/kern/energy_perf.h
+osfmk/kern/exc_guard.h
+osfmk/kern/exc_resource.h
+osfmk/kern/extmod_statistics.h
+osfmk/kern/host.h
+osfmk/kern/hv_support.h
+osfmk/kern/hv_support_kext.h
+osfmk/kern/ipc_kobject.h
+osfmk/kern/ipc_mig.h
+osfmk/kern/ipc_misc.h
+osfmk/kern/kalloc.h
+osfmk/kern/kcdata.h
+osfmk/kern/kern_cdata.h
+osfmk/kern/kern_types.h
+osfmk/kern/kext_alloc.h
+osfmk/kern/kpc.h
+osfmk/kern/ledger.h
+osfmk/kern/lock.h
+osfmk/kern/lock_group.h
+osfmk/kern/lock_stat.h
+osfmk/kern/locks.h
+osfmk/kern/mach_param.h
+osfmk/kern/macro_help.h
+osfmk/kern/monotonic.h
+osfmk/kern/mpqueue.h
+osfmk/kern/mpsc_queue.h
+osfmk/kern/page_decrypt.h
+osfmk/kern/percpu.h
+osfmk/kern/pms.h
+osfmk/kern/policy_internal.h
+osfmk/kern/priority_queue.h
+osfmk/kern/processor.h
+osfmk/kern/queue.h
+osfmk/kern/remote_time.h
+osfmk/kern/restartable.h
+osfmk/kern/sched_clutch.h
+osfmk/kern/sched_prim.h
+osfmk/kern/sfi.h
+osfmk/kern/simple_lock.h
+osfmk/kern/startup.h
+osfmk/kern/task.h
+osfmk/kern/telemetry.h
+osfmk/kern/thread.h
+osfmk/kern/thread_call.h
+osfmk/kern/thread_group.h
+osfmk/kern/timer_call.h
+osfmk/kern/trustcache.h
+osfmk/kern/turnstile.h
+osfmk/kern/ux_handler.h
+osfmk/kern/waitq.h
+osfmk/kern/work_interval.h
+osfmk/kern/zalloc.h
+osfmk/kextd/kextd_mach.defs
+osfmk/kextd/kextd_mach.h
+osfmk/kperf/action.h
+osfmk/kperf/context.h
+osfmk/kperf/kdebug_trigger.h
+osfmk/kperf/kperf.h
+osfmk/kperf/kperfbsd.h
+osfmk/kperf/kptimer.h
+osfmk/kperf/lazy.h
+osfmk/kperf/pet.h
+osfmk/lockd/lockd_mach.defs
+osfmk/lockd/lockd_mach.h
+osfmk/lockd/lockd_mach_types.h
+osfmk/mach/arcade_upcall_server.h
+osfmk/mach/arm/_structs.h
+osfmk/mach/arm/asm.h
+osfmk/mach/arm/boolean.h
+osfmk/mach/arm/exception.h
+osfmk/mach/arm/kern_return.h
+osfmk/mach/arm/ndr_def.h
+osfmk/mach/arm/processor_info.h
+osfmk/mach/arm/rpc.h
+osfmk/mach/arm/sdt_isa.h
+osfmk/mach/arm/syscall_sw.h
+osfmk/mach/arm/thread_state.h
+osfmk/mach/arm/thread_status.h
+osfmk/mach/arm/traps.h
+osfmk/mach/arm/vm_param.h
+osfmk/mach/arm/vm_types.h
+osfmk/mach/arm64/asm.h
+osfmk/mach/audit_triggers.defs
+osfmk/mach/audit_triggers_server.h
+osfmk/mach/audit_triggers_types.h
+osfmk/mach/boolean.h
+osfmk/mach/clock.defs
+osfmk/mach/clock.h
+osfmk/mach/clock_priv.defs
+osfmk/mach/clock_priv.h
+osfmk/mach/clock_reply.defs
+osfmk/mach/clock_reply_server.h
+osfmk/mach/clock_types.defs
+osfmk/mach/clock_types.h
+osfmk/mach/coalition.h
+osfmk/mach/coalition_notification_server.h
+osfmk/mach/dyld_kernel.h
+osfmk/mach/error.h
+osfmk/mach/exc.defs
+osfmk/mach/exc_server.h
+osfmk/mach/exception.h
+osfmk/mach/exception_types.h
+osfmk/mach/fairplayd_notification_server.h
+osfmk/mach/host_info.h
+osfmk/mach/host_notify.h
+osfmk/mach/host_notify_reply.defs
+osfmk/mach/host_priv.defs
+osfmk/mach/host_priv.h
+osfmk/mach/host_reboot.h
+osfmk/mach/host_security.defs
+osfmk/mach/host_security.h
+osfmk/mach/host_special_ports.h
+osfmk/mach/kern_return.h
+osfmk/mach/kmod.h
+osfmk/mach/ktrace_background.h
+osfmk/mach/lock_set.defs
+osfmk/mach/lock_set.h
+osfmk/mach/mach_eventlink_types.h
+osfmk/mach/mach_exc.defs
+osfmk/mach/mach_exc_server.h
+osfmk/mach/mach_host.defs
+osfmk/mach/mach_host.h
+osfmk/mach/mach_interface.h
+osfmk/mach/mach_param.h
+osfmk/mach/mach_port.defs
+osfmk/mach/mach_port.h
+osfmk/mach/mach_syscalls.h
+osfmk/mach/mach_time.h
+osfmk/mach/mach_traps.h
+osfmk/mach/mach_types.defs
+osfmk/mach/mach_types.h
+osfmk/mach/mach_vm.defs
+osfmk/mach/mach_vm.h
+osfmk/mach/mach_voucher.defs
+osfmk/mach/mach_voucher.h
+osfmk/mach/mach_voucher_attr_control.defs
+osfmk/mach/mach_voucher_attr_control.h
+osfmk/mach/mach_voucher_types.h
+osfmk/mach/machine.h
+osfmk/mach/machine/_structs.h
+osfmk/mach/machine/asm.h
+osfmk/mach/machine/boolean.h
+osfmk/mach/machine/exception.h
+osfmk/mach/machine/kern_return.h
+osfmk/mach/machine/machine_types.defs
+osfmk/mach/machine/ndr_def.h
+osfmk/mach/machine/processor_info.h
+osfmk/mach/machine/rpc.h
+osfmk/mach/machine/sdt.h
+osfmk/mach/machine/sdt_isa.h
+osfmk/mach/machine/syscall_sw.h
+osfmk/mach/machine/thread_state.h
+osfmk/mach/machine/thread_status.h
+osfmk/mach/machine/vm_param.h
+osfmk/mach/machine/vm_types.h
+osfmk/mach/memory_entry.defs
+osfmk/mach/memory_entry.h
+osfmk/mach/memory_object_control.h
+osfmk/mach/memory_object_default_server.h
+osfmk/mach/memory_object_types.h
+osfmk/mach/message.h
+osfmk/mach/mig.h
+osfmk/mach/mig_errors.h
+osfmk/mach/mig_strncpy_zerofill_support.h
+osfmk/mach/mig_voucher_support.h
+osfmk/mach/ndr.h
+osfmk/mach/notify.defs
+osfmk/mach/notify.h
+osfmk/mach/notify_server.h
+osfmk/mach/policy.h
+osfmk/mach/port.h
+osfmk/mach/processor.defs
+osfmk/mach/processor.h
+osfmk/mach/processor_info.h
+osfmk/mach/processor_set.defs
+osfmk/mach/processor_set.h
+osfmk/mach/resource_monitors.h
+osfmk/mach/rpc.h
+osfmk/mach/sdt.h
+osfmk/mach/semaphore.h
+osfmk/mach/sfi_class.h
+osfmk/mach/shared_memory_server.h
+osfmk/mach/shared_region.h
+osfmk/mach/std_types.defs
+osfmk/mach/std_types.h
+osfmk/mach/sync_policy.h
+osfmk/mach/syscall_sw.h
+osfmk/mach/sysdiagnose_notification_server.h
+osfmk/mach/task.defs
+osfmk/mach/task.h
+osfmk/mach/task_access.defs
+osfmk/mach/task_access.h
+osfmk/mach/task_access_server.h
+osfmk/mach/task_info.h
+osfmk/mach/task_inspect.h
+osfmk/mach/task_policy.h
+osfmk/mach/task_special_ports.h
+osfmk/mach/telemetry_notification.defs
+osfmk/mach/telemetry_notification_server.h
+osfmk/mach/thread_act.defs
+osfmk/mach/thread_act.h
+osfmk/mach/thread_info.h
+osfmk/mach/thread_policy.h
+osfmk/mach/thread_special_ports.h
+osfmk/mach/thread_status.h
+osfmk/mach/thread_switch.h
+osfmk/mach/time_value.h
+osfmk/mach/upl.h
+osfmk/mach/vfs_nspace.h
+osfmk/mach/vfs_nspace_server.h
+osfmk/mach/vm_attributes.h
+osfmk/mach/vm_behavior.h
+osfmk/mach/vm_inherit.h
+osfmk/mach/vm_map.defs
+osfmk/mach/vm_map.h
+osfmk/mach/vm_param.h
+osfmk/mach/vm_prot.h
+osfmk/mach/vm_purgable.h
+osfmk/mach/vm_region.h
+osfmk/mach/vm_statistics.h
+osfmk/mach/vm_sync.h
+osfmk/mach/vm_types.h
+osfmk/mach_debug/hash_info.h
+osfmk/mach_debug/ipc_info.h
+osfmk/mach_debug/lockgroup_info.h
+osfmk/mach_debug/mach_debug.h
+osfmk/mach_debug/mach_debug_types.defs
+osfmk/mach_debug/mach_debug_types.h
+osfmk/mach_debug/page_info.h
+osfmk/mach_debug/vm_info.h
+osfmk/mach_debug/zone_info.h
+osfmk/machine/atomic.h
+osfmk/machine/config.h
+osfmk/machine/cpu_capabilities.h
+osfmk/machine/cpu_number.h
+osfmk/machine/io_map_entries.h
+osfmk/machine/lock.h
+osfmk/machine/locks.h
+osfmk/machine/machine_cpuid.h
+osfmk/machine/machine_kpc.h
+osfmk/machine/machine_remote_time.h
+osfmk/machine/machine_routines.h
+osfmk/machine/memory_types.h
+osfmk/machine/monotonic.h
+osfmk/machine/pal_hibernate.h
+osfmk/machine/pal_routines.h
+osfmk/machine/simple_lock.h
+osfmk/machine/smp.h
+osfmk/machine/trap.h
+osfmk/prng/entropy.h
+osfmk/prng/random.h
+osfmk/string.h
+osfmk/tests/ktest.h
+osfmk/tests/xnupost.h
+osfmk/vm/WKdm_new.h
+osfmk/vm/memory_types.h
+osfmk/vm/pmap.h
+osfmk/vm/vm_compressor_algorithms.h
+osfmk/vm/vm_fault.h
+osfmk/vm/vm_kern.h
+osfmk/vm/vm_map.h
+osfmk/vm/vm_options.h
+osfmk/vm/vm_pageout.h
+osfmk/vm/vm_protos.h
+osfmk/vm/vm_shared_region.h
+osfmk/voucher/ipc_pthread_priority_types.h
+pexpert/boot.h
+pexpert/machine/boot.h
+pexpert/machine/protos.h
+pexpert/pexpert.h
+pexpert/pexpert/arm/AIC.h
+pexpert/pexpert/arm/PL192_VIC.h
+pexpert/pexpert/arm/S3cUART.h
+pexpert/pexpert/arm/T8002.h
+pexpert/pexpert/arm/board_config.h
+pexpert/pexpert/arm/boot.h
+pexpert/pexpert/arm/consistent_debug.h
+pexpert/pexpert/arm/dockchannel.h
+pexpert/pexpert/arm/protos.h
+pexpert/pexpert/arm64/AIC.h
+pexpert/pexpert/arm64/BCM2837.h
+pexpert/pexpert/arm64/H7.h
+pexpert/pexpert/arm64/H8.h
+pexpert/pexpert/arm64/H9.h
+pexpert/pexpert/arm64/S3c2410x.h
+pexpert/pexpert/arm64/apple_arm64_common.h
+pexpert/pexpert/arm64/apple_arm64_regs.h
+pexpert/pexpert/arm64/board_config.h
+pexpert/pexpert/arm64/boot.h
+pexpert/pexpert/arm64/spr_locks.h
+pexpert/pexpert/boot.h
+pexpert/pexpert/device_tree.h
+pexpert/pexpert/machine/boot.h
+pexpert/pexpert/machine/protos.h
+pexpert/pexpert/pexpert.h
+pexpert/pexpert/protos.h
+pexpert/protos.h
+san/san/kasan.h
+san/san/ksancov.h
+san/san/memintrinsics.h
+security/audit/audit_ioctl.h
+security/security/_label.h
+security/security/mac.h
+security/security/mac_data.h
+security/security/mac_framework.h
+security/security/mac_internal.h
+security/security/mac_mach_internal.h
+security/security/mac_policy.h
+servers/key_defs.h
+servers/ls_defs.h
+servers/netname.h
+servers/netname_defs.h
+servers/nm_defs.h
+sys/_endian.h
+sys/_posix_availability.h
+sys/_select.h
+sys/_structs.h
+sys/_symbol_aliasing.h
+sys/_types.h
+sys/_types/_blkcnt_t.h
+sys/_types/_blksize_t.h
+sys/_types/_caddr_t.h
+sys/_types/_clock_t.h
+sys/_types/_ct_rune_t.h
+sys/_types/_dev_t.h
+sys/_types/_errno_t.h
+sys/_types/_fd_clr.h
+sys/_types/_fd_copy.h
+sys/_types/_fd_def.h
+sys/_types/_fd_isset.h
+sys/_types/_fd_set.h
+sys/_types/_fd_setsize.h
+sys/_types/_fd_zero.h
+sys/_types/_filesec_t.h
+sys/_types/_fsblkcnt_t.h
+sys/_types/_fsfilcnt_t.h
+sys/_types/_fsid_t.h
+sys/_types/_fsobj_id_t.h
+sys/_types/_gid_t.h
+sys/_types/_guid_t.h
+sys/_types/_id_t.h
+sys/_types/_in_addr_t.h
+sys/_types/_in_port_t.h
+sys/_types/_ino64_t.h
+sys/_types/_ino_t.h
+sys/_types/_int16_t.h
+sys/_types/_int32_t.h
+sys/_types/_int64_t.h
+sys/_types/_int8_t.h
+sys/_types/_intptr_t.h
+sys/_types/_iovec_t.h
+sys/_types/_key_t.h
+sys/_types/_mach_port_t.h
+sys/_types/_mbstate_t.h
+sys/_types/_mode_t.h
+sys/_types/_nlink_t.h
+sys/_types/_null.h
+sys/_types/_o_dsync.h
+sys/_types/_o_sync.h
+sys/_types/_off_t.h
+sys/_types/_offsetof.h
+sys/_types/_os_inline.h
+sys/_types/_pid_t.h
+sys/_types/_posix_vdisable.h
+sys/_types/_ptrdiff_t.h
+sys/_types/_rsize_t.h
+sys/_types/_rune_t.h
+sys/_types/_s_ifmt.h
+sys/_types/_sa_family_t.h
+sys/_types/_seek_set.h
+sys/_types/_sigaltstack.h
+sys/_types/_sigset_t.h
+sys/_types/_size_t.h
+sys/_types/_socklen_t.h
+sys/_types/_ssize_t.h
+sys/_types/_suseconds_t.h
+sys/_types/_time_t.h
+sys/_types/_timespec.h
+sys/_types/_timeval.h
+sys/_types/_timeval32.h
+sys/_types/_timeval64.h
+sys/_types/_u_char.h
+sys/_types/_u_int.h
+sys/_types/_u_int16_t.h
+sys/_types/_u_int32_t.h
+sys/_types/_u_int64_t.h
+sys/_types/_u_int8_t.h
+sys/_types/_u_short.h
+sys/_types/_ucontext.h
+sys/_types/_ucontext64.h
+sys/_types/_uid_t.h
+sys/_types/_uintptr_t.h
+sys/_types/_useconds_t.h
+sys/_types/_uuid_t.h
+sys/_types/_va_list.h
+sys/_types/_wchar_t.h
+sys/_types/_wint_t.h
+sys/acct.h
+sys/aio.h
+sys/appleapiopts.h
+sys/attr.h
+sys/buf.h
+sys/cdefs.h
+sys/clonefile.h
+sys/commpage.h
+sys/conf.h
+sys/dir.h
+sys/dirent.h
+sys/disk.h
+sys/dkstat.h
+sys/domain.h
+sys/dtrace.h
+sys/dtrace_glue.h
+sys/dtrace_impl.h
+sys/errno.h
+sys/ev.h
+sys/event.h
+sys/fasttrap.h
+sys/fasttrap_isa.h
+sys/fcntl.h
+sys/file.h
+sys/filedesc.h
+sys/filio.h
+sys/fsgetpath.h
+sys/gmon.h
+sys/ioccom.h
+sys/ioctl.h
+sys/ioctl_compat.h
+sys/ipc.h
+sys/kauth.h
+sys/kdebug.h
+sys/kdebug_signpost.h
+sys/kern_control.h
+sys/kern_event.h
+sys/kernel.h
+sys/kernel_types.h
+sys/lctx.h
+sys/loadable_fs.h
+sys/lock.h
+sys/lockf.h
+sys/lockstat.h
+sys/log_data.h
+sys/malloc.h
+sys/mbuf.h
+sys/mman.h
+sys/mount.h
+sys/msg.h
+sys/msgbuf.h
+sys/netport.h
+sys/param.h
+sys/paths.h
+sys/pipe.h
+sys/poll.h
+sys/posix_sem.h
+sys/posix_shm.h
+sys/proc.h
+sys/proc_info.h
+sys/protosw.h
+sys/ptrace.h
+sys/queue.h
+sys/quota.h
+sys/random.h
+sys/reboot.h
+sys/resource.h
+sys/resourcevar.h
+sys/sbuf.h
+sys/sdt.h
+sys/select.h
+sys/sem.h
+sys/semaphore.h
+sys/shm.h
+sys/signal.h
+sys/signalvar.h
+sys/snapshot.h
+sys/socket.h
+sys/socketvar.h
+sys/sockio.h
+sys/spawn.h
+sys/stat.h
+sys/stdio.h
+sys/sys_domain.h
+sys/syscall.h
+sys/sysctl.h
+sys/syslimits.h
+sys/syslog.h
+sys/termios.h
+sys/time.h
+sys/timeb.h
+sys/times.h
+sys/timex.h
+sys/tprintf.h
+sys/trace.h
+sys/tty.h
+sys/ttychars.h
+sys/ttycom.h
+sys/ttydefaults.h
+sys/ttydev.h
+sys/types.h
+sys/ubc.h
+sys/ucontext.h
+sys/ucred.h
+sys/uio.h
+sys/un.h
+sys/unistd.h
+sys/unpcb.h
+sys/user.h
+sys/utfconv.h
+sys/utsname.h
+sys/vadvise.h
+sys/vcmd.h
+sys/vm.h
+sys/vmmeter.h
+sys/vmparam.h
+sys/vnioctl.h
+sys/vnode.h
+sys/vnode_if.h
+sys/vsock.h
+sys/vstat.h
+sys/wait.h
+sys/xattr.h
+sys__types.modulemap
+sys_cdefs.modulemap
+sys_types.modulemap
+system-version-compat-support.h
+uuid/uuid.h
+vfs/vfs_support.h
+voucher/ipc_pthread_priority_types.h
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/headers.txt b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/headers-x86_64.txt
index 93c0dbb18bf7..93c0dbb18bf7 100644
--- a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/headers.txt
+++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/headers-x86_64.txt
diff --git a/nixpkgs/pkgs/os-specific/darwin/dockutil/default.nix b/nixpkgs/pkgs/os-specific/darwin/dockutil/default.nix
index d937ce8fd12a..5e4187f07280 100644
--- a/nixpkgs/pkgs/os-specific/darwin/dockutil/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/dockutil/default.nix
@@ -1,24 +1,29 @@
-{ lib, stdenv, fetchFromGitHub }:
-
+{ lib, stdenv, fetchurl, libarchive, p7zip }:
 stdenv.mkDerivation rec {
   pname = "dockutil";
-  version = "2.0.5";
+  version = "3.0.2";
 
-  src = fetchFromGitHub {
-    owner  = "kcrawford";
-    repo   = "dockutil";
-    rev    = version;
-    sha256 = "sha256-8tDkueCTCtvxc7owp3K9Tsrn4hL79CM04zBNv7AcHgA=";
+  src = fetchurl {
+    url =
+      "https://github.com/kcrawford/dockutil/releases/download/${version}/dockutil-${version}.pkg";
+    sha256 = "175137ea747e83ed221d60b18b712b256ed31531534cde84f679487d337668fd";
   };
 
   dontBuild = true;
 
+  nativeBuildInputs = [ libarchive p7zip ];
+
+  unpackPhase = ''
+    7z x $src
+    bsdtar -xf Payload~
+  '';
+
   installPhase = ''
     runHook preInstall
-
     mkdir -p $out/bin
-    install -Dm755 scripts/dockutil -t $out/bin
-
+    mkdir -p $out/usr/local/bin
+    install -Dm755 usr/local/bin/dockutil -t $out/usr/local/bin
+    ln -rs $out/usr/local/bin/dockutil $out/bin/dockutil
     runHook postInstall
   '';
 
diff --git a/nixpkgs/pkgs/os-specific/darwin/goku/default.nix b/nixpkgs/pkgs/os-specific/darwin/goku/default.nix
index c729ee6010c5..af70aaccc464 100644
--- a/nixpkgs/pkgs/os-specific/darwin/goku/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/goku/default.nix
@@ -1,14 +1,22 @@
-{lib, stdenv, fetchurl }:
+{ lib
+, stdenv
+, fetchurl
+, unzip
+}:
 
 stdenv.mkDerivation rec {
   pname = "goku";
-  version = "0.3.6";
+  version = "0.5.2";
 
   src = fetchurl {
-    url = "https://github.com/yqrashawn/GokuRakuJoudo/releases/download/v${version}/goku.tar.gz";
-    sha256 = "1pss1k2slbqzpfynik50pdk4jsaiag4abhmr6kadmaaj18mfz7ai";
+    url = "https://github.com/yqrashawn/GokuRakuJoudo/releases/download/v${version}/goku.zip";
+    sha256 = "506eccdabedc68c112778b13ded65099327267c2e3fd488916e3a340bc312954";
   };
 
+  nativeBuildInputs = [
+    unzip
+  ];
+
   sourceRoot = ".";
 
   installPhase = ''
diff --git a/nixpkgs/pkgs/os-specific/darwin/iproute2mac/default.nix b/nixpkgs/pkgs/os-specific/darwin/iproute2mac/default.nix
index 915ef7c91588..f542f2c5221b 100644
--- a/nixpkgs/pkgs/os-specific/darwin/iproute2mac/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/iproute2mac/default.nix
@@ -1,21 +1,20 @@
-{ lib, stdenv, fetchFromGitHub, darwin, python2 }:
+{ lib, stdenv, fetchFromGitHub, darwin, python3 }:
 
 stdenv.mkDerivation rec {
-  version = "1.2.1";
+  version = "1.4.0";
   pname = "iproute2mac";
 
   src = fetchFromGitHub {
     owner = "brona";
     repo = "iproute2mac";
     rev = "v${version}";
-    sha256 = "1n6la7blbxza2m79cpnywsavhzsdv4gzdxrkly4dppyidjg6jy1h";
+    sha256 = "sha256-xakCNjmZpdVY7MMxk38EZatrakgkEeDhvljhl+aMmGg=";
   };
 
-  buildInputs = [ python2 ];
+  buildInputs = [ python3 ];
 
   postPatch = ''
     substituteInPlace src/ip.py \
-      --replace /usr/bin/python ${python2}/bin/python \
       --replace /sbin/ifconfig ${darwin.network_cmds}/bin/ifconfig \
       --replace /sbin/route ${darwin.network_cmds}/bin/route \
       --replace /usr/sbin/netstat ${darwin.network_cmds}/bin/netstat \
@@ -32,7 +31,7 @@ stdenv.mkDerivation rec {
     homepage = "https://github.com/brona/iproute2mac";
     description = "CLI wrapper for basic network utilites on Mac OS X inspired with iproute2 on Linux systems - ip command.";
     license = licenses.mit;
-    maintainers = with maintainers; [ flokli ];
+    maintainers = with maintainers; [ jiegec ];
     platforms = platforms.darwin;
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/darwin/kwm/default.nix b/nixpkgs/pkgs/os-specific/darwin/kwm/default.nix
index 273ea7345d9d..c210f9e8c65d 100644
--- a/nixpkgs/pkgs/os-specific/darwin/kwm/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/kwm/default.nix
@@ -29,6 +29,7 @@ stdenv.mkDerivation rec {
     downloadPage = "https://github.com/koekeishiya/kwm/releases";
     platforms = platforms.darwin;
     maintainers = with maintainers; [ lnl7 ];
+    mainProgram = "kwmc";
     license = licenses.mit;
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/darwin/m-cli/default.nix b/nixpkgs/pkgs/os-specific/darwin/m-cli/default.nix
index 939ff36ef0ce..9134fad6012c 100644
--- a/nixpkgs/pkgs/os-specific/darwin/m-cli/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/m-cli/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "m-cli";
-  version = "0.2.5";
+  version = "0.3.0";
 
   src = fetchFromGitHub {
     owner = "rgcr";
-    repo = "m-cli";
+    repo = pname;
     rev = "v${version}";
-    sha512 = "0mkcx7jq91pbfs8327qc8434gj73fvjgdfdsrza0lyd9wns6jhsqsf0585klzl68aqscvksgzi2asdnim4va35cdkp2fdzl0g3sm4kd";
+    sha256 = "sha256-KzlE1DdVMLnGmcOS1a2HK4pASofD1EHpdqbzVVIxeb4=";
   };
 
   dontBuild = true;
@@ -40,5 +40,6 @@ stdenv.mkDerivation rec {
 
     platforms = platforms.darwin;
     maintainers = with maintainers; [];
+    mainProgram = "m";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/darwin/mas/default.nix b/nixpkgs/pkgs/os-specific/darwin/mas/default.nix
index 907d21853273..968cb10cd5a3 100644
--- a/nixpkgs/pkgs/os-specific/darwin/mas/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/mas/default.nix
@@ -1,38 +1,41 @@
 { lib
-, stdenv
+, stdenvNoCC
 , fetchurl
-, libarchive
-, p7zip
+, installShellFiles
+, testers
+, mas
 }:
 
-stdenv.mkDerivation rec {
+stdenvNoCC.mkDerivation rec {
   pname = "mas";
-  version = "1.8.2";
+  version = "1.8.6";
 
   src = fetchurl {
-    url = "https://github.com/mas-cli/mas/releases/download/v${version}/mas.pkg";
-    sha256 = "HlLQKBVIYKanS6kjkbYdabBi1T0irxE6fNd2H6mDKe4=";
+    # Use the tarball until https://github.com/mas-cli/mas/issues/452 is fixed.
+    # Even though it looks like an OS/arch specific build it is actually a universal binary.
+    url = "https://github.com/mas-cli/mas/releases/download/v${version}/mas-${version}.monterey.bottle.tar.gz";
+    sha256 = "0q4skdhymgn5xrwafyisfshx327faia682yv83mf68r61m2jl10d";
   };
 
-  nativeBuildInputs = [ libarchive p7zip ];
-
-  unpackPhase = ''
-    7z x $src
-    bsdtar -xf Payload~
-  '';
-
-  dontBuild = true;
+  nativeBuildInputs = [ installShellFiles ];
 
   installPhase = ''
-    mkdir -p $out
-    cp -r ./usr/local/bin $out
+    install -D './${version}/bin/mas' "$out/bin/mas"
+    installShellCompletion --cmd mas --bash './${version}/etc/bash_completion.d/mas'
   '';
 
+  passthru.tests = {
+    version = testers.testVersion {
+      package = mas;
+      command = "mas version";
+    };
+  };
+
   meta = with lib; {
     description = "Mac App Store command line interface";
     homepage = "https://github.com/mas-cli/mas";
     license = licenses.mit;
-    maintainers = with maintainers; [ zachcoyle ];
-    platforms = platforms.darwin;
+    maintainers = with maintainers; [ steinybot zachcoyle ];
+    platforms = [ "x86_64-darwin" "aarch64-darwin" ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/darwin/moltenvk/MoltenVK.xcodeproj.patch b/nixpkgs/pkgs/os-specific/darwin/moltenvk/MoltenVK.xcodeproj.patch
index abbb3b8fb0e1..e4b03dfe0cc3 100644
--- a/nixpkgs/pkgs/os-specific/darwin/moltenvk/MoltenVK.xcodeproj.patch
+++ b/nixpkgs/pkgs/os-specific/darwin/moltenvk/MoltenVK.xcodeproj.patch
@@ -86,61 +86,3 @@ index c23afce4..12ac12f4 100644
  /* Begin XCBuildConfiguration section */
  		2FEA0AB824902F9F00EEF3AD /* Debug */ = {
  			isa = XCBuildConfiguration;
-@@ -1586,11 +1544,12 @@
- 				GCC_WARN_UNUSED_VARIABLE = YES;
- 				GENERATE_MASTER_OBJECT_FILE = YES;
- 				HEADER_SEARCH_PATHS = (
--					"\"$(SRCROOT)/include\"",
--					"\"$(SRCROOT)/../MoltenVKShaderConverter\"",
--					"\"$(SRCROOT)/../MoltenVKShaderConverter/SPIRV-Cross\"",
--					"\"$(SRCROOT)/../External/cereal/include\"",
--					"\"${BUILT_PRODUCTS_DIR}\"",
-+					"@@sourceRoot@@/outputs/include",
-+					"@@sourceRoot@@/outputs/include/simd_workaround",
-+					"@@sourceRoot@@/MoltenVKShaderConverter",
-+					"@@cereal@@/include",
-+					"@@spirv-cross@@/include/spirv_cross",
-+					"@@vulkan-headers@@/include",
- 				);
- 				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- 				MACH_O_TYPE = staticlib;
-@@ -1600,6 +1559,10 @@
- 				MVK_SKIP_DYLIB = "";
- 				"MVK_SKIP_DYLIB[sdk=appletvsimulator*]" = YES;
- 				"MVK_SKIP_DYLIB[sdk=iphonesimulator*]" = YES;
-+				OTHER_CFLAGS = (
-+					"-isystem",
-+					"@@libcxx@@/include/c++/v1",
-+				);
- 				PRELINK_LIBS = "${CONFIGURATION_BUILD_DIR}/libMoltenVKShaderConverter.a";
- 				PRODUCT_NAME = MoltenVK;
- 				SKIP_INSTALL = YES;
-@@ -1658,11 +1621,12 @@
- 				GCC_WARN_UNUSED_VARIABLE = YES;
- 				GENERATE_MASTER_OBJECT_FILE = YES;
- 				HEADER_SEARCH_PATHS = (
--					"\"$(SRCROOT)/include\"",
--					"\"$(SRCROOT)/../MoltenVKShaderConverter\"",
--					"\"$(SRCROOT)/../MoltenVKShaderConverter/SPIRV-Cross\"",
--					"\"$(SRCROOT)/../External/cereal/include\"",
--					"\"${BUILT_PRODUCTS_DIR}\"",
-+					"@@sourceRoot@@/outputs/include",
-+					"@@sourceRoot@@/outputs/include/simd_workaround",
-+					"@@sourceRoot@@/MoltenVKShaderConverter",
-+					"@@cereal@@/include",
-+					"@@spirv-cross@@/include/spirv_cross",
-+					"@@vulkan-headers@@/include",
- 				);
- 				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- 				MACH_O_TYPE = staticlib;
-@@ -1672,6 +1636,10 @@
- 				MVK_SKIP_DYLIB = "";
- 				"MVK_SKIP_DYLIB[sdk=appletvsimulator*]" = YES;
- 				"MVK_SKIP_DYLIB[sdk=iphonesimulator*]" = YES;
-+				OTHER_CFLAGS = (
-+					"-isystem",
-+					"@@libcxx@@/include/c++/v1",
-+				);
- 				PRELINK_LIBS = "${CONFIGURATION_BUILD_DIR}/libMoltenVKShaderConverter.a";
- 				PRODUCT_NAME = MoltenVK;
- 				SKIP_INSTALL = YES;
diff --git a/nixpkgs/pkgs/os-specific/darwin/moltenvk/MoltenVKShaderConverter.xcodeproj.patch b/nixpkgs/pkgs/os-specific/darwin/moltenvk/MoltenVKShaderConverter.xcodeproj.patch
index 7a7ec7afa2ee..ecc5242684d9 100644
--- a/nixpkgs/pkgs/os-specific/darwin/moltenvk/MoltenVKShaderConverter.xcodeproj.patch
+++ b/nixpkgs/pkgs/os-specific/darwin/moltenvk/MoltenVKShaderConverter.xcodeproj.patch
@@ -82,99 +82,3 @@ index c7842b63..d55f73ed 100644
  			productReference = A93903C71C57E9ED00FE90DC /* libMoltenVKShaderConverter.a */;
  			productType = "com.apple.product-type.library.static";
  		};
-@@ -536,6 +518,17 @@
- 				OTHER_LDFLAGS = (
- 					"-ObjC",
- 					"-w",
-+					"-lMachineIndependent",
-+					"-lGenericCodeGen",
-+					"-lOGLCompiler",
-+					"-lglslang",
-+					"-lOSDependent",
-+					"-lSPIRV",
-+					"-lSPIRV-Tools",
-+					"-lSPIRV-Tools-opt",
-+					"-lspirv-cross-msl",
-+					"-lspirv-cross-core",
-+					"-lspirv-cross-glsl",
- 				);
- 				SDKROOT = macosx;
- 			};
-@@ -548,6 +541,17 @@
- 				OTHER_LDFLAGS = (
- 					"-ObjC",
- 					"-w",
-+					"-lMachineIndependent",
-+					"-lGenericCodeGen",
-+					"-lOGLCompiler",
-+					"-lglslang",
-+					"-lOSDependent",
-+					"-lSPIRV",
-+					"-lSPIRV-Tools",
-+					"-lSPIRV-Tools-opt",
-+					"-lspirv-cross-msl",
-+					"-lspirv-cross-core",
-+					"-lspirv-cross-glsl",
- 				);
- 				SDKROOT = macosx;
- 			};
-@@ -624,15 +628,24 @@
- 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- 				GCC_WARN_UNUSED_FUNCTION = YES;
- 				HEADER_SEARCH_PATHS = (
--					"$(inherited)",
--					"\"$(SRCROOT)\"",
--					"\"$(SRCROOT)/SPIRV-Cross\"",
--					"\"$(SRCROOT)/glslang\"",
--					"\"$(SRCROOT)/glslang/External/spirv-tools/include\"",
-+					"@@sourceRoot@@/Common",
-+					"@@glslang@@/include",
-+					"@@spirv-cross@@/include/spirv_cross",
-+					"@@spirv-tools@@/include",
-+					"@@spirv-headers@@/include/spirv/unified1/",
- 				);
- 				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
-+				LIBRARY_SEARCH_PATHS = (
-+					"@@glslang@@/lib",
-+					"@@spirv-cross@@/lib",
-+					"@@spirv-tools@@/lib",
-+				);
- 				MACH_O_TYPE = staticlib;
- 				MACOSX_DEPLOYMENT_TARGET = 10.11;
-+				OTHER_CFLAGS = (
-+					"-isystem",
-+					"@@libcxx@@/include/c++/v1",
-+				);
- 				PRODUCT_NAME = MoltenVKShaderConverter;
- 				SKIP_INSTALL = YES;
- 				TVOS_DEPLOYMENT_TARGET = 9.0;
-@@ -683,15 +696,24 @@
- 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- 				GCC_WARN_UNUSED_FUNCTION = YES;
- 				HEADER_SEARCH_PATHS = (
--					"$(inherited)",
--					"\"$(SRCROOT)\"",
--					"\"$(SRCROOT)/SPIRV-Cross\"",
--					"\"$(SRCROOT)/glslang\"",
--					"\"$(SRCROOT)/glslang/External/spirv-tools/include\"",
-+					"@@sourceRoot@@/Common",
-+					"@@glslang@@/include",
-+					"@@spirv-cross@@/include/spirv_cross",
-+					"@@spirv-tools@@/include",
-+					"@@spirv-headers@@/include/spirv/unified1/",
- 				);
- 				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
-+				LIBRARY_SEARCH_PATHS = (
-+					"@@glslang@@/lib",
-+					"@@spirv-cross@@/lib",
-+					"@@spirv-tools@@/lib",
-+				);
- 				MACH_O_TYPE = staticlib;
- 				MACOSX_DEPLOYMENT_TARGET = 10.11;
-+				OTHER_CFLAGS = (
-+					"-isystem",
-+					"@@libcxx@@/include/c++/v1",
-+				);
- 				PRODUCT_NAME = MoltenVKShaderConverter;
- 				SKIP_INSTALL = YES;
- 				TVOS_DEPLOYMENT_TARGET = 9.0;
diff --git a/nixpkgs/pkgs/os-specific/darwin/moltenvk/createDylib.patch b/nixpkgs/pkgs/os-specific/darwin/moltenvk/createDylib.patch
deleted file mode 100644
index b4a990cd9891..000000000000
--- a/nixpkgs/pkgs/os-specific/darwin/moltenvk/createDylib.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/Scripts/create_dylib.sh b/Scripts/create_dylib.sh
-index 5ba75f67..a0405067 100755
---- a/Scripts/create_dylib.sh
-+++ b/Scripts/create_dylib.sh
-@@ -57,6 +57,8 @@ ${MVK_SAN} \
- -framework Metal ${MVK_IOSURFACE_FWK} -framework ${MVK_UX_FWK} -framework QuartzCore -framework CoreGraphics ${MVK_IOKIT_FWK} -framework Foundation \
- --library-directory ${MVK_USR_LIB_DIR} \
- -o "${MVK_BUILT_PROD_DIR}/dynamic/${MVK_DYLIB_NAME}" \
-+-L@@sourceRoot@@/outputs/lib -L@@glslang@@/lib -L@@spirv-tools@@/lib -L@@spirv-cross@@/lib \
-+-lobjc -lMoltenVKShaderConverter -lGenericCodeGen -lMachineIndependent -lOGLCompiler -lOSDependent -lSPIRV -lSPIRV-Tools -lSPIRV-Tools-opt -lspirv-cross-core -lspirv-cross-glsl -lspirv-cross-msl -lspirv-cross-reflect \
- -force_load "${MVK_BUILT_PROD_DIR}/lib${PRODUCT_NAME}.a"
-
- if test "$CONFIGURATION" = Debug; then
diff --git a/nixpkgs/pkgs/os-specific/darwin/moltenvk/default.nix b/nixpkgs/pkgs/os-specific/darwin/moltenvk/default.nix
index dc7f3f58fd3a..1d8f89deff19 100644
--- a/nixpkgs/pkgs/os-specific/darwin/moltenvk/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/moltenvk/default.nix
@@ -1,103 +1,80 @@
 { lib
+, overrideCC
 , stdenv
-, stdenvNoCC
 , fetchurl
 , fetchFromGitHub
 , cctools
 , sigtool
 , cereal
+, libcxx
 , glslang
 , spirv-cross
 , spirv-headers
 , spirv-tools
 , vulkan-headers
+, xcbuild
 , AppKit
 , Foundation
+, Libsystem
+, MacOSX-SDK
 , Metal
 , QuartzCore
 }:
 
-# Even though the derivation is currently impure, it is written to build successfully using
-# `xcbuild`.  Once the SDK on x86_64-darwin is updated, it should be possible to switch from being
-# an impure derivation.
-#
-# The `sandboxProfile` was copied from the iTerm2 derivation.  In order to build you at least need
-# the `sandbox` option set to `relaxed` or `false`.  Xcode should be available in the default
-# location.
-let
-  libcxx.dev = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr";
-in
-stdenvNoCC.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "MoltenVK";
-  version = "1.1.8";
+  version = "1.1.10";
 
-  buildInputs = [
-    AppKit
-    Foundation
-    Metal
-    QuartzCore
-  ];
+  buildInputs = [ AppKit Foundation Metal QuartzCore cereal ]
+    ++ lib.attrValues finalAttrs.passthru;
+
+  nativeBuildInputs = [ cctools sigtool xcbuild ];
 
-  outputs = [ "out" "bin" ];
+  outputs = [ "out" "bin" "dev" ];
 
   # MoltenVK requires specific versions of its dependencies.
   # Pin them here except for cereal, which is four years old and has several CVEs.
   passthru = {
-    # The patch required to support DXVK may different from version to version. This should never
-    # be used except with DXVK, so there’s no package for it. To emphasize that this patch should
-    # never be used except with DXVK, `dxvk` provides a function for applying this patch.
-    dxvkPatch = ./dxvk-moltenvk-compat.patch;
     glslang = (glslang.overrideAttrs (old: {
       src = fetchFromGitHub {
         owner = "KhronosGroup";
         repo = "glslang";
-        rev = "90d4bd05cd77ef5782a6779a0fe3d084440dc80d";
-        hash = "sha256-Q0sk4bPj/skPat1n4GJyuXAlZqpfEn4Td8Bm2IBNUqE=";
+        rev = "adbf0d3106b26daa237b10b9bf72b1af7c31092d";
+        hash = "sha256-sjidkiPtRADhyOEKDb2cHCBXnFjLwk2F5Lppv5/fwNQ=";
       };
-    })).override {
-      inherit (passthru) spirv-headers spirv-tools;
-    };
+    })).override { inherit (finalAttrs.passthru) spirv-headers spirv-tools; };
     spirv-cross = spirv-cross.overrideAttrs (old: {
-      cmakeFlags = (old.cmakeFlags or [ ]) ++ [
-        "-DSPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross"
-      ];
+      cmakeFlags = (old.cmakeFlags or [ ])
+        ++ [ "-DSPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross" ];
       src = fetchFromGitHub {
         owner = "KhronosGroup";
         repo = "SPIRV-Cross";
-        rev = "131278458ea8eebe6a6e9c476fbcf71278726e1a";
-        hash = "sha256-LrRYDFGv3Zxfy4qRNLwM2OOa8jbcq0ttPxDamCH21xU=";
+        rev = "50b4d5389b6a06f86fb63a2848e1a7da6d9755ca";
+        hash = "sha256-SsupPHJ3VHxJhEAUl3EeQwN4texYhdDjxTnGD+bkNAw=";
       };
     });
     spirv-headers = spirv-headers.overrideAttrs (_: {
       src = fetchFromGitHub {
         owner = "KhronosGroup";
         repo = "spirv-headers";
-        rev = "b42ba6d92faf6b4938e6f22ddd186dbdacc98d78";
-        hash = "sha256-ks9JCj5rj+Xu++7z5RiHDkU3/sFXhcScw8dATfB/ot0";
+        rev = "5a121866927a16ab9d49bed4788b532c7fcea766";
+        hash = "sha256-X4GuFesX015mrzutguhZLrIGlllCgAZ+DUBGSADt8xU=";
       };
     });
     spirv-tools = (spirv-tools.overrideAttrs (old: {
       src = fetchFromGitHub {
         owner = "KhronosGroup";
         repo = "spirv-tools";
-        rev = "45dd184c790d6bfc78a5a74a10c37e888b1823fa";
-        hash = "sha256-DSqZlwfNTbN4fyIrVBKltm5U2U4GthW3L+Ksw4lSVG8=";
+        rev = "b930e734ea198b7aabbbf04ee1562cf6f57962f0";
+        hash = "sha256-NWpFSRoxtYWi+hLUt9gpw0YScM3shcUwv9yUmbivRb0=";
       };
-      meta = old.meta // {
-        platforms = old.meta.platforms ++ lib.platforms.darwin;
-      };
-    })).override {
-      inherit (passthru) spirv-headers;
-    };
+    })).override { inherit (finalAttrs.passthru) spirv-headers; };
     vulkan-headers = vulkan-headers.overrideAttrs (old: {
       src = fetchFromGitHub {
         owner = "KhronosGroup";
         repo = "Vulkan-Headers";
-        rev = "1dace16d8044758d32736eb59802d171970e9448";
-        hash = "sha256-C6YgxWcinI3QumcWmoJaiTAf0u6jSDc8sCIarn2t04k";
-      };
-      meta = old.meta // {
-        platforms = old.meta.platforms ++ lib.platforms.darwin;
+        rev = "3ef4c97fd6ea001d75a8e9da408ee473c180e456";
+        hash = "sha256-jHzW3m9smuzEGbZrSyBI74K9rFozxiG3M5Xql/WOw7U=";
       };
     });
   };
@@ -105,92 +82,100 @@ stdenvNoCC.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "MoltenVK";
-    rev = "v${version}";
-    hash = "sha256-IfTBtA2fM7YN4qaSDUTfsiCXzn+omSV6oroL1ivKiVA=";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-LZvCCP2yelTaWcNt+WvG+RZnVLHRgMDTlNWwRIey7ZM=";
   };
 
   patches = [
-    # Specify the libraries to link directly since XCFrameworks are not being used.
-    ./createDylib.patch
-    # Move `mvkGitRevDerived.h` to a stable location
-    ./gitRevHeaderStability.patch
     # Fix the Xcode projects to play nicely with `xcbuild`.
     ./MoltenVKShaderConverter.xcodeproj.patch
     ./MoltenVK.xcodeproj.patch
   ];
 
   postPatch = ''
-    substituteInPlace MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj \
-      --replace @@sourceRoot@@ $(pwd) \
-      --replace @@libcxx@@ "${libcxx.dev}" \
-      --replace @@glslang@@ "${passthru.glslang}" \
-      --replace @@spirv-cross@@ "${passthru.spirv-cross}" \
-      --replace @@spirv-tools@@ "${passthru.glslang.spirv-tools}" \
-      --replace @@spirv-headers@@ "${passthru.glslang.spirv-headers}"
-    substituteInPlace MoltenVK/MoltenVK.xcodeproj/project.pbxproj \
-      --replace @@sourceRoot@@ $(pwd) \
-      --replace @@libcxx@@ "${libcxx.dev}" \
-      --replace @@cereal@@ "${cereal}" \
-      --replace @@spirv-cross@@ "${passthru.spirv-cross}" \
-      --replace @@vulkan-headers@@ "${passthru.vulkan-headers}"
-    substituteInPlace Scripts/create_dylib.sh \
-      --replace @@sourceRoot@@ $(pwd) \
-      --replace @@glslang@@ "${passthru.glslang}" \
-      --replace @@spirv-tools@@ "${passthru.glslang.spirv-tools}" \
-      --replace @@spirv-cross@@ "${passthru.spirv-cross}"
+    # Move `mvkGitRevDerived.h` to a stable location
     substituteInPlace Scripts/gen_moltenvk_rev_hdr.sh \
-      --replace @@sourceRoot@@ $(pwd) \
-      --replace '$(git rev-parse HEAD)' ${src.rev}
+      --replace '$'''{BUILT_PRODUCTS_DIR}' "$NIX_BUILD_TOP/$sourceRoot/build/include" \
+      --replace '$(git rev-parse HEAD)' ${finalAttrs.src.rev}
+    # Adding all of `usr/include` from the SDK results in header conflicts with `libcxx.dev`.
+    # Work around it by symlinking just the SIMD stuff needed by MoltenVK.
+    mkdir -p build/include
+    ln -s "${MacOSX-SDK}/usr/include/simd" "build/include"
   '';
 
   dontConfigure = true;
 
+  NIX_CFLAGS_COMPILE = [
+    "-isystem ${lib.getDev libcxx}/include/c++/v1"
+    "-I${finalAttrs.passthru.spirv-cross}/include/spirv_cross"
+    "-I${finalAttrs.passthru.spirv-headers}/include/spirv/unified1/"
+  ];
+
   buildPhase = ''
+    NIX_CFLAGS_COMPILE+=" \
+      -I$NIX_BUILD_TOP/$sourceRoot/build/include \
+      -I$NIX_BUILD_TOP/$sourceRoot/Common"
+    NIX_LDFLAGS+=" -L$NIX_BUILD_TOP/$sourceRoot/build/lib"
+
     # Build each project on its own because `xcbuild` fails to build `MoltenVKPackaging.xcodeproj`.
-    derived_data_path=$(pwd)/DerivedData
+    build=$NIX_BUILD_TOP/$sourceRoot/build
+    mkdir -p "$build/bin" "$build/lib"
+
+    NIX_LDFLAGS+=" \
+      -lMachineIndependent \
+      -lGenericCodeGen \
+      -lOGLCompiler \
+      -lglslang \
+      -lOSDependent \
+      -lSPIRV \
+      -lSPIRV-Tools \
+      -lSPIRV-Tools-opt \
+      -lspirv-cross-msl \
+      -lspirv-cross-core \
+      -lspirv-cross-glsl"
+
     pushd MoltenVKShaderConverter
-      /usr/bin/xcodebuild build \
-        -jobs $NIX_BUILD_CORES \
-        -derivedDataPath "$derived_data_path" \
-        -configuration Release \
-        -project MoltenVKShaderConverter.xcodeproj \
-        -scheme MoltenVKShaderConverter \
-        -arch ${stdenv.targetPlatform.darwinArch}
-    popd
-    mkdir -p outputs/bin outputs/lib
-    declare -A outputs=( [MoltenVKShaderConverter]=bin [libMoltenVKShaderConverter.a]=lib )
-    for output in "''${!outputs[@]}"; do
-      cp DerivedData/Build/Products/Release/$output "outputs/''${outputs[$output]}/$output"
+    xcodebuild build \
+      -jobs $NIX_BUILD_CORES \
+      -configuration Release \
+      -project MoltenVKShaderConverter.xcodeproj \
+      -scheme MoltenVKShaderConverter \
+      -arch ${stdenv.targetPlatform.darwinArch}
+    declare -A products=( [MoltenVKShaderConverter]=bin [libMoltenVKShaderConverter.a]=lib )
+    for product in "''${!products[@]}"; do
+      cp MoltenVKShaderConverter-*/Build/Products/Release/$product "$build/''${products[$product]}/$product"
     done
+    popd
+
+    NIX_LDFLAGS+=" \
+      -lobjc \
+      -lMoltenVKShaderConverter \
+      -lspirv-cross-reflect"
 
     pushd MoltenVK
-      /usr/bin/xcodebuild build \
-        -jobs $NIX_BUILD_CORES \
-        -derivedDataPath "$derived_data_path" \
-        -configuration Release \
-        -project MoltenVK.xcodeproj \
-        -scheme MoltenVK-macOS \
-        -arch ${stdenv.targetPlatform.darwinArch}
+    xcodebuild build \
+      -jobs $NIX_BUILD_CORES \
+      -configuration Release \
+      -project MoltenVK.xcodeproj \
+      -scheme MoltenVK-macOS \
+      -arch ${stdenv.targetPlatform.darwinArch}
+    cp MoltenVK-*/Build/Products/Release/dynamic/libMoltenVK.dylib "$build/lib/libMoltenVK.dylib"
     popd
-    cp DerivedData/Build/Products/Release/dynamic/libMoltenVK.dylib outputs/lib/libMoltenVK.dylib
   '';
 
   installPhase = ''
-    mkdir -p "$out/lib" "$out/share/vulkan/icd.d" "$bin/bin"
-    cp outputs/bin/MoltenVKShaderConverter "$bin/bin/"
-    cp outputs/lib/libMoltenVK.dylib "$out/lib/"
-    ${cctools}/bin/install_name_tool -id "$out/lib/libMoltenVK.dylib" "$out/lib/libMoltenVK.dylib"
-    # FIXME: https://github.com/NixOS/nixpkgs/issues/148189
-    /usr/bin/codesign -s - -f "$out/lib/libMoltenVK.dylib"
+    mkdir -p "$out/lib" "$out/share/vulkan/icd.d" "$bin/bin" "$dev/include/MoltenVK"
+    cp build/bin/MoltenVKShaderConverter "$bin/bin/"
+    cp build/lib/libMoltenVK.dylib "$out/lib/"
+    cp MoltenVK/MoltenVK/API/* "$dev/include/MoltenVK"
     install -m644 MoltenVK/icd/MoltenVK_icd.json "$out/share/vulkan/icd.d/MoltenVK_icd.json"
     substituteInPlace $out/share/vulkan/icd.d/MoltenVK_icd.json \
-      --replace ./libMoltenVK.dylib "$out/share/vulkan/icd.d/MoltenVK_icd.json"
+      --replace ./libMoltenVK.dylib "$out/lib/libMoltenVK.dylib"
   '';
 
-  sandboxProfile = ''
-    (allow file-read* file-write* process-exec mach-lookup)
-    ; block homebrew dependencies
-    (deny file-read* file-write* process-exec mach-lookup (subpath "/usr/local") (with no-log))
+  postFixup = ''
+    install_name_tool -id "$out/lib/libMoltenVK.dylib" "$out/lib/libMoltenVK.dylib"
+    codesign -s - -f "$out/lib/libMoltenVK.dylib"
   '';
 
   meta = {
@@ -201,4 +186,4 @@ stdenvNoCC.mkDerivation rec {
     license = lib.licenses.asl20;
     platforms = lib.platforms.darwin;
   };
-}
+})
diff --git a/nixpkgs/pkgs/os-specific/darwin/moltenvk/dxvk-moltenvk-compat.patch b/nixpkgs/pkgs/os-specific/darwin/moltenvk/dxvk-moltenvk-compat.patch
deleted file mode 100644
index 7d16fdf70331..000000000000
--- a/nixpkgs/pkgs/os-specific/darwin/moltenvk/dxvk-moltenvk-compat.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-Source: https://github.com/Gcenx/MoltenVK/commit/1f268bd45f6c928784d7cb90dedce382895f10ae
-
-Fake extensions for DXVK;
-- _features.geometryShader
-- _features.tessellationShader
-- _features.shaderCullDistance
-
-Enabled defaults;
-- MVK_ALLOW_METAL_FENCES=1
-- MVK_CONFIG_RESUME_LOST_DEVICE=1
----
- MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm  | 3 +++
- MoltenVK/MoltenVK/Utility/MVKEnvironment.h | 4 ++--
- 2 files changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
-index bc6d19df..e1959c6e 100644
---- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
-+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
-@@ -1656,6 +1656,8 @@
-     _features.robustBufferAccess = true;  // XXX Required by Vulkan spec
-     _features.fullDrawIndexUint32 = true;
-     _features.independentBlend = true;
-+    _features.geometryShader = true;  // XXX Required by DXVK for D3D10
-+    _features.tessellationShader = true;  // XXX Required by DXVK for D3D11
-     _features.sampleRateShading = true;
-     _features.depthBiasClamp = true;
-     _features.fillModeNonSolid = true;
-@@ -1669,6 +1671,7 @@
-     _features.shaderUniformBufferArrayDynamicIndexing = true;
-     _features.shaderStorageBufferArrayDynamicIndexing = true;
-     _features.shaderClipDistance = true;
-+    _features.shaderCullDistance = true;  // XXX Required by DXVK for 10level9
-     _features.shaderInt16 = true;
-     _features.multiDrawIndirect = true;
-     _features.inheritedQueries = true;
-diff --git a/MoltenVK/MoltenVK/Utility/MVKEnvironment.h b/MoltenVK/MoltenVK/Utility/MVKEnvironment.h
-index 81d0defc..80c414d3 100644
---- a/MoltenVK/MoltenVK/Utility/MVKEnvironment.h
-+++ b/MoltenVK/MoltenVK/Utility/MVKEnvironment.h
-@@ -240,7 +240,7 @@ void mvkSetConfig(const MVKConfiguration& mvkConfig);
- #   define MVK_ALLOW_METAL_EVENTS    1
- #endif
- #ifndef MVK_ALLOW_METAL_FENCES
--#   define MVK_ALLOW_METAL_FENCES    0
-+#   define MVK_ALLOW_METAL_FENCES    1 // XXX Required by DXVK for Apple/NVidia GPUs (better FPS than CPU Emulation)
- #endif
- 
- /** Substitute Metal 2D textures for Vulkan 1D images. Enabled by default. */
-@@ -275,7 +275,7 @@ void mvkSetConfig(const MVKConfiguration& mvkConfig);
- 
- /** Resume MVKDevice VK_ERROR_DEVICE_LOST errors that do not cause MVKPhysicalDevice errors. Disabled by default. */
- #ifndef MVK_CONFIG_RESUME_LOST_DEVICE
--#   define MVK_CONFIG_RESUME_LOST_DEVICE    0
-+#   define MVK_CONFIG_RESUME_LOST_DEVICE    1
- #endif
- 
- /** Support Metal argument buffers. Disabled by default. */
- 
\ No newline at end of file
diff --git a/nixpkgs/pkgs/os-specific/darwin/moltenvk/gitRevHeaderStability.patch b/nixpkgs/pkgs/os-specific/darwin/moltenvk/gitRevHeaderStability.patch
deleted file mode 100644
index e28b9ee70b6a..000000000000
--- a/nixpkgs/pkgs/os-specific/darwin/moltenvk/gitRevHeaderStability.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/Scripts/gen_moltenvk_rev_hdr.sh b/Scripts/gen_moltenvk_rev_hdr.sh
-index c49ea4e6..9b7d13d1 100755
---- a/Scripts/gen_moltenvk_rev_hdr.sh
-+++ b/Scripts/gen_moltenvk_rev_hdr.sh
-@@ -2,7 +2,7 @@
-
- # Record the MoltenVK GIT revision as a derived header file suitable for including in a build
- MVK_GIT_REV=$(git rev-parse HEAD)
--MVK_HDR_FILE="${BUILT_PRODUCTS_DIR}/mvkGitRevDerived.h"
-+MVK_HDR_FILE="@@sourceRoot@@/outputs/include/mvkGitRevDerived.h"
-+mkdir -p $(dirname ${MVK_HDR_FILE})
- echo "// Auto-generated by MoltenVK" > "${MVK_HDR_FILE}"
- echo "static const char* mvkRevString = \"${MVK_GIT_REV}\";" >> "${MVK_HDR_FILE}"
--
diff --git a/nixpkgs/pkgs/os-specific/darwin/pngpaste/default.nix b/nixpkgs/pkgs/os-specific/darwin/pngpaste/default.nix
new file mode 100644
index 000000000000..99ae8048f7fd
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/darwin/pngpaste/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, AppKit, Cocoa }:
+
+let
+  pname = "pngpaste";
+  version = "0.2.3";
+in stdenv.mkDerivation {
+  inherit pname version;
+  src = fetchFromGitHub {
+    owner = "jcsalterego";
+    repo = pname;
+    rev = version;
+    sha256 = "uvajxSelk1Wfd5is5kmT2fzDShlufBgC0PDCeabEOSE=";
+  };
+
+  buildInputs = [ AppKit Cocoa ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp pngpaste $out/bin
+  '';
+
+  meta = with lib; {
+    description = "Paste image files from clipboard to file on MacOS";
+    longDescription = ''
+      Paste PNG into files on MacOS, much like pbpaste does for text.
+      Supported input formats are PNG, PDF, GIF, TIF, JPEG.
+      Supported output formats are PNG, GIF, JPEG, TIFF.  Output
+      formats are determined by the provided filename extension,
+      falling back to PNG.
+    '';
+    homepage = "https://github.com/jcsalterego/pngpaste";
+    changelog = "https://github.com/jcsalterego/pngpaste/raw/${version}/CHANGELOG.md";
+    platforms = platforms.darwin;
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ samw ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/darwin/sketchybar/default.nix b/nixpkgs/pkgs/os-specific/darwin/sketchybar/default.nix
index cc5c4ae20458..4f089c7be3e1 100644
--- a/nixpkgs/pkgs/os-specific/darwin/sketchybar/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/sketchybar/default.nix
@@ -3,20 +3,20 @@
 let
   inherit (stdenv.hostPlatform) system;
   target = {
-    "aarch64-darwin" = "arm";
+    "aarch64-darwin" = "arm64";
     "x86_64-darwin" = "x86";
   }.${system} or (throw "Unsupported system: ${system}");
 in
 
 stdenv.mkDerivation rec {
   pname = "sketchybar";
-  version = "2.5.0";
+  version = "2.8.2";
 
   src = fetchFromGitHub {
     owner = "FelixKratz";
     repo = "SketchyBar";
     rev = "v${version}";
-    sha256 = "sha256-ucTyJhRhSVyE4E/x6PtFz7nHRUg6cKKVOrRpPs39iO8=";
+    sha256 = "sha256-GmM+0h6xxUzW2kpTDZWAiqJAXoQgdsJRlNbvsuxKmZ8=";
   };
 
   buildInputs = [ Carbon Cocoa SkyLight ]
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     mkdir -p $out/bin
-    cp ./bin/sketchybar_${target} $out/bin/sketchybar
+    cp ./bin/sketchybar $out/bin/sketchybar
   '';
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/os-specific/darwin/spacebar/default.nix b/nixpkgs/pkgs/os-specific/darwin/spacebar/default.nix
index 8cfbaa3f9a3b..2656c10f6dc3 100644
--- a/nixpkgs/pkgs/os-specific/darwin/spacebar/default.nix
+++ b/nixpkgs/pkgs/os-specific/darwin/spacebar/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "spacebar";
-  version = "1.2.1";
+  version = "1.4.0";
 
   src = fetchFromGitHub {
     owner = "cmacrae";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0f5ddn3sx13rwwh0nfl784160s8ml3m5593d5fz2b1996aznzrsx";
+    sha256 = "sha256-4LiG43kPZtsm7SQ/28RaGMpYsDshCaGvc1mouPG3jFM=";
   };
 
   buildInputs = [ Carbon Cocoa ScriptingBridge SkyLight ];
diff --git a/nixpkgs/pkgs/os-specific/linux/adcli/default.nix b/nixpkgs/pkgs/os-specific/linux/adcli/default.nix
new file mode 100644
index 000000000000..977c1d09dbae
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/adcli/default.nix
@@ -0,0 +1,68 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, fetchpatch
+, openldap
+, libkrb5
+, libxslt
+, autoreconfHook
+, pkg-config
+, cyrus_sasl
+, util-linux
+, xmlto
+, docbook_xsl
+, docbook_xml_dtd_43
+}:
+
+stdenv.mkDerivation rec {
+  pname = "adcli";
+  version = "0.9.1";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = "realmd";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-Zzt4qgLiJNuSrbtDWuxJEfGL7sWSbqN301q3qXZpn9c=";
+  };
+
+  # https://bugs.gentoo.org/820224
+  # Without this it produces some weird missing symbol error in glibc
+  patches = [
+    (fetchpatch {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-crypt/adcli/files/adcli-0.9.1-glibc-2.34-resolv.patch?id=01db544de893262e857685e11b33c2a74210181f";
+      sha256 = "sha256-dZ6dkzxd+0XjY/X9/2IWMan3syvCDGFHiMbxFxMHGFA=";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace tools/Makefile.am \
+      --replace 'sbin_PROGRAMS' 'bin_PROGRAMS'
+
+    substituteInPlace doc/Makefile.am \
+        --replace 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl' \
+                  '${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl'
+
+    function patch_docbook(){
+      substituteInPlace $1 \
+        --replace "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" \
+                  "${docbook_xml_dtd_43}/xml/dtd/docbook/docbookx.dtd"
+    }
+    patch_docbook doc/adcli.xml
+    patch_docbook doc/adcli-devel.xml
+    patch_docbook doc/adcli-docs.xml
+  '';
+  nativeBuildInputs = [ autoreconfHook pkg-config docbook_xsl ];
+
+  buildInputs = [ openldap libkrb5 libxslt cyrus_sasl util-linux xmlto docbook_xsl ];
+
+  configureFlags = [ "--disable-debug" ];
+
+  meta = with lib; {
+    homepage = "https://www.freedesktop.org/software/realmd/adcli/adcli.html";
+    description = "A helper library and tools for Active Directory client operations.";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ SohamG ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/akvcam/default.nix b/nixpkgs/pkgs/os-specific/linux/akvcam/default.nix
index 0724118431ce..6d916e0ff7fc 100644
--- a/nixpkgs/pkgs/os-specific/linux/akvcam/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/akvcam/default.nix
@@ -29,5 +29,6 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ freezeboy ];
     platforms = platforms.linux;
     license = licenses.gpl2Only;
+    broken = kernel.kernelAtLeast "5.18";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-firmware/default.nix b/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-firmware/default.nix
index 2ef971a8cf7f..8ddc97890e92 100644
--- a/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-firmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-firmware/default.nix
@@ -1,6 +1,6 @@
-{ lib, buildPackages, stdenv, autoreconfHook, fetchurl }:
+{ lib, buildPackages, stdenvNoCC, autoreconfHook, fetchurl }:
 
-stdenv.mkDerivation rec {
+stdenvNoCC.mkDerivation rec {
   pname = "alsa-firmware";
   version = "1.2.4";
 
diff --git a/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-lib/default.nix b/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-lib/default.nix
index 58e5990ae0a6..db8ede6feb81 100644
--- a/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-lib/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-lib/default.nix
@@ -7,11 +7,11 @@
 
 stdenv.mkDerivation rec {
   pname = "alsa-lib";
-  version = "1.2.6.1";
+  version = "1.2.7.2";
 
   src = fetchurl {
     url = "mirror://alsa/lib/${pname}-${version}.tar.bz2";
-    hash = "sha256-rVgpk9Us21+xWaC+q2CmrFfqsMwb34XcTbbWGX8CMz8=";
+    hash = "sha256-ijW3IY5Q8qLHk0LQ3pje2BQ5zhnhKAk4Xsm+lZbefC8=";
   };
 
   patches = [
diff --git a/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-plugins/default.nix b/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-plugins/default.nix
index 86ff7ff5d219..ababb767955b 100644
--- a/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-plugins/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-plugins/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "alsa-plugins";
-  version = "1.2.6";
+  version = "1.2.7.1";
 
   src = fetchurl {
     url = "mirror://alsa/plugins/${pname}-${version}.tar.bz2";
-    sha256 = "sha256-BogYpLVdjAKdqgABXYU9RRE/VrIkt8ZOHhF5iMglsqA=";
+    hash = "sha256-jDN4FJVLt8FnRWczpgRhQqKTHxLsy6PsKkrmGKNDJRE=";
   };
 
   nativeBuildInputs = [ pkg-config ];
diff --git a/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-ucm-conf/default.nix b/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-ucm-conf/default.nix
index e1474e02ed5b..512fe605b6e5 100644
--- a/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-ucm-conf/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-ucm-conf/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "alsa-ucm-conf";
-  version = "1.2.6.3";
+  version = "1.2.7.1";
 
   src = fetchurl {
     url = "mirror://alsa/lib/${pname}-${version}.tar.bz2";
-    sha256 = "sha256-uKA6o4emJKL2XtwgG/d3QhGQtgUpqSCHZGgjr72Wxc0=";
+    hash = "sha256-rFsqEnV4Pv8H4cs0w2xsWYd0JnmjQAN1B8BKncHSLKw=";
   };
 
   dontBuild = true;
diff --git a/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-utils/default.nix b/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-utils/default.nix
index e614be978c06..e8c6a2ae566f 100644
--- a/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-utils/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/alsa-project/alsa-utils/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "alsa-utils";
-  version = "1.2.6";
+  version = "1.2.7";
 
   src = fetchurl {
     url = "mirror://alsa/utils/${pname}-${version}.tar.bz2";
-    sha256 = "sha256-ah79ih8dnTjkiWM+rsH/+lwxVmOzFsq4BL5IaIfmFF0=";
+    sha256 = "sha256-6Qa/JAT/BMRI6qPSJtKDpiuaKD8S5P2EV/skusJ05ng=";
   };
 
   nativeBuildInputs = [ gettext makeWrapper ];
diff --git a/nixpkgs/pkgs/os-specific/linux/anbox/kmod.nix b/nixpkgs/pkgs/os-specific/linux/anbox/kmod.nix
deleted file mode 100644
index 9ce65cd87261..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/anbox/kmod.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{ lib, stdenv, kernel, fetchFromGitHub }:
-
-stdenv.mkDerivation {
-  pname = "anbox-modules";
-  version = "2020-06-14-${kernel.version}";
-
-  src = fetchFromGitHub {
-    owner = "anbox";
-    repo = "anbox-modules";
-    rev = "98f0f3b3b1eeb5a6954ca15ec43e150b76369086";
-    sha256 = "sha256-6xDJQ4YItdbYqle/9VNfOc7D80yFGd9cFyF+CuABaF0=";
-  };
-
-  nativeBuildInputs = kernel.moduleBuildDependencies;
-
-  KERNEL_SRC="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
-
-  buildPhase = ''
-    for d in ashmem binder;do
-      cd $d
-      make
-      cd -
-    done
-  '';
-
-  installPhase = ''
-    modDir=$out/lib/modules/${kernel.modDirVersion}/kernel/updates/
-    mkdir -p $modDir
-    for d in ashmem binder;do
-      mv $d/$d*.ko $modDir/.
-    done
-  '';
-
-  meta = with lib; {
-    description = "Anbox ashmem and binder drivers.";
-    homepage = "https://github.com/anbox/anbox-modules";
-    license = licenses.gpl2Only;
-    platforms = platforms.linux;
-    broken = kernel.kernelOlder "4.4" || kernel.kernelAtLeast "5.5";
-    maintainers = with maintainers; [ edwtjo ];
-  };
-}
diff --git a/nixpkgs/pkgs/os-specific/linux/apfs/default.nix b/nixpkgs/pkgs/os-specific/linux/apfs/default.nix
index 98fd83ed5d51..bcc53e82b9aa 100644
--- a/nixpkgs/pkgs/os-specific/linux/apfs/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/apfs/default.nix
@@ -6,13 +6,13 @@
 
 stdenv.mkDerivation {
   pname = "apfs";
-  version = "unstable-2021-09-21-${kernel.version}";
+  version = "unstable-2022-07-24-${kernel.version}";
 
   src = fetchFromGitHub {
     owner = "linux-apfs";
     repo = "linux-apfs-rw";
-    rev = "362c4e32ab585b9234a26aa3e49f29b605612a31";
-    sha256 = "sha256-Y8/PGPLirNrICF+Bum60v/DBPa1xpox5VBvt64myZzs=";
+    rev = "925d86b7be3ccf21b17734cfececf40e43c4598e";
+    sha256 = "sha256-N5lGJu4c03cVDk3WTcegzZHBDmguPEX8dCedJS2TMSI=";
   };
 
   hardeningDisable = [ "pic" ];
@@ -29,7 +29,7 @@ stdenv.mkDerivation {
     homepage = "https://github.com/linux-apfs/linux-apfs-rw";
     license = licenses.gpl2Only;
     platforms = platforms.linux;
-    broken = kernel.kernelOlder "4.9";
+    broken = kernel.kernelOlder "4.9" || kernel.kernelAtLeast "5.19";
     maintainers = with maintainers; [ Luflosi ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/apparmor/default.nix b/nixpkgs/pkgs/os-specific/linux/apparmor/default.nix
index 5c1cf272e0e7..f7a2c0c52a95 100644
--- a/nixpkgs/pkgs/os-specific/linux/apparmor/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/apparmor/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, fetchpatch, makeWrapper, autoreconfHook
+{ stdenv, lib, fetchFromGitLab, fetchpatch, makeWrapper, autoreconfHook
 , pkg-config, which
 , flex, bison
 , linuxHeaders ? stdenv.cc.libc.linuxHeaders
@@ -21,7 +21,7 @@
 }:
 
 let
-  apparmor-version = "3.0.3";
+  apparmor-version = "3.0.4";
 
   apparmor-meta = component: with lib; {
     homepage = "https://apparmor.net/";
@@ -31,9 +31,11 @@ let
     platforms = platforms.linux;
   };
 
-  apparmor-sources = fetchurl {
-    url = "https://launchpad.net/apparmor/${lib.versions.majorMinor apparmor-version}/${apparmor-version}/+download/apparmor-${apparmor-version}.tar.gz";
-    sha256 = "0nasq8pdmzkrf856yg1v8z5hcs0nn6gw2qr60ab0a7j9ixfv0g8m";
+  apparmor-sources = fetchFromGitLab {
+    owner = "apparmor";
+    repo = "apparmor";
+    rev = "v${apparmor-version}";
+    sha256 = "1a217j28rgfq4lsmpn0wv1xgmdr9ba8iysv9i6q477kj6z77zrb9";
   };
 
   aa-teardown = writeShellScript "aa-teardown" ''
@@ -48,8 +50,9 @@ let
     substituteInPlace ./common/Make.rules \
       --replace "/usr/bin/pod2man" "${buildPackages.perl}/bin/pod2man" \
       --replace "/usr/bin/pod2html" "${buildPackages.perl}/bin/pod2html" \
-      --replace "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h" \
       --replace "/usr/share/man" "share/man"
+    substituteInPlace ./utils/Makefile \
+      --replace "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h"
   '';
 
   patches = lib.optionals stdenv.hostPlatform.isMusl [
@@ -60,6 +63,8 @@ let
     })
   ];
 
+  python = python3.withPackages (ps: with ps; [ setuptools ]);
+
   # Set to `true` after the next FIXME gets fixed or this gets some
   # common derivation infra. Too much copy-paste to fix one by one.
   doCheck = false;
@@ -86,19 +91,16 @@ let
       ncurses
       which
       perl
-    ] ++ lib.optional withPython python3;
+    ] ++ lib.optional withPython python;
 
     buildInputs = lib.optional withPerl perl
-      ++ lib.optional withPython python3;
+      ++ lib.optional withPython python;
 
     # required to build apparmor-parser
     dontDisableStatic = true;
 
     prePatch = prePatchCommon + ''
       substituteInPlace ./libraries/libapparmor/swig/perl/Makefile.am --replace install_vendor install_site
-      substituteInPlace ./libraries/libapparmor/swig/perl/Makefile.in --replace install_vendor install_site
-      substituteInPlace ./libraries/libapparmor/src/Makefile.am --replace "/usr/include/netinet/in.h" "${lib.getDev stdenv.cc.libc}/include/netinet/in.h"
-      substituteInPlace ./libraries/libapparmor/src/Makefile.in --replace "/usr/include/netinet/in.h" "${lib.getDev stdenv.cc.libc}/include/netinet/in.h"
     '';
     inherit patches;
 
@@ -132,12 +134,12 @@ let
 
     strictDeps = true;
 
-    nativeBuildInputs = [ makeWrapper which python3 ];
+    nativeBuildInputs = [ makeWrapper which python ];
 
     buildInputs = [
       bash
       perl
-      python3
+      python
       libapparmor
       libapparmor.python
     ];
@@ -159,7 +161,7 @@ let
     postInstall = ''
       sed -i $out/bin/aa-unconfined -e "/my_env\['PATH'\]/d"
       for prog in aa-audit aa-autodep aa-cleanprof aa-complain aa-disable aa-enforce aa-genprof aa-logprof aa-mergeprof aa-unconfined ; do
-        wrapProgram $out/bin/$prog --prefix PYTHONPATH : "$out/lib/${python3.libPrefix}/site-packages:$PYTHONPATH"
+        wrapProgram $out/bin/$prog --prefix PYTHONPATH : "$out/lib/${python.sitePackages}:$PYTHONPATH"
       done
 
       substituteInPlace $out/bin/aa-notify \
@@ -190,7 +192,6 @@ let
     nativeBuildInputs = [
       pkg-config
       libapparmor
-      gawk
       which
     ];
 
diff --git a/nixpkgs/pkgs/os-specific/linux/atop/default.nix b/nixpkgs/pkgs/os-specific/linux/atop/default.nix
index b082c594acbf..47f76649dea9 100644
--- a/nixpkgs/pkgs/os-specific/linux/atop/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/atop/default.nix
@@ -12,16 +12,27 @@
 
 stdenv.mkDerivation rec {
   pname = "atop";
-  version = "2.6.0";
+  version = "2.7.1";
 
   src = fetchurl {
     url = "https://www.atoptool.nl/download/atop-${version}.tar.gz";
-    sha256 = "nsLKOlcWkvfvqglfmaUQZDK8txzCLNbElZfvBIEFj3I=";
+    sha256 = "sha256-ykjS8X4HHe6tXm6cyeOIv2oycNaV5hl2s3lNTZJ7XE4=";
   };
 
-  nativeBuildInputs = lib.optionals withAtopgpu [ python3.pkgs.wrapPython ];
-  buildInputs = [ zlib ncurses ] ++ lib.optionals withAtopgpu [ python3 ];
-  pythonPath = lib.optionals withAtopgpu [ python3.pkgs.pynvml ];
+  nativeBuildInputs = lib.optionals withAtopgpu [
+    python3.pkgs.wrapPython
+  ];
+
+  buildInputs = [
+    zlib
+    ncurses
+  ] ++ lib.optionals withAtopgpu [
+    python3
+  ];
+
+  pythonPath = lib.optionals withAtopgpu [
+    python3.pkgs.pynvml
+  ];
 
   makeFlags = [
     "DESTDIR=$(out)"
@@ -53,12 +64,12 @@ stdenv.mkDerivation rec {
     substituteInPlace Makefile --replace 'chmod 04711' 'chmod 0711'
   '';
 
-  installTargets = [ "systemdinstall" ];
   preInstall = ''
     mkdir -p $out/bin
   '';
+
   postInstall = ''
-    # remove extra files we don't need
+    # Remove extra files we don't need
     rm -r $out/{var,etc} $out/bin/atop{sar,}-${version}
   '' + (if withAtopgpu then ''
     wrapPythonPrograms
@@ -70,9 +81,13 @@ stdenv.mkDerivation rec {
     platforms = platforms.linux;
     maintainers = with maintainers; [ raskin ];
     description = "Console system performance monitor";
-
     longDescription = ''
-      Atop is an ASCII full-screen performance monitor that is capable of reporting the activity of all processes (even if processes have finished during the interval), daily logging of system and process activity for long-term analysis, highlighting overloaded system resources by using colors, etc. At regular intervals, it shows system-level activity related to the CPU, memory, swap, disks and network layers, and for every active process it shows the CPU utilization, memory growth, disk utilization, priority, username, state, and exit code.
+      Atop is an ASCII full-screen performance monitor that is capable of reporting the activity of
+      all processes (even if processes have finished during the interval), daily logging of system
+      and process activity for long-term analysis, highlighting overloaded system resources by using
+      colors, etc. At regular intervals, it shows system-level activity related to the CPU, memory,
+      swap, disks and network layers, and for every active process it shows the CPU utilization,
+      memory growth, disk utilization, priority, username, state, and exit code.
     '';
     license = licenses.gpl2Plus;
     downloadPage = "http://atoptool.nl/downloadatop.php";
diff --git a/nixpkgs/pkgs/os-specific/linux/audit/default.nix b/nixpkgs/pkgs/os-specific/linux/audit/default.nix
index e9762f44dcdc..bda8d8ab30c5 100644
--- a/nixpkgs/pkgs/os-specific/linux/audit/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/audit/default.nix
@@ -2,7 +2,7 @@
   lib, stdenv, buildPackages, fetchurl, fetchpatch,
   runCommand,
   autoreconfHook,
-  autoconf, automake, libtool,
+  autoconf, automake, libtool, bash,
   # Enabling python support while cross compiling would be possible, but
   # the configure script tries executing python to gather info instead of
   # relying on python3-config exclusively
@@ -21,9 +21,11 @@ stdenv.mkDerivation rec {
 
   outputs = [ "bin" "dev" "out" "man" ];
 
+  strictDeps = true;
   depsBuildBuild = [ buildPackages.stdenv.cc ];
-  nativeBuildInputs = [ autoreconfHook ];
-  buildInputs = lib.optionals enablePython [ python3 swig ];
+  nativeBuildInputs = [ autoreconfHook ]
+    ++ lib.optionals enablePython [ python3 swig ];
+  buildInputs = [ bash ];
 
   configureFlags = [
     # z/OS plugin is not useful on Linux,
@@ -69,6 +71,13 @@ stdenv.mkDerivation rec {
       sha256 = "0qjq41ridyamajz9v9nyplgq7f8nn3fxw375s9sa5a0igsrx9pm0";
       excludes = [ "ChangeLog" ];
     })
+    # Fix pending upstream inclusion for linux-headers-5.17 support:
+    #  https://github.com/linux-audit/audit-userspace/pull/253
+    (fetchpatch {
+      name = "ignore-flexible-array.patch";
+      url = "https://github.com/linux-audit/audit-userspace/commit/beed138222421a2eb4212d83cb889404bd7efc49.patch";
+      sha256 = "1hf02zaxv6x0wmn4ca9fj48y2shks7vfna43i1zz58xw9jq7sza0";
+    })
   ];
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/autofs/default.nix b/nixpkgs/pkgs/os-specific/linux/autofs/default.nix
index 7b29f5a0e5cf..5e552301fe48 100644
--- a/nixpkgs/pkgs/os-specific/linux/autofs/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/autofs/default.nix
@@ -1,5 +1,7 @@
 { lib, stdenv, fetchurl, flex, bison, linuxHeaders, libtirpc, mount, umount, nfs-utils, e2fsprogs
-, libxml2, libkrb5, kmod, openldap, sssd, cyrus_sasl, openssl, rpcsvc-proto }:
+, libxml2, libkrb5, kmod, openldap, sssd, cyrus_sasl, openssl, rpcsvc-proto
+, fetchpatch
+}:
 
 stdenv.mkDerivation rec {
   version = "5.1.6";
@@ -10,6 +12,15 @@ stdenv.mkDerivation rec {
     sha256 = "1vya21mb4izj3khcr3flibv7xc15vvx2v0rjfk5yd31qnzcy7pnx";
   };
 
+  patches = [
+    # glibc 2.34 compat
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/autofs/raw/cc745af5e42396d540d5b3b92fae486e232bf6bd/f/autofs-5.1.7-use-default-stack-size-for-threads.patch";
+      sha256 = "sha256-6ETDFbW7EhHR03xFWF+6OJBgn9NX3WW3bGhTNGodaOc=";
+      excludes = [ "CHANGELOG" ];
+    })
+  ];
+
   preConfigure = ''
     configureFlags="--enable-force-shutdown --enable-ignore-busy --with-path=$PATH"
     export sssldir="${sssd}/lib/sssd/modules"
diff --git a/nixpkgs/pkgs/os-specific/linux/autosuspend/default.nix b/nixpkgs/pkgs/os-specific/linux/autosuspend/default.nix
index 4283230f7ad7..ba3460938920 100644
--- a/nixpkgs/pkgs/os-specific/linux/autosuspend/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/autosuspend/default.nix
@@ -5,13 +5,13 @@
 
 python3.pkgs.buildPythonApplication rec {
   pname = "autosuspend";
-  version = "4.1.0";
+  version = "4.2.0";
 
   src = fetchFromGitHub {
     owner = "languitar";
     repo = pname;
-    rev = "v${version}";
-    sha256 = "0vn1qhsmjlgd7gn11w938kraz55xyixpzrgq06dar066hcsn1x8w";
+    rev = "refs/tags/v${version}";
+    sha256 = "sha256-aIWqE422xfAzAyF+4hARYOcomZHraTrtxtw2YfAxJ1M=";
   };
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/ax99100/default.nix b/nixpkgs/pkgs/os-specific/linux/ax99100/default.nix
new file mode 100644
index 000000000000..9167b4e5f89d
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/ax99100/default.nix
@@ -0,0 +1,29 @@
+{ kernel, stdenv, kmod, lib, fetchzip }:
+stdenv.mkDerivation
+{
+  pname = "ax99100";
+  version = "1.8.0";
+  nativeBuildInputs = [ kmod ] ++ kernel.moduleBuildDependencies;
+  src = fetchzip {
+    url = "https://www.asix.com.tw/en/support/download/file/1229";
+    sha256 = "1rbp1m01qr6b3nbr72vpbw89pjh8mddc60im78z2yjd951xkbcjh";
+    extension = "tar.bz2";
+  };
+
+  makeFlags = [ "KDIR='${kernel.dev}/lib/modules/${kernel.modDirVersion}/build'" ];
+
+  installPhase = ''
+    mkdir -p $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/tty/serial
+    cp ax99100.ko $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/tty/serial
+  '';
+
+  meta = {
+    description = "ASIX AX99100 Serial and Parralel Port driver";
+    homepage = "https://www.asix.com.tw/en/product/Interface/PCIe_Bridge/AX99100";
+    # According to the source code in the tarball, the license is gpl2.
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+    # currently, the build fails with kernels newer than 5.17
+    broken = lib.versionAtLeast kernel.version "5.18.0";
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/batman-adv/default.nix b/nixpkgs/pkgs/os-specific/linux/batman-adv/default.nix
index 123c42e83971..3d22720b9625 100644
--- a/nixpkgs/pkgs/os-specific/linux/batman-adv/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/batman-adv/default.nix
@@ -1,4 +1,9 @@
-{ lib, stdenv, fetchurl, kernel }:
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, kernel
+}:
 
 let cfg = import ./version.nix; in
 
diff --git a/nixpkgs/pkgs/os-specific/linux/batman-adv/version.nix b/nixpkgs/pkgs/os-specific/linux/batman-adv/version.nix
index 048318e3e33a..dd2227874501 100644
--- a/nixpkgs/pkgs/os-specific/linux/batman-adv/version.nix
+++ b/nixpkgs/pkgs/os-specific/linux/batman-adv/version.nix
@@ -1,9 +1,9 @@
 {
-  version = "2021.4";
+  version = "2022.1";
 
   sha256 = {
-    batman-adv = "06zbyf8s7njn6wdm1fdq3kl8kx1vx4spxkgiy7dx0pq4c3qs5xyg";
-    alfred = "15fbw80ix95zy8i4c6acm1631vxlz2hakjv4zv5wig74bp2bcyac";
-    batctl = "1ryqz90av2p5pgmmpi1afmycd18zhpwz1i4f7r0s359jis86xndn";
+    batman-adv = "sha256-bQQdNTCr1LJJq/Wpb8Ki4kFDG/lEO1R/2yWi2P0ymkA=";
+    alfred = "sha256-OgrCuybgyz8nMtSHNmmgoi6YJej5qOerrJhjY/J1CX8=";
+    batctl = "sha256-h+iak4lxuGJCJoG7NBBOmytLZRLR0WXelTYw3zjWGmg=";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/bbswitch/default.nix b/nixpkgs/pkgs/os-specific/linux/bbswitch/default.nix
index 4d081225f11e..886bf3e6fee8 100644
--- a/nixpkgs/pkgs/os-specific/linux/bbswitch/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/bbswitch/default.nix
@@ -2,7 +2,7 @@
 
 let
   baseName = "bbswitch";
-  version = "0.8";
+  version = "unstable-2021-11-29";
   name = "${baseName}-${version}-${kernel.version}";
 
 in
@@ -13,18 +13,15 @@ stdenv.mkDerivation {
   src = fetchFromGitHub {
     owner = "Bumblebee-Project";
     repo = "bbswitch";
-    rev = "v${version}";
-    hash = "sha256-FHC8myKnouNDERVds2QCJj1ZstjHrOzFpb+FDiSBjL4=";
+    # https://github.com/Bumblebee-Project/bbswitch/tree/develop
+    rev = "23891174a80ea79c7720bcc7048a5c2bfcde5cd9";
+    hash = "sha256-50v1Jxem5kaI1dHOKmgBbPLxI82QeYxiaRHhrHpWRzU=";
   };
 
   patches = [
     (fetchpatch {
-      url = "https://github.com/Bumblebee-Project/bbswitch/pull/102.patch";
-      sha256 = "1lbr6pyyby4k9rn2ry5qc38kc738d0442jhhq57vmdjb6hxjya7m";
-    })
-    (fetchpatch {
-      url = "https://github.com/Bumblebee-Project/bbswitch/pull/196.patch";
-      sha256 = "02ihy3piws7783qbm9q0mb9s18ipn5ckdy1iar74xn31qjrsn99n";
+      url = "https://raw.githubusercontent.com/archlinux/svntogit-community/0bd986055ba52887b81048de5c61e618eec06eb0/trunk/0003-kernel-5.18.patch";
+      sha256 = "sha256-va62/bR1qyBBMPg0lUwCH7slGG0XijxVCsFa4FCoHEQ=";
     })
   ];
 
diff --git a/nixpkgs/pkgs/os-specific/linux/bcc/default.nix b/nixpkgs/pkgs/os-specific/linux/bcc/default.nix
index d6e4b059088d..ab3e2232852b 100644
--- a/nixpkgs/pkgs/os-specific/linux/bcc/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/bcc/default.nix
@@ -77,6 +77,8 @@ python.pkgs.buildPythonApplication rec {
     wrapPythonProgramsIn "$out/share/bcc/tools" "$out $pythonPath"
   '';
 
+  outputs = [ "out" "man" ];
+
   passthru.tests = {
     bpf = nixosTests.bpf;
   };
diff --git a/nixpkgs/pkgs/os-specific/linux/bionic-prebuilt/default.nix b/nixpkgs/pkgs/os-specific/linux/bionic-prebuilt/default.nix
index 8fa17036c4ad..da5011e67373 100644
--- a/nixpkgs/pkgs/os-specific/linux/bionic-prebuilt/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/bionic-prebuilt/default.nix
@@ -4,22 +4,47 @@
 }:
 let
 
-  prebuilt_crt = fetchzip {
-    url =  "https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/+archive/98dce673ad97a9640c5d90bbb1c718e75c21e071/lib/gcc/aarch64-linux-android/4.9.x.tar.gz";
-    sha256 = "sha256-LLD2OJi78sNN5NulOsJZl7Ei4F1EUYItGG6eUsKWULc=";
-    stripRoot = false;
+  choosePlatform =
+    let pname = stdenv.targetPlatform.parsed.cpu.name; in
+    pset: pset.${pname} or (throw "bionic-prebuilt: unsupported platform ${pname}");
+
+  prebuilt_crt = choosePlatform {
+    aarch64 = fetchzip {
+      url =  "https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/+archive/98dce673ad97a9640c5d90bbb1c718e75c21e071/lib/gcc/aarch64-linux-android/4.9.x.tar.gz";
+      sha256 = "sha256-LLD2OJi78sNN5NulOsJZl7Ei4F1EUYItGG6eUsKWULc=";
+      stripRoot = false;
+    };
+    x86_64 = fetchzip {
+      url = "https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/+archive/7e8507d2a2d4df3bced561b894576de70f065be4/lib/gcc/x86_64-linux-android/4.9.x.tar.gz";
+      sha256 = "sha256-y7CFLF76pTlj+oYev9taBnL2nlT3+Tx8c6wmicWmKEw=";
+      stripRoot = false;
+    };
   };
 
-  prebuilt_libs = fetchzip {
-    url = "https://android.googlesource.com/platform/prebuilts/ndk/+archive/f2c77d8ba8a7f5c2d91771e31164f29be0b8ff98/platform/platforms/android-30/arch-arm64/usr/lib.tar.gz";
-    sha256 = "sha256-TZBV7+D1QvKOCEi+VNGT5SStkgj0xRbyWoLH65zSrjw=";
-    stripRoot = false;
+  prebuilt_libs = choosePlatform {
+    aarch64 = fetchzip {
+      url = "https://android.googlesource.com/platform/prebuilts/ndk/+archive/f2c77d8ba8a7f5c2d91771e31164f29be0b8ff98/platform/platforms/android-30/arch-arm64/usr/lib.tar.gz";
+      sha256 = "sha256-TZBV7+D1QvKOCEi+VNGT5SStkgj0xRbyWoLH65zSrjw=";
+      stripRoot = false;
+    };
+    x86_64 = fetchzip {
+      url = "https://android.googlesource.com/platform/prebuilts/ndk/+archive/f2c77d8ba8a7f5c2d91771e31164f29be0b8ff98/platform/platforms/android-30/arch-x86_64/usr/lib64.tar.gz";
+      sha256 = "sha256-n2EuOKy3RGKmEYofNlm+vDDBuiQRuAJEJT6wq6NEJQs=";
+      stripRoot = false;
+    };
   };
 
-  prebuilt_ndk_crt = fetchzip {
-    url = "https://android.googlesource.com/toolchain/prebuilts/ndk/r23/+archive/6c5fa4c0d3999b9ee932f6acbd430eb2f31f3151/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/30.tar.gz";
-    sha256 = "sha256-KHw+cCwAwlm+5Nwp1o8WONqdi4BBDhFaVVr+7GxQ5uE=";
-    stripRoot = false;
+  prebuilt_ndk_crt = choosePlatform {
+    aarch64 = fetchzip {
+      url = "https://android.googlesource.com/toolchain/prebuilts/ndk/r23/+archive/6c5fa4c0d3999b9ee932f6acbd430eb2f31f3151/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/30.tar.gz";
+      sha256 = "sha256-KHw+cCwAwlm+5Nwp1o8WONqdi4BBDhFaVVr+7GxQ5uE=";
+      stripRoot = false;
+    };
+    x86_64 = fetchzip {
+      url = "https://android.googlesource.com/toolchain/prebuilts/ndk/r23/+archive/6c5fa4c0d3999b9ee932f6acbd430eb2f31f3151/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/30.tar.gz";
+      sha256 = "sha256-XEd7L3cBzn+1pKfji40V92G/uZhHSMMuZcRZaiKkLnk=";
+      stripRoot = false;
+    };
   };
 
   ndk_support_headers = fetchzip {
@@ -41,6 +66,7 @@ in
 stdenvNoCC.mkDerivation rec {
   pname = "bionic-prebuilt";
   version = "ndk-release-r23";
+  name = "${stdenv.targetPlatform.parsed.cpu.name}-${pname}-${version}";
 
   src = fetchzip {
     url = "https://android.googlesource.com/platform/bionic/+archive/00e8ce1142d8823b0d2fc8a98b40119b0f1f02cd.tar.gz";
diff --git a/nixpkgs/pkgs/os-specific/linux/bluez/default.nix b/nixpkgs/pkgs/os-specific/linux/bluez/default.nix
index ab9b7055fdda..d09ef77fb0d8 100644
--- a/nixpkgs/pkgs/os-specific/linux/bluez/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/bluez/default.nix
@@ -1,6 +1,7 @@
 { stdenv
 , lib
 , fetchurl
+, fetchpatch
 , alsa-lib
 , dbus
 , ell
@@ -11,7 +12,7 @@
 , pkg-config
 , python3
 , readline
-, systemd
+, systemdMinimal
 , udev
 , withExperimental ? false
 }: let
@@ -22,11 +23,11 @@
   ];
 in stdenv.mkDerivation rec {
   pname = "bluez";
-  version = "5.63";
+  version = "5.64";
 
   src = fetchurl {
     url = "mirror://kernel/linux/bluetooth/${pname}-${version}.tar.xz";
-    sha256 = "sha256-k0nhHoFguz1yCDXScSUNinQk02kPUonm22/gfMZsbXY=";
+    sha256 = "sha256-rkN+ZbazBwwZi8WwEJ/pzeueqjhzgOIHL53mX+ih3jQ=";
   };
 
   buildInputs = [
@@ -47,11 +48,22 @@ in stdenv.mkDerivation rec {
     python3.pkgs.wrapPython
   ];
 
-  outputs = [ "out" "dev" ] ++ lib.optional doCheck "test";
+  outputs = [ "out" "dev" "test" ];
+
+  patches = [
+    # https://github.com/bluez/bluez/commit/0905a06410d4a5189f0be81e25eb3c3e8a2199c5
+    # which fixes https://github.com/bluez/bluez/issues/329
+    # and is already merged upstream and not yet in a release.
+    (fetchpatch {
+      name = "StateDirectory_and_ConfigurationDirectory.patch";
+      url = "https://github.com/bluez/bluez/commit/0905a06410d4a5189f0be81e25eb3c3e8a2199c5.patch";
+      sha256 = "sha256-MI6yPTiDLHsSTjLvNqtWnuy2xUMYpSat1WhMbeoedSM=";
+    })
+  ];
 
   postPatch = ''
     substituteInPlace tools/hid2hci.rules \
-      --replace /sbin/udevadm ${systemd}/bin/udevadm \
+      --replace /sbin/udevadm ${systemdMinimal}/bin/udevadm \
       --replace "hid2hci " "$out/lib/udev/hid2hci "
     # Disable some tests:
     # - test-mesh-crypto depends on the following kernel settings:
@@ -95,7 +107,7 @@ in stdenv.mkDerivation rec {
 
   doCheck = stdenv.hostPlatform.isx86_64;
 
-  postInstall = lib.optionalString doCheck ''
+  postInstall = ''
     mkdir -p $test/{bin,test}
     cp -a test $test
     pushd $test/test
@@ -126,6 +138,7 @@ in stdenv.mkDerivation rec {
       filename=$(basename $files)
       install -Dm755 tools/$filename $out/bin/$filename
     done
+    install -Dm755 attrib/gatttool $out/bin/gatttool
   '';
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/os-specific/linux/bolt/default.nix b/nixpkgs/pkgs/os-specific/linux/bolt/default.nix
index dd9436d9b0ea..d424f89fdfb3 100644
--- a/nixpkgs/pkgs/os-specific/linux/bolt/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/bolt/default.nix
@@ -13,7 +13,7 @@
 , libxml2
 , libxslt
 , docbook_xml_dtd_45
-, docbook_xsl
+, docbook-xsl-nons
 , glib
 , systemd
 , polkit
@@ -21,39 +21,33 @@
 
 stdenv.mkDerivation rec {
   pname = "bolt";
-  version = "0.9.1";
+  version = "0.9.2";
 
   src = fetchFromGitLab {
     domain = "gitlab.freedesktop.org";
     owner = "bolt";
     repo = "bolt";
     rev = version;
-    sha256 = "1phgp8fs0dlj74kbkqlvfniwc32daz47b3pvsxlfxqzyrp77xrfm";
+    sha256 = "eXjj7oD5HOW/AG2uxDa0tSleKmbouFd2fwlL2HHFiMA=";
   };
 
   patches = [
     # meson install tries to create /var/lib/boltd
     ./0001-skip-mkdir.patch
 
-    # https://github.com/NixOS/nixpkgs/issues/104429
+    # Test does not work on ZFS with atime disabled.
     # Upstream issue: https://gitlab.freedesktop.org/bolt/bolt/-/issues/167
     (fetchpatch {
-      name = "disable-atime-tests.diff";
-      url = "https://gitlab.freedesktop.org/roberth/bolt/-/commit/1f672a7de2ebc4dd51590bb90f3b873a8ac0f4e6.diff";
-      sha256 = "134f5s6kjqs6612pwq5pm1miy58crn1kxbyyqhzjnzmf9m57fnc8";
-    })
-
-    # Fix tests with newer umockdev
-    (fetchpatch {
-      url = "https://gitlab.freedesktop.org/bolt/bolt/-/commit/130e09d1c7ff02c09e4ad1c9c36e9940b68e58d8.patch";
-      sha256 = "HycuM7z4VvtBuZZLU68tBxGT1YjaqJRS4sKyoTGHZEk=";
+      url = "https://gitlab.freedesktop.org/bolt/bolt/-/commit/c2f1d5c40ad71b20507e02faa11037b395fac2f8.diff";
+      revert = true;
+      sha256 = "6w7ll65W/CydrWAVi/qgzhrQeDv1PWWShulLxoglF+I=";
     })
   ];
 
   nativeBuildInputs = [
     asciidoc
     docbook_xml_dtd_45
-    docbook_xsl
+    docbook-xsl-nons
     libxml2
     libxslt
     meson
diff --git a/nixpkgs/pkgs/os-specific/linux/bpftools/default.nix b/nixpkgs/pkgs/os-specific/linux/bpftools/default.nix
index f2ca8d874714..b4621feeb31f 100644
--- a/nixpkgs/pkgs/os-specific/linux/bpftools/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/bpftools/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv
-, libopcodes, libbfd, libelf, readline
+, libopcodes, libbfd, elfutils, readline
 , linuxPackages_latest, zlib
 , python3, bison, flex
 }:
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   inherit (linuxPackages_latest.kernel) version src;
 
   nativeBuildInputs = [ python3 bison flex ];
-  buildInputs = [ libopcodes libbfd libelf zlib readline ];
+  buildInputs = [ libopcodes libbfd elfutils zlib readline ];
 
   preConfigure = ''
     patchShebangs scripts/bpf_doc.py
diff --git a/nixpkgs/pkgs/os-specific/linux/bpftrace/btf-dump-new-0.6.0.patch b/nixpkgs/pkgs/os-specific/linux/bpftrace/btf-dump-new-0.6.0.patch
deleted file mode 100644
index b5037192203c..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/bpftrace/btf-dump-new-0.6.0.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -ur source/src/btf.cpp new/src/btf.cpp
---- source/src/btf.cpp	1970-01-01 09:00:01.000000000 +0900
-+++ new/src/btf.cpp	2021-12-04 21:46:59.337023489 +0900
-@@ -225,7 +225,7 @@
-   char err_buf[256];
-   int err;
- 
--  dump = btf_dump__new(btf, nullptr, &opts, dump_printf);
-+  dump = btf_dump__new_deprecated(btf, nullptr, &opts, dump_printf);
-   err = libbpf_get_error(dump);
-   if (err)
-   {
-@@ -496,7 +496,7 @@
-   char err_buf[256];
-   int err;
- 
--  dump = btf_dump__new(btf, nullptr, &opts, dump_printf);
-+  dump = btf_dump__new_deprecated(btf, nullptr, &opts, dump_printf);
-   err = libbpf_get_error(dump);
-   if (err)
-   {
-@@ -554,7 +554,7 @@
-   char err_buf[256];
-   int err;
- 
--  dump = btf_dump__new(btf, nullptr, &opts, dump_printf);
-+  dump = btf_dump__new_deprecated(btf, nullptr, &opts, dump_printf);
-   err = libbpf_get_error(dump);
-   if (err)
-   {
-@@ -648,7 +648,7 @@
-   char err_buf[256];
-   int err;
- 
--  dump = btf_dump__new(btf, nullptr, &opts, dump_printf);
-+  dump = btf_dump__new_deprecated(btf, nullptr, &opts, dump_printf);
-   err = libbpf_get_error(dump);
-   if (err)
-   {
diff --git a/nixpkgs/pkgs/os-specific/linux/bpftrace/default.nix b/nixpkgs/pkgs/os-specific/linux/bpftrace/default.nix
index abf8fb63bc35..6cc9e40bdbf7 100644
--- a/nixpkgs/pkgs/os-specific/linux/bpftrace/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/bpftrace/default.nix
@@ -1,35 +1,49 @@
 { lib, stdenv, fetchFromGitHub
 , cmake, pkg-config, flex, bison
 , llvmPackages, elfutils
-, libelf, libbfd, libbpf, libopcodes, bcc
+, libbfd, libbpf, libopcodes, bcc
 , cereal, asciidoctor
 , nixosTests
+, util-linux
 }:
 
 stdenv.mkDerivation rec {
   pname = "bpftrace";
-  version = "0.14.1";
+  version = "0.15.0";
+
+  # Cherry-picked from merged PR, remove this hook on next update
+  # https://github.com/iovisor/bpftrace/pull/2242
+  # Cannot `fetchpatch` such pure renaming diff since
+  # https://github.com/iovisor/bpftrace/commit/2df807dbae4037aa8bf0afc03f52fb3f6321c62a.patch
+  # does not contain any diff in unified format but just this instead:
+  #   ...
+  #   man/man8/{bashreadline.8 => bashreadline.bt.8}     | 0
+  #   ...
+  #   35 files changed, 0 insertions(+), 0 deletions(-)
+  #   rename man/man8/{bashreadline.8 => bashreadline.bt.8} (100%)
+  #   ...
+  # on witch `fetchpatch` fails with
+  #   error: Normalized patch '/build/patch' is empty (while the fetched file was not)!
+  #   Did you maybe fetch a HTML representation of a patch instead of a raw patch?
+  postUnpack = ''
+    rename .8 .bt.8 "$sourceRoot"/man/man8/*.8
+  '';
 
   src = fetchFromGitHub {
     owner  = "iovisor";
     repo   = "bpftrace";
     rev    = "v${version}";
-    sha256 = "sha256-QDqHAEVM/XHCFMS0jMLdKJfDUOpkUqONOf8+Fbd5dCY=";
+    sha256 = "sha256-9adZAKSn00W2yNwVDbVB1/O5Y+10c4EkVJGCHyd4Tgg=";
   };
 
-  # libbpf 0.6.0 relies on typeof in bpf/btf.h to pick the right version of
-  # btf_dump__new() but that's not valid c++.
-  # see https://github.com/iovisor/bpftrace/issues/2068
-  patches = [ ./btf-dump-new-0.6.0.patch ];
-
   buildInputs = with llvmPackages;
     [ llvm libclang
-      elfutils libelf bcc
+      elfutils bcc
       libbpf libbfd libopcodes
       cereal asciidoctor
     ];
 
-  nativeBuildInputs = [ cmake pkg-config flex bison llvmPackages.llvm.dev ];
+  nativeBuildInputs = [ cmake pkg-config flex bison llvmPackages.llvm.dev util-linux ];
 
   # tests aren't built, due to gtest shenanigans. see:
   #
@@ -43,8 +57,18 @@ stdenv.mkDerivation rec {
 
   # nuke the example/reference output .txt files, for the included tools,
   # stuffed inside $out. we don't need them at all.
+  # (see "Allow skipping examples" for a potential option
+  #  https://github.com/iovisor/bpftrace/pull/2256)
+  #
+  # Pull BPF scripts into $PATH (next to their bcc program equivalents), but do
+  # not move them to keep `${pkgs.bpftrace}/share/bpftrace/tools/...` working.
+  # (remove `chmod` once a new release "Add executable permission to tools"
+  #  https://github.com/iovisor/bpftrace/commit/77e524e6d276216ed6a6e1984cf204418db07c78)
   postInstall = ''
     rm -rf $out/share/bpftrace/tools/doc
+
+    ln -s $out/share/bpftrace/tools/*.bt $out/bin/
+    chmod +x $out/bin/*.bt
   '';
 
   outputs = [ "out" "man" ];
diff --git a/nixpkgs/pkgs/os-specific/linux/broadcom-sta/default.nix b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/default.nix
index 5d86c2311f1f..d7acf94e39a1 100644
--- a/nixpkgs/pkgs/os-specific/linux/broadcom-sta/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/default.nix
@@ -39,6 +39,11 @@ stdenv.mkDerivation {
     ./linux-5.6.patch
     # source: https://gist.github.com/joanbm/5c640ac074d27fd1d82c74a5b67a1290
     ./linux-5.9.patch
+    # source: https://github.com/archlinux/svntogit-community/blob/33b4bd2b9e30679b03f5d7aa2741911d914dcf94/trunk/012-linux517.patch
+    ./linux-5.17.patch
+    # source: https://github.com/archlinux/svntogit-community/blob/2e1fd240f9ce06f500feeaa3e4a9675e65e6b967/trunk/013-linux518.patch
+    ./linux-5.18.patch
+    ./pedantic-fix.patch
     ./null-pointer-fix.patch
     ./gcc.patch
   ];
diff --git a/nixpkgs/pkgs/os-specific/linux/broadcom-sta/i686-build-failure.patch b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/i686-build-failure.patch
index cfa16075409b..9bb093ca49c5 100644
--- a/nixpkgs/pkgs/os-specific/linux/broadcom-sta/i686-build-failure.patch
+++ b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/i686-build-failure.patch
@@ -1,5 +1,5 @@
-https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=fe47ae6e1a5005b2e82f7eab57b5c3820453293a
-https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=4ea1636b04dbd66536fa387bae2eea463efc705b
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=fe47ae6e1a5005b2e82f7eab57b5c3820453293a
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=4ea1636b04dbd66536fa387bae2eea463efc705b
 
 diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c
 --- a/src/shared/linux_osl.c	2015-09-19 01:47:15.000000000 +0300
diff --git a/nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-4.7.patch b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-4.7.patch
index 566680a09140..44222b3324bf 100644
--- a/nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-4.7.patch
+++ b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-4.7.patch
@@ -2,12 +2,12 @@ Since Linux 4.7, the enum ieee80211_band is no longer used
 
 This shall cause no problem's since both enums ieee80211_band
 and nl80211_band were added in the same commit:
-https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c
 
 This patch refactors the references of IEEE80211_BAND_* to NL80211_BAND_*
 
 Reference:
-https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3
 
 --- a/src/wl/sys/wl_cfg80211_hybrid.c	2016-06-13 11:57:36.159340297 -0500
 +++ b/src/wl/sys/wl_cfg80211_hybrid.c	2016-06-13 11:58:18.442323435 -0500
diff --git a/nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-5.17.patch b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-5.17.patch
new file mode 100644
index 000000000000..6f23316691c8
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-5.17.patch
@@ -0,0 +1,80 @@
+From 31b7849092c43805c7fbaf7518b99874aa1b310c Mon Sep 17 00:00:00 2001
+From: Joan Bruguera <joanbrugueram@gmail.com>
+Date: Wed, 12 Jan 2022 20:49:20 +0100
+Subject: [PATCH] Tentative fix for broadcom-wl 6.30.223.271 driver for Linux 5.17-rc1
+
+Set netdev->dev_addr through dev_addr_mod + PDE_DATA fix
+
+Since Linux 5.17 netdev->dev_addr is const and must be changed through
+dev_addr_mod, otherwise a warning is logged in dmesg and bad things may happen.
+
+NB: The #if is not wrong, dev_addr_mod is defined since Linux 5.15-rc1
+
+Plus a trivial fix for PDE_DATA.
+
+Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-28 on Arch Linux.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=adeef3e32146a8d2a73c399dc6f5d76a449131b1
+          https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=359745d78351c6f5442435f81549f0207ece28aa
+---
+ src/wl/sys/wl_linux.c | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
+index e491df7..e4614fb 100644
+--- a/src/wl/sys/wl_linux.c
++++ b/src/wl/sys/wl_linux.c
+@@ -93,6 +93,10 @@ struct iw_statistics *wl_get_wireless_stats(struct net_device *dev);
+ 
+ #include <wlc_wowl.h>
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
++#define PDE_DATA pde_data
++#endif
++
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+ static void wl_timer(struct timer_list *tl);
+ #else
+@@ -490,6 +494,12 @@ wl_if_setup(struct net_device *dev)
+ #endif
+ }
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
++static inline void eth_hw_addr_set(struct net_device *dev, const void *addr) {
++	memcpy(dev->dev_addr, addr, ETHER_ADDR_LEN);
++}
++#endif
++
+ static wl_info_t *
+ wl_attach(uint16 vendor, uint16 device, ulong regs,
+ 	uint bustype, void *btparam, uint irq, uchar* bar1_addr, uint32 bar1_size)
+@@ -634,7 +644,7 @@ wl_attach(uint16 vendor, uint16 device, ulong regs,
+ 			WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit));
+ 	}
+ #endif 
+-	bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->pub->cur_etheraddr.octet);
+ 
+ 	online_cpus = 1;
+ 
+@@ -1835,7 +1845,7 @@ wl_set_mac_address(struct net_device *dev, void *addr)
+ 
+ 	WL_LOCK(wl);
+ 
+-	bcopy(sa->sa_data, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, sa->sa_data);
+ 	err = wlc_iovar_op(wl->wlc, "cur_etheraddr", NULL, 0, sa->sa_data, ETHER_ADDR_LEN,
+ 		IOV_SET, (WL_DEV_IF(dev))->wlcif);
+ 	WL_UNLOCK(wl);
+@@ -3010,7 +3020,7 @@ _wl_add_monitor_if(wl_task_t *task)
+ 	else
+ 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
+ 
+-	bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->dev->dev_addr);
+ 
+ #if defined(WL_USE_NETDEV_OPS)
+ 	dev->netdev_ops = &wl_netdev_monitor_ops;
+-- 
+2.35.1
+
diff --git a/nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-5.18.patch b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-5.18.patch
new file mode 100644
index 000000000000..d837429a6899
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/linux-5.18.patch
@@ -0,0 +1,71 @@
+diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
+--- a/src/shared/linux_osl.c	2022-05-24 20:51:15.662604980 +0000
++++ b/src/shared/linux_osl.c	2022-05-24 21:13:38.264472425 +0000
+@@ -599,6 +599,8 @@
+ 	va = kmalloc(size, GFP_ATOMIC | __GFP_ZERO);
+ 	if (va)
+ 		*pap = (ulong)__virt_to_phys(va);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
++	va = dma_alloc_coherent(&((struct pci_dev *)osh->pdev)->dev, size, (dma_addr_t*)pap, GFP_ATOMIC);
+ #else
+ 	va = pci_alloc_consistent(osh->pdev, size, (dma_addr_t*)pap);
+ #endif
+@@ -612,6 +614,8 @@
+ 
+ #ifdef __ARM_ARCH_7A__
+ 	kfree(va);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
++	dma_free_coherent(&((struct pci_dev *)osh->pdev)->dev, size, va, (dma_addr_t)pa);
+ #else
+ 	pci_free_consistent(osh->pdev, size, va, (dma_addr_t)pa);
+ #endif
+@@ -623,7 +627,11 @@
+ 	int dir;
+ 
+ 	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
++	dir = (direction == DMA_TX)? DMA_TO_DEVICE: DMA_FROM_DEVICE;
++#else
+ 	dir = (direction == DMA_TX)? PCI_DMA_TODEVICE: PCI_DMA_FROMDEVICE;
++#endif
+ 
+ #if defined(__ARM_ARCH_7A__) && defined(BCMDMASGLISTOSL)
+ 	if (dmah != NULL) {
+@@ -641,7 +649,11 @@
+ 				ASSERT(totsegs + nsegs <= MAX_DMA_SEGS);
+ 				sg->page_link = 0;
+ 				sg_set_buf(sg, PKTDATA(osh, skb), PKTLEN(osh, skb));
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
++				dma_map_single(&((struct pci_dev *)osh->pdev)->dev, PKTDATA(osh, skb), PKTLEN(osh, skb), dir);
++#else
+ 				pci_map_single(osh->pdev, PKTDATA(osh, skb), PKTLEN(osh, skb), dir);
++#endif
+ 			}
+ 			totsegs += nsegs;
+ 			totlen += PKTLEN(osh, skb);
+@@ -656,7 +668,11 @@
+ 	}
+ #endif 
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
++	return (dma_map_single(&((struct pci_dev *)osh->pdev)->dev, va, size, dir));
++#else
+ 	return (pci_map_single(osh->pdev, va, size, dir));
++#endif
+ }
+ 
+ void BCMFASTPATH
+@@ -665,8 +681,13 @@
+ 	int dir;
+ 
+ 	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
++	dir = (direction == DMA_TX)? DMA_TO_DEVICE: DMA_FROM_DEVICE;
++	dma_unmap_single(&((struct pci_dev *)osh->pdev)->dev, (uint32)pa, size, dir);
++#else
+ 	dir = (direction == DMA_TX)? PCI_DMA_TODEVICE: PCI_DMA_FROMDEVICE;
+ 	pci_unmap_single(osh->pdev, (uint32)pa, size, dir);
++#endif
+ }
+ 
+ #if defined(BCMDBG_ASSERT)
diff --git a/nixpkgs/pkgs/os-specific/linux/broadcom-sta/pedantic-fix.patch b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/pedantic-fix.patch
new file mode 100644
index 000000000000..f97709fef904
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/broadcom-sta/pedantic-fix.patch
@@ -0,0 +1,94 @@
+diff --git a/src/shared/linux_osl.c b/shared/linux_osl.c
+index 711b771..5a2636a 100644
+--- a/src/shared/linux_osl.c
++++ b/src/shared/linux_osl.c
+@@ -1105,7 +1105,7 @@ osl_os_get_image_block(char *buf, int len, void *image)
+ 	if (!image)
+ 		return 0;
+ 
+-	rdlen = kernel_read(fp, fp->f_pos, buf, len);
++	rdlen = kernel_read(fp, (void *)fp->f_pos, (size_t)len, (loff_t *)buf);
+ 	if (rdlen > 0)
+ 		fp->f_pos += rdlen;
+ 
+diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/wl/sys/wl_cfg80211_hybrid.c
+index 41c16d8..d39d9de 100644
+--- a/src/wl/sys/wl_cfg80211_hybrid.c
++++ b/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -790,6 +790,7 @@ wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
+ 		break;
+ 	case NL80211_AUTHTYPE_NETWORK_EAP:
+ 		WL_DBG(("network eap\n"));
++		break;
+ 	default:
+ 		val = 2;
+ 		WL_ERR(("invalid auth type (%d)\n", sme->auth_type));
+@@ -2347,21 +2348,20 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev,
+                     const wl_event_msg_t *e, void *data)
+ {
+ 	struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl);
++	s32 err = 0;
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+ 	struct cfg80211_bss *bss;
+ 	struct wlc_ssid *ssid;
++	struct cfg80211_roam_info roam_info;
+ 	ssid = &wl->profile->ssid;
+ 	bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid,
+ 	ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
+-	struct cfg80211_roam_info roam_info = {
+-		.bss = bss,
+-		.req_ie = conn_info->req_ie,
+-		.req_ie_len = conn_info->req_ie_len,
+-		.resp_ie = conn_info->resp_ie,
+-		.resp_ie_len = conn_info->resp_ie_len,
+-	};
++	roam_info.bss = bss;
++	roam_info.req_ie = conn_info->req_ie;
++	roam_info.req_ie_len = conn_info->req_ie_len;
++	roam_info.resp_ie = conn_info->resp_ie;
++	roam_info.resp_ie_len = conn_info->resp_ie_len;
+ #endif
+-	s32 err = 0;
+ 
+ 	wl_get_assoc_ies(wl);
+ 	memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN);
+diff --git a/src/wl/sys/wl_iw.h b/wl/sys/wl_iw.h
+index 3ab084f..471d11f 100644
+--- a/src/wl/sys/wl_iw.h
++++ b/src/wl/sys/wl_iw.h
+@@ -70,7 +70,6 @@ struct cntry_locales_custom {
+ #define	WL_IW_RSSI_EXCELLENT	-57	
+ #define	WL_IW_RSSI_INVALID	 0	
+ #define MAX_WX_STRING 80
+-#define isprint(c) bcm_isprint(c)
+ #define WL_IW_SET_ACTIVE_SCAN	(SIOCIWFIRSTPRIV+1)
+ #define WL_IW_GET_RSSI			(SIOCIWFIRSTPRIV+3)
+ #define WL_IW_SET_PASSIVE_SCAN	(SIOCIWFIRSTPRIV+5)
+diff --git a/src/wl/sys/wl_linux.c b/wl/sys/wl_linux.c
+index d13fb98..97ae2a6 100644
+--- a/src/wl/sys/wl_linux.c
++++ b/src/wl/sys/wl_linux.c
+@@ -797,14 +797,15 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+ 	pci_read_config_dword(pdev, 0x40, &val);
+ 	if ((val & 0x0000ff00) != 0)
+ 		pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
+-		bar1_size = pci_resource_len(pdev, 2);
+-		#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
+-		bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2),
+-			bar1_size);
+-		#else
+-		bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
+-			bar1_size);
+-		#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */
++
++	bar1_size = pci_resource_len(pdev, 2);
++	#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++	bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2),
++		bar1_size);
++	#else
++	bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
++		bar1_size);
++	#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */
+ 	wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev,
+ 		pdev->irq, bar1_addr, bar1_size);
+ 
diff --git a/nixpkgs/pkgs/os-specific/linux/busybox/default.nix b/nixpkgs/pkgs/os-specific/linux/busybox/default.nix
index 7aaedb5b1acd..3feb590eb5d6 100644
--- a/nixpkgs/pkgs/os-specific/linux/busybox/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/busybox/default.nix
@@ -50,14 +50,14 @@ in
 
 stdenv.mkDerivation rec {
   pname = "busybox";
-  version = "1.34.1";
+  version = "1.35.0";
 
   # Note to whoever is updating busybox: please verify that:
   # nix-build pkgs/stdenv/linux/make-bootstrap-tools.nix -A test
   # still builds after the update.
   src = fetchurl {
     url = "https://busybox.net/downloads/${pname}-${version}.tar.bz2";
-    sha256 = "0jfm9fik7nv4w21zqdg830pddgkdjmplmna9yjn9ck1lwn4vsps1";
+    sha256 = "sha256-+u6yRMNaNIozT0pZ5EYm7ocPsHtohNaMEK6LwZ+DppQ=";
   };
 
   hardeningDisable = [ "format" "pie" ]
@@ -65,6 +65,21 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./busybox-in-store.patch
+    (fetchurl {
+      name = "CVE-2022-28391.patch";
+      url = "https://git.alpinelinux.org/aports/plain/main/busybox/0001-libbb-sockaddr2str-ensure-only-printable-characters-.patch?id=ed92963eb55bbc8d938097b9ccb3e221a94653f4";
+      sha256 = "sha256-yviw1GV+t9tbHbY7YNxEqPi7xEreiXVqbeRyf8c6Awo=";
+    })
+    (fetchurl {
+      name = "CVE-2022-28391.patch";
+      url = "https://git.alpinelinux.org/aports/plain/main/busybox/0002-nslookup-sanitize-all-printed-strings-with-printable.patch?id=ed92963eb55bbc8d938097b9ccb3e221a94653f4";
+      sha256 = "sha256-vl1wPbsHtXY9naajjnTicQ7Uj3N+EQ8pRNnrdsiow+w=";
+    })
+    (fetchurl {
+      name = "CVE-2022-30065.patch";
+      url = "https://git.alpinelinux.org/aports/plain/main/busybox/CVE-2022-30065.patch?id=4ffd996b3f8298c7dd424b912c245864c816e354";
+      sha256 = "sha256-+WSYxI6eF8S0tya/S62f9Nc6jVMnHO0q1OyM69GlNTY=";
+    })
   ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./clang-cross.patch;
 
   separateDebugInfo = true;
diff --git a/nixpkgs/pkgs/os-specific/linux/can-isotp/default.nix b/nixpkgs/pkgs/os-specific/linux/can-isotp/default.nix
index 73edb3be9ec3..7c20b74e54cb 100644
--- a/nixpkgs/pkgs/os-specific/linux/can-isotp/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/can-isotp/default.nix
@@ -24,6 +24,7 @@ stdenv.mkDerivation {
   nativeBuildInputs = kernel.moduleBuildDependencies;
 
   meta = with lib; {
+    broken = kernel.kernelAtLeast "5.16";
     description = "Kernel module for ISO-TP (ISO 15765-2)";
     homepage = "https://github.com/hartkopp/can-isotp";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/os-specific/linux/cfs-zen-tweaks/default.nix b/nixpkgs/pkgs/os-specific/linux/cfs-zen-tweaks/default.nix
new file mode 100644
index 000000000000..a894e0bd4b69
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/cfs-zen-tweaks/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, makeWrapper
+, gawk
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cfs-zen-tweaks";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "igo95862";
+    repo = "cfs-zen-tweaks";
+    rev = version;
+    sha256 = "HRR2tdjNmWyrpbcMlihSdb/7g/tHma3YyXogQpRCVyo=";
+  };
+
+  postPatch = ''
+    patchShebangs set-cfs-zen-tweaks.bash
+    chmod +x set-cfs-zen-tweaks.bash
+    substituteInPlace set-cfs-zen-tweaks.bash \
+      --replace '$(gawk' '$(${gawk}/bin/gawk'
+  '';
+
+  buildInputs = [
+    gawk
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    makeWrapper
+  ];
+
+  meta = with lib; {
+    description = "Tweak Linux CPU scheduler for desktop responsiveness";
+    homepage = "https://github.com/igo95862/cfs-zen-tweaks";
+    license = licenses.gpl2Only;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ mkg20001 ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/checksec/default.nix b/nixpkgs/pkgs/os-specific/linux/checksec/default.nix
index fada305c3720..1bdd4cf5f677 100644
--- a/nixpkgs/pkgs/os-specific/linux/checksec/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/checksec/default.nix
@@ -1,39 +1,59 @@
-{ lib, stdenv, fetchFromGitHub, makeWrapper, file, findutils
-, binutils-unwrapped, glibc, coreutils, sysctl, openssl
+{ lib
+, stdenv
+, fetchFromGitHub
+, makeWrapper
+, file
+, findutils
+, binutils-unwrapped
+, glibc
+, coreutils
+, sysctl
+, openssl
 }:
 
 stdenv.mkDerivation rec {
   pname = "checksec";
-  version = "2.5.0";
+  version = "2.6.0";
 
   src = fetchFromGitHub {
     owner = "slimm609";
     repo = "checksec.sh";
     rev = version;
-    sha256 = "sha256-GxWXocz+GCEssRrIQP6E9hjVIhVh2EmZrefELxQlV1Q=";
+    hash = "sha256-BWtchWXukIDSLJkFX8M/NZBvfi7vUE2j4yFfS0KEZDo=";
   };
 
-  patches = [ ./0001-attempt-to-modprobe-config-before-checking-kernel.patch ];
-  nativeBuildInputs = [ makeWrapper ];
+  patches = [
+    ./0001-attempt-to-modprobe-config-before-checking-kernel.patch
+  ];
 
-  installPhase = let
-    path = lib.makeBinPath [
-      findutils file binutils-unwrapped sysctl openssl
-    ];
-  in ''
-    mkdir -p $out/bin
-    install checksec $out/bin
-    substituteInPlace $out/bin/checksec --replace /lib/libc.so.6 ${glibc.out}/lib/libc.so.6
-    substituteInPlace $out/bin/checksec --replace "/usr/bin/id -" "${coreutils}/bin/id -"
-    wrapProgram $out/bin/checksec \
-      --prefix PATH : ${path}
-  '';
+  nativeBuildInputs = [
+    makeWrapper
+  ];
+
+  installPhase =
+    let
+      path = lib.makeBinPath [
+        findutils
+        file
+        binutils-unwrapped
+        sysctl
+        openssl
+      ];
+    in
+    ''
+      mkdir -p $out/bin
+      install checksec $out/bin
+      substituteInPlace $out/bin/checksec --replace /lib/libc.so.6 ${glibc.out}/lib/libc.so.6
+      substituteInPlace $out/bin/checksec --replace "/usr/bin/id -" "${coreutils}/bin/id -"
+      wrapProgram $out/bin/checksec \
+        --prefix PATH : ${path}
+    '';
 
   meta = with lib; {
-    description = "A tool for checking security bits on executables";
-    homepage    = "https://www.trapkit.de/tools/checksec/";
-    license     = licenses.bsd3;
-    platforms   = platforms.linux;
+    description = "Tool for checking security bits on executables";
+    homepage = "https://www.trapkit.de/tools/checksec/";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
     maintainers = with maintainers; [ thoughtpolice globin ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/cifs-utils/default.nix b/nixpkgs/pkgs/os-specific/linux/cifs-utils/default.nix
index d6dcf702110d..ba790f2eaca4 100644
--- a/nixpkgs/pkgs/os-specific/linux/cifs-utils/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/cifs-utils/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   pname = "cifs-utils";
-  version = "6.14";
+  version = "6.15";
 
   src = fetchurl {
     url = "mirror://samba/pub/linux-cifs/cifs-utils/${pname}-${version}.tar.bz2";
-    sha256 = "sha256-ZgnoB0tUISlf8BKjHwLM2aBYQVxhnIE2Lrt4jb8HVrg=";
+    sha256 = "sha256-p7aUDpMlDBZ2pvpmturZG3jNQ6X+6ZzEYkWci5zx5vQ=";
   };
 
   nativeBuildInputs = [ autoreconfHook docutils pkg-config ];
diff --git a/nixpkgs/pkgs/os-specific/linux/conky/default.nix b/nixpkgs/pkgs/os-specific/linux/conky/default.nix
index 9bd8890e7134..87f5bb052f48 100644
--- a/nixpkgs/pkgs/os-specific/linux/conky/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/conky/default.nix
@@ -1,7 +1,7 @@
 { config, lib, stdenv, fetchFromGitHub, pkg-config, cmake
 
 # dependencies
-, glib, libXinerama
+, glib, libXinerama, catch2
 
 # optional features without extra dependencies
 , mpdSupport          ? true
@@ -85,6 +85,8 @@ stdenv.mkDerivation rec {
     sed -i 's/ Example: .*$//' doc/config_settings.xml
 
     substituteInPlace cmake/Conky.cmake --replace "# set(RELEASE true)" "set(RELEASE true)"
+
+    cp ${catch2}/include/catch2/catch.hpp tests/catch2/catch.hpp
   '';
 
   NIX_LDFLAGS = "-lgcc_s";
@@ -133,6 +135,8 @@ stdenv.mkDerivation rec {
   # src/conky.cc:137:23: fatal error: defconfig.h: No such file or directory
   enableParallelBuilding = false;
 
+  doCheck = true;
+
   meta = with lib; {
     homepage = "http://conky.sourceforge.net/";
     description = "Advanced, highly configurable system monitor based on torsmo";
diff --git a/nixpkgs/pkgs/os-specific/linux/conspy/default.nix b/nixpkgs/pkgs/os-specific/linux/conspy/default.nix
index 12e7f798e79e..00e97855e261 100644
--- a/nixpkgs/pkgs/os-specific/linux/conspy/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/conspy/default.nix
@@ -10,9 +10,8 @@ stdenv.mkDerivation rec {
     curlOpts = " -A application/octet-stream ";
   };
 
+  nativeBuildInputs = [ autoconf automake ];
   buildInputs = [
-    autoconf
-    automake
     ncurses
   ];
 
diff --git a/nixpkgs/pkgs/os-specific/linux/cpuid/default.nix b/nixpkgs/pkgs/os-specific/linux/cpuid/default.nix
index b0d1967d10c2..abe6f44f31a9 100644
--- a/nixpkgs/pkgs/os-specific/linux/cpuid/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/cpuid/default.nix
@@ -6,11 +6,11 @@
 
 stdenv.mkDerivation rec {
   pname = "cpuid";
-  version = "20220224";
+  version = "20220812";
 
   src = fetchurl {
     url = "http://etallen.com/cpuid/${pname}-${version}.src.tar.gz";
-    sha256 = "sha256-ShneKhGK7kT4Vs0b7PpaGSV0tZV3lTcqhuN9yiTaH50=";
+    sha256 = "sha256-O/aPuX2UcU+QdjzK2BDfjcX3/pwfmjZSQ2SR/XVBWr8=";
   };
 
   # For pod2man during the build process.
diff --git a/nixpkgs/pkgs/os-specific/linux/cpupower-gui/default.nix b/nixpkgs/pkgs/os-specific/linux/cpupower-gui/default.nix
index 2fcc55e14cb3..1f57bc9428f0 100644
--- a/nixpkgs/pkgs/os-specific/linux/cpupower-gui/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/cpupower-gui/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, fetchpatch
 , buildPythonApplication
 , appstream-glib
 , dbus-python
@@ -35,6 +36,15 @@ buildPythonApplication rec {
     sha256 = "05lvpi3wgyi741sd8lgcslj8i7yi3wz7jwl7ca3y539y50hwrdas";
   };
 
+  patches = [
+    # Fix build with 0.61, can be removed on next update
+    # https://hydra.nixos.org/build/171052557/nixlog/1
+    (fetchpatch {
+      url = "https://github.com/vagnum08/cpupower-gui/commit/97f8ac02fe33e412b59d3f3968c16a217753e74b.patch";
+      sha256 = "XYnpm03kq8JLMjAT73BMCJWlzz40IAuHESm715VV6G0=";
+    })
+  ];
+
   nativeBuildInputs = [
     appstream-glib
     desktop-file-utils # needed for update-desktop-database
diff --git a/nixpkgs/pkgs/os-specific/linux/criu/default.nix b/nixpkgs/pkgs/os-specific/linux/criu/default.nix
index af7726458248..5475a565b09b 100644
--- a/nixpkgs/pkgs/os-specific/linux/criu/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/criu/default.nix
@@ -1,20 +1,30 @@
-{ stdenv, lib, fetchurl, protobuf, protobufc, asciidoc, iptables
-, xmlto, docbook_xsl, libpaper, libnl, libcap, libnet, pkg-config
-, which, python3, makeWrapper, docbook_xml_dtd_45, perl }:
+{ stdenv, lib, fetchFromGitHub, fetchpatch, protobuf, protobufc, asciidoc, iptables
+, xmlto, docbook_xsl, libpaper, libnl, libcap, libnet, pkg-config, iproute2
+, which, python3, makeWrapper, docbook_xml_dtd_45, perl, nftables, libbsd }:
 
 stdenv.mkDerivation rec {
   pname = "criu";
-  version = "3.15";
+  version = "3.17.1";
 
-  src = fetchurl {
-    url    = "https://download.openvz.org/criu/${pname}-${version}.tar.bz2";
-    sha256 = "09d0j24x0cyc7wkgi7cnxqgfjk7kbdlm79zxpj8d356sa3rw2z24";
+  src = fetchFromGitHub {
+    owner = "checkpoint-restore";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-0B0cdX5bemy4glF9iWjrQIXIqilyYcCcAN9x4Jjrwzk=";
   };
 
+  patches = [
+    # Fixes redefinition of rseq headers
+    (fetchpatch {
+      url = "https://github.com/checkpoint-restore/criu/commit/1e6e826ffb7ac05f33fa123051c2fc2ddf0f68ea.patch";
+      hash = "sha256-LJjk0jQ5v5wqeprvBMpxhjLXn7v+lSPldEGgazGUM44=";
+    })
+  ];
+
   enableParallelBuilding = true;
   nativeBuildInputs = [ pkg-config docbook_xsl which makeWrapper docbook_xml_dtd_45 python3 python3.pkgs.wrapPython perl ];
-  buildInputs = [ protobuf protobufc asciidoc xmlto libpaper libnl libcap libnet iptables ];
-  propagatedBuildInputs = with python3.pkgs; [ python python3.pkgs.protobuf ];
+  buildInputs = [ protobuf asciidoc xmlto libpaper libnl libcap libnet nftables libbsd ];
+  propagatedBuildInputs = [ protobufc ] ++ (with python3.pkgs; [ python python3.pkgs.protobuf ]);
 
   postPatch = ''
     substituteInPlace ./Documentation/Makefile \
@@ -39,7 +49,8 @@ stdenv.mkDerivation rec {
 
   postFixup = ''
     wrapProgram $out/bin/criu \
-      --prefix PATH : ${lib.makeBinPath [ iptables ]}
+      --set-default CR_IPTABLES ${iptables}/bin/iptables \
+      --set-default CR_IP_TOOL ${iproute2}/bin/ip
     wrapPythonPrograms
   '';
 
diff --git a/nixpkgs/pkgs/os-specific/linux/cryptsetup/default.nix b/nixpkgs/pkgs/os-specific/linux/cryptsetup/default.nix
index a9bd508d16ec..be819802394e 100644
--- a/nixpkgs/pkgs/os-specific/linux/cryptsetup/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/cryptsetup/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
   pname = "cryptsetup";
   version = "2.4.3";
 
-  outputs = [ "out" "dev" "man" ];
+  outputs = [ "bin" "out" "dev" "man" ];
   separateDebugInfo = true;
 
   src = fetchurl {
@@ -31,6 +31,12 @@ stdenv.mkDerivation rec {
     "--enable-cryptsetup-reencrypt"
     "--with-crypto_backend=openssl"
     "--disable-ssh-token"
+  ] ++ lib.optionals stdenv.hostPlatform.isStatic [
+    "--disable-external-tokens"
+    # We have to override this even though we're removing token
+    # support, because the path still gets included in the binary even
+    # though it isn't used.
+    "--with-luks2-external-tokens-path=/"
   ];
 
   nativeBuildInputs = [ pkg-config ];
diff --git a/nixpkgs/pkgs/os-specific/linux/cshatag/default.nix b/nixpkgs/pkgs/os-specific/linux/cshatag/default.nix
index bc1b7f7ecf54..dc210b017a68 100644
--- a/nixpkgs/pkgs/os-specific/linux/cshatag/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/cshatag/default.nix
@@ -1,25 +1,23 @@
-{ lib, buildGoPackage, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub }:
 
-buildGoPackage rec {
+buildGoModule rec {
   pname = "cshatag";
-  version = "2019-12-03";
-
-  goPackagePath = "github.com/rfjakob/cshatag";
-  goDeps = ./deps.nix;
+  version = "2.0";
 
   src = fetchFromGitHub {
     owner = "rfjakob";
     repo = pname;
-    rev = "b169f0a9dd35a7381774eb176d4badf64d403560";
-    sha256 = "16kam3w75avh8khkk6jfdnxwggz2pw6ccv6v7d064j0fbb9y8x0v";
+    rev = "v${version}";
+    sha256 = "sha256-jSRMNLS+JnA3coZf9zkOL/buxZubhbftXnxDJx0nwuU=";
   };
 
-  makeFlags = [ "PREFIX=$(out)" "GITVERSION=${version}" ];
+  vendorSha256 = "sha256-BX7jbYhs3+yeOUvPvz08aV2p14bXNGTag4QYkCHr5DQ=";
+
+  ldflags = [ "-s" "-w" ];
 
   postInstall = ''
     # Install man page
-    cd go/src/${goPackagePath}
-    make install $makeFlags
+    install -D -m755 -t $out/share/man/man1/ cshatag.1
   '';
 
   meta = with lib; {
@@ -28,5 +26,4 @@ buildGoPackage rec {
     license = licenses.mit;
     platforms = platforms.linux;
   };
-
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/cshatag/deps.nix b/nixpkgs/pkgs/os-specific/linux/cshatag/deps.nix
deleted file mode 100644
index 6daad9856782..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/cshatag/deps.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-# This file was generated by https://github.com/kamilchm/go2nix v1.3.0
-[
-  {
-    goPackagePath = "github.com/pkg/xattr";
-    fetch = {
-      type = "git";
-      url = "https://github.com/pkg/xattr";
-      rev = "d304131d5e58ca76d8b31ceefbb0c85c7b2d2a36";
-      sha256 = "0bxskiai283zfra13z5f7q7f77zz2cgswaj6l6jr2nwnc3l5m80i";
-    };
-  }
-  {
-    goPackagePath = "golang.org/x/sys";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/sys";
-      rev = "201ba4db2418b54b698efb4d8082dcb504617cdb";
-      sha256 = "1cqaiwp19kl38g4d6brfhi32822rhnh2q8x1j0i6yg7a8dzfvbz6";
-    };
-  }
-]
diff --git a/nixpkgs/pkgs/os-specific/linux/dddvb/default.nix b/nixpkgs/pkgs/os-specific/linux/dddvb/default.nix
index 7db444bff0f4..ea69ecd7513c 100644
--- a/nixpkgs/pkgs/os-specific/linux/dddvb/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/dddvb/default.nix
@@ -1,20 +1,29 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, fetchpatch
 , kernel
 }:
 
 stdenv.mkDerivation rec {
   pname = "dddvb";
-  version = "0.9.38-pre.4";
+  version = "0.9.38-pre.6";
 
   src = fetchFromGitHub {
     owner = "DigitalDevices";
     repo = "dddvb";
-    rev = "e9ccab3578965234c0ea38c5b30969f33600561d";
-    sha256 = "sha256-gOG+dAeQ++kTC5xaEpsr3emz3s6FXiKeCHmA9shYBJk=";
+    rev = "refs/tags/${version}";
+    hash = "sha256-bt/vMnqRWDDChZ6R4JbCr77cz3nlSPkx6siC9KLSEqs=";
   };
 
+  patches = [
+    (fetchpatch {
+      # pci_*_dma_mask no longer exists in 5.18
+      url = "https://github.com/DigitalDevices/dddvb/commit/871821d6a0be147313bb52570591ce3853b3d370.patch";
+      hash = "sha256-wY05HrsduvsIdp/KpS9NWfL3hR9IvGjuNCDljFn7dd0=";
+    })
+  ];
+
   postPatch = ''
     sed -i '/depmod/d' Makefile
   '';
diff --git a/nixpkgs/pkgs/os-specific/linux/device-tree/default.nix b/nixpkgs/pkgs/os-specific/linux/device-tree/default.nix
index 13c609cdf7d9..88791a1fb1d4 100644
--- a/nixpkgs/pkgs/os-specific/linux/device-tree/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/device-tree/default.nix
@@ -1,9 +1,9 @@
-{ lib, stdenvNoCC, dtc, findutils }:
+{ lib, stdenvNoCC, dtc }:
 
 with lib; {
   applyOverlays = (base: overlays': stdenvNoCC.mkDerivation {
     name = "device-tree-overlays";
-    nativeBuildInputs = [ dtc findutils ];
+    nativeBuildInputs = [ dtc ];
     buildCommand = let
       overlays = toList overlays';
     in ''
diff --git a/nixpkgs/pkgs/os-specific/linux/digimend/default.nix b/nixpkgs/pkgs/os-specific/linux/digimend/default.nix
index e26509d3a7cb..70fc58232ab4 100644
--- a/nixpkgs/pkgs/os-specific/linux/digimend/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/digimend/default.nix
@@ -1,16 +1,14 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, kernel }:
-
-assert lib.versionAtLeast kernel.version "3.5";
+{ lib, stdenv, fetchFromGitHub, kernel }:
 
 stdenv.mkDerivation rec {
   pname = "digimend";
-  version = "unstable-2019-06-18";
+  version = "10";
 
   src = fetchFromGitHub {
     owner = "digimend";
     repo = "digimend-kernel-drivers";
-    rev = "8b228a755e44106c11f9baaadb30ce668eede5d4";
-    sha256 = "1l54j85540386a8aypqka7p5hy1b63cwmpsscv9rmmf10f78v8mm";
+    rev = "v${version}";
+    sha256 = "0lifd6cx6aa6hcms4zn4hlla3alra08r0svj5x1l8nlsv0ydnl6i";
   };
 
   postPatch = ''
@@ -18,14 +16,8 @@ stdenv.mkDerivation rec {
     sed 's/depmod /true /' -i Makefile
   '';
 
-  patches = [
-    # Fix build on Linux kernel >= 5.4
-    # https://github.com/DIGImend/digimend-kernel-drivers/pull/331
-    (fetchpatch {
-      url = "https://github.com/DIGImend/digimend-kernel-drivers/commit/fb8a2eb6a9198bb35aaccb81e22dd5ebe36124d1.patch";
-      sha256 = "1j7l5hsk59gccydpf7n6xx1ki4rm6aka7k879a7ah5jn8p1ylgw9";
-    })
-  ];
+  # Fix build on Linux kernel >= 5.18
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=implicit-fallthrough" ];
 
   nativeBuildInputs = kernel.moduleBuildDependencies;
 
diff --git a/nixpkgs/pkgs/os-specific/linux/directvnc/default.nix b/nixpkgs/pkgs/os-specific/linux/directvnc/default.nix
index d20b69775bfd..78ccb6772571 100644
--- a/nixpkgs/pkgs/os-specific/linux/directvnc/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/directvnc/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, directfb, zlib, libjpeg, xorgproto }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkg-config, directfb, zlib, libjpeg, xorgproto }:
 
 stdenv.mkDerivation {
   pname = "directvnc";
@@ -11,6 +11,17 @@ stdenv.mkDerivation {
     sha256 = "16x7mr7x728qw7nbi6rqhrwsy73zsbpiz8pbgfzfl2aqhfdiz88b";
   };
 
+  patches = [
+    # Pull fix pending upstream inclusion for -fno-common toolchain
+    # support:
+    #   https://github.com/drinkmilk/directvnc/pull/7
+    (fetchpatch {
+      name = "fno-common.patch";
+      url = "https://github.com/drinkmilk/directvnc/commit/e9c23d049bcf31d0097348d44391fe5fd9aad12b.patch";
+      sha256 = "1dnzr0dnx20w80r73j4a9n6mhbazjzlr5ps9xjj898924cg140zx";
+    })
+  ];
+
   nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   buildInputs = [ directfb zlib libjpeg xorgproto ];
diff --git a/nixpkgs/pkgs/os-specific/linux/disk-indicator/default.nix b/nixpkgs/pkgs/os-specific/linux/disk-indicator/default.nix
index 44dd19b27dfb..f5c7f3bc774e 100644
--- a/nixpkgs/pkgs/os-specific/linux/disk-indicator/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/disk-indicator/default.nix
@@ -2,31 +2,40 @@
 
 stdenv.mkDerivation {
   pname = "disk-indicator";
-  version = "unstable-2014-05-19";
+  version = "unstable-2018-12-18";
 
   src = fetchFromGitHub {
     owner = "MeanEYE";
     repo = "Disk-Indicator";
-    rev = "51ef4afd8141b8d0659cbc7dc62189c56ae9c2da";
-    sha256 = "sha256-bRaVEe18VUmyftXzMNmGuL5gZ/dKCipuEDYrnHo1XYI=";
+    rev = "ec2d2f6833f038f07a72d15e2d52625c23e10b12";
+    sha256 = "sha256-cRqgIxF6H1WyJs5hhaAXVdWAlv6t22BZLp3p/qRlCSM=";
   };
 
   buildInputs = [ libX11 ];
 
-  patchPhase = ''
-    substituteInPlace ./makefile --replace "COMPILER=c99" "COMPILER=gcc -std=c99"
-    substituteInPlace ./makefile --replace "COMPILE_FLAGS=" "COMPILE_FLAGS=-O2 "
+  postPatch = ''
+    # avoid -Werror
+    substituteInPlace Makefile --replace "-Werror" ""
+    # avoid host-specific options
+    substituteInPlace Makefile --replace "-march=native" ""
   '';
 
-  buildPhase = "make -f makefile";
-
-  NIX_CFLAGS_COMPILE = "-Wno-error=cpp";
+  postConfigure = ''
+    patchShebangs ./configure.sh
+    ./configure.sh --all
+  '';
 
-  hardeningDisable = [ "fortify" ];
+  makeFlags = [
+    "COMPILER=${stdenv.cc.targetPrefix}cc"
+  ];
 
   installPhase = ''
+    runHook preInstall
+
     mkdir -p "$out/bin"
     cp ./disk_indicator "$out/bin/"
+
+    runHook postInstall
   '';
 
   meta = {
diff --git a/nixpkgs/pkgs/os-specific/linux/displaylink/default.nix b/nixpkgs/pkgs/os-specific/linux/displaylink/default.nix
index e7e572ce18e1..d920e44d425a 100644
--- a/nixpkgs/pkgs/os-specific/linux/displaylink/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/displaylink/default.nix
@@ -20,22 +20,22 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "displaylink";
-  version = "5.5.0-59.151";
+  version = "5.6.0-59.176";
 
   src = requireFile rec {
-    name = "displaylink-55.zip";
-    sha256 = "0pswmczzrqqq0s0ksp6rfnkm693ligq4nblki1v53jdh0y7d1gff";
+    name = "displaylink-56.zip";
+    sha256 = "1v9s4ksr4mnl629n24si14g762b7knr00sqacz60mxcmy4mch5fa";
     message = ''
       In order to install the DisplayLink drivers, you must first
       comply with DisplayLink's EULA and download the binaries and
       sources from here:
 
-      https://www.synaptics.com/products/displaylink-graphics/downloads/ubuntu-5.5
+      https://www.synaptics.com/products/displaylink-graphics/downloads/ubuntu-5.6
 
       Once you have downloaded the file, please use the following
       commands and re-run the installation:
 
-      mv \$PWD/"DisplayLink USB Graphics Software for Ubuntu5.5-EXE.zip" \$PWD/${name}
+      mv \$PWD/"DisplayLink USB Graphics Software for Ubuntu5.6-EXE.zip" \$PWD/${name}
       nix-prefetch-url file://\$PWD/${name}
     '';
   };
@@ -58,7 +58,7 @@ stdenv.mkDerivation rec {
       --set-rpath ${libPath} \
       $out/bin/DisplayLinkManager
     wrapProgram $out/bin/DisplayLinkManager \
-      --run "cd $out/lib/displaylink"
+      --chdir "$out/lib/displaylink"
 
     # We introduce a dependency on the source file so that it need not be redownloaded everytime
     echo $src >> "$out/share/workspace_dependencies.pin"
@@ -70,7 +70,7 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     description = "DisplayLink DL-5xxx, DL-41xx and DL-3x00 Driver for Linux";
-    maintainers = with maintainers; [ nshalman abbradar peterhoeg eyjhb ];
+    maintainers = with maintainers; [ abbradar peterhoeg eyjhb ];
     platforms = [ "x86_64-linux" "i686-linux" ];
     license = licenses.unfree;
     homepage = "https://www.displaylink.com/";
diff --git a/nixpkgs/pkgs/os-specific/linux/dmidecode/default.nix b/nixpkgs/pkgs/os-specific/linux/dmidecode/default.nix
index ae4e19ef0f84..a8c263144208 100644
--- a/nixpkgs/pkgs/os-specific/linux/dmidecode/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/dmidecode/default.nix
@@ -1,58 +1,14 @@
-{ lib, stdenv, fetchurl, fetchpatch }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "dmidecode";
-  version = "3.2";
+  version = "3.4";
 
   src = fetchurl {
     url = "mirror://savannah/dmidecode/dmidecode-${version}.tar.xz";
-    sha256 = "1pcfhcgs2ifdjwp7amnsr3lq95pgxpr150bjhdinvl505px0cw07";
+    sha256 = "sha256-Q8uoUdhGfJl5zNvqsZLrZjjH06aX66Xdt3naiDdUIhI=";
   };
 
-  patches = [
-    # suggested patches for 3.2 according to https://www.nongnu.org/dmidecode/
-    (fetchpatch {
-      name = "0001-fix_redfish_hostname_print_length.patch";
-      url = "https://git.savannah.gnu.org/cgit/dmidecode.git/patch/?id=fde47bb227b8fa817c88d7e10a8eb771c46de1df";
-      sha256 = "133nd0c72p68hnqs5m714167761r1pp6bd3kgbsrsrwdx40jlc3m";
-    })
-    (fetchpatch {
-      name = "0002-add_logical_non-volatile_device_to_memory_device_types.patch";
-      url = "https://git.savannah.gnu.org/cgit/dmidecode.git/patch/?id=74dfb854b8199ddb0a27e89296fa565f4706cb9d";
-      sha256 = "0wdpmlcwmqdyyrsmyis8jb7cx3q6fnqpdpc5xly663dj841jcvwh";
-    })
-    (fetchpatch {
-      name = "0003-only-scan-devmem-for-entry-point-on-x86.patch";
-      url = "https://git.savannah.gnu.org/cgit/dmidecode.git/patch/?id=e12ec26e19e02281d3e7258c3aabb88a5cf5ec1d";
-      sha256 = "1y2858n98bfa49syjinx911vza6mm7aa6xalvzjgdlyirhccs30i";
-    })
-    (fetchpatch {
-      name = "0004-fix_formatting_of_tpm_table_output.patch";
-      url = "https://git.savannah.gnu.org/cgit/dmidecode.git/patch/?id=1d0db85949a5bdd96375f6131d393a11204302a6";
-      sha256 = "11s8jciw7xf2668v79qcq2c9w2gwvm3dkcik8dl9v74p654y1nr8";
-    })
-    (fetchpatch {
-      name = "0005-fix_system-slot_information_for_pcie_ssd.patch";
-      url = "https://git.savannah.gnu.org/cgit/dmidecode.git/patch/?id=fd08479625b5845e4d725ab628628f7ebfccc407";
-      sha256 = "07l61wvsw1d8g14zzf6zm7l0ri9kkqz8j5n4h116qwhg1p2k49y4";
-    })
-    (fetchpatch {
-      name = "0006-print_type_33_name_unconditionally.patch";
-      url = "https://git.savannah.gnu.org/cgit/dmidecode.git/patch/?id=65438a7ec0f4cddccf810136da6f280bd148af71";
-      sha256 = "0gqz576ccxys0c8217spf1qmw9lxi9xalw85jjqwsi2bj1k6vy4n";
-    })
-    (fetchpatch {
-      name = "0007-dont_choke_on_invalid_processor_voltage.patch";
-      url = "https://git.savannah.gnu.org/cgit/dmidecode.git/patch/?id=5bb7eb173b72256f70c6b3f3916d7a444be93340";
-      sha256 = "1dkg4lq9kn2g1w5raz1gssn6zqk078zjqbnh9i32f822f727syhp";
-    })
-    (fetchpatch {
-      name = "0008-fix_the_alignment_of_type_25_name.patch";
-      url = "https://git.savannah.gnu.org/cgit/dmidecode.git/patch/?id=557c3c373a9992d45d4358a6a2ccf53b03276f39";
-      sha256 = "18hc91pk7civyqrlilg3kn2nmp2warhh49xlbzrwqi7hgipyf12z";
-    })
-  ];
-
   makeFlags = [
     "prefix=$(out)"
     "CC=${stdenv.cc.targetPrefix}cc"
@@ -63,5 +19,6 @@ stdenv.mkDerivation rec {
     description = "A tool that reads information about your system's hardware from the BIOS according to the SMBIOS/DMI standard";
     license = licenses.gpl2Plus;
     platforms = platforms.linux;
+    maintainers = with maintainers; [ delroth ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/dpdk-kmods/default.nix b/nixpkgs/pkgs/os-specific/linux/dpdk-kmods/default.nix
index 694e508dcd01..cdd643a40b66 100644
--- a/nixpkgs/pkgs/os-specific/linux/dpdk-kmods/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/dpdk-kmods/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
   version = "2021-04-21";
 
   src = fetchzip {
-    url = "http://git.dpdk.org/dpdk-kmods/snapshot/dpdk-kmods-e13d7af77a1bf98757f85c3c4083f6ee6d0d2372.tar.xz";
+    url = "https://git.dpdk.org/dpdk-kmods/snapshot/dpdk-kmods-e13d7af77a1bf98757f85c3c4083f6ee6d0d2372.tar.xz";
     sha256 = "sha256-8ysWT3X3rIyUAo4/QbkX7cQq5iFeU18/BPsmmWugcIc=";
   };
 
@@ -32,5 +32,6 @@ stdenv.mkDerivation rec {
     license = licenses.gpl2Only;
     maintainers = [ maintainers.mic92 ];
     platforms = platforms.linux;
+    broken = kernel.kernelAtLeast "5.18";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/dpdk/default.nix b/nixpkgs/pkgs/os-specific/linux/dpdk/default.nix
index 1e4f50e42df3..d9f446f7a2dc 100644
--- a/nixpkgs/pkgs/os-specific/linux/dpdk/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/dpdk/default.nix
@@ -9,14 +9,14 @@
 
 let
   mod = kernel != null;
-  dpdkVersion = "21.11";
+  dpdkVersion = "22.03";
 in stdenv.mkDerivation rec {
   pname = "dpdk";
   version = "${dpdkVersion}" + lib.optionalString mod "-${kernel.version}";
 
   src = fetchurl {
     url = "https://fast.dpdk.org/rel/dpdk-${dpdkVersion}.tar.xz";
-    sha256 = "sha256-Mkbj7WjuKzaaXYviwGzxCKZp4Vf01Bxby7sha/Wr06E=";
+    sha256 = "sha256-st5fCLzVcz+Q1NfmwDJRWQja2PyNJnrGolNELZuDp8U=";
   };
 
   nativeBuildInputs = [
@@ -91,5 +91,6 @@ in stdenv.mkDerivation rec {
     license = with licenses; [ lgpl21 gpl2 bsd2 ];
     platforms =  platforms.linux;
     maintainers = with maintainers; [ magenbluten orivej mic92 zhaofengli ];
+    broken = mod && kernel.kernelAtLeast "5.18";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/dropwatch/default.nix b/nixpkgs/pkgs/os-specific/linux/dropwatch/default.nix
index c2701c057193..470b59018704 100644
--- a/nixpkgs/pkgs/os-specific/linux/dropwatch/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/dropwatch/default.nix
@@ -13,13 +13,13 @@
 
 stdenv.mkDerivation rec {
   pname = "dropwatch";
-  version = "1.5.3";
+  version = "1.5.4";
 
   src = fetchFromGitHub {
     owner = "nhorman";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0axx0zzrs7apqnl0r70jyvmgk7cs5wk185id479mapgngibwkyxy";
+    sha256 = "sha256-TbhgcX5WzuigP5/Mj5JuK7O/UKcu70D7dcOcvo4fxeQ=";
   };
 
   nativeBuildInputs = [
diff --git a/nixpkgs/pkgs/os-specific/linux/ell/default.nix b/nixpkgs/pkgs/os-specific/linux/ell/default.nix
index aa8e3f15aab2..67d8f107ce38 100644
--- a/nixpkgs/pkgs/os-specific/linux/ell/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/ell/default.nix
@@ -7,14 +7,14 @@
 
 stdenv.mkDerivation rec {
   pname = "ell";
-  version = "0.46";
+  version = "0.52";
 
   outputs = [ "out" "dev" ];
 
   src = fetchgit {
     url = "https://git.kernel.org/pub/scm/libs/ell/ell.git";
     rev = version;
-    sha256 = "sha256-Am1PNFFfSzII4Iaeq0wgfuVHSeMDjiDzYkNQWlnEHJY=";
+    sha256 = "sha256-JnkNWWdr0CSlwME619BBWkvelFZoZpzmAR53nm2bSqM=";
   };
 
   nativeBuildInputs = [
@@ -31,11 +31,12 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = with lib; {
-    homepage = "https://01.org/ell";
+    homepage = "https://git.kernel.org/pub/scm/libs/ell/ell.git";
     description = "Embedded Linux Library";
     longDescription = ''
       The Embedded Linux* Library (ELL) provides core, low-level functionality for system daemons. It typically has no dependencies other than the Linux kernel, C standard library, and libdl (for dynamic linking). While ELL is designed to be efficient and compact enough for use on embedded Linux platforms, it is not limited to resource-constrained systems.
     '';
+    changelog = "https://git.kernel.org/pub/scm/libs/ell/ell.git/tree/ChangeLog?h=${version}";
     license = licenses.lgpl21Plus;
     platforms = platforms.linux;
     maintainers = with maintainers; [ mic92 dtzWill maxeaubrey ];
diff --git a/nixpkgs/pkgs/os-specific/linux/ena/default.nix b/nixpkgs/pkgs/os-specific/linux/ena/default.nix
index 5873a2fe2c1d..b8128c83c0c6 100644
--- a/nixpkgs/pkgs/os-specific/linux/ena/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/ena/default.nix
@@ -1,14 +1,14 @@
 { lib, stdenv, fetchFromGitHub, kernel }:
 
 stdenv.mkDerivation rec {
-  version = "2.5.0";
+  version = "2.7.1";
   name = "ena-${version}-${kernel.version}";
 
   src = fetchFromGitHub {
     owner = "amzn";
     repo = "amzn-drivers";
     rev = "ena_linux_${version}";
-    sha256 = "sha256-uOf/1624UtjaZtrk7XyQpeUGdTNVDnzZJZMgU86i+SM=";
+    sha256 = "sha256-JkGzmmsAmLvL9e+bg58H79GNHgsqydK/79VoWEq5/Mc=";
   };
 
   hardeningDisable = [ "pic" ];
@@ -42,6 +42,6 @@ stdenv.mkDerivation rec {
     license = licenses.gpl2Only;
     maintainers = [ maintainers.eelco ];
     platforms = platforms.linux;
-    broken = kernel.kernelOlder "4.5" || kernel.kernelAtLeast "5.15";
+    broken = kernel.kernelAtLeast "5.17";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/erofs-utils/default.nix b/nixpkgs/pkgs/os-specific/linux/erofs-utils/default.nix
index 40d958bdd0f8..547e6cc651ab 100644
--- a/nixpkgs/pkgs/os-specific/linux/erofs-utils/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/erofs-utils/default.nix
@@ -2,14 +2,14 @@
 
 stdenv.mkDerivation rec {
   pname = "erofs-utils";
-  version = "1.4";
+  version = "1.5";
   outputs = [ "out" "man" ];
 
   src = fetchgit {
     url =
       "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git";
     rev = "v" + version;
-    sha256 = "sha256-yYMvtW6mQKGx+TZGzadbLX9pXU7vY5b4d1B8d5Ph6vk=";
+    sha256 = "sha256-vMWAmGMJp0XDuc4sbo6Y7gfCQVAo4rETea0Tkdbg82U=";
   };
 
   nativeBuildInputs = [ autoreconfHook pkg-config ];
diff --git a/nixpkgs/pkgs/os-specific/linux/evdi/default.nix b/nixpkgs/pkgs/os-specific/linux/evdi/default.nix
index 721a49ed4a56..b94f4351ff52 100644
--- a/nixpkgs/pkgs/os-specific/linux/evdi/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/evdi/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "evdi";
-  version = "1.10.0";
+  version = "1.12.0";
 
   src = fetchFromGitHub {
     owner = "DisplayLink";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-vMcmUWdnO9JmImxz4vO3/UONlsrCGc8VH/o38YwCIzg=";
+    sha256 = "sha256-JZKZ7+1OMbBtUA7pAZ41TzeDDyiD0h7yTXJINJ5FjN4=";
   };
 
   NIX_CFLAGS_COMPILE = "-Wno-error -Wno-error=sign-compare";
@@ -29,6 +29,8 @@ stdenv.mkDerivation rec {
     install -Dm755 library/libevdi.so $out/lib/libevdi.so
   '';
 
+  enableParallelBuilding = true;
+
   meta = with lib; {
     description = "Extensible Virtual Display Interface";
     maintainers = with maintainers; [ eyjhb ];
diff --git a/nixpkgs/pkgs/os-specific/linux/facetimehd/default.nix b/nixpkgs/pkgs/os-specific/linux/facetimehd/default.nix
index 163001638cda..3bb656e8cb09 100644
--- a/nixpkgs/pkgs/os-specific/linux/facetimehd/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/facetimehd/default.nix
@@ -1,9 +1,9 @@
 { stdenv, lib, fetchFromGitHub, kernel }:
 
-# facetimehd is not supported for kernels older than 3.19";
-assert lib.versionAtLeast kernel.version "3.19";
+stdenv.mkDerivation rec {
+  name = "facetimehd-${version}-${kernel.version}";
+  version = "0.5.18";
 
-let
   # Note: When updating this revision:
   # 1. Also update pkgs/os-specific/linux/firmware/facetimehd-firmware/
   # 2. Test the module and firmware change via:
@@ -14,29 +14,11 @@ let
   #    e. see if the module loads back (apps using the camera won't
   #       recover and will have to be restarted) and the camera
   #       still works.
-  srcParams = if (lib.versionAtLeast kernel.version "4.8") then
-    { # Use mainline branch
-      version = "unstable-2020-04-16";
-      rev = "82626d4892eeb9eb704538bf0dc49a00725ff451";
-      sha256 = "118z6vjvhhcwvs4n3sgwwdagys9w718b8nkh6l9ic93732vv7cqx";
-    }
-  else
-    { # Use master branch (broken on 4.8)
-      version = "unstable-2016-05-02";
-      rev = "5a7083bd98b38ef3bd223f7ee531d58f4fb0fe7c";
-      sha256 = "0d455kajvn5xav9iilqy7s1qvsy4yb8vzjjxx7bvcgp7aj9ljvdp";
-    }
-  ;
-in
-
-stdenv.mkDerivation rec {
-  name = "facetimehd-${version}-${kernel.version}";
-  version = srcParams.version;
-
   src = fetchFromGitHub {
     owner = "patjak";
-    repo = "bcwc_pcie";
-    inherit (srcParams) rev sha256;
+    repo = "facetimehd";
+    rev = version;
+    sha256 = "sha256-UO8t2zrfdJlu4uzhhyWOuHIjJNVezIq3nUPGZeW/KJU=";
   };
 
   preConfigure = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/firejail/default.nix b/nixpkgs/pkgs/os-specific/linux/firejail/default.nix
index c3dc819b5bcf..7b7abdb8441c 100644
--- a/nixpkgs/pkgs/os-specific/linux/firejail/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firejail/default.nix
@@ -11,13 +11,13 @@
 
 stdenv.mkDerivation rec {
   pname = "firejail";
-  version = "0.9.68";
+  version = "0.9.70";
 
   src = fetchFromGitHub {
     owner = "netblue30";
     repo = "firejail";
     rev = version;
-    sha256 = "18yy1mykx7h78yj7sz729i3dlsrgi25m17m5x9gbrvsx7f87rw7j";
+    sha256 = "sha256-x1txt0uER66bZN6BD6c/31Zu6fPPwC9kl/3bxEE6Ce8=";
   };
 
   nativeBuildInputs = [
@@ -37,6 +37,7 @@ stdenv.mkDerivation rec {
     # Adds the /nix directory when using an overlay.
     # Required to run any programs under this mode.
     ./mount-nix-dir-on-overlay.patch
+
     # By default fbuilder hardcodes the firejail binary to the install path.
     # On NixOS the firejail binary is a setuid wrapper available in $PATH.
     ./fbuilder-call-firejail-on-path.patch
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware-cutter/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware-cutter/default.nix
index 389078db0af5..fe7a3e9ae406 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware-cutter/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware-cutter/default.nix
@@ -11,7 +11,10 @@ stdenv.mkDerivation rec {
 
   patches = [ ./no-root-install.patch ];
 
-  makeFlags = [ "PREFIX=$(out)" ];
+  makeFlags = [
+    "PREFIX=$(out)"
+    "CC=${stdenv.cc.targetPrefix}cc"
+  ];
 
   meta = {
     description = "Firmware extractor for cards supported by the b43 kernel module";
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix b/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix
index 3f810fd93a1c..a5683a1ce535 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix
@@ -1,8 +1,8 @@
-{ lib, stdenv, fetchurl, b43FirmwareCutter }:
+{ lib, stdenvNoCC, fetchurl, b43FirmwareCutter }:
 
 let version = "5.100.138"; in
 
-stdenv.mkDerivation {
+stdenvNoCC.mkDerivation {
   pname = "b43-firmware";
   inherit version;
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
     sha256 = "0vz4ka8gycf72gmnaq61k8rh8y17j1wm2k3fidxvcqjvmix0drzi";
   };
 
-  buildInputs = [ b43FirmwareCutter ];
+  nativeBuildInputs = [ b43FirmwareCutter ];
 
   installPhase = ''
     mkdir -p $out/lib/firmware
@@ -24,4 +24,3 @@ stdenv.mkDerivation {
     license = lib.licenses.unfree;
   };
 }
-
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix b/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix
index 1116d96a637f..e117db45b182 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix
@@ -1,6 +1,6 @@
-{ lib, stdenv, fetchurl, b43FirmwareCutter }:
+{ lib, stdenvNoCC, fetchurl, b43FirmwareCutter }:
 
-stdenv.mkDerivation rec {
+stdenvNoCC.mkDerivation rec {
   pname = "b43-firmware";
   version = "6.30.163.46";
 
@@ -9,13 +9,13 @@ stdenv.mkDerivation rec {
     sha256 = "0baw6gcnrhxbb447msv34xg6rmlcj0gm3ahxwvdwfcvq4xmknz50";
   };
 
-  buildInputs = [ b43FirmwareCutter ];
+  nativeBuildInputs = [ b43FirmwareCutter ];
 
   sourceRoot = ".";
 
   installPhase = ''
-    mkdir $out
-    b43-fwcutter -w $out *.wl_apsta.o
+    mkdir -p $out/lib/firmware
+    b43-fwcutter -w $out/lib/firmware *.wl_apsta.o
   '';
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix
index a0985cad0dbe..073d443bee41 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix
@@ -1,9 +1,6 @@
-{ lib, stdenv, fetchurl, cabextract, bt-fw-converter }:
+{ lib, stdenvNoCC, fetchurl, cabextract, bt-fw-converter }:
 
-# Kernels between 4.2 and 4.7 will not work with
-# this packages as they expect the firmware to be named "BCM.hcd"
-# see: https://github.com/NixOS/nixpkgs/pull/25478#issuecomment-299034865
-stdenv.mkDerivation rec {
+stdenvNoCC.mkDerivation rec {
   pname = "broadcom-bt-firmware";
   version = "12.0.1.1012";
 
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/facetimehd-calibration/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/facetimehd-calibration/default.nix
new file mode 100644
index 000000000000..ca6782688728
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/facetimehd-calibration/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenvNoCC, fetchurl, unrar-wrapper, pkgs }:
+
+let
+
+  version = "5.1.5769";
+
+
+  # Described on https://github.com/patjak/facetimehd/wiki/Extracting-the-sensor-calibration-files
+
+  # From the wiki page, range extracted with binwalk:
+  zipUrl = "https://download.info.apple.com/Mac_OS_X/031-30890-20150812-ea191174-4130-11e5-a125-930911ba098f/bootcamp${version}.zip";
+  zipRange = "2338085-3492508"; # the whole download is 518MB, this deflate stream is 1.2MB
+
+  # CRC and length from the ZIP entry header (not strictly necessary, but makes it extract cleanly):
+  gzFooter = ''\x51\x1f\x86\x78\xcf\x5b\x12\x00'';
+
+  # Also from the wiki page:
+  calibrationFiles = [
+    { file = "1771_01XX.dat"; offset = "1644880"; size = "19040"; }
+    { file = "1871_01XX.dat"; offset = "1606800"; size = "19040"; }
+    { file = "1874_01XX.dat"; offset = "1625840"; size = "19040"; }
+    { file = "9112_01XX.dat"; offset = "1663920"; size = "33060"; }
+  ];
+
+in
+
+stdenvNoCC.mkDerivation {
+
+  pname = "facetimehd-calibration";
+  inherit version;
+  src = fetchurl {
+    url = zipUrl;
+    sha256 = "1dzyv457fp6d8ly29sivqn6llwj5ydygx7p8kzvdnsp11zvid2xi";
+    curlOpts = "-r ${zipRange}";
+  };
+
+  dontUnpack = true;
+  dontInstall = true;
+
+  buildInputs = [ unrar-wrapper ];
+
+  buildPhase = ''
+    { printf '\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00'
+      cat $src
+      printf '${gzFooter}'
+    } | zcat > AppleCamera64.exe
+    unrar x AppleCamera64.exe AppleCamera.sys
+
+    mkdir -p $out/lib/firmware/facetimehd
+  '' + lib.concatMapStrings ({file, offset, size}: ''
+    dd bs=1 skip=${offset} count=${size} if=AppleCamera.sys of=$out/lib/firmware/facetimehd/${file}
+  '') calibrationFiles;
+
+  meta = with lib; {
+    description = "facetimehd calibration";
+    homepage = "https://support.apple.com/kb/DL1837";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ alexshpilkin womfoo grahamc ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/facetimehd-firmware/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/facetimehd-firmware/default.nix
index 1c3d8fbbaf7d..6679f1f19e75 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/facetimehd-firmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/facetimehd-firmware/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, cpio, xz, pkgs }:
+{ lib, stdenvNoCC, fetchurl, cpio, xz, pkgs }:
 
 let
 
@@ -33,7 +33,7 @@ let
 
 in
 
-stdenv.mkDerivation {
+stdenvNoCC.mkDerivation {
 
   pname = "facetimehd-firmware";
   inherit version;
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/firmware-updater/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/firmware-updater/default.nix
index 02b549dd9ea1..fb9d3a9a36c4 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/firmware-updater/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/firmware-updater/default.nix
@@ -7,7 +7,7 @@ flutter.mkFlutterApp {
   pname = "firmware-updater";
   version = "unstable";
 
-  vendorHash = "sha256-L8am4vTx4KlMHUdIhrUsCxGc27vkolawS/9DyFCPOJQ=";
+  vendorHash = "sha256-3wVA9BLCnMijC0gOmskz+Hv7NQIGu/jhBDbWjmoq1Tc=";
 
   src = fetchFromGitHub {
     owner = "canonical";
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd-efi/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd-efi/default.nix
index bd9f0d2474e4..56001cb225aa 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd-efi/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd-efi/default.nix
@@ -12,11 +12,11 @@
 
 stdenv.mkDerivation rec {
   pname = "fwupd-efi";
-  version = "1.2";
+  version = "1.3";
 
   src = fetchurl {
     url = "https://people.freedesktop.org/~hughsient/releases/${pname}-${version}.tar.xz";
-    sha256 = "sha256-aRx38RwhAQSNjauvY8bQ/iLPrQ5dQyIEHJurzrr86z8=";
+    sha256 = "sha256-1Ys04TwhWYZ8ORJgr04kGO6/lI1I36sC6kcrVoP/r1k=";
   };
 
   nativeBuildInputs = [
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/add-option-for-installation-sysconfdir.patch b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/add-option-for-installation-sysconfdir.patch
index bdb2fc34728a..c136f935e03e 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/add-option-for-installation-sysconfdir.patch
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/add-option-for-installation-sysconfdir.patch
@@ -1,66 +1,66 @@
 diff --git a/data/meson.build b/data/meson.build
-index 2ae29ce5..342cac92 100644
+index d8494020d..7c896fa0d 100644
 --- a/data/meson.build
 +++ b/data/meson.build
 @@ -26,7 +26,7 @@ endif
  
  if build_standalone
    install_data(['daemon.conf'],
--    install_dir : join_paths(sysconfdir, 'fwupd')
-+    install_dir : join_paths(sysconfdir_install, 'fwupd')
+-    install_dir: join_paths(sysconfdir, 'fwupd')
++    install_dir: join_paths(sysconfdir_install, 'fwupd')
    )
-   install_data(['power.quirk', 'cfi.quirk'],
-     install_dir: join_paths(datadir, 'fwupd', 'quirks.d'))
+   plugin_quirks += join_paths(meson.current_source_dir(), 'power.quirk')
+   plugin_quirks += join_paths(meson.current_source_dir(), 'cfi.quirk')
 diff --git a/data/pki/meson.build b/data/pki/meson.build
-index 2a7d0f24..091981f7 100644
+index 3649fecea..c3462744b 100644
 --- a/data/pki/meson.build
 +++ b/data/pki/meson.build
 @@ -12,13 +12,13 @@ install_data([
      'GPG-KEY-Linux-Foundation-Firmware',
      'GPG-KEY-Linux-Vendor-Firmware-Service',
    ],
--  install_dir : join_paths(sysconfdir, 'pki', 'fwupd')
-+  install_dir : join_paths(sysconfdir_install, 'pki', 'fwupd')
+-  install_dir: join_paths(sysconfdir, 'pki', 'fwupd')
++  install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd')
  )
  install_data([
      'GPG-KEY-Linux-Foundation-Metadata',
      'GPG-KEY-Linux-Vendor-Firmware-Service',
    ],
--  install_dir : join_paths(sysconfdir, 'pki', 'fwupd-metadata')
-+  install_dir : join_paths(sysconfdir_install, 'pki', 'fwupd-metadata')
+-  install_dir: join_paths(sysconfdir, 'pki', 'fwupd-metadata')
++  install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd-metadata')
  )
  endif
  
-@@ -26,11 +26,11 @@ if supported_pkcs7 == '1'
+@@ -26,11 +26,11 @@ if supported_pkcs7
  install_data([
      'LVFS-CA.pem',
    ],
--  install_dir : join_paths(sysconfdir, 'pki', 'fwupd')
-+  install_dir : join_paths(sysconfdir_install, 'pki', 'fwupd')
+-  install_dir: join_paths(sysconfdir, 'pki', 'fwupd')
++  install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd')
  )
  install_data([
      'LVFS-CA.pem',
    ],
--  install_dir : join_paths(sysconfdir, 'pki', 'fwupd-metadata')
-+  install_dir : join_paths(sysconfdir_install, 'pki', 'fwupd-metadata')
+-  install_dir: join_paths(sysconfdir, 'pki', 'fwupd-metadata')
++  install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd-metadata')
  )
  endif
 diff --git a/data/remotes.d/meson.build b/data/remotes.d/meson.build
-index 02d8777b..2c89d593 100644
+index 1d1698a7e..5469d00a6 100644
 --- a/data/remotes.d/meson.build
 +++ b/data/remotes.d/meson.build
 @@ -2,7 +2,7 @@ if build_standalone and get_option('lvfs') != 'false'
    install_data([
        'lvfs-testing.conf',
      ],
--    install_dir : join_paths(sysconfdir, 'fwupd', 'remotes.d')
-+    install_dir : join_paths(sysconfdir_install, 'fwupd', 'remotes.d')
+-    install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d')
++    install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d')
    )
    con3 = configuration_data()
    if get_option('lvfs') == 'disabled'
 @@ -15,7 +15,7 @@ if build_standalone and get_option('lvfs') != 'false'
-     output : 'lvfs.conf',
-     configuration : con3,
+     output: 'lvfs.conf',
+     configuration: con3,
      install: true,
 -    install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
 +    install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
@@ -68,25 +68,25 @@ index 02d8777b..2c89d593 100644
    i18n.merge_file(
      input: 'lvfs.metainfo.xml',
 @@ -49,12 +49,12 @@ configure_file(
-   output : 'vendor.conf',
-   configuration : con2,
+   output: 'vendor.conf',
+   configuration: con2,
    install: true,
 -  install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
 +  install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
  )
  configure_file(
-   input : 'vendor-directory.conf',
-   output : 'vendor-directory.conf',
-   configuration : con2,
+   input: 'vendor-directory.conf',
+   output: 'vendor-directory.conf',
+   configuration: con2,
    install: true,
 -  install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
 +  install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
  )
 diff --git a/meson.build b/meson.build
-index 394f40fa..7b602c73 100644
+index e6b717078..f8a7a7455 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -187,6 +187,12 @@ endif
+@@ -195,6 +195,12 @@ endif
  mandir = join_paths(prefix, get_option('mandir'))
  localedir = join_paths(prefix, get_option('localedir'))
  
@@ -97,87 +97,87 @@ index 394f40fa..7b602c73 100644
 +endif
 +
  diffcmd = find_program('diff')
- gio = dependency('gio-2.0', version : '>= 2.45.8')
- giounix = dependency('gio-unix-2.0', version : '>= 2.45.8', required: false)
+ gio = dependency('gio-2.0', version: '>= 2.45.8')
+ giounix = dependency('gio-unix-2.0', version: '>= 2.45.8', required: false)
 diff --git a/meson_options.txt b/meson_options.txt
-index c1b483cb..047dbdd8 100644
+index 06d242371..d9e517fc0 100644
 --- a/meson_options.txt
 +++ b/meson_options.txt
 @@ -1,3 +1,4 @@
 +option('sysconfdir_install', type: 'string', value: '', description: 'sysconfdir to use during installation')
  option('build', type : 'combo', choices : ['all', 'standalone', 'library'], value : 'all', description : 'build type')
- option('consolekit', type : 'boolean', value : true, description : 'enable ConsoleKit support')
+ option('consolekit', type : 'feature', description : 'ConsoleKit support', deprecated: {'true': 'enabled', 'false': 'disabled'})
  option('static_analysis', type : 'boolean', value : false, description : 'enable GCC static analysis support')
 diff --git a/plugins/dell-esrt/meson.build b/plugins/dell-esrt/meson.build
-index e9f12879..a0126dbb 100644
+index 67bd3b9d9..ad04a91b6 100644
 --- a/plugins/dell-esrt/meson.build
 +++ b/plugins/dell-esrt/meson.build
 @@ -38,6 +38,6 @@ configure_file(
-   output : 'dell-esrt.conf',
-   configuration : con2,
+   output: 'dell-esrt.conf',
+   configuration: con2,
    install: true,
 -  install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
 +  install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
  )
  endif
 diff --git a/plugins/msr/meson.build b/plugins/msr/meson.build
-index 3ea47456..40dbd116 100644
+index 13f03ccd4..9235ebe33 100644
 --- a/plugins/msr/meson.build
 +++ b/plugins/msr/meson.build
-@@ -12,7 +12,7 @@ install_data(['fwupd-msr.conf'],
+@@ -10,7 +10,7 @@ install_data(['fwupd-msr.conf'],
  endif
  
  install_data(['msr.conf'],
--  install_dir:  join_paths(sysconfdir, 'fwupd')
-+  install_dir:  join_paths(sysconfdir_install, 'fwupd')
+-  install_dir: join_paths(sysconfdir, 'fwupd')
++  install_dir: join_paths(sysconfdir_install, 'fwupd')
  )
  shared_module('fu_plugin_msr',
    fu_hash,
 diff --git a/plugins/redfish/meson.build b/plugins/redfish/meson.build
-index 4a0a8664..7d9ba77d 100644
+index 95606e478..e5355e520 100644
 --- a/plugins/redfish/meson.build
 +++ b/plugins/redfish/meson.build
-@@ -53,7 +53,7 @@ shared_module('fu_plugin_redfish',
+@@ -43,7 +43,7 @@ shared_module('fu_plugin_redfish',
  )
  
  install_data(['redfish.conf'],
--  install_dir:  join_paths(sysconfdir, 'fwupd'),
-+  install_dir:  join_paths(sysconfdir_install, 'fwupd'),
+-  install_dir: join_paths(sysconfdir, 'fwupd'),
++  install_dir: join_paths(sysconfdir_install, 'fwupd'),
  )
  
  if get_option('tests')
 diff --git a/plugins/thunderbolt/meson.build b/plugins/thunderbolt/meson.build
-index 1ba9562f..c074f770 100644
+index 5f8ffbf90..9ba323e75 100644
 --- a/plugins/thunderbolt/meson.build
 +++ b/plugins/thunderbolt/meson.build
-@@ -37,7 +37,7 @@ fu_plugin_thunderbolt = shared_module('fu_plugin_thunderbolt',
+@@ -32,7 +32,7 @@ fu_plugin_thunderbolt = shared_module('fu_plugin_thunderbolt',
  )
  
  install_data(['thunderbolt.conf'],
--  install_dir:  join_paths(sysconfdir, 'fwupd')
-+  install_dir:  join_paths(sysconfdir_install, 'fwupd')
+-  install_dir: join_paths(sysconfdir, 'fwupd')
++  install_dir: join_paths(sysconfdir_install, 'fwupd')
  )
  # we use functions from 2.52 in the tests
- if get_option('tests') and umockdev.found() and gio.version().version_compare('>= 2.52')
+ if get_option('tests') and run_sanitize_unsafe_tests and umockdev.found() and gio.version().version_compare('>= 2.52')
 diff --git a/plugins/uefi-capsule/meson.build b/plugins/uefi-capsule/meson.build
-index 04cbd51a..9a8c43de 100644
+index ef38dc03e..78ff65e1d 100644
 --- a/plugins/uefi-capsule/meson.build
 +++ b/plugins/uefi-capsule/meson.build
-@@ -21,7 +21,7 @@ if host_machine.system() == 'linux'
-     output : '35_fwupd',
-     configuration : con2,
+@@ -20,7 +20,7 @@ if host_machine.system() == 'linux'
+     output: '35_fwupd',
+     configuration: con2,
      install: true,
 -    install_dir: join_paths(sysconfdir, 'grub.d')
 +    install_dir: join_paths(sysconfdir_install, 'grub.d')
    )
  elif host_machine.system() == 'freebsd'
    backend_srcs += 'fu-uefi-backend-freebsd.c'
-@@ -114,7 +114,7 @@ if get_option('compat_cli') and get_option('man')
+@@ -110,7 +110,7 @@ if get_option('compat_cli') and get_option('man')
  endif
  
  install_data(['uefi_capsule.conf'],
--  install_dir:  join_paths(sysconfdir, 'fwupd')
-+  install_dir:  join_paths(sysconfdir_install, 'fwupd')
+-  install_dir: join_paths(sysconfdir, 'fwupd')
++  install_dir: join_paths(sysconfdir_install, 'fwupd')
  )
  
  # add all the .po files as inputs to watch
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/default.nix
index 272bd6dbe8fc..541bef93a8a3 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/default.nix
@@ -3,9 +3,8 @@
 { stdenv
 , lib
 , fetchurl
-, fetchpatch
 , fetchFromGitHub
-, gtk-doc
+, gi-docgen
 , pkg-config
 , gobject-introspection
 , gettext
@@ -18,7 +17,6 @@
 , libarchive
 , curl
 , libjcat
-, libxslt
 , elfutils
 , libsmbios
 , efivar
@@ -26,14 +24,12 @@
 , meson
 , libuuid
 , colord
-, docbook_xml_dtd_43
-, docbook-xsl-nons
 , ninja
 , gcab
 , gnutls
 , protobufc
 , python3
-, wrapGAppsHook
+, wrapGAppsNoGuiHook
 , json-glib
 , bash-completion
 , shared-mime-info
@@ -54,6 +50,8 @@
 , modemmanager
 , libqmi
 , libmbim
+, libcbor
+, xz
 }:
 
 let
@@ -116,7 +114,7 @@ let
 
   self = stdenv.mkDerivation rec {
     pname = "fwupd";
-    version = "1.7.6";
+    version = "1.8.3";
 
     # libfwupd goes to lib
     # daemon, plug-ins and libfwupdplugin go to out
@@ -125,7 +123,7 @@ let
 
     src = fetchurl {
       url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz";
-      sha256 = "sha256-fr4VFKy2iNJknOzDktuSkJTaPwPPyYqcD6zKuwhJEvo=";
+      sha256 = "sha256-ciIpd86KhmJRH/o8CIFWb2xFjsjWHSUNlGYRfWEiOOw=";
     };
 
     patches = [
@@ -140,32 +138,18 @@ let
       # they are not really part of the library.
       ./install-fwupdplugin-to-out.patch
 
-      # Fix detection of installed tests
-      # https://github.com/fwupd/fwupd/issues/3880
-      (fetchpatch {
-        url = "https://github.com/fwupd/fwupd/commit/5bc546221331feae9cedc1892219a25d8837955f.patch";
-        sha256 = "XcLhcDrB2/MFCXjKAyhftQgvJG4BBkp07geM9eK3q1g=";
-      })
-
       # Installed tests are installed to different output
       # we also cannot have fwupd-tests.conf in $out/etc since it would form a cycle.
       ./installed-tests-path.patch
 
       # EFI capsule is located in fwupd-efi now.
       ./efi-app-path.patch
-
-      # Drop hard-coded FHS path
-      # https://github.com/fwupd/fwupd/issues/4360
-      (fetchpatch {
-        url = "https://github.com/fwupd/fwupd/commit/14cc2e7ee471b66ee2ef54741f4bec1f92204620.patch";
-        sha256 = "47682oqE66Y6QKPtN2mYpnb2+TIJFqBgsgx60LmC3FM=";
-      })
     ];
 
     nativeBuildInputs = [
       meson
       ninja
-      gtk-doc
+      gi-docgen
       pkg-config
       gobject-introspection
       gettext
@@ -173,12 +157,9 @@ let
       valgrind
       gcab
       gnutls
-      docbook_xml_dtd_43
-      docbook-xsl-nons
-      libxslt
       protobufc # for protoc
       python
-      wrapGAppsHook
+      wrapGAppsNoGuiHook
       vala
     ];
 
@@ -204,16 +185,20 @@ let
       protobufc
       modemmanager
       libmbim
+      libcbor
       libqmi
+      xz # for liblzma.
     ] ++ lib.optionals haveDell [
       libsmbios
+    ] ++ lib.optionals haveFlashrom [
+      flashrom
     ];
 
     mesonFlags = [
-      "-Ddocs=gtkdoc"
+      "-Ddocs=enabled"
       "-Dplugin_dummy=true"
       # We are building the official releases.
-      "-Dsupported_build=true"
+      "-Dsupported_build=enabled"
       # Would dlopen libsoup to preserve compatibility with clients linking against older fwupd.
       # https://github.com/fwupd/fwupd/commit/173d389fa59d8db152a5b9da7cc1171586639c97
       "-Dsoup_session_compat=false"
@@ -224,7 +209,9 @@ let
       "--sysconfdir=/etc"
       "-Dsysconfdir_install=${placeholder "out"}/etc"
       "-Defi_os_dir=nixos"
-      "-Dplugin_modem_manager=true"
+      "-Dplugin_modem_manager=enabled"
+      # Requires Meson 0.63
+      "-Dgresource_quirks=disabled"
 
       # We do not want to place the daemon into lib (cyclic reference)
       "--libexecdir=${placeholder "out"}/libexec"
@@ -232,14 +219,14 @@ let
       # against libfwupdplugin which is in $out/lib.
       "-Dc_link_args=-Wl,-rpath,${placeholder "out"}/lib"
     ] ++ lib.optionals (!haveDell) [
-      "-Dplugin_dell=false"
-      "-Dplugin_synaptics_mst=false"
+      "-Dplugin_dell=disabled"
+      "-Dplugin_synaptics_mst=disabled"
     ] ++ lib.optionals (!haveRedfish) [
-      "-Dplugin_redfish=false"
-    ] ++ lib.optionals haveFlashrom [
-      "-Dplugin_flashrom=true"
+      "-Dplugin_redfish=disabled"
+    ] ++ lib.optionals (!haveFlashrom) [
+      "-Dplugin_flashrom=disabled"
     ] ++ lib.optionals (!haveMSR) [
-      "-Dplugin_msr=false"
+      "-Dplugin_msr=disabled"
     ];
 
     # TODO: wrapGAppsHook wraps efi capsule even though it is not ELF
@@ -270,10 +257,20 @@ let
         meson_post_install.sh \
         po/test-deps
 
+      # This checks a version of a dependency of gi-docgen but gi-docgen is self-contained in Nixpkgs.
+      echo "Clearing docs/test-deps.py"
+      test -f docs/test-deps.py
+      echo > docs/test-deps.py
+
       substituteInPlace data/installed-tests/fwupdmgr-p2p.sh \
         --replace "gdbus" ${glib.bin}/bin/gdbus
     '';
 
+    preBuild = ''
+      # jcat-tool at buildtime requires a home directory
+      export HOME="$(mktemp -d)"
+    '';
+
     preCheck = ''
       addToSearchPath XDG_DATA_DIRS "${shared-mime-info}/share"
     '';
@@ -298,7 +295,7 @@ let
         efibootmgr
         bubblewrap
         tpm2-tools
-      ] ++ lib.optional haveFlashrom flashrom;
+      ];
     in ''
       gappsWrapperArgs+=(
         --prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
@@ -307,8 +304,8 @@ let
       )
     '';
 
-    # Since we had to disable wrapGAppsHook, we need to wrap the executables manually.
     postFixup = ''
+      # Since we had to disable wrapGAppsHook, we need to wrap the executables manually.
       find -L "$out/bin" "$out/libexec" -type f -executable -print0 \
         | while IFS= read -r -d ''' file; do
         if [[ "$file" != *.efi ]]; then
@@ -316,6 +313,9 @@ let
           wrapGApp "$file"
         fi
       done
+
+      # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
+      moveToOutput "share/doc" "$devdoc"
     '';
 
     separateDebugInfo = true;
@@ -323,7 +323,6 @@ let
     passthru = {
       filesInstalledToEtc = [
         "fwupd/daemon.conf"
-        "fwupd/msr.conf"
         "fwupd/remotes.d/lvfs-testing.conf"
         "fwupd/remotes.d/lvfs.conf"
         "fwupd/remotes.d/vendor.conf"
@@ -341,6 +340,8 @@ let
         "fwupd/remotes.d/dell-esrt.conf"
       ] ++ lib.optionals haveRedfish [
         "fwupd/redfish.conf"
+      ] ++ lib.optionals haveMSR [
+        "fwupd/msr.conf"
       ];
 
       # DisabledPlugins key in fwupd/daemon.conf
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/efi-app-path.patch b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/efi-app-path.patch
index c2502502a40c..afee6d9f61ea 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/efi-app-path.patch
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/efi-app-path.patch
@@ -1,10 +1,10 @@
 diff --git a/meson.build b/meson.build
-index 4330512e..e53b70ab 100644
+index b91dd037..01d70a61 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -403,7 +403,7 @@ endif
- if build_standalone and get_option('plugin_uefi_capsule')
-   efiboot = dependency('efiboot')
+@@ -413,7 +413,7 @@ if build_standalone and efiboot.found() and efivar.found()
+     conf.set('HAVE_EFI_TIME_T', '1')
+   endif
  
 -  efi_app_location = join_paths(libexecdir, 'fwupd', 'efi')
 +  efi_app_location = join_paths(dependency('fwupd-efi').get_pkgconfig_variable('prefix'), 'libexec', 'fwupd', 'efi')
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch
index 6667156e831c..f3369b6e1333 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/install-fwupdplugin-to-out.patch
@@ -1,32 +1,32 @@
 diff --git a/libfwupdplugin/meson.build b/libfwupdplugin/meson.build
-index d6a2ed68..12c82a95 100644
+index 1afa28e1..3da81d30 100644
 --- a/libfwupdplugin/meson.build
 +++ b/libfwupdplugin/meson.build
-@@ -216,7 +216,8 @@ fwupdplugin = library(
+@@ -220,7 +220,8 @@ fwupdplugin = library(
    ],
-   link_args : vflag,
-   link_depends : fwupdplugin_mapfile,
--  install : true
-+  install : true,
-+  install_dir : bindir / '..' / 'lib',
+   link_args: cc.get_supported_link_arguments([vflag]),
+   link_depends: fwupdplugin_mapfile,
+-  install: true
++  install: true,
++  install_dir: bindir / '..' / 'lib',
  )
  
  fwupdplugin_pkgg = import('pkgconfig')
-@@ -276,7 +277,8 @@ if get_option('introspection')
+@@ -280,7 +281,8 @@ if introspection.allowed()
        girtargets,
        fwupd_gir[0],
      ],
--    install : true
-+    install : true,
-+    install_dir_typelib : bindir / '..' / 'lib' / 'girepository-1.0',
+-    install: true
++    install: true,
++    install_dir_typelib: bindir / '..' / 'lib' / 'girepository-1.0',
    )
  
    # Verify the map file is correct -- note we can't actually use the generated
 diff --git a/meson.build b/meson.build
-index 38aa36b0..3fb7e579 100644
+index b91dd037..f97b4c26 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -521,7 +521,7 @@ if build_standalone
+@@ -504,7 +504,7 @@ if build_standalone
  if host_machine.system() == 'windows'
    plugin_dir = 'fwupd-plugins-@0@'.format(libfwupdplugin_lt_current)
  else
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch
index ea50d88dfed6..49bca65d9c60 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch
@@ -1,5 +1,5 @@
 diff --git a/data/installed-tests/meson.build b/data/installed-tests/meson.build
-index b8ec916f0..38209b363 100644
+index b8ec916f..38209b36 100644
 --- a/data/installed-tests/meson.build
 +++ b/data/installed-tests/meson.build
 @@ -83,5 +83,5 @@ configure_file(
@@ -10,10 +10,10 @@ index b8ec916f0..38209b363 100644
 +  install_dir: join_paths(get_option('installed_test_prefix'), 'etc', 'fwupd', 'remotes.d'),
  )
 diff --git a/meson.build b/meson.build
-index 32fe6e408..b35d741e0 100644
+index b91dd037..d7e20b18 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -183,8 +183,8 @@ else
+@@ -188,8 +188,8 @@ else
    datadir = join_paths(prefix, get_option('datadir'))
    sysconfdir = join_paths(prefix, get_option('sysconfdir'))
    localstatedir = join_paths(prefix, get_option('localstatedir'))
@@ -21,10 +21,10 @@ index 32fe6e408..b35d741e0 100644
 -  installed_test_datadir = join_paths(datadir, 'installed-tests', meson.project_name())
 +  installed_test_bindir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
 +  installed_test_datadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
+   daemon_dir = join_paths(libexecdir, 'fwupd')
  endif
  mandir = join_paths(prefix, get_option('mandir'))
- localedir = join_paths(prefix, get_option('localedir'))
-@@ -484,6 +484,7 @@ gnome = import('gnome')
+@@ -492,6 +492,7 @@ gnome = import('gnome')
  i18n = import('i18n')
  
  conf.set_quoted('FWUPD_PREFIX', prefix)
@@ -33,19 +33,19 @@ index 32fe6e408..b35d741e0 100644
  conf.set_quoted('FWUPD_LIBDIR', libdir)
  conf.set_quoted('FWUPD_LIBEXECDIR', libexecdir)
 diff --git a/meson_options.txt b/meson_options.txt
-index 0a0e2853..5f68d78b 100644
+index d00038db..be1c45b4 100644
 --- a/meson_options.txt
 +++ b/meson_options.txt
-@@ -25,6 +26,7 @@ option('plugin_coreboot', type : 'boolean', value : true, description : 'enable
- option('systemd', type : 'boolean', value : true, description : 'enable systemd support')
+@@ -56,6 +56,7 @@ option('systemd', type : 'feature', description : 'systemd support', deprecated:
+ option('systemd_unit_user', type : 'string', description : 'User account to use for fwupd-refresh.service (empty for DynamicUser)')
  option('systemd_root_prefix', type: 'string', value: '', description: 'Directory to base systemd’s installation directories on')
- option('elogind', type : 'boolean', value : false, description : 'enable elogind support')
+ option('elogind', type : 'feature', description : 'elogind support', deprecated: {'true': 'enabled', 'false': 'disabled'})
 +option('installed_test_prefix', type: 'string', description: 'Prefix for installed tests')
  option('tests', type : 'boolean', value : true, description : 'enable tests')
- option('tpm', type : 'boolean', value : true, description : 'enable TPM support')
- option('udevdir', type: 'string', value: '', description: 'Directory for udev rules')
+ option('soup_session_compat', type : 'boolean', value : true, description : 'enable SoupSession runtime compatibility support')
+ option('curl', type : 'feature', description : 'libcurl support', deprecated: {'true': 'enabled', 'false': 'disabled'})
 diff --git a/plugins/redfish/fu-self-test.c b/plugins/redfish/fu-self-test.c
-index c507fabc8..0cddc3248 100644
+index 4d19e560..91cfaa61 100644
 --- a/plugins/redfish/fu-self-test.c
 +++ b/plugins/redfish/fu-self-test.c
 @@ -27,7 +27,7 @@ fu_test_is_installed_test(void)
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/intel2200BGFirmware/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/intel2200BGFirmware/default.nix
index 7c195cd2d7ca..716c5e4d8288 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/intel2200BGFirmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/intel2200BGFirmware/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ stdenvNoCC
 , lib
 , fetchurl }:
 
-stdenv.mkDerivation rec {
+stdenvNoCC.mkDerivation rec {
   pname = "intel2200BGFirmware";
   version = "3.1";
 
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/libreelec-dvb-firmware/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/libreelec-dvb-firmware/default.nix
index 2103012d3ed9..9579ff11c739 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/libreelec-dvb-firmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/libreelec-dvb-firmware/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, lib}:
+{ stdenvNoCC, fetchFromGitHub, lib}:
 
-stdenv.mkDerivation rec {
+stdenvNoCC.mkDerivation rec {
   pname = "libreelec-dvb-firmware";
   version = "1.4.2";
 
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/linux-firmware/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/linux-firmware/default.nix
index 22dc930d293d..20058e7bc821 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/linux-firmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/linux-firmware/default.nix
@@ -1,13 +1,12 @@
-{ stdenvNoCC, fetchgit, lib }:
+{ stdenvNoCC, fetchzip, lib }:
 
 stdenvNoCC.mkDerivation rec {
   pname = "linux-firmware";
-  version = "20220310";
+  version = "20220815";
 
-  src = fetchgit {
-    url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git";
-    rev = "refs/tags/${version}";
-    sha256 = "sha256-U5XZHzriZaPlgiAcrZnAA7K8PKnIGy58Pi6JziVFTR8=";
+  src = fetchzip {
+    url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${version}.tar.gz";
+    sha256 = "sha256-StPlnwn4KOvOf4fRblDzJQqyI8iIz8e9fo/BsTyCKjI=";
   };
 
   installFlags = [ "DESTDIR=$(out)" ];
@@ -17,7 +16,7 @@ stdenvNoCC.mkDerivation rec {
 
   outputHashMode = "recursive";
   outputHashAlgo = "sha256";
-  outputHash = "sha256-CAYJssH36aKhzvl0q60HyxgDXeAluspfnLLmawmWIQw=";
+  outputHash = "sha256-VTRrOOkdWepUCKAkziO/0egb3oaQEOJCtsuDEgs/W78=";
 
   meta = with lib; {
     description = "Binary firmware collection packaged by kernel.org";
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix
index 4ade35845ecb..730e839bd457 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/raspberrypi-wireless/default.nix
@@ -1,8 +1,8 @@
-{ lib, stdenv, fetchFromGitHub }:
+{ lib, stdenvNoCC, fetchFromGitHub }:
 
-stdenv.mkDerivation {
+stdenvNoCC.mkDerivation {
   pname = "raspberrypi-wireless-firmware";
-  version = "2021-11-02";
+  version = "2021-12-06";
 
   srcs = [
     (fetchFromGitHub {
@@ -10,14 +10,14 @@ stdenv.mkDerivation {
       owner = "RPi-Distro";
       repo = "bluez-firmware";
       rev = "e7fd166981ab4bb9a36c2d1500205a078a35714d";
-      sha256 = "1dkg8mzn7n4afi50ibrda2s33nw2qj52jjjdv9w560q601gms47b";
+      hash = "sha256-6xBdXwAGA1N42k1KKYrEgtsxtFAtrwhKdIrYY39Fb7Y=";
     })
     (fetchFromGitHub {
       name = "firmware-nonfree";
       owner = "RPi-Distro";
       repo = "firmware-nonfree";
-      rev = "54ffdd6e2ea6055d46656b78e148fe7def3ec9d8";
-      sha256 = "4WTrs/tUyOugufRrrh0qsEmhPclQD64ypYysxsnOyS8=";
+      rev = "99d5c588e95ec9c9b86d7e88d3cf85b4f729d2bc";
+      hash = "sha256-xg6fYQvg7t2ikyLI8/XfpiNaNTf7CNFQlAzpTldTz10=";
     })
   ];
 
@@ -32,20 +32,19 @@ stdenv.mkDerivation {
     mkdir -p "$out/lib/firmware/brcm"
 
     # Wifi firmware
-    shopt -s extglob
-    for filename in firmware-nonfree/brcm/brcmfmac434??{,s}-sdio.*; do
-      cp "$filename" "$out/lib/firmware/brcm"
-    done
+    cp -rv "$NIX_BUILD_TOP/firmware-nonfree/debian/config/brcm80211/." "$out/lib/firmware/"
 
     # Bluetooth firmware
-    cp bluez-firmware/broadcom/*.hcd "$out/lib/firmware/brcm"
+    cp -rv "$NIX_BUILD_TOP/bluez-firmware/broadcom/." "$out/lib/firmware/brcm"
+
+    # CM4 symlink must be added since it's missing from upstream
+    pushd $out/lib/firmware/brcm &>/dev/null
+    ln -s "./brcmfmac43455-sdio.txt" "$out/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt"
+    popd &>/dev/null
+
     runHook postInstall
   '';
 
-  outputHashMode = "recursive";
-  outputHashAlgo = "sha256";
-  outputHash = "l+7VOq7CV5QA8/FWjMBGDcxq8Qe7NFf6E2Y42htZEgE=";
-
   meta = with lib; {
     description = "Firmware for builtin Wifi/Bluetooth devices in the Raspberry Pi 3+ and Zero W";
     homepage = "https://github.com/RPi-Distro/firmware-nonfree";
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/raspberrypi/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/raspberrypi/default.nix
index 7f0eef05dc4e..9181a94dcb66 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/raspberrypi/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/raspberrypi/default.nix
@@ -1,17 +1,17 @@
-{ lib, stdenvNoCC, fetchurl, unzip }:
+{ lib, stdenvNoCC, fetchFromGitHub }:
 
 stdenvNoCC.mkDerivation rec {
   # NOTE: this should be updated with linux_rpi
   pname = "raspberrypi-firmware";
-  version = "1.20220118";
+  version = "1.20220331";
 
-  src = fetchurl {
-    url = "https://github.com/raspberrypi/firmware/archive/${version}.zip";
-    sha256 = "sha256-98rbwKIuB7vb4MWbFCr7TYsvJB0HzPdH8Tw0+bktK/M=";
+  src = fetchFromGitHub {
+    owner = "raspberrypi";
+    repo = "firmware";
+    rev = version;
+    hash = "sha256-TxlpHPEJAtVJTtDghuJpx2mLjEPiKkcAr7S9Cd/cocE=";
   };
 
-  nativeBuildInputs = [ unzip ];
-
   installPhase = ''
     mkdir -p $out/share/raspberrypi/
     mv boot "$out/share/raspberrypi/"
@@ -26,5 +26,6 @@ stdenvNoCC.mkDerivation rec {
     homepage = "https://github.com/raspberrypi/firmware";
     license = licenses.unfreeRedistributableFirmware; # See https://github.com/raspberrypi/firmware/blob/master/boot/LICENCE.broadcom
     maintainers = with maintainers; [ dezgeg ];
+    broken = stdenvNoCC.isDarwin; # Hash mismatch on source, mystery.
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/rt5677/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/rt5677/default.nix
index f21d34bbe533..47e0068cc348 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/rt5677/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/rt5677/default.nix
@@ -1,6 +1,6 @@
-{ lib, stdenv, fetchFromGitHub }:
+{ lib, stdenvNoCC, fetchFromGitHub }:
 
-stdenv.mkDerivation {
+stdenvNoCC.mkDerivation {
   name = "rt5677-firmware";
 
   src = fetchFromGitHub {
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix
index 3363140ad569..53f32ac31f9d 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix
@@ -1,6 +1,6 @@
-{ lib, stdenv, fetchFromGitHub }:
+{ lib, stdenvNoCC, fetchFromGitHub }:
 with lib;
-stdenv.mkDerivation {
+stdenvNoCC.mkDerivation {
   pname = "rtl8192su";
   version = "unstable-2016-10-05";
 
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/rtl8723bs-firmware/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/rtl8723bs-firmware/default.nix
index f3ea80348b3b..8e486e1c4b2c 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/rtl8723bs-firmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/rtl8723bs-firmware/default.nix
@@ -1,6 +1,6 @@
-{ lib, stdenv, linuxPackages }:
+{ lib, stdenvNoCC, linuxPackages }:
 with lib;
-stdenv.mkDerivation {
+stdenvNoCC.mkDerivation {
   pname = "rtl8723bs-firmware";
   version = linuxPackages.rtl8723bs.version;
   inherit (linuxPackages.rtl8723bs) src;
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/rtl8761b-firmware/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/rtl8761b-firmware/default.nix
index 925521696da9..c3fbe79537c4 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/rtl8761b-firmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/rtl8761b-firmware/default.nix
@@ -1,6 +1,6 @@
-{ lib, stdenv, fetchFromGitHub }:
+{ lib, stdenvNoCC, fetchFromGitHub }:
 
-stdenv.mkDerivation {
+stdenvNoCC.mkDerivation {
   name = "rtl8761b-firmware";
 
   src = fetchFromGitHub {
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/sof-firmware/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/sof-firmware/default.nix
index 841e73cfc8ba..b15f4c4949de 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/sof-firmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/sof-firmware/default.nix
@@ -5,13 +5,13 @@
 
 stdenvNoCC.mkDerivation rec {
   pname = "sof-firmware";
-  version = "2.0";
+  version = "2.2";
 
   src = fetchFromGitHub {
     owner = "thesofproject";
     repo = "sof-bin";
     rev = "v${version}";
-    sha256 = "sha256-pDxNcDe/l1foFYuHB0w3YZidKIeH6h0IuwRmMzeMteE=";
+    sha256 = "sha256-/gjGTDOXJ0vz/MH2hlistS3X3Euqf8T6TLnD1A2SBYo=";
   };
 
   dontFixup = true; # binaries must not be stripped or patchelfed
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/system76-firmware/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/system76-firmware/default.nix
index 5ec2bd70fdb6..a019a6f79321 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/system76-firmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/system76-firmware/default.nix
@@ -2,13 +2,13 @@
 rustPlatform.buildRustPackage rec {
   pname = "system76-firmware";
   # Check Makefile when updating, make sure postInstall matches make install
-  version = "1.0.32";
+  version = "1.0.39";
 
   src = fetchFromGitHub {
     owner = "pop-os";
     repo = pname;
     rev = version;
-    sha256 = "sha256-EV7byqfoz0sAIkf/hgZh+m7D2+54DEnE4td4CTX6c4s=";
+    sha256 = "sha256-nPHBL73hmvW9z5SQjmfu+ozMXxUEajNQxNtE/V9QwZ0=";
   };
 
   nativeBuildInputs = [ pkg-config makeWrapper ];
@@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec {
 
   cargoBuildFlags = [ "--workspace" ];
 
-  cargoSha256 = "sha256-/bf5JQgyFN8TH7o2TWHX5sv/NkxBLJ495iVW8c9Vqis=";
+  cargoSha256 = "sha256-BrzicLj7FbUqRG1BgQIRqh801tRQpRZkHSiX3ekAYqc=";
 
   # Purposefully don't install systemd unit file, that's for NixOS
   postInstall = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/xow_dongle-firmware/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/xow_dongle-firmware/default.nix
index 0375eb0eead8..824615a4baf2 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/xow_dongle-firmware/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/xow_dongle-firmware/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, lib, fetchurl, cabextract }:
+{ stdenvNoCC, lib, fetchurl, cabextract }:
 
-stdenv.mkDerivation rec {
+stdenvNoCC.mkDerivation rec {
   pname = "xow_dongle-firmware";
   version = "2017-07";
 
-  dontUnpack = true;
-  dontInstall = true;
+  dontConfigure = true;
+  dontBuild = true;
 
   src = fetchurl {
     url = "http://download.windowsupdate.com/c/msdownload/update/driver/drvs/2017/07/1cd6a87c-623f-4407-a52d-c31be49e925c_e19f60808bdcbfbd3c3df6be3e71ffc52e43261e.cab";
@@ -14,10 +14,14 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cabextract ];
 
-  buildPhase = ''
+  sourceRoot = "./.";
+
+  unpackCmd = ''
     cabextract -F FW_ACC_00U.bin ${src}
-    mkdir -p $out/lib/firmware
-    cp -a FW_ACC_00U.bin $out/lib/firmware/xow_dongle.bin
+  '';
+
+  installPhase = ''
+    install -Dm644 FW_ACC_00U.bin ${placeholder "out"}/lib/firmware/xow_dongle.bin
   '';
 
   meta = with lib; {
@@ -28,5 +32,3 @@ stdenv.mkDerivation rec {
     platforms = platforms.linux;
   };
 }
-
-
diff --git a/nixpkgs/pkgs/os-specific/linux/firmware/zd1211/default.nix b/nixpkgs/pkgs/os-specific/linux/firmware/zd1211/default.nix
index 075e46a5de55..6b86277ebc6e 100644
--- a/nixpkgs/pkgs/os-specific/linux/firmware/zd1211/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/firmware/zd1211/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ stdenvNoCC
 , lib
 , fetchurl
 }:
 
-stdenv.mkDerivation rec {
+stdenvNoCC.mkDerivation rec {
   pname = "zd1211-firmware";
   version = "1.5";
 
diff --git a/nixpkgs/pkgs/os-specific/linux/fsverity-utils/default.nix b/nixpkgs/pkgs/os-specific/linux/fsverity-utils/default.nix
new file mode 100644
index 000000000000..c5bed075338f
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/fsverity-utils/default.nix
@@ -0,0 +1,51 @@
+{ stdenv
+, lib
+, fetchgit
+, openssl
+, enableShared ? !stdenv.hostPlatform.isStatic
+, enableManpages ? false
+, pandoc
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fsverity-utils";
+  version = "1.5";
+
+  outputs = [ "out" "lib" "dev" ] ++ lib.optional enableManpages "man";
+
+  src = fetchgit {
+    url = "https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/fsverity-utils.git";
+    rev = "v${version}";
+    sha256 = "sha256-ygBOkp2PBe8Z2ak6SXEJ6HHuT4NRKmIsbJDHcY+h8PQ=";
+  };
+
+  patches = lib.optionals (!enableShared) [
+    ./remove-dynamic-libs.patch
+  ];
+
+  enableParallelBuilding = true;
+  strictDeps = true;
+
+  nativeBuildInputs = lib.optional enableManpages pandoc;
+  buildInputs = [ openssl ];
+
+  makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ] ++ lib.optional enableShared "USE_SHARED_LIB=1";
+
+  doCheck = true;
+
+  installTargets = [ "install" ] ++ lib.optional enableManpages "install-man";
+
+  postInstall = ''
+    mkdir -p $lib
+    mv $out/lib $lib/lib
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.kernel.org/doc/html/latest/filesystems/fsverity.html#userspace-utility";
+    changelog = "https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/fsverity-utils.git/tree/NEWS.md";
+    description = "A set of userspace utilities for fs-verity";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jk ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/fsverity-utils/remove-dynamic-libs.patch b/nixpkgs/pkgs/os-specific/linux/fsverity-utils/remove-dynamic-libs.patch
new file mode 100644
index 000000000000..95635cbccdb8
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/fsverity-utils/remove-dynamic-libs.patch
@@ -0,0 +1,27 @@
+diff --git a/Makefile b/Makefile
+index 2304a21..697ccd4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -149,13 +149,11 @@ libfsverity.so.$(SOVERSION):$(SHARED_LIB_OBJ)
+ 	$(QUIET_CCLD) $(CC) -o $@ -Wl,-soname=$@ -shared $+ \
+ 		$(CFLAGS) $(LDFLAGS) $(LDLIBS)
+ 
+-DEFAULT_TARGETS += libfsverity.so.$(SOVERSION)
+ 
+ # Create the symlink libfsverity.so => libfsverity.so.$(SOVERSION)
+ libfsverity.so:libfsverity.so.$(SOVERSION)
+ 	$(QUIET_LN) ln -sf $+ $@
+ 
+-DEFAULT_TARGETS += libfsverity.so
+ 
+ ##############################################################################
+ 
+@@ -263,8 +261,6 @@ install:all
+ 	install -d $(DESTDIR)$(LIBDIR)/pkgconfig $(DESTDIR)$(INCDIR) $(DESTDIR)$(BINDIR)
+ 	install -m755 $(FSVERITY) $(DESTDIR)$(BINDIR)
+ 	install -m644 libfsverity.a $(DESTDIR)$(LIBDIR)
+-	install -m755 libfsverity.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)
+-	ln -sf libfsverity.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)/libfsverity.so
+ 	install -m644 include/libfsverity.h $(DESTDIR)$(INCDIR)
+ 	sed -e "s|@PREFIX@|$(PREFIX)|" \
+ 		-e "s|@LIBDIR@|$(LIBDIR)|" \
diff --git a/nixpkgs/pkgs/os-specific/linux/fuse/common.nix b/nixpkgs/pkgs/os-specific/linux/fuse/common.nix
index 5adb1b5355ad..ac4deb19f51c 100644
--- a/nixpkgs/pkgs/os-specific/linux/fuse/common.nix
+++ b/nixpkgs/pkgs/os-specific/linux/fuse/common.nix
@@ -31,7 +31,13 @@ in stdenv.mkDerivation rec {
       })
     ++ (if isFuse3
       then [ ./fuse3-install.patch ./fuse3-Do-not-set-FUSERMOUNT_DIR.patch ]
-      else [ ./fuse2-Do-not-set-FUSERMOUNT_DIR.patch ]);
+      else [
+        ./fuse2-Do-not-set-FUSERMOUNT_DIR.patch
+        (fetchpatch {
+          url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/fuse/files/fuse-2.9.9-closefrom-glibc-2-34.patch?id=8a970396fca7aca2d5a761b8e7a8242f1eef14c9";
+          sha256 = "sha256-ELYBW/wxRcSMssv7ejCObrpsJHtOPJcGq33B9yHQII4=";
+        })
+      ]);
 
   nativeBuildInputs = if isFuse3
     then [ meson ninja pkg-config ]
@@ -92,7 +98,7 @@ in stdenv.mkDerivation rec {
       provides the reference implementation for communicating with the FUSE
       kernel module.
     '';
-    inherit (src.meta) homepage;
+    homepage = "https://github.com/libfuse/libfuse";
     changelog = "https://github.com/libfuse/libfuse/releases/tag/fuse-${version}";
     platforms = platforms.linux;
     license = with licenses; [ gpl2Only lgpl21Only ];
diff --git a/nixpkgs/pkgs/os-specific/linux/fuse/default.nix b/nixpkgs/pkgs/os-specific/linux/fuse/default.nix
index b1d9d3dc41ef..6aa3e46d4e1a 100644
--- a/nixpkgs/pkgs/os-specific/linux/fuse/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/fuse/default.nix
@@ -11,7 +11,7 @@ in {
   };
 
   fuse_3 = mkFuse {
-    version = "3.10.5";
-    sha256Hash = "1yxh85m8fnn3w21f6g6vza7k2giizmyhcbkms4rmkcd2dd2rzk3y";
+    version = "3.11.0";
+    sha256Hash = "1wx80xxlvjn0wxhmkr1g91vwrgxssyzds1hizzxc2xrd4kjh9dfb";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/g15daemon/default.nix b/nixpkgs/pkgs/os-specific/linux/g15daemon/default.nix
index 118a17c4c8f0..d20fb662ff55 100644
--- a/nixpkgs/pkgs/os-specific/linux/g15daemon/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/g15daemon/default.nix
@@ -79,6 +79,11 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libg15 libg15render ];
 
+  # Workaround build failure on -fno-common toolchains like upstream gcc-10:
+  #  ld: g15_plugins.o:/build/g15daemon-1.9.5.3/g15daemon/./g15daemon.h:218:
+  #   multiple definition of `lcdlist_mutex'; utility_funcs.o:g15daemon.h:218: first defined here
+  NIX_CFLAGS_COMPILE = "-fcommon";
+
   enableParallelBuilding = true;
 
   meta = {
diff --git a/nixpkgs/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix b/nixpkgs/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix
index bcea220cc96e..1f0265207dfb 100644
--- a/nixpkgs/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix
@@ -8,13 +8,13 @@ let
   kerneldir = "lib/modules/${kernel.modDirVersion}";
 in stdenv.mkDerivation rec {
   pname = "gcadapter-oc-kmod";
-  version = "1.4";
+  version = "unstable-2021-12-11";
 
   src = fetchFromGitHub {
     owner = "HannesMann";
     repo = pname;
-    rev = "v${version}";
-    sha256 = "1nqhj3vqq9rnj37cnm2c4867mnxkr8di3i036shcz44h9qmy9d40";
+    rev = "d4ddf15deb74c51dbdfc814d481ef127c371f444";
+    sha256 = "sha256-bHA1611rcO8/d48b1CHsiurEt3/n+5WErtHXAU7Eh1o=";
   };
 
   nativeBuildInputs = kernel.moduleBuildDependencies;
diff --git a/nixpkgs/pkgs/os-specific/linux/gt/default.nix b/nixpkgs/pkgs/os-specific/linux/gt/default.nix
index a7e4c0750463..e227b6b6bc91 100644
--- a/nixpkgs/pkgs/os-specific/linux/gt/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/gt/default.nix
@@ -4,20 +4,23 @@
 }:
 stdenv.mkDerivation {
   pname = "gt";
-  version = "unstable-2021-09-30";
+  version = "unstable-2022-05-08";
 
   src = fetchFromGitHub {
     owner = "linux-usb-gadgets";
     repo = "gt";
-    rev = "7247547a14b2d092dc03fd83218ae65c2f7ff7d6";
-    sha256 = "1has9q2sghd5vyi25l3h2hd4d315vvpld076iwwsg01fx4d9vjmg";
+    rev = "7f9c45d98425a27444e49606ce3cf375e6164e8e";
+    sha256 = "sha256-km4U+t4Id2AZx6GpH24p2WNmvV5RVjJ14sy8tWLCQsk=";
   };
-  sourceRoot = "source";
+
+  sourceRoot = "source/source";
 
   preConfigure = ''
     cmakeFlagsArray+=("-DBASH_COMPLETION_COMPLETIONSDIR=$out/share/bash-completions/completions")
   '';
+
   nativeBuildInputs = [ cmake pkg-config asciidoc ];
+
   buildInputs = [ bash-completion libconfig libusbgx];
 
   meta = {
diff --git a/nixpkgs/pkgs/os-specific/linux/hd-idle/default.nix b/nixpkgs/pkgs/os-specific/linux/hd-idle/default.nix
index a1f355a849c2..b9256158549a 100644
--- a/nixpkgs/pkgs/os-specific/linux/hd-idle/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/hd-idle/default.nix
@@ -2,13 +2,13 @@
 
 buildGoModule rec {
   pname = "hd-idle";
-  version = "1.16";
+  version = "1.17";
 
   src = fetchFromGitHub {
     owner = "adelolmo";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-LZcMwF/BhHiWWXMcrzbk8GyvwXdA3B2olmbOBxQwV5g=";
+    sha256 = "sha256-BHUjKvhUDeD/Xm0KKbkLH2XWn1W77E7Pm3OSPARF6Xw=";
   };
 
   vendorSha256 = null;
diff --git a/nixpkgs/pkgs/os-specific/linux/hdparm/default.nix b/nixpkgs/pkgs/os-specific/linux/hdparm/default.nix
index 2b112a9590b0..1dd0fa6a2089 100644
--- a/nixpkgs/pkgs/os-specific/linux/hdparm/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/hdparm/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "hdparm";
-  version = "9.63";
+  version = "9.64";
 
   src = fetchurl {
     url = "mirror://sourceforge/hdparm/hdparm-${version}.tar.gz";
-    sha256 = "sha256-cHhd6uu6WHeonBI1aLQd7pkNpV/FFCDxP2CaEHKJlpE=";
+    sha256 = "sha256-MVuVaVHD/qAnKH3iBDgVNCF8C9Dze0k1h3/i2wyrhZo=";
   };
 
   preBuild = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/hid-ite8291r3/default.nix b/nixpkgs/pkgs/os-specific/linux/hid-ite8291r3/default.nix
new file mode 100644
index 000000000000..d4f69c734ac0
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/hid-ite8291r3/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, kernel }:
+
+stdenv.mkDerivation rec {
+  pname = "hid-ite8291r3";
+  version = "unstable-2022-06-01";
+
+  src = fetchFromGitHub {
+    owner = "pobrn";
+    repo = "hid-ite8291r3";
+    rev = "48e04cb96517f8574225ebabb286775feb942ef5";
+    hash = "sha256-/69vvVbAVULDW8rwDYSj5706vrqJ6t4s/T6s3vmG9wk=";
+  };
+
+  nativeBuildInputs = kernel.moduleBuildDependencies;
+
+  makeFlags = kernel.makeFlags ++ [
+    "VERSION=${version}"
+    "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    install -D hid-ite8291r3.ko -t $out/lib/modules/${kernel.modDirVersion}/extra
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Linux driver for the ITE 8291 RGB keyboard backlight controller";
+    homepage = "https://github.com/pobrn/hid-ite8291r3/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ aacebedo ];
+    platforms = platforms.linux;
+    broken = kernel.kernelOlder "5.9";
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/hwdata/default.nix b/nixpkgs/pkgs/os-specific/linux/hwdata/default.nix
index f700bf035de8..fe789d51dbb5 100644
--- a/nixpkgs/pkgs/os-specific/linux/hwdata/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/hwdata/default.nix
@@ -2,24 +2,25 @@
 
 stdenv.mkDerivation rec {
   pname = "hwdata";
-  version = "0.347";
+  version = "0.360";
 
   src = fetchFromGitHub {
     owner = "vcrhonek";
     repo = "hwdata";
     rev = "v${version}";
-    sha256 = "19kmz25zq6qqs67ppqhws4mh3qf6zrp55cpyxyw36q95yjdcqp21";
+    sha256 = "sha256-dF1Yeb3xH4keQzcydZ3h3kyuSZ1knW/2YAJ8xvFSoMo=";
   };
 
-  preConfigure = "patchShebangs ./configure";
+  postPatch = ''
+    patchShebangs ./configure
+  '';
 
   configureFlags = [ "--datadir=${placeholder "out"}/share" ];
 
   doCheck = false; # this does build machine-specific checks (e.g. enumerates PCI bus)
 
   outputHashMode = "recursive";
-  outputHashAlgo = "sha256";
-  outputHash = "0haaczd6pi9q2vdlvbwn7100sb87zsy64z94xhpbmlari4vzjmz0";
+  outputHash = "sha256-gkgnHy1XwP87qpQiAm31AIAkxgGm5JYxMBr60kvd+gE=";
 
   meta = {
     homepage = "https://github.com/vcrhonek/hwdata";
diff --git a/nixpkgs/pkgs/os-specific/linux/ima-evm-utils/default.nix b/nixpkgs/pkgs/os-specific/linux/ima-evm-utils/default.nix
index afd46f0d9e8f..aeafd68e7080 100644
--- a/nixpkgs/pkgs/os-specific/linux/ima-evm-utils/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/ima-evm-utils/default.nix
@@ -20,6 +20,6 @@ stdenv.mkDerivation rec {
     homepage = "https://sourceforge.net/projects/linux-ima/";
     license = lib.licenses.gpl2;
     platforms = lib.platforms.linux;
-    maintainers = with lib.maintainers; [ tstrobel ];
+    maintainers = with lib.maintainers; [ ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/intel-cmt-cat/default.nix b/nixpkgs/pkgs/os-specific/linux/intel-cmt-cat/default.nix
index af194d9dc1ca..dd96e518300e 100644
--- a/nixpkgs/pkgs/os-specific/linux/intel-cmt-cat/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/intel-cmt-cat/default.nix
@@ -1,14 +1,14 @@
 { lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
-  version = "4.3.0";
+  version = "4.4.1";
   pname = "intel-cmt-cat";
 
   src = fetchFromGitHub {
     owner = "intel";
     repo = "intel-cmt-cat";
     rev = "v${version}";
-    sha256 = "sha256-9XZuSHWcAFN5otBfG8xE4gTIDixw7mYnHT/CTjyOvwo=";
+    sha256 = "sha256-6v9MRIW9Wqojia6GZNM75AvoYJGJ9C/k+ShwQKOjiL8=";
   };
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/os-specific/linux/intel-compute-runtime/default.nix b/nixpkgs/pkgs/os-specific/linux/intel-compute-runtime/default.nix
index 1d1d5667fe98..5c38e05fbfe4 100644
--- a/nixpkgs/pkgs/os-specific/linux/intel-compute-runtime/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/intel-compute-runtime/default.nix
@@ -11,13 +11,13 @@
 
 stdenv.mkDerivation rec {
   pname = "intel-compute-runtime";
-  version = "21.42.21270";
+  version = "22.32.23937";
 
   src = fetchFromGitHub {
     owner = "intel";
     repo = "compute-runtime";
     rev = version;
-    sha256 = "N9MsDcsL8kBWxfZjhukcxZiSJnXxqMgWF0etOhf2/AE=";
+    sha256 = "sha256-W+0EbrbF+jPtsf9QCMmSEX7HFDlfiRtD/kjeMJVqCoY=";
   };
 
   nativeBuildInputs = [ cmake pkg-config ];
diff --git a/nixpkgs/pkgs/os-specific/linux/intel-ocl/default.nix b/nixpkgs/pkgs/os-specific/linux/intel-ocl/default.nix
index 06cb18b23774..b1451421d69b 100644
--- a/nixpkgs/pkgs/os-specific/linux/intel-ocl/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/intel-ocl/default.nix
@@ -5,7 +5,12 @@ stdenv.mkDerivation rec {
   version = "5.0-63503";
 
   src = fetchzip {
-    url = "https://registrationcenter-download.intel.com/akdlm/irc_nas/11396/SRB5.0_linux64.zip";
+    # https://github.com/NixOS/nixpkgs/issues/166886
+    urls = [
+      "https://registrationcenter-download.intel.com/akdlm/irc_nas/11396/SRB5.0_linux64.zip"
+      "http://registrationcenter-download.intel.com/akdlm/irc_nas/11396/SRB5.0_linux64.zip"
+      "https://web.archive.org/web/20190526190814/http://registrationcenter-download.intel.com/akdlm/irc_nas/11396/SRB5.0_linux64.zip"
+    ];
     sha256 = "0qbp63l74s0i80ysh9ya8x7r79xkddbbz4378nms9i7a0kprg9p2";
     stripRoot = false;
   };
@@ -65,9 +70,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Official OpenCL runtime for Intel CPUs";
-    homepage    = "https://software.intel.com/en-us/articles/opencl-drivers";
-    license     = lib.licenses.unfree;
-    platforms   = [ "x86_64-linux" ];
+    homepage = "https://software.intel.com/en-us/articles/opencl-drivers";
+    license = lib.licenses.unfree;
+    platforms = [ "x86_64-linux" ];
     maintainers = [ lib.maintainers.kierdavis ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/intel-speed-select/default.nix b/nixpkgs/pkgs/os-specific/linux/intel-speed-select/default.nix
index 89b4feff7a50..2caad335d57c 100644
--- a/nixpkgs/pkgs/os-specific/linux/intel-speed-select/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/intel-speed-select/default.nix
@@ -16,5 +16,6 @@ stdenv.mkDerivation {
     homepage = "https://www.kernel.org/";
     license = licenses.gpl2;
     platforms = [ "i686-linux" "x86_64-linux" ]; # x86-specific
+    broken = kernel.kernelAtLeast "5.18";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/iproute/default.nix b/nixpkgs/pkgs/os-specific/linux/iproute/default.nix
index 74003ff83b83..4d06e82fcaef 100644
--- a/nixpkgs/pkgs/os-specific/linux/iproute/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/iproute/default.nix
@@ -1,15 +1,16 @@
 { lib, stdenv, fetchurl, fetchpatch
 , buildPackages, bison, flex, pkg-config
 , db, iptables, libelf, libmnl
+, gitUpdater
 }:
 
 stdenv.mkDerivation rec {
   pname = "iproute2";
-  version = "5.14.0";
+  version = "5.18.0";
 
   src = fetchurl {
     url = "mirror://kernel/linux/utils/net/${pname}/${pname}-${version}.tar.xz";
-    sha256 = "1m4ifnxq7lxnm95l5354z8dk3xj6w9isxmbz53266drgln2sf3r1";
+    sha256 = "W6PUZNUcjCg1UNUH/6w9EPeuxYe3xmsMy2lQZDZGOJ4=";
   };
 
   patches = [
@@ -48,6 +49,13 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  passthru.updateScript = gitUpdater {
+    inherit pname version;
+    # No nicer place to find latest release.
+    url = "https://git.kernel.org/pub/scm/network/iproute2/iproute2.git";
+    rev-prefix = "v";
+  };
+
   meta = with lib; {
     homepage = "https://wiki.linuxfoundation.org/networking/iproute2";
     description = "A collection of utilities for controlling TCP/IP networking and traffic control in Linux";
diff --git a/nixpkgs/pkgs/os-specific/linux/iproute/mptcp.nix b/nixpkgs/pkgs/os-specific/linux/iproute/mptcp.nix
index 8a4cde0c79ed..e43af52bb349 100644
--- a/nixpkgs/pkgs/os-specific/linux/iproute/mptcp.nix
+++ b/nixpkgs/pkgs/os-specific/linux/iproute/mptcp.nix
@@ -1,4 +1,4 @@
-{ lib, iproute2, fetchFromGitHub }:
+{ lib, iproute2, fetchFromGitHub, fetchpatch }:
 
 iproute2.overrideAttrs (oa: rec {
   pname = "iproute_mptcp";
@@ -15,8 +15,19 @@ iproute2.overrideAttrs (oa: rec {
     patchShebangs configure
   '';
 
-  # We override "patches" to never apply any iproute2 patches:
-  patches = [ ];
+  patches = [
+    # We override "patches" to never apply any iproute2 patches:
+  ] ++ [
+    # iproute-mptcp patches:
+
+    # Pull upstream fix for -fno-common toolchain support:
+    #   https://github.com/multipath-tcp/iproute-mptcp/pull/8
+    (fetchpatch {
+      name = "fno-common.patch";
+      url = "https://github.com/multipath-tcp/iproute-mptcp/commit/7aebfde8624c978f6f73b03142892f802d21cc0b.patch";
+      sha256 = "098402sjdm10r9xggz6naygnfjs74d9k3s2wc2aczx0d2zayhff8";
+    })
+  ];
 
   meta = with lib; {
     homepage = "https://github.com/multipath-tcp/iproute-mptcp";
diff --git a/nixpkgs/pkgs/os-specific/linux/iptables/default.nix b/nixpkgs/pkgs/os-specific/linux/iptables/default.nix
index c6dc10f32bac..0704860c961f 100644
--- a/nixpkgs/pkgs/os-specific/linux/iptables/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/iptables/default.nix
@@ -1,19 +1,38 @@
 { lib, stdenv, fetchurl, pkg-config, pruneLibtoolFiles, flex, bison
 , libmnl, libnetfilter_conntrack, libnfnetlink, libnftnl, libpcap
 , nftablesCompat ? true
+, fetchpatch
 }:
 
-with lib;
-
 stdenv.mkDerivation rec {
-  version = "1.8.7";
+  version = "1.8.8";
   pname = "iptables";
 
   src = fetchurl {
     url = "https://www.netfilter.org/projects/${pname}/files/${pname}-${version}.tar.bz2";
-    sha256 = "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1";
+    sha256 = "sha256-ccdYidxxBnZjFVPrFRHaAXe7qvG1USZbkS0jbD9RhZ8=";
   };
 
+  patches = [
+    # xshared: Fix build for -Werror=format-security
+    (fetchpatch {
+      url = "https://git.netfilter.org/iptables/patch/?id=b72eb12ea5a61df0655ad99d5048994e916be83a";
+      sha256 = "sha256-pnamqOagwNWoiwlxPnKCqSc2N7MP/eZlT7JiE09c8OE=";
+    })
+    # treewide: use uint* instead of u_int*
+    (fetchpatch {
+      url = "https://git.netfilter.org/iptables/patch/?id=f319389525b066b7dc6d389c88f16a0df3b8f189";
+      sha256 = "sha256-rOxCEWZoI8Ac5fQDp286YHAwvreUAoDVAbomboKrGyM=";
+    })
+    # fix Musl build
+    (fetchpatch {
+      url = "https://git.netfilter.org/iptables/patch/?id=0e7cf0ad306cdf95dc3c28d15a254532206a888e";
+      sha256 = "18mnvqfxzd7ifq3zjb4vyifcyadpxdi8iqcj8wsjgw23n49lgrbj";
+    })
+  ];
+
+  outputs = [ "out" "dev" "man" ];
+
   nativeBuildInputs = [ pkg-config pruneLibtoolFiles flex bison ];
 
   buildInputs = [ libmnl libnetfilter_conntrack libnfnetlink libnftnl libpcap ];
@@ -28,11 +47,9 @@ stdenv.mkDerivation rec {
     "--enable-libipq"
     "--enable-nfsynproxy"
     "--enable-shared"
-  ] ++ optional (!nftablesCompat) "--disable-nftables";
-
-  outputs = [ "out" "dev" ];
+  ] ++ lib.optional (!nftablesCompat) "--disable-nftables";
 
-  postInstall = optionalString nftablesCompat ''
+  postInstall = lib.optionalString nftablesCompat ''
     rm $out/sbin/{iptables,iptables-restore,iptables-save,ip6tables,ip6tables-restore,ip6tables-save}
     ln -sv xtables-nft-multi $out/bin/iptables
     ln -sv xtables-nft-multi $out/bin/iptables-restore
@@ -42,7 +59,7 @@ stdenv.mkDerivation rec {
     ln -sv xtables-nft-multi $out/bin/ip6tables-save
   '';
 
-  meta = {
+  meta = with lib; {
     description = "A program to configure the Linux IP packet filtering ruleset";
     homepage = "https://www.netfilter.org/projects/iptables/index.html";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/os-specific/linux/irqbalance/default.nix b/nixpkgs/pkgs/os-specific/linux/irqbalance/default.nix
index b11be3f27353..d09b5f38f916 100644
--- a/nixpkgs/pkgs/os-specific/linux/irqbalance/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/irqbalance/default.nix
@@ -2,27 +2,16 @@
 
 stdenv.mkDerivation rec {
   pname = "irqbalance";
-  version = "1.8.0";
+  version = "1.9.0";
 
   src = fetchFromGitHub {
     owner = "irqbalance";
     repo = "irqbalance";
     rev = "v${version}";
-    sha256 = "sha256-K+Nv6HqBZb0pwfNV127QDq+suaUD7TTV413S6j8NdUU=";
+    sha256 = "sha256-OifGlOUT/zFz5gussEmLL24w4AovGeyNfbg/yCfzerw=";
   };
 
-  patches = [
-    # pull pending upstream inclusion fix for ncurses-6.3:
-    #  https://github.com/Irqbalance/irqbalance/pull/194
-    (fetchpatch {
-      name = "ncurses-6.3.patch";
-      url = "https://github.com/Irqbalance/irqbalance/commit/f8bdd0e64284d841544fd3ebe22f4652902ba8d2.patch";
-      sha256 = "sha256-QJIXr8BiKmn/81suuhNJsBRhY2as19/e480lsp2wd6g=";
-    })
-  ];
-
   nativeBuildInputs = [ autoreconfHook pkg-config ];
-
   buildInputs = [ glib ncurses libcap_ng ];
 
   LDFLAGS = "-lncurses";
diff --git a/nixpkgs/pkgs/os-specific/linux/it87/default.nix b/nixpkgs/pkgs/os-specific/linux/it87/default.nix
index 1e56d3a830cc..aa51626986e7 100644
--- a/nixpkgs/pkgs/os-specific/linux/it87/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/it87/default.nix
@@ -2,14 +2,15 @@
 
 stdenv.mkDerivation rec {
   name = "it87-${version}-${kernel.version}";
-  version = "2018-08-14";
+  version = "unstable-2022-02-26";
 
-  # The original was deleted from github, but this seems to be an active fork
+  # Original is no longer maintained.
+  # This is the same upstream as the AUR uses.
   src = fetchFromGitHub {
-    owner = "hannesha";
+    owner = "frankcrawford";
     repo = "it87";
-    rev = "5515f5b78838cb6be551943ffef5d1792012724c";
-    sha256 = "1ygi4mwds4q7byhg8gqnh3syamdj5rpjy3jj012k7vl54gdgrmgm";
+    rev = "c93d61adadecb009c92f3258cd3ff14a66efb193";
+    sha256 = "sha256-wVhs//iwZUUGRTk1DpV/SnA7NZ7cFyYbsUbtazlxb6Q=";
   };
 
   hardeningDisable = [ "pic" ];
@@ -29,8 +30,8 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     description = "Patched module for IT87xx superio chip sensors support";
     homepage = "https://github.com/hannesha/it87";
-    license = licenses.gpl2;
+    license = licenses.gpl2Plus;
     platforms = [ "x86_64-linux" "i686-linux" ];
-    maintainers = with maintainers; [ yorickvp ];
+    maintainers = teams.lumiguide.members;
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/ithc/default.nix b/nixpkgs/pkgs/os-specific/linux/ithc/default.nix
new file mode 100644
index 000000000000..69b202e7e201
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/ithc/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, kernel }:
+
+stdenv.mkDerivation rec {
+  pname = "ithc";
+  version = "unstable-2022-06-07";
+
+  src = fetchFromGitHub {
+    owner = "quo";
+    repo = "ithc-linux";
+    rev = "5af2a2213d2f3d944b19ec7ccdb96f16d56adddb";
+    hash = "sha256-p4TooWUOWPfNdePE18ESmRJezPDAl9nLb55LQtkJiSg=";
+  };
+
+  nativeBuildInputs = kernel.moduleBuildDependencies;
+
+  makeFlags = kernel.makeFlags ++ [
+    "VERSION=${version}"
+    "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
+  ];
+
+  postPatch = ''
+    sed -i ./Makefile -e '/depmod/d'
+  '';
+
+  installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ];
+
+  meta = with lib; {
+    description = "Linux driver for Intel Touch Host Controller";
+    homepage = "https://github.com/quo/ithc-linux";
+    license = licenses.publicDomain;
+    maintainers = with maintainers; [ aacebedo ];
+    platforms = platforms.linux;
+    broken = kernel.kernelOlder "5.9";
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/iwd/default.nix b/nixpkgs/pkgs/os-specific/linux/iwd/default.nix
index 72ecaffe5f50..dfd5f5724ef8 100644
--- a/nixpkgs/pkgs/os-specific/linux/iwd/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/iwd/default.nix
@@ -12,12 +12,12 @@
 
 stdenv.mkDerivation rec {
   pname = "iwd";
-  version = "1.20";
+  version = "1.29";
 
   src = fetchgit {
     url = "https://git.kernel.org/pub/scm/network/wireless/iwd.git";
     rev = version;
-    sha256 = "sha256-GcqmMqrZSgvSrsY8FJbPynNWTzSi5A6kmyq+xJ+2i3Y=";
+    sha256 = "sha256-W2MOK6aIa1whkj13OeuibNjL/2LWt7TO8h4JeoUrZnQ=";
   };
 
   outputs = [ "out" "man" "doc" ]
@@ -59,6 +59,7 @@ stdenv.mkDerivation rec {
   postUnpack = ''
     mkdir -p iwd/ell
     ln -s ${ell.src}/ell/useful.h iwd/ell/useful.h
+    ln -s ${ell.src}/ell/asn1-private.h iwd/ell/asn1-private.h
     patchShebangs .
   '';
 
diff --git a/nixpkgs/pkgs/os-specific/linux/kbd/default.nix b/nixpkgs/pkgs/os-specific/linux/kbd/default.nix
index 23a523b15d72..4d08a38dbe85 100644
--- a/nixpkgs/pkgs/os-specific/linux/kbd/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kbd/default.nix
@@ -63,11 +63,13 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [ check pam ];
+  NIX_LDFLAGS = lib.optional stdenv.hostPlatform.isStatic "-laudit";
   nativeBuildInputs = [ autoreconfHook pkg-config flex ];
 
   passthru.tests = {
     inherit (nixosTests) keymap kbd-setfont-decompress kbd-update-search-paths-patch;
   };
+  passthru.gzip = gzip;
 
   meta = with lib; {
     homepage = "https://kbd-project.org/";
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel-headers/default.nix b/nixpkgs/pkgs/os-specific/linux/kernel-headers/default.nix
index 833598448878..daa8c1ae2019 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel-headers/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel-headers/default.nix
@@ -14,6 +14,9 @@ let
 
     ARCH = stdenvNoCC.hostPlatform.linuxArch;
 
+    strictDeps = true;
+    enableParallelBuilding = true;
+
     # It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc.
     # We do this so we have a build->build, not build->host, C compiler.
     depsBuildBuild = [ buildPackages.stdenv.cc ];
@@ -24,7 +27,7 @@ let
       flex bison python rsync
     ];
 
-    extraIncludeDirs = lib.optional stdenvNoCC.hostPlatform.isPowerPC ["ppc"];
+    extraIncludeDirs = lib.optional (with stdenvNoCC.hostPlatform; isPower && is32bit && isBigEndian) ["ppc"];
 
     inherit patches;
 
@@ -81,12 +84,12 @@ let
 in {
   inherit makeLinuxHeaders;
 
-  linuxHeaders = let version = "5.16"; in
+  linuxHeaders = let version = "5.19"; in
     makeLinuxHeaders {
       inherit version;
       src = fetchurl {
         url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
-        sha256 = "1fq86dbx2p124vi4j8nan68gj4zyw4xnqh4jxq9aqsdvi24pwz82";
+        sha256 = "1a05a3hw4w3k530mxhns96xw7hag743xw5w967yazqcykdbhq97z";
       };
       patches = [
          ./no-relocs.patch # for building x86 kernel headers on non-ELF platforms
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/common-config.nix b/nixpkgs/pkgs/os-specific/linux/kernel/common-config.nix
index 153b41194b85..a859d7eea4f1 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/common-config.nix
@@ -29,7 +29,7 @@ let
     mkIf (stdenv.hostPlatform.isAarch32 ||
           stdenv.hostPlatform.isAarch64 ||
           stdenv.hostPlatform.isx86_64 ||
-          (stdenv.hostPlatform.isPowerPC && stdenv.hostPlatform.is64bit) ||
+          (stdenv.hostPlatform.isPower && stdenv.hostPlatform.is64bit) ||
           (stdenv.hostPlatform.isMips && stdenv.hostPlatform.is64bit));
 
   options = {
@@ -38,9 +38,17 @@ let
       # Necessary for BTF
       DEBUG_INFO                = mkMerge [
         (whenOlder "5.2" (if (features.debug or false) then yes else no))
-        (whenAtLeast "5.2" yes)
+        (whenBetween "5.2" "5.18" yes)
       ];
+      DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT = whenAtLeast "5.18" yes;
+      # Reduced debug info conflict with BTF and have been enabled in
+      # aarch64 defconfig since 5.13
+      DEBUG_INFO_REDUCED        = whenAtLeast "5.13" (option no);
       DEBUG_INFO_BTF            = whenAtLeast "5.2" (option yes);
+      # Allow loading modules with mismatched BTFs
+      # FIXME: figure out how to actually make BTFs reproducible instead
+      # See https://github.com/NixOS/nixpkgs/pull/181456 for details.
+      MODULE_ALLOW_BTF_MISMATCH = whenAtLeast "5.18" (option yes);
       BPF_LSM                   = whenAtLeast "5.7" (option yes);
       DEBUG_KERNEL              = yes;
       DEBUG_DEVRES              = no;
@@ -288,6 +296,9 @@ let
       # Intel GVT-g graphics virtualization supports 64-bit only
       DRM_I915_GVT = whenAtLeast "4.16" yes;
       DRM_I915_GVT_KVMGT = whenAtLeast "4.16" module;
+    } // optionalAttrs (stdenv.hostPlatform.system == "aarch64-linux") {
+      # enable HDMI-CEC on RPi boards
+      DRM_VC4_HDMI_CEC = whenAtLeast "4.14" yes;
     };
 
     sound = {
@@ -407,7 +418,7 @@ let
       UDF_FS              = module;
 
       NFSD_V2_ACL            = yes;
-      NFSD_V3                = yes;
+      NFSD_V3                = whenOlder "5.18" yes;
       NFSD_V3_ACL            = yes;
       NFSD_V4                = yes;
       NFSD_V4_SECURITY_LABEL = yes;
@@ -448,6 +459,9 @@ let
       NLS_CODEPAGE_437 = module; # VFAT default for the codepage= mount option
       NLS_ISO8859_1    = module; # VFAT default for the iocharset= mount option
 
+      # Needed to use the installation iso image. Not included in all defconfigs (e.g. arm64)
+      ISO9660_FS = module;
+
       DEVTMPFS = yes;
 
       UNICODE = whenAtLeast "5.2" yes; # Casefolding support for filesystems
@@ -838,6 +852,8 @@ let
       MOUSE_PS2_VMMOUSE  = yes;
       MTRR_SANITIZER     = yes;
       NET_FC             = yes; # Fibre Channel driver support
+      # Needed for touchpads to work on some AMD laptops
+      PINCTRL_AMD        = whenAtLeast "5.19" yes;
       # GPIO on Intel Bay Trail, for some Chromebook internal eMMC disks
       PINCTRL_BAYTRAIL   = yes;
       # GPIO for Braswell and Cherryview devices
@@ -880,6 +896,8 @@ let
       # Disable the firmware helper fallback, udev doesn't implement it any more
       FW_LOADER_USER_HELPER_FALLBACK = option no;
 
+      FW_LOADER_COMPRESS = option yes;
+
       HOTPLUG_PCI_ACPI = yes; # PCI hotplug using ACPI
       HOTPLUG_PCI_PCIE = yes; # PCI-Expresscard hotplug support
 
@@ -901,11 +919,19 @@ let
 
       FSL_MC_UAPI_SUPPORT = mkIf (stdenv.hostPlatform.system == "aarch64-linux") (whenAtLeast "5.12" yes);
 
-      ASHMEM =                 { optional = true; tristate = whenAtLeast "5.0" "y";};
+      ASHMEM =                 { optional = true; tristate = whenBetween "5.0" "5.18" "y";};
       ANDROID =                { optional = true; tristate = whenAtLeast "5.0" "y";};
       ANDROID_BINDER_IPC =     { optional = true; tristate = whenAtLeast "5.0" "y";};
       ANDROID_BINDERFS =       { optional = true; tristate = whenAtLeast "5.0" "y";};
       ANDROID_BINDER_DEVICES = { optional = true; freeform = whenAtLeast "5.0" "binder,hwbinder,vndbinder";};
+
+      TASKSTATS = yes;
+      TASK_DELAY_ACCT = yes;
+      TASK_XACCT = yes;
+      TASK_IO_ACCOUNTING = yes;
+
+      # Fresh toolchains frequently break -Werror build for minor issues.
+      WERROR = whenAtLeast "5.15" no;
     } // optionalAttrs (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "aarch64-linux") {
       # Enable CPU/memory hotplug support
       # Allows you to dynamically add & remove CPUs/memory to a VM client running NixOS without requiring a reboot
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/4.11.patch b/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/4.11.patch
index 38cc0532ba97..4e247e432891 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/4.11.patch
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/4.11.patch
@@ -428,7 +428,7 @@ index 000000000000..1ed7032d4472
 +solution, and details the disagreements and arguments.  The latest
 +version of this document can be found at the following URL.
 +
-+ https://git.kernel.org/cgit/linux/kernel/git/tj/cgroup.git/tree/Documentation/cgroup-v2-cpu.txt?h=cgroup-v2-cpu
++ https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git/tree/Documentation/cgroup-v2-cpu.txt?h=cgroup-v2-cpu
 +
 +This document was posted to the linux-kernel and cgroup mailing lists.
 +Unfortunately, no consensus was reached as of Oct, 2016.  The thread
@@ -759,7 +759,7 @@ index 000000000000..1ed7032d4472
 +     Re: [PATCHSET RFC cgroup/for-4.6] cgroup, sched: implement resource group and PRIO_RGRP
 +     Peter Zijlstra <peterz@infradead.org>
 +
-+[5]  https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/cgroup-v2.txt
++[5]  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/cgroup-v2.txt
 +     Control Group v2
 +     Tejun Heo <tj@kernel.org>
 +
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/4.9.patch b/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/4.9.patch
index 6f0904cbce99..596718b83c43 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/4.9.patch
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/4.9.patch
@@ -428,7 +428,7 @@ index 000000000000..1ed7032d4472
 +solution, and details the disagreements and arguments.  The latest
 +version of this document can be found at the following URL.
 +
-+ https://git.kernel.org/cgit/linux/kernel/git/tj/cgroup.git/tree/Documentation/cgroup-v2-cpu.txt?h=cgroup-v2-cpu
++ https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git/tree/Documentation/cgroup-v2-cpu.txt?h=cgroup-v2-cpu
 +
 +This document was posted to the linux-kernel and cgroup mailing lists.
 +Unfortunately, no consensus was reached as of Oct, 2016.  The thread
@@ -759,7 +759,7 @@ index 000000000000..1ed7032d4472
 +     Re: [PATCHSET RFC cgroup/for-4.6] cgroup, sched: implement resource group and PRIO_RGRP
 +     Peter Zijlstra <peterz@infradead.org>
 +
-+[5]  https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/cgroup-v2.txt
++[5]  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/cgroup-v2.txt
 +     Control Group v2
 +     Tejun Heo <tj@kernel.org>
 +
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/README.md b/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/README.md
index 6d48fde6beef..b454e14801db 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/README.md
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/README.md
@@ -18,4 +18,4 @@ $ ver=4.7
 $ git log --reverse --patch v$ver..remotes/tc-cgroup/cgroup-v2-cpu-v$ver > ../nixpkgs/pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/$ver.patch
 ```
 
-[1]: https://git.kernel.org/cgit/linux/kernel/git/tj/cgroup.git/tree/Documentation/cgroup-v2-cpu.txt?h=cgroup-v2-cpu
+[1]: https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git/tree/Documentation/cgroup-v2-cpu.txt?h=cgroup-v2-cpu
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/generate-config.pl b/nixpkgs/pkgs/os-specific/linux/kernel/generate-config.pl
index df807188f14f..7e12ca5d96a9 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/generate-config.pl
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/generate-config.pl
@@ -81,7 +81,7 @@ sub runConfig {
                 my $question = $1; my $name = $2; my $alts = $3;
                 my $answer = "";
                 # Build everything as a module if possible.
-                $answer = "m" if $autoModules && $alts =~ /\/m/ && !($preferBuiltin && $alts =~ /Y/);
+                $answer = "m" if $autoModules && $alts =~ qr{\A(\w/)+m/(\w/)*\?\z} && !($preferBuiltin && $alts =~ /Y/);
                 $answer = $answers{$name} if defined $answers{$name};
                 print STDERR "QUESTION: $question, NAME: $name, ALTS: $alts, ANSWER: $answer\n" if $debug;
                 print OUT "$answer\n";
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/generic.nix b/nixpkgs/pkgs/os-specific/linux/kernel/generic.nix
index bca6554ca2ae..056544014f42 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/generic.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/generic.nix
@@ -6,6 +6,7 @@
 , gmp ? null
 , libmpc ? null
 , mpfr ? null
+, pahole
 , lib
 , stdenv
 
@@ -124,7 +125,8 @@ let
 
     depsBuildBuild = [ buildPackages.stdenv.cc ];
     nativeBuildInputs = [ perl gmp libmpc mpfr ]
-      ++ lib.optionals (lib.versionAtLeast version "4.16") [ bison flex ];
+      ++ lib.optionals (lib.versionAtLeast version "4.16") [ bison flex ]
+      ++ lib.optional (lib.versionAtLeast version "5.2") pahole;
 
     platformName = stdenv.hostPlatform.linux-kernel.name;
     # e.g. "defconfig"
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/gpio-utils.nix b/nixpkgs/pkgs/os-specific/linux/kernel/gpio-utils.nix
index 9c7386f61c1d..40e282bbf541 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/gpio-utils.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/gpio-utils.nix
@@ -2,8 +2,6 @@
 
 with lib;
 
-assert versionAtLeast linux.version "4.6";
-
 stdenv.mkDerivation {
   pname = "gpio-utils";
   version = linux.version;
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/hardened/patches.json b/nixpkgs/pkgs/os-specific/linux/kernel/hardened/patches.json
index cdb6099d4a17..35ef199c9d6a 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/hardened/patches.json
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/hardened/patches.json
@@ -2,51 +2,61 @@
     "4.14": {
         "patch": {
             "extra": "-hardened1",
-            "name": "linux-hardened-4.14.269-hardened1.patch",
-            "sha256": "1hj3yn70aifprcfz4k088pj0lbr92cl5y840g08p0cqz3f3jvf24",
-            "url": "https://github.com/anthraxx/linux-hardened/releases/download/4.14.269-hardened1/linux-hardened-4.14.269-hardened1.patch"
+            "name": "linux-hardened-4.14.290-hardened1.patch",
+            "sha256": "14bnps4y5k2aa0fd2g4bdbiir1w7xfrvgsqd3cfzni8zhf4xrw0l",
+            "url": "https://github.com/anthraxx/linux-hardened/releases/download/4.14.290-hardened1/linux-hardened-4.14.290-hardened1.patch"
         },
-        "sha256": "1lhqq3va468k8w5f4hhsq1rgjcfrgi5l8lnrikfy9jisbi05z9h3",
-        "version": "4.14.269"
+        "sha256": "0zyxb99a7fa2l85vnzmvg2nry99clj20d4j38piqm921iqxak2j4",
+        "version": "4.14.290"
     },
     "4.19": {
         "patch": {
             "extra": "-hardened1",
-            "name": "linux-hardened-4.19.232-hardened1.patch",
-            "sha256": "195gbiial5rpiak4mszw3kn1dmm38npk2bchyb9lfvk1f26h2ybc",
-            "url": "https://github.com/anthraxx/linux-hardened/releases/download/4.19.232-hardened1/linux-hardened-4.19.232-hardened1.patch"
+            "name": "linux-hardened-4.19.255-hardened1.patch",
+            "sha256": "1pi0na6gr0l56479dzny8fvb3yzvxvjbvwn7c6kxf0gdhdqjzsc9",
+            "url": "https://github.com/anthraxx/linux-hardened/releases/download/4.19.255-hardened1/linux-hardened-4.19.255-hardened1.patch"
         },
-        "sha256": "0b520cwwqr5b1skc3gbq35hfjqpidxcl3gq7x5bdqqqdg0afiksg",
-        "version": "4.19.232"
+        "sha256": "0hwa3g09cmllc2z01s2jqbczpznzdp3ldngx18k5c2ac7w394fbp",
+        "version": "4.19.255"
     },
     "5.10": {
         "patch": {
             "extra": "-hardened1",
-            "name": "linux-hardened-5.10.103-hardened1.patch",
-            "sha256": "0i70cya9llz6nnhf4d5zz3f8xhj21si8capymmzcjczz0378argj",
-            "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.10.103-hardened1/linux-hardened-5.10.103-hardened1.patch"
+            "name": "linux-hardened-5.10.136-hardened1.patch",
+            "sha256": "1mw30dy0xk2l12gds0kf7mjxbfamjxdwshkwc4kcics9rf57mgx6",
+            "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.10.136-hardened1/linux-hardened-5.10.136-hardened1.patch"
         },
-        "sha256": "02jq126r8dgqrhgdg8dym2v8xgp9jkjm8kf9zgj440s3wrasvf2g",
-        "version": "5.10.103"
+        "sha256": "0naiwihlj6aswnqwdz3xzmga98xpj5lf2iy9vxqzdng7b46rs28w",
+        "version": "5.10.136"
     },
     "5.15": {
         "patch": {
             "extra": "-hardened1",
-            "name": "linux-hardened-5.15.26-hardened1.patch",
-            "sha256": "14pdmiqnn06by8mvxw4gklqfrnngrimyz1ag76pr60iz6ka6y5g8",
-            "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.15.26-hardened1/linux-hardened-5.15.26-hardened1.patch"
+            "name": "linux-hardened-5.15.60-hardened1.patch",
+            "sha256": "1w93qgwycicwjp3aiklm6c6yvg0gq674pxcxvbsdd0c1p0b4y8dk",
+            "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.15.60-hardened1/linux-hardened-5.15.60-hardened1.patch"
         },
-        "sha256": "0fmydc5v51iacd5ys7p1m1k2318p47prj8xv02rcngv1y8s224jq",
-        "version": "5.15.26"
+        "sha256": "0yi3bvqz4qn8nvgr910ic09zvpisafwi282j0y2gvbvgr7vlb59d",
+        "version": "5.15.60"
+    },
+    "5.18": {
+        "patch": {
+            "extra": "-hardened1",
+            "name": "linux-hardened-5.18.17-hardened1.patch",
+            "sha256": "0vic9y72d3vfw66y32yrgh7q2wgjk902780ik2viylwr3f5xq1yq",
+            "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.18.17-hardened1/linux-hardened-5.18.17-hardened1.patch"
+        },
+        "sha256": "0i7yms65b8kxjm92ahic0787vb9h7xblbwp1v6cq8zpns3ivv0ih",
+        "version": "5.18.17"
     },
     "5.4": {
         "patch": {
             "extra": "-hardened1",
-            "name": "linux-hardened-5.4.182-hardened1.patch",
-            "sha256": "0hcxy2hn836mivydmrbqrpvm4bfdsgf9xpx0iyz92rhd91ipgcyq",
-            "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.4.182-hardened1/linux-hardened-5.4.182-hardened1.patch"
+            "name": "linux-hardened-5.4.210-hardened1.patch",
+            "sha256": "0qbz9h97m0lxa45j85sv2lhhmrlx9nv5z0bf5vdhyq6g0h7d2mm9",
+            "url": "https://github.com/anthraxx/linux-hardened/releases/download/5.4.210-hardened1/linux-hardened-5.4.210-hardened1.patch"
         },
-        "sha256": "03gly4ivsdahixmshi021al48ycsalx30vsxr3iyj47hchgj1wdj",
-        "version": "5.4.182"
+        "sha256": "13l8zh5balciqhi4k4328sznza30v8g871wxcqqka61cij3rc0wl",
+        "version": "5.4.210"
     }
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/hardened/update.py b/nixpkgs/pkgs/os-specific/linux/kernel/hardened/update.py
index 48567b68dc3e..d0f8c77c783f 100755
--- a/nixpkgs/pkgs/os-specific/linux/kernel/hardened/update.py
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/hardened/update.py
@@ -219,7 +219,16 @@ failures = False
 
 # Match each kernel version with the best patch version.
 releases = {}
+i = 0
 for release in repo.get_releases():
+    # Dirty workaround to make sure that we don't run into issues because
+    # GitHub's API only allows fetching the last 1000 releases.
+    # It's not reliable to exit earlier because not every kernel minor may
+    # have hardened patches, hence the naive search below.
+    i += 1
+    if i > 500:
+        break
+
     version = parse_version(release.tag_name)
     # needs to look like e.g. 5.6.3-hardened1
     if len(version) < 4:
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/htmldocs.nix b/nixpkgs/pkgs/os-specific/linux/kernel/htmldocs.nix
new file mode 100644
index 000000000000..4e42288aff8d
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/htmldocs.nix
@@ -0,0 +1,85 @@
+{ lib
+, stdenv
+, graphviz
+, imagemagick
+, linux_latest
+, makeFontsConf
+, perl
+, python3
+, sphinx
+, which
+}:
+
+let
+  py = python3.override {
+    packageOverrides = final: prev: rec {
+      docutils_old = prev.docutils.overridePythonAttrs (oldAttrs: rec {
+        version = "0.16";
+        src = final.fetchPypi {
+          pname = "docutils";
+          inherit version;
+          sha256 = "sha256-wt46YOnn0Hvia38rAMoDCcIH4GwQD5zCqUkx/HWkePw=";
+        };
+      });
+
+      sphinx = (prev.sphinx.override rec {
+        alabaster = prev.alabaster.override { inherit pygments; };
+        docutils = docutils_old;
+        pygments = prev.pygments.override { docutils = docutils_old; };
+      }).overridePythonAttrs {
+        # fails due to duplicated packages
+        doCheck = false;
+      };
+
+      sphinx-rtd-theme = prev.sphinx-rtd-theme.override {
+        inherit sphinx;
+        docutils = docutils_old;
+      };
+    };
+  };
+in
+
+stdenv.mkDerivation {
+  pname = "linux-kernel-latest-htmldocs";
+
+  inherit (linux_latest) version src;
+
+  postPatch = ''
+    patchShebangs \
+      Documentation/sphinx/parse-headers.pl \
+      scripts/{get_abi.pl,get_feat.pl,kernel-doc,sphinx-pre-install}
+  '';
+
+  FONTCONFIG_FILE = makeFontsConf {
+    fontDirectories = [ ];
+  };
+
+  nativeBuildInputs = [
+    graphviz
+    imagemagick
+    perl
+    py.pkgs.sphinx
+    py.pkgs.sphinx-rtd-theme
+    which
+  ];
+
+  preBuild = ''
+    export XDG_CACHE_HOME="$(mktemp -d)"
+  '';
+
+  makeFlags = [ "htmldocs" ];
+
+  installPhase = ''
+    mkdir -p $out/share/doc
+    mv Documentation/output $out/share/doc/linux-doc
+    cp -r Documentation/* $out/share/doc/linux-doc/
+  '';
+
+  meta = with lib; {
+    description = "Linux kernel html documentation";
+    homepage = "https://www.kernel.org/doc/htmldocs/";
+    platforms = platforms.linux;
+    inherit (linux_latest.meta) license;
+    maintainers = with maintainers; [ SuperSandro2000 ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.14.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.14.nix
index 0683e7d6ad4d..018ec0e8a927 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.14.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.14.nix
@@ -3,7 +3,7 @@
 with lib;
 
 buildLinux (args // rec {
-  version = "4.14.274";
+  version = "4.14.290";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1bbz1w5l7im7dspq6g6iy5vahsxcaa1b2ykrw49m3pw8rf7m6hib";
+    sha256 = "0zyxb99a7fa2l85vnzmvg2nry99clj20d4j38piqm921iqxak2j4";
   };
 } // (args.argsOverride or {}))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.19.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.19.nix
index 6121fccf15fa..0981efb66a77 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.19.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.19.nix
@@ -3,7 +3,7 @@
 with lib;
 
 buildLinux (args // rec {
-  version = "4.19.237";
+  version = "4.19.255";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1n0c4bmmbj145zsp662a5rxh294fpq4dkillpz16wj6c098z7zxs";
+    sha256 = "0hwa3g09cmllc2z01s2jqbczpznzdp3ldngx18k5c2ac7w394fbp";
   };
 } // (args.argsOverride or {}))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.9.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.9.nix
index ad58c3ef6413..3fb588d3cb93 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.9.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-4.9.nix
@@ -1,12 +1,12 @@
 { buildPackages, fetchurl, perl, buildLinux, nixosTests, stdenv, ... } @ args:
 
 buildLinux (args // rec {
-  version = "4.9.309";
+  version = "4.9.325";
   extraMeta.branch = "4.9";
   extraMeta.broken = stdenv.isAarch64;
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "05468rk4hlz9ag1zb7shngn5rl42npw7haqbi5mpaa0yksl5asp8";
+    sha256 = "04msx0x0d8v93zjr3jj0qqkgg7m4hb7rj6hk5vzrzasmgbjmb3dl";
   };
 } // (args.argsOverride or {}))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.10.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.10.nix
index 7b5c9cba1444..a9fde05e0ca5 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.10.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.10.nix
@@ -3,7 +3,7 @@
 with lib;
 
 buildLinux (args // rec {
-  version = "5.10.109";
+  version = "5.10.136";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
-    sha256 = "1p0k46isy2wzzms801lrnb59f1nb9mhywjj7fnkrwrj9nbn25yqq";
+    sha256 = "0naiwihlj6aswnqwdz3xzmga98xpj5lf2iy9vxqzdng7b46rs28w";
   };
 } // (args.argsOverride or {}))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.15.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.15.nix
index dab27c119aa5..4bf8303b2a41 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.15.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.15.nix
@@ -1,9 +1,9 @@
-{ lib, stdenv, buildPackages, fetchurl, perl, buildLinux, nixosTests, modDirVersionArg ? null, ... } @ args:
+{ lib, buildPackages, fetchurl, perl, buildLinux, nixosTests, modDirVersionArg ? null, ... } @ args:
 
 with lib;
 
 buildLinux (args // rec {
-  version = "5.15.32";
+  version = "5.15.61";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
@@ -11,10 +11,8 @@ buildLinux (args // rec {
   # branchVersion needs to be x.y
   extraMeta.branch = versions.majorMinor version;
 
-  extraMeta.broken = stdenv.isi686;
-
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
-    sha256 = "11nz2w6hgwy6va6sxf4ic1s4kv24zbpssgjxsq6n321h4bxcsqql";
+    sha256 = "0hpx0ziz162lc41jwi2ybj3qgidinjcsp71lchvmp6h0vyiddj9v";
   };
 } // (args.argsOverride or { }))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.16.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.18.nix
index 4dcb71c4f5cd..096f197a1a1c 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.16.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.18.nix
@@ -3,7 +3,7 @@
 with lib;
 
 buildLinux (args // rec {
-  version = "5.16.18";
+  version = "5.18.18";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
-    sha256 = "096f80m2czj8khvil7s037pqdf1s6pklqn5d9419jqkz7v70piry";
+    sha256 = "0as0cslwz6zdiwd5wzcjggw3qpa9hzvfmxlhy72jdhn5vk47dhy1";
   };
 } // (args.argsOverride or { }))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.17.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.19.nix
index edd5339e103d..09e226ba3410 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.17.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.19.nix
@@ -3,7 +3,7 @@
 with lib;
 
 buildLinux (args // rec {
-  version = "5.17.1";
+  version = "5.19.2";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
-    sha256 = "092cx18va108lb27kxx2b00ma3l9g22nmkk81034apx26bacbmbw";
+    sha256 = "0gg63y078k886clgfq4k5n7nh2r0359ksvf8wd06rv01alghmr28";
   };
 } // (args.argsOverride or { }))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.4.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.4.nix
index 65c9f6c4b26d..3018d83840e3 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.4.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-5.4.nix
@@ -3,7 +3,7 @@
 with lib;
 
 buildLinux (args // rec {
-  version = "5.4.188";
+  version = "5.4.210";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
-    sha256 = "1g7xf2jx1hx580f42yirfgv9v0f9f88wzxxx0wiwx7wcqbyqpg4z";
+    sha256 = "13l8zh5balciqhi4k4328sznza30v8g871wxcqqka61cij3rc0wl";
   };
 } // (args.argsOverride or {}))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix
index 70ac299f1619..69bbdf648d22 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-hardkernel-4.14.nix
@@ -1,4 +1,4 @@
-{ buildPackages, fetchFromGitHub, perl, buildLinux, libelf, util-linux, ... } @ args:
+{ buildPackages, fetchFromGitHub, fetchurl, perl, buildLinux, libelf, util-linux, kernelPatches ? [], ... } @ args:
 
 buildLinux (args // rec {
   version = "4.14.180-176";
@@ -16,6 +16,14 @@ buildLinux (args // rec {
     sha256 = "0n7i7a2bkrm9p1wfr20h54cqm32fbjvwyn703r6zm1f6ivqhk43v";
   };
 
+  kernelPatches = args.kernelPatches ++ [{
+    name = "usbip-tools-fno-common";
+    patch = fetchurl {
+      url = "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=d5efc2e6b98fe661dbd8dd0d5d5bfb961728e57a";
+      hash = "sha256-1CXYCV5zMLA4YdbCr8cO2N4CHEDzQChS9qbKYHPm3U4=";
+    };
+  }];
+
   defconfig = "odroidxu4_defconfig";
 
   # This extraConfig is (only) required because the gator module fails to build as-is.
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-libre.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-libre.nix
index 16bbbf614aa9..389bae733587 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-libre.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-libre.nix
@@ -1,8 +1,8 @@
 { stdenv, lib, fetchsvn, linux
 , scripts ? fetchsvn {
     url = "https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/branches/";
-    rev = "18664";
-    sha256 = "0yvgnqf355wr7wmfd0r8zydbr7icic06cp5hjp060vv0m9bf87xi";
+    rev = "18837";
+    sha256 = "0645lkbh5bi9a8nhdyh21h7rrw8x8pmb7la08zn7gpkmwvk3wnwx";
   }
 , ...
 }:
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-lqx.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-lqx.nix
deleted file mode 100644
index 0d56108f2f23..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-lqx.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ lib, fetchFromGitHub, buildLinux, linux_zen, ... } @ args:
-
-let
-  version = "5.15.16";
-  suffix = "lqx2";
-in
-
-buildLinux (args // {
-  modDirVersion = "${version}-${suffix}";
-  inherit version;
-  isZen = true;
-
-  src = fetchFromGitHub {
-    owner = "zen-kernel";
-    repo = "zen-kernel";
-    rev = "v${version}-${suffix}";
-    sha256 = "sha256-kdT/hiASZ72pkS0Igta0KT0GWTgDRjxBnd5CQ0eonfg=";
-  };
-
-  extraMeta = {
-    branch = "5.14/master";
-    maintainers = with lib.maintainers; [ atemu ];
-    description = linux_zen.meta.description + " (Same as linux_zen but less aggressive release schedule)";
-  };
-
-} // (args.argsOverride or { }))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-rpi.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-rpi.nix
index 99b966ac5cde..8654bc432ceb 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-rpi.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-rpi.nix
@@ -2,9 +2,8 @@
 
 let
   # NOTE: raspberrypifw & raspberryPiWirelessFirmware should be updated with this
-  modDirVersion = "5.10.92";
-  tag = "1.20220118";
-  rev = "650082a559a570d6c9d2739ecc62843d6f951059";
+  modDirVersion = "5.15.32";
+  tag = "1.20220331";
 in
 lib.overrideDerivation (buildLinux (args // {
   version = "${modDirVersion}-${tag}";
@@ -13,8 +12,8 @@ lib.overrideDerivation (buildLinux (args // {
   src = fetchFromGitHub {
     owner = "raspberrypi";
     repo = "linux";
-    inherit rev;
-    sha256 = "sha256-OSDx9dzqm8JnLUvdiv1aKqhRz80uWqfjXLd7m6ycXME=";
+    rev = tag;
+    hash = "sha256-dJtOXe4yvZz/iu0Ly5F9/E/2GbpTJF/9ZMU3rC1nKMw=";
   };
 
   defconfig = {
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix
index cf0744bce681..58be2be6e9d2 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix
@@ -6,7 +6,7 @@
 , ... } @ args:
 
 let
-  version = "5.10.106-rt64"; # updated by ./update-rt.sh
+  version = "5.10.131-rt72"; # updated by ./update-rt.sh
   branch = lib.versions.majorMinor version;
   kversion = builtins.elemAt (lib.splitString "-" version) 0;
 in buildLinux (args // {
@@ -18,14 +18,14 @@ in buildLinux (args // {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v5.x/linux-${kversion}.tar.xz";
-    sha256 = "0yjrlghcxw3lhd6nc2m4zy4gk536w3a3w6mxdsml690fqz4531n6";
+    sha256 = "1ki11mvl3dky7iih90znr47vr66dxnlwrqwg2jkk1hqn5i243i4b";
   };
 
   kernelPatches = let rt-patch = {
     name = "rt";
     patch = fetchurl {
       url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz";
-      sha256 = "0z5gyi1vyjyd05vyccmk9yfgvm5v1lc8vbfywahx495xzpp9i8xb";
+      sha256 = "0ag000h9m7phvgrqa4jcmd94x0rk8z8bh7qhqqlywbiz2b1b91qa";
     };
   }; in [ rt-patch ] ++ kernelPatches;
 
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix
index 747563e3c01f..898bd1d18ad1 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix
@@ -6,7 +6,7 @@
 , ... } @ args:
 
 let
-  version = "5.4.182-rt71"; # updated by ./update-rt.sh
+  version = "5.4.209-rt77"; # updated by ./update-rt.sh
   branch = lib.versions.majorMinor version;
   kversion = builtins.elemAt (lib.splitString "-" version) 0;
 in buildLinux (args // {
@@ -14,14 +14,14 @@ in buildLinux (args // {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v5.x/linux-${kversion}.tar.xz";
-    sha256 = "03gly4ivsdahixmshi021al48ycsalx30vsxr3iyj47hchgj1wdj";
+    sha256 = "1kdnz99k7zspzaxqaxahbf6hncigy4cvjlb79jsy7a95qxxr31qf";
   };
 
   kernelPatches = let rt-patch = {
     name = "rt";
     patch = fetchurl {
       url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz";
-      sha256 = "1lxj63v37bhdgynr8ffyd5g8vp5a79dnzi6fng7jsjapfriywzqh";
+      sha256 = "1wh5m7ychgnn33yg7gg9nlwcmmm72dixvdf77m764hs90xl8c9ig";
     };
   }; in [ rt-patch ] ++ kernelPatches;
 
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix
index e86f6fced569..a1748156d098 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix
@@ -1,9 +1,9 @@
 { lib
 , fetchpatch
 , kernel
-, date ? "2022-03-21"
-, commit ? "c38b7167aa5f3b1b91dcc93ade57f30e95064590"
-, diffHash ? "04lgwnng7p2rlz9sxn74n22750kh524xwfws3agqs12pcrvfsm0j"
+, date ? "2022-04-25"
+, commit ? "bdf6d7c1350497bc7b0be6027a51d9330645672d"
+, diffHash ? "09bcbklvfj9i9czjdpix2iz7fvjksmavaljx8l92ay1i9fapjmhc"
 , kernelPatches # must always be defined in bcachefs' all-packages.nix entry because it's also a top-level attribute supplied by callPackage
 , argsOverride ? {}
 , ...
@@ -17,6 +17,7 @@
     extraMeta = {
       branch = "master";
       maintainers = with lib.maintainers; [ davidak Madouura ];
+      broken = true;
     };
   } // argsOverride;
 
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-testing.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-testing.nix
index 0754ff335bae..a4304e9e9369 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-testing.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/linux-testing.nix
@@ -3,7 +3,7 @@
 with lib;
 
 buildLinux (args // rec {
-  version = "5.15-rc6";
+  version = "6.0-rc1";
   extraMeta.branch = lib.versions.majorMinor version;
 
   # modDirVersion needs to be x.y.z, will always add .0
@@ -11,7 +11,7 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "https://git.kernel.org/torvalds/t/linux-${version}.tar.gz";
-    sha256 = "1lp3jqwsbd97k3bx4crs8rc2wssyaf0v8x4kl4zv7g7ww2kkg2ii";
+    sha256 = "sha256-RReHoEYavib86K9XQKwguBYQvyQboRl7537p69P8ca0=";
   };
 
   # Should the testing kernels ever be built on Hydra?
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-xanmod.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-xanmod.nix
deleted file mode 100644
index b170ec044b05..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-xanmod.nix
+++ /dev/null
@@ -1,68 +0,0 @@
-{ lib, stdenv, buildLinux, fetchFromGitHub, ... } @ args:
-
-let
-  version = "5.15.27";
-  release = "1";
-  suffix = "xanmod${release}-tt";
-in
-buildLinux (args // rec {
-  inherit version;
-  modDirVersion = "${version}-${suffix}";
-
-  src = fetchFromGitHub {
-    owner = "xanmod";
-    repo = "linux";
-    rev = modDirVersion;
-    sha256 = "sha256-ycUvTXDKnffxs8FKZJurX2bDr85gMQlSIFD0nST2Q98=";
-  };
-
-  structuredExtraConfig = with lib.kernel; {
-    # removed options
-    CFS_BANDWIDTH = lib.mkForce (option no);
-    RT_GROUP_SCHED = lib.mkForce (option no);
-    SCHED_AUTOGROUP = lib.mkForce (option no);
-
-    # AMD P-state driver
-    X86_AMD_PSTATE = yes;
-
-    # Linux RNG framework
-    LRNG = yes;
-
-    # Paragon's NTFS3 driver
-    NTFS3_FS = module;
-    NTFS3_LZX_XPRESS = yes;
-    NTFS3_FS_POSIX_ACL = yes;
-
-    # Preemptive Full Tickless Kernel at 500Hz
-    SCHED_CORE = lib.mkForce (option no);
-    PREEMPT_VOLUNTARY = lib.mkForce no;
-    PREEMPT = lib.mkForce yes;
-    NO_HZ_FULL = yes;
-    HZ_500 = yes;
-
-    # Google's BBRv2 TCP congestion Control
-    TCP_CONG_BBR2 = yes;
-    DEFAULT_BBR2 = yes;
-
-    # FQ-PIE Packet Scheduling
-    NET_SCH_DEFAULT = yes;
-    DEFAULT_FQ_PIE = yes;
-
-    # Graysky's additional CPU optimizations
-    CC_OPTIMIZE_FOR_PERFORMANCE_O3 = yes;
-
-    # Futex WAIT_MULTIPLE implementation for Wine / Proton Fsync.
-    FUTEX = yes;
-    FUTEX_PI = yes;
-
-    # WineSync driver for fast kernel-backed Wine
-    WINESYNC = module;
-  };
-
-  extraMeta = {
-    branch = "5.15-tt";
-    maintainers = with lib.maintainers; [ fortuneteller2k lovesegfault ];
-    description = "Built with custom settings and new features built to provide a stable, responsive and smooth desktop experience";
-    broken = stdenv.isAarch64;
-  };
-} // (args.argsOverride or { }))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/linux-zen.nix b/nixpkgs/pkgs/os-specific/linux/kernel/linux-zen.nix
deleted file mode 100644
index 0e6cc394a549..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/kernel/linux-zen.nix
+++ /dev/null
@@ -1,36 +0,0 @@
-{ lib, fetchFromGitHub, buildLinux, ... } @ args:
-
-let
-  # having the full version string here makes it easier to update
-  modDirVersion = "5.17.0-zen1";
-  parts = lib.splitString "-" modDirVersion;
-  version = lib.elemAt parts 0;
-  suffix = lib.elemAt parts 1;
-
-  numbers = lib.splitString "." version;
-  branch = "${lib.elemAt numbers 0}.${lib.elemAt numbers 1}";
-  rev = if ((lib.elemAt numbers 2) == "0") then "v${branch}-${suffix}" else "v${modDirVersion}";
-in
-
-buildLinux (args // {
-  inherit version modDirVersion;
-  isZen = true;
-
-  src = fetchFromGitHub {
-    owner = "zen-kernel";
-    repo = "zen-kernel";
-    inherit rev;
-    sha256 = "sha256-8DCcO2oPnwXjjm3PW7vNZKbB3S7XsEB/svAMhbPRJIo=";
-  };
-
-  structuredExtraConfig = with lib.kernel; {
-    ZEN_INTERACTIVE = yes;
-  };
-
-  extraMeta = {
-    inherit branch;
-    maintainers = with lib.maintainers; [ atemu andresilva ];
-    description = "Built using the best configuration and kernel sources for desktop, multimedia, and gaming workloads.";
-  };
-
-} // (args.argsOverride or { }))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/manual-config.nix b/nixpkgs/pkgs/os-specific/linux/kernel/manual-config.nix
index 220f09ed8b50..7e734a4f13ab 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -1,6 +1,5 @@
 { lib, buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl
-, libelf, cpio, elfutils, zstd, gawk, python3Minimal, zlib, pahole
-, writeTextFile
+, libelf, cpio, elfutils, zstd, python3Minimal, zlib, pahole
 }:
 
 let
@@ -56,20 +55,17 @@ let
     hasAttr getAttr optional optionals optionalString optionalAttrs maintainers platforms;
 
   # Dependencies that are required to build kernel modules
-  moduleBuildDependencies = [ perl ] ++ optional (lib.versionAtLeast version "4.14") libelf;
+  moduleBuildDependencies = [ perl ]
+    ++ optional (lib.versionAtLeast version "4.14") libelf
+    ++ optional (lib.versionAtLeast version "5.13") zstd;
 
 
-  installkernel = writeTextFile { name = "installkernel"; executable=true; text = ''
-    #!${stdenv.shell} -e
+  installkernel = buildPackages.writeShellScript "installkernel" ''
+    set -e
     mkdir -p $4
     cp -av $2 $4
     cp -av $3 $4
-  ''; };
-
-  commonMakeFlags = [
-    "O=$(buildRoot)"
-  ] ++ lib.optionals (stdenv.hostPlatform.linux-kernel ? makeFlags)
-    stdenv.hostPlatform.linux-kernel.makeFlags;
+  '';
 
   drvAttrs = config_: kernelConf: kernelPatches: configfile:
     let
@@ -112,7 +108,8 @@ let
       patches =
         map (p: p.patch) kernelPatches
         # Required for deterministic builds along with some postPatch magic.
-        ++ optional (lib.versionAtLeast version "4.13") ./randstruct-provide-seed.patch
+        ++ optional (lib.versionAtLeast version "4.13" && lib.versionOlder version "5.19") ./randstruct-provide-seed.patch
+        ++ optional (lib.versionAtLeast version "5.19") ./randstruct-provide-seed-5.19.patch
         # Fixes determinism by normalizing metadata for the archive of kheaders
         ++ optional (lib.versionAtLeast version "5.2" && lib.versionOlder version "5.4") ./gen-kheaders-metadata.patch;
 
@@ -320,7 +317,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPat
   enableParallelBuilding = true;
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
-  nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr gawk zstd python3Minimal ]
+  nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr zstd python3Minimal ]
       ++ optional  (stdenv.hostPlatform.linux-kernel.target == "uImage") buildPackages.ubootTools
       ++ optional  (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") libelf
       # Removed util-linuxMinimal since it should not be a dependency.
@@ -332,13 +329,15 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPat
   hardeningDisable = [ "bindnow" "format" "fortify" "stackprotector" "pic" "pie" ];
 
   # Absolute paths for compilers avoid any PATH-clobbering issues.
-  makeFlags = commonMakeFlags ++ [
+  makeFlags = [
+    "O=$(buildRoot)"
     "CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
     "HOSTCC=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"
     "ARCH=${stdenv.hostPlatform.linuxArch}"
-  ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
-  ] ++ extraMakeFlags;
+  ] ++ (stdenv.hostPlatform.linux-kernel.makeFlags or [])
+    ++ extraMakeFlags;
 
   karch = stdenv.hostPlatform.linuxArch;
 } // (optionalAttrs (pos != null) { inherit pos; }))
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/perf/5.19-binutils-2.39-support.patch b/nixpkgs/pkgs/os-specific/linux/kernel/perf/5.19-binutils-2.39-support.patch
new file mode 100644
index 000000000000..5f4f2fc0b4a9
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/perf/5.19-binutils-2.39-support.patch
@@ -0,0 +1,352 @@
+Fetched as:
+    $ wget 'https://github.com/torvalds/linux/compare/00b32625982e0c796f0abb8effcac9c05ef55bd3...600b7b26c07a070d0153daa76b3806c1e52c9e00.patch'
+
+Adds support for binutils-2.39 API change around init_disassemble_info().
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC :=                  \
+         libaio				\
+         libzstd				\
+         disassembler-four-args		\
++        disassembler-init-styled	\
+         file-handle
+ 
+ # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -18,6 +18,7 @@ FILES=                                          \
+          test-libbfd.bin                        \
+          test-libbfd-buildid.bin		\
+          test-disassembler-four-args.bin        \
++         test-disassembler-init-styled.bin	\
+          test-reallocarray.bin			\
+          test-libbfd-liberty.bin                \
+          test-libbfd-liberty-z.bin              \
+@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
+ $(OUTPUT)test-disassembler-four-args.bin:
+ 	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+ 
++$(OUTPUT)test-disassembler-init-styled.bin:
++	$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++
+ $(OUTPUT)test-reallocarray.bin:
+ 	$(BUILD)
+ 
+--- a/tools/build/feature/test-all.c
++++ b/tools/build/feature/test-all.c
+@@ -166,6 +166,10 @@
+ # include "test-disassembler-four-args.c"
+ #undef main
+ 
++#define main main_test_disassembler_init_styled
++# include "test-disassembler-init-styled.c"
++#undef main
++
+ #define main main_test_libzstd
+ # include "test-libzstd.c"
+ #undef main
+--- /dev/null
++++ b/tools/build/feature/test-disassembler-init-styled.c
+@@ -0,0 +1,13 @@
++// SPDX-License-Identifier: GPL-2.0
++#include <stdio.h>
++#include <dis-asm.h>
++
++int main(void)
++{
++	struct disassemble_info info;
++
++	init_disassemble_info(&info, stdout,
++			      NULL, NULL);
++
++	return 0;
++}
+
+--- a/tools/build/Makefile.feature
++++ b/tools/build/Makefile.feature
+@@ -135,8 +135,7 @@ FEATURE_DISPLAY ?=              \
+          get_cpuid              \
+          bpf			\
+          libaio			\
+-         libzstd		\
+-         disassembler-four-args
++         libzstd
+ 
+ # Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features.
+ # If in the future we need per-feature checks/flags for features not
+
+--- /dev/null
++++ b/tools/include/tools/dis-asm-compat.h
+@@ -0,0 +1,55 @@
++/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
++#ifndef _TOOLS_DIS_ASM_COMPAT_H
++#define _TOOLS_DIS_ASM_COMPAT_H
++
++#include <stdio.h>
++#include <dis-asm.h>
++
++/* define types for older binutils version, to centralize ifdef'ery a bit */
++#ifndef DISASM_INIT_STYLED
++enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
++typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
++#endif
++
++/*
++ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
++ * init_disassemble_info_compat() when normal fprintf suffices.
++ */
++static inline int fprintf_styled(void *out,
++				 enum disassembler_style style,
++				 const char *fmt, ...)
++{
++	va_list args;
++	int r;
++
++	(void)style;
++
++	va_start(args, fmt);
++	r = vfprintf(out, fmt, args);
++	va_end(args);
++
++	return r;
++}
++
++/*
++ * Wrapper for init_disassemble_info() that hides version
++ * differences. Depending on binutils version and architecture either
++ * fprintf_func or fprintf_styled_func will be called.
++ */
++static inline void init_disassemble_info_compat(struct disassemble_info *info,
++						void *stream,
++						fprintf_ftype unstyled_func,
++						fprintf_styled_ftype styled_func)
++{
++#ifdef DISASM_INIT_STYLED
++	init_disassemble_info(info, stream,
++			      unstyled_func,
++			      styled_func);
++#else
++	(void)styled_func;
++	init_disassemble_info(info, stream,
++			      unstyled_func);
++#endif
++}
++
++#endif /* _TOOLS_DIS_ASM_COMPAT_H */
+
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
+ FEATURE_CHECK_LDFLAGS-libaio = -lrt
+ 
+ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
++FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
+ 
+ CORE_CFLAGS += -fno-omit-frame-pointer
+ CORE_CFLAGS += -ggdb3
+@@ -924,13 +925,16 @@ ifndef NO_LIBBFD
+     ifeq ($(feature-libbfd-liberty), 1)
+       EXTLIBS += -lbfd -lopcodes -liberty
+       FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
++      FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
+     else
+       ifeq ($(feature-libbfd-liberty-z), 1)
+         EXTLIBS += -lbfd -lopcodes -liberty -lz
+         FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
++        FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
+       endif
+     endif
+     $(call feature_check,disassembler-four-args)
++    $(call feature_check,disassembler-init-styled)
+   endif
+ 
+   ifeq ($(feature-libbfd-buildid), 1)
+@@ -1044,6 +1048,10 @@ ifeq ($(feature-disassembler-four-args), 1)
+     CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
+ 
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
++
+ ifeq (${IS_64_BIT}, 1)
+   ifndef NO_PERF_READ_VDSO32
+     $(call feature_check,compile-32)
+--- a/tools/perf/util/annotate.c
++++ b/tools/perf/util/annotate.c
+@@ -1720,6 +1720,7 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil
+ #include <bpf/btf.h>
+ #include <bpf/libbpf.h>
+ #include <linux/btf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ static int symbol__disassemble_bpf(struct symbol *sym,
+ 				   struct annotate_args *args)
+@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
+ 		ret = errno;
+ 		goto out;
+ 	}
+-	init_disassemble_info(&info, s,
+-			      (fprintf_ftype) fprintf);
+-
++	init_disassemble_info_compat(&info, s,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 
+
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -34,7 +34,7 @@ else
+ endif
+ 
+ FEATURE_USER = .bpf
+-FEATURE_TESTS = libbfd disassembler-four-args
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+ FEATURE_DISPLAY = libbfd disassembler-four-args
+ 
+ check_feat := 1
+@@ -56,6 +56,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ $(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
+ 	$(QUIET_BISON)$(YACC) -o $@ -d $<
+--- a/tools/bpf/bpf_jit_disasm.c
++++ b/tools/bpf/bpf_jit_disasm.c
+@@ -28,6 +28,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <limits.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #define CMD_ACTION_SIZE_BUFFER		10
+ #define CMD_ACTION_READ_ALL		3
+@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
+ 	assert(bfdf);
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+-	init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
++	init_disassemble_info_compat(&info, stdout,
++				     (fprintf_ftype) fprintf,
++				     fprintf_styled);
+ 	info.arch = bfd_get_arch(bfdf);
+ 	info.mach = bfd_get_mach(bfdf);
+ 	info.buffer = image;
+
+--- a/tools/bpf/Makefile
++++ b/tools/bpf/Makefile
+@@ -35,7 +35,7 @@ endif
+ 
+ FEATURE_USER = .bpf
+ FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
+-FEATURE_DISPLAY = libbfd disassembler-four-args
++FEATURE_DISPLAY = libbfd
+ 
+ check_feat := 1
+ NON_CHECK_FEAT_TARGETS := clean bpftool_clean runqslower_clean resolve_btfids_clean
+
+--- a/tools/bpf/bpftool/Makefile
++++ b/tools/bpf/bpftool/Makefile
+@@ -93,7 +93,7 @@ INSTALL ?= install
+ RM ?= rm -f
+ 
+ FEATURE_USER = .bpftool
+-FEATURE_TESTS = libbfd disassembler-four-args zlib libcap \
++FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled zlib libcap \
+ 	clang-bpf-co-re
+ FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+ 	clang-bpf-co-re
+@@ -117,6 +117,9 @@ endif
+ ifeq ($(feature-disassembler-four-args), 1)
+ CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
+ endif
++ifeq ($(feature-disassembler-init-styled), 1)
++    CFLAGS += -DDISASM_INIT_STYLED
++endif
+ 
+ LIBS = $(LIBBPF) -lelf -lz
+ LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
+--- a/tools/bpf/bpftool/jit_disasm.c
++++ b/tools/bpf/bpftool/jit_disasm.c
+@@ -24,6 +24,7 @@
+ #include <sys/stat.h>
+ #include <limits.h>
+ #include <bpf/libbpf.h>
++#include <tools/dis-asm-compat.h>
+ 
+ #include "json_writer.h"
+ #include "main.h"
+@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, size_t size)
+ }
+ 
+ static int oper_count;
+-static int fprintf_json(void *out, const char *fmt, ...)
++static int printf_json(void *out, const char *fmt, va_list ap)
+ {
+-	va_list ap;
+ 	char *s;
+ 	int err;
+ 
+-	va_start(ap, fmt);
+ 	err = vasprintf(&s, fmt, ap);
+-	va_end(ap);
+ 	if (err < 0)
+ 		return -1;
+ 
+@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
+ 	return 0;
+ }
+ 
++static int fprintf_json(void *out, const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
++static int fprintf_json_styled(void *out,
++			       enum disassembler_style style __maybe_unused,
++			       const char *fmt, ...)
++{
++	va_list ap;
++	int r;
++
++	va_start(ap, fmt);
++	r = printf_json(out, fmt, ap);
++	va_end(ap);
++
++	return r;
++}
++
+ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 		       const char *arch, const char *disassembler_options,
+ 		       const struct btf *btf,
+@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
+ 	assert(bfd_check_format(bfdf, bfd_object));
+ 
+ 	if (json_output)
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf_json);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf_json,
++					     fprintf_json_styled);
+ 	else
+-		init_disassemble_info(&info, stdout,
+-				      (fprintf_ftype) fprintf);
++		init_disassemble_info_compat(&info, stdout,
++					     (fprintf_ftype) fprintf,
++					     fprintf_styled);
+ 
+ 	/* Update architecture info for offload. */
+ 	if (arch) {
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/perf.nix b/nixpkgs/pkgs/os-specific/linux/kernel/perf/default.nix
index 6d1763a0d0fd..d481eea7e753 100644
--- a/nixpkgs/pkgs/os-specific/linux/kernel/perf.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/perf/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, kernel, elfutils, python2, python3, perl, newt, slang, asciidoc, xmlto, makeWrapper
+{ lib, stdenv, fetchpatch, kernel, elfutils, python2, python3, perl, newt, slang, asciidoc, xmlto, makeWrapper
 , docbook_xsl, docbook_xml_dtd_45, libxslt, flex, bison, pkg-config, libunwind, binutils-unwrapped
 , libiberty, audit, libbfd, libopcodes, openssl, systemtap, numactl
 , zlib
@@ -7,16 +7,19 @@
 , withLibcap ? true, libcap
 }:
 
-with lib;
-
-assert versionAtLeast kernel.version "3.12";
-
 stdenv.mkDerivation {
   pname = "perf-linux";
   version = kernel.version;
 
   inherit (kernel) src;
 
+  patches = lib.optionals (lib.versionAtLeast kernel.version "5.19" && lib.versionOlder kernel.version "5.20") [
+    # binutils-2.39 support around init_disassemble_info()
+    # API change.
+    # Will be included in 5.20.
+    ./5.19-binutils-2.39-support.patch
+  ];
+
   preConfigure = ''
     cd tools/perf
 
@@ -45,12 +48,10 @@ stdenv.mkDerivation {
     elfutils newt slang libunwind libbfd zlib openssl systemtap.stapBuild numactl
     libopcodes python3 perl
   ] ++ lib.optional withGtk gtk2
-    ++ (if (versionAtLeast kernel.version "4.19") then [ python3 ] else [ python2 ])
+    ++ (if (lib.versionAtLeast kernel.version "4.19") then [ python3 ] else [ python2 ])
     ++ lib.optional withZstd zstd
     ++ lib.optional withLibcap libcap;
 
-  # Note: we don't add elfutils to buildInputs, since it provides a
-  # bad `ld' and other stuff.
   NIX_CFLAGS_COMPILE = toString [
     "-Wno-error=cpp"
     "-Wno-error=bool-compare"
@@ -74,11 +75,11 @@ stdenv.mkDerivation {
       --prefix PATH : "${binutils-unwrapped}/bin"
   '';
 
-  meta = {
+  meta = with lib; {
     homepage = "https://perf.wiki.kernel.org/";
     description = "Linux tools to profile with performance counters";
-    maintainers = with lib.maintainers; [viric];
-    platforms = with lib.platforms; linux;
+    maintainers = with maintainers; [ viric ];
+    platforms = platforms.linux;
     broken = kernel.kernelOlder "5";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/randstruct-provide-seed-5.19.patch b/nixpkgs/pkgs/os-specific/linux/kernel/randstruct-provide-seed-5.19.patch
new file mode 100644
index 000000000000..5ca897a76bf6
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/randstruct-provide-seed-5.19.patch
@@ -0,0 +1,13 @@
+diff --git a/scripts/gen-randstruct-seed.sh b/scripts/gen-randstruct-seed.sh
+index 61017b36c464..7bb494dd2e18 100755
+--- a/scripts/gen-randstruct-seed.sh
++++ b/scripts/gen-randstruct-seed.sh
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ # SPDX-License-Identifier: GPL-2.0
+ 
+-SEED=$(od -A n -t x8 -N 32 /dev/urandom | tr -d ' \n')
++SEED="NIXOS_RANDSTRUCT_SEED"
+ echo "$SEED" > "$1"
+ HASH=$(echo -n "$SEED" | sha256sum | cut -d" " -f1)
+ echo "#define RANDSTRUCT_HASHED_SEED \"$HASH\"" > "$2"
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/update-zen.py b/nixpkgs/pkgs/os-specific/linux/kernel/update-zen.py
new file mode 100755
index 000000000000..204a39ad3a9a
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/update-zen.py
@@ -0,0 +1,97 @@
+#! /usr/bin/env nix-shell
+#! nix-shell -i python3 -p python3 nix nix-prefetch-git
+
+import fileinput
+import json
+import os
+import sys
+import re
+import subprocess
+
+from datetime import datetime
+from urllib.request import urlopen, Request
+
+
+def panic(exc):
+    raise Exception(exc)
+
+
+DIR = os.path.dirname(os.path.abspath(__file__))
+HEADERS = {'Accept': 'application/vnd.github.v3+json'}
+
+
+def github_api_request(endpoint):
+    base_url = 'https://api.github.com/'
+    request = Request(base_url + endpoint, headers=HEADERS)
+    with urlopen(request) as http_response:
+        return json.loads(http_response.read().decode('utf-8'))
+
+
+def get_commit_date(repo, sha):
+    url = f'https://api.github.com/repos/{repo}/commits/{sha}'
+    request = Request(url, headers=HEADERS)
+    with urlopen(request) as http_response:
+        commit = json.loads(http_response.read().decode())
+        date = commit['commit']['committer']['date'].rstrip('Z')
+        date = datetime.fromisoformat(date).date().isoformat()
+        return 'unstable-' + date
+
+
+def nix_prefetch_git(url, rev):
+    """Prefetches the requested Git revision (incl. submodules) of the given repository URL."""
+    print(f'nix-prefetch-git {url} {rev}')
+    out = subprocess.check_output([
+        'nix-prefetch-git', '--quiet',
+        '--url', url,
+        '--rev', rev,
+        '--fetch-submodules'])
+    return json.loads(out)['sha256']
+
+
+def nix_prefetch_url(url, unpack=False):
+    """Prefetches the content of the given URL."""
+    print(f'nix-prefetch-url {url}')
+    options = ['--type', 'sha256']
+    if unpack:
+        options += ['--unpack']
+    out = subprocess.check_output(['nix-prefetch-url'] + options + [url])
+    return out.decode('utf-8').rstrip()
+
+
+def update_file(relpath, variant, version, suffix, sha256):
+    file_path = os.path.join(DIR, relpath)
+    with fileinput.FileInput(file_path, inplace=True) as f:
+        for line in f:
+            result = line
+            result = re.sub(
+                fr'^    version = ".+"; #{variant}',
+                f'    version = "{version}"; #{variant}',
+                result)
+            result = re.sub(
+                fr'^    suffix = ".+"; #{variant}',
+                f'    suffix = "{suffix}"; #{variant}',
+                result)
+            result = re.sub(
+                fr'^    sha256 = ".+"; #{variant}',
+                f'    sha256 = "{sha256}"; #{variant}',
+                result)
+            print(result, end='')
+
+
+if __name__ == "__main__":
+    if len(sys.argv) == 1:
+        panic("Update variant expected")
+    variant = sys.argv[1]
+    if variant not in ("zen", "lqx"):
+        panic(f"Unexepected variant instead of 'zen' or 'lqx': {sys.argv[1]}")
+    pattern = re.compile(fr"v(\d+\.\d+\.?\d*)-({variant}\d+)")
+    zen_tags = github_api_request('repos/zen-kernel/zen-kernel/releases')
+    for tag in zen_tags:
+        zen_match = pattern.match(tag['tag_name'])
+        if zen_match:
+            zen_tag = zen_match.group(0)
+            zen_version = zen_match.group(1)
+            zen_suffix = zen_match.group(2)
+            break
+    zen_hash = nix_prefetch_git('https://github.com/zen-kernel/zen-kernel.git', zen_tag)
+    update_file('zen-kernels.nix', variant, zen_version, zen_suffix, zen_hash)
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/update-zen.sh b/nixpkgs/pkgs/os-specific/linux/kernel/update-zen.sh
deleted file mode 100755
index 1532d7be02b3..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/kernel/update-zen.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#! /usr/bin/env nix-shell
-#! nix-shell -I nixpkgs=../../../.. -i bash -p nix-prefetch git gnused gnugrep nix curl
-set -euo pipefail -x
-
-nixpkgs="$(git rev-parse --show-toplevel)"
-old=$(nix-instantiate --eval -A linuxPackages_zen.kernel.modDirVersion "$nixpkgs")
-old="${old%\"}"
-old="${old#\"}"
-new=$(curl https://github.com/zen-kernel/zen-kernel/releases.atom | grep -m1 -o -E '[0-9.]+-zen[0-9]+')
-if [[ "$new" == "$old" ]]; then
-    echo "already up-to-date"
-    exit 0
-fi
-
-path="$nixpkgs/pkgs/os-specific/linux/kernel/linux-zen.nix"
-
-sed -i -e "s!modDirVersion = \".*\"!modDirVersion = \"${new}\"!" "$path"
-checksum=$(nix-prefetch "(import ${nixpkgs} {}).linuxPackages_zen.kernel")
-sed -i -e "s!sha256 = \".*\"!sha256 = \"${checksum}\"!" "$path"
-
-git commit -m "linux_zen: ${old} -> ${new}" $path
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/xanmod-kernels.nix b/nixpkgs/pkgs/os-specific/linux/kernel/xanmod-kernels.nix
new file mode 100644
index 000000000000..53b00b93358a
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/xanmod-kernels.nix
@@ -0,0 +1,84 @@
+{ lib, stdenv, fetchFromGitHub, buildLinux, ... } @ args:
+
+let
+  # These names are how they are designated in https://xanmod.org.
+  ltsVariant = {
+    version = "5.15.60";
+    hash = "sha256-XSOYgrJ/uvPpEG+P3Zy1geFeF/HMZ4LejsKWtTxMUTs=";
+  };
+
+  edgeVariant = {
+    version = "5.19.1";
+    hash = "sha256-Fw+XW2YDAGKEzZ4AO88Y8GcypfOb6AjKp3XOlkT8ZTQ=";
+  };
+
+  ttVariant = {
+    version = "5.15.54";
+    suffix = "xanmod1-tt";
+    hash = "sha256-4ck9PAFuIt/TxA/U+moGlVfCudJnzSuAw7ooFG3OJis=";
+  };
+
+  xanmodKernelFor = { version, suffix ? "xanmod1", hash }: buildLinux (args // rec {
+    inherit version;
+    modDirVersion = "${version}-${suffix}";
+
+    src = fetchFromGitHub {
+      owner = "xanmod";
+      repo = "linux";
+      rev = modDirVersion;
+      inherit hash;
+    };
+
+    structuredExtraConfig = with lib.kernel; {
+      # removed options
+      CFS_BANDWIDTH = lib.mkForce (option no);
+      RT_GROUP_SCHED = lib.mkForce (option no);
+      SCHED_AUTOGROUP = lib.mkForce (option no);
+
+      # AMD P-state driver
+      X86_AMD_PSTATE = yes;
+
+      # Paragon's NTFS3 driver
+      NTFS3_FS = module;
+      NTFS3_LZX_XPRESS = yes;
+      NTFS3_FS_POSIX_ACL = yes;
+
+      # Preemptive Full Tickless Kernel at 500Hz
+      SCHED_CORE = lib.mkForce (option no);
+      PREEMPT_VOLUNTARY = lib.mkForce no;
+      PREEMPT = lib.mkForce yes;
+      NO_HZ_FULL = yes;
+      HZ_500 = yes;
+
+      # Google's BBRv2 TCP congestion Control
+      TCP_CONG_BBR2 = yes;
+      DEFAULT_BBR2 = yes;
+
+      # FQ-PIE Packet Scheduling
+      NET_SCH_DEFAULT = yes;
+      DEFAULT_FQ_PIE = yes;
+
+      # Graysky's additional CPU optimizations
+      CC_OPTIMIZE_FOR_PERFORMANCE_O3 = yes;
+
+      # Futex WAIT_MULTIPLE implementation for Wine / Proton Fsync.
+      FUTEX = yes;
+      FUTEX_PI = yes;
+
+      # WineSync driver for fast kernel-backed Wine
+      WINESYNC = module;
+    };
+
+    extraMeta = {
+      branch = lib.versions.majorMinor version;
+      maintainers = with lib.maintainers; [ fortuneteller2k lovesegfault atemu ];
+      description = "Built with custom settings and new features built to provide a stable, responsive and smooth desktop experience";
+      broken = stdenv.isAarch64;
+    };
+  } // (args.argsOverride or { }));
+in
+{
+  lts = xanmodKernelFor ltsVariant;
+  edge = xanmodKernelFor edgeVariant;
+  tt = xanmodKernelFor ttVariant;
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/kernel/zen-kernels.nix b/nixpkgs/pkgs/os-specific/linux/kernel/zen-kernels.nix
new file mode 100644
index 000000000000..58a71edf6fa9
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/kernel/zen-kernels.nix
@@ -0,0 +1,45 @@
+{ lib, fetchFromGitHub, buildLinux, ... } @ args:
+
+let
+  # comments with variant added for update script
+  # ./update-zen.py zen
+  zenVariant = {
+    version = "5.19.1"; #zen
+    suffix = "zen1"; #zen
+    sha256 = "1b906fa4hk56y5g1hx50kp395fakrphna4nnvy98vs8cxpcfyqi7"; #zen
+    isLqx = false;
+  };
+  # ./update-zen.py lqx
+  lqxVariant = {
+    version = "5.18.17"; #lqx
+    suffix = "lqx1"; #lqx
+    sha256 = "1cf4ix9xx1yi781xsrkaxn673mzi98dxlccsfvky78gjchmc8d6p"; #lqx
+    isLqx = true;
+  };
+  zenKernelsFor = { version, suffix, sha256, isLqx }: buildLinux (args // {
+    inherit version;
+    modDirVersion = "${lib.concatStringsSep "." (lib.take 3 (lib.splitVersion version ++ [ "0" "0" ]))}-${suffix}";
+    isZen = true;
+
+    src = fetchFromGitHub {
+      owner = "zen-kernel";
+      repo = "zen-kernel";
+      rev = "v${version}-${suffix}";
+      inherit sha256;
+    };
+
+    passthru.updateScript = [ ./update-zen.py (if isLqx then "lqx" else "zen") ];
+
+    extraMeta = {
+      branch = lib.versions.majorMinor version + "/master";
+      maintainers = with lib.maintainers; [ andresilva pedrohlc ];
+      description = "Built using the best configuration and kernel sources for desktop, multimedia, and gaming workloads." +
+        lib.optionalString isLqx " (Same as linux_zen but less aggressive release schedule)";
+    };
+
+  } // (args.argsOverride or { }));
+in
+{
+  zen = zenKernelsFor zenVariant;
+  lqx = zenKernelsFor lqxVariant;
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/kexec-tools/default.nix b/nixpkgs/pkgs/os-specific/linux/kexec-tools/default.nix
index 0631e1da2b1b..6faa401eccc5 100644
--- a/nixpkgs/pkgs/os-specific/linux/kexec-tools/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kexec-tools/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, buildPackages, fetchurl, zlib }:
+{ lib, stdenv, buildPackages, fetchurl, fetchpatch, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "kexec-tools";
@@ -12,6 +12,14 @@ stdenv.mkDerivation rec {
     sha256 = "qmPNbH3ZWwbOumJAp/3GeSeJytp1plXmcUmHF1IkJBs=";
   };
 
+  patches = [
+    # Use ELFv2 ABI on ppc64be
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/void-linux/void-packages/6c1192cbf166698932030c2e3de71db1885a572d/srcpkgs/kexec-tools/patches/ppc64-elfv2.patch";
+      sha256 = "19wzfwb0azm932v0vhywv4221818qmlmvdfwpvvpfyw4hjsc2s1l";
+    })
+  ];
+
   hardeningDisable = [ "format" "pic" "relro" "pie" ];
 
   # Prevent kexec-tools from using uname to detect target, which is wrong in
diff --git a/nixpkgs/pkgs/os-specific/linux/keyutils/default.nix b/nixpkgs/pkgs/os-specific/linux/keyutils/default.nix
index f307bd56d1cf..88410654f3b3 100644
--- a/nixpkgs/pkgs/os-specific/linux/keyutils/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/keyutils/default.nix
@@ -15,11 +15,6 @@ stdenv.mkDerivation rec {
   };
 
   patches = [
-    (fetchurl {
-      # improve reproducibility
-      url = "https://salsa.debian.org/debian/keyutils/raw/4cecffcb8e2a2aa4ef41777ed40e4e4bcfb2e5bf/debian/patches/Make-build-reproducible.patch";
-      sha256 = "0wnvbjfrbk7rghd032z684l7vk7mhy3bd41zvhkrhgp3cd5id0bm";
-    })
     ./conf-symlink.patch
     # This patch solves a duplicate symbol error when building with a clang stdenv
     # Before removing this patch, please ensure the package still builds by running eg.
@@ -29,9 +24,16 @@ stdenv.mkDerivation rec {
 
   makeFlags = lib.optionals stdenv.hostPlatform.isStatic "NO_SOLIB=1";
 
-  BUILDDATE = "1970-01-01";
   outputs = [ "out" "lib" "dev" ];
 
+  postPatch = ''
+    # https://github.com/archlinux/svntogit-packages/blob/packages/keyutils/trunk/reproducible.patch
+    substituteInPlace Makefile \
+      --replace \
+        'VCPPFLAGS	:= -DPKGBUILD="\"$(shell date -u +%F)\""' \
+        'VCPPFLAGS	:= -DPKGBUILD="\"$(date -ud "@$SOURCE_DATE_EPOCH" +%F)\""'
+  '';
+
   enableParallelBuilding = true;
 
   installFlags = [
diff --git a/nixpkgs/pkgs/os-specific/linux/kmod/darwin.patch b/nixpkgs/pkgs/os-specific/linux/kmod/darwin.patch
deleted file mode 100644
index 4d9931b03eef..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/kmod/darwin.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-diff --git a/Makefile.am b/Makefile.am
-index 194e111..0a095b5 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -80,8 +80,7 @@ EXTRA_DIST += libkmod/README \
- 	libkmod/COPYING testsuite/COPYING tools/COPYING COPYING
- 
- libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \
--	-version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \
--	-Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
-+	-version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE)
- libkmod_libkmod_la_DEPENDENCIES = \
- 	shared/libshared.la \
- 	${top_srcdir}/libkmod/libkmod.sym
-@@ -91,8 +90,7 @@ libkmod_libkmod_la_LIBADD = \
- 
- noinst_LTLIBRARIES += libkmod/libkmod-internal.la
- libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
--libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \
--	-Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
-+libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS)
- libkmod_libkmod_internal_la_DEPENDENCIES  = $(libkmod_libkmod_la_DEPENDENCIES)
- libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD)
- 
-diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
-index 889f264..6f0a285 100644
---- a/libkmod/libkmod-module.c
-+++ b/libkmod/libkmod-module.c
-@@ -787,7 +787,11 @@ KMOD_EXPORT int kmod_module_remove_module(struct kmod_module *mod,
- 	flags &= KMOD_REMOVE_FORCE;
- 	flags |= KMOD_REMOVE_NOWAIT;
- 
-+#if defined(__linux__)
- 	err = delete_module(mod->name, flags);
-+#else
-+	err = -1;
-+#endif
- 	if (err != 0) {
- 		err = -errno;
- 		ERR(mod->ctx, "could not remove '%s': %m\n", mod->name);
-@@ -879,7 +883,11 @@ KMOD_EXPORT int kmod_module_insert_module(struct kmod_module *mod,
- 	}
- 	size = kmod_file_get_size(mod->file);
- 
-+#if defined(__linux__)
- 	err = init_module(mem, size, args);
-+#else
-+	err = -1;
-+#endif
- init_finished:
- 	if (err < 0) {
- 		err = -errno;
-diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
-index 429ffbd..17a3b9c 100644
---- a/libkmod/libkmod-signature.c
-+++ b/libkmod/libkmod-signature.c
-@@ -17,7 +17,10 @@
-  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
-  */
- 
-+#if defined(__linux__)
- #include <endian.h>
-+#endif
-+
- #include <inttypes.h>
- #include <stdio.h>
- #include <stdlib.h>
-diff --git a/shared/macro.h b/shared/macro.h
-index 4fc5405..b5a2702 100644
---- a/shared/macro.h
-+++ b/shared/macro.h
-@@ -53,6 +53,10 @@
- #define CONCATENATE(x, y) XCONCATENATE(x, y)
- #define UNIQ(x) CONCATENATE(x, __COUNTER__)
-
-+#if !defined(__linux__)
-+#define program_invocation_short_name getprogname()
-+#endif
-+
- /* Temporaries for importing index handling */
- #define NOFAIL(x) (x)
- #define fatal(x...) do { } while (0)
-diff --git a/shared/missing.h b/shared/missing.h
-index 4c0d136..ad8ec0f 100644
---- a/shared/missing.h
-+++ b/shared/missing.h
-@@ -45,6 +45,9 @@ static inline int finit_module(int fd, const char *uargs, int flags)
- #endif
- 
- #if !HAVE_DECL_BE32TOH
-+
-+#if defined(__linux__)
-+
- #include <endian.h>
- #include <byteswap.h>
- #if __BYTE_ORDER == __LITTLE_ENDIAN
-@@ -52,4 +55,16 @@ static inline int finit_module(int fd, const char *uargs, int flags)
- #else
- #define be32toh(x) (x)
- #endif
-+
-+#elif defined(__APPLE__)
-+
-+#include <libkern/OSByteOrder.h>
-+#define be32toh(x) OSSwapBigToHostInt32(x)
-+
-+#else
-+
-+#error No be32toh known for platform
-+
-+#endif
-+
- #endif
-diff --git a/shared/util.c b/shared/util.c
-index fd2028d..ecb0141 100644
---- a/shared/util.c
-+++ b/shared/util.c
-@@ -367,7 +367,7 @@ char *path_make_absolute_cwd(const char *p)
- 	if (path_is_absolute(p))
- 		return strdup(p);
- 
--	cwd = get_current_dir_name();
-+	cwd = getcwd(NULL, 0);
- 	if (!cwd)
- 		return NULL;
- 
---- a/shared/util.h	2018-01-31 18:10:59.000000000 +0100
-+++ b/shared/util.h	2020-12-28 19:48:21.000000000 +0100
-@@ -7,6 +7,9 @@
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/stat.h>
-+#ifdef __APPLE__
-+#include <libgen.h>
-+#endif
- 
- #include <shared/macro.h>
- 
diff --git a/nixpkgs/pkgs/os-specific/linux/kmod/default.nix b/nixpkgs/pkgs/os-specific/linux/kmod/default.nix
index a1a1906ba9ce..802335046342 100644
--- a/nixpkgs/pkgs/os-specific/linux/kmod/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kmod/default.nix
@@ -1,6 +1,9 @@
-{ stdenv, lib, fetchurl, autoreconfHook, pkg-config
+{ stdenv, lib, fetchzip, autoconf, automake, docbook_xml_dtd_42
+, docbook_xml_dtd_43, docbook_xsl, gtk-doc, libtool, pkg-config
 , libxslt, xz, zstd, elf-header
+, withDevdoc ? stdenv.hostPlatform == stdenv.buildPlatform
 , withStatic ? stdenv.hostPlatform.isStatic
+, gitUpdater
 }:
 
 let
@@ -9,25 +12,40 @@ let
 
 in stdenv.mkDerivation rec {
   pname = "kmod";
-  version = "29";
+  version = "30";
 
-  src = fetchurl {
-    url = "mirror://kernel/linux/utils/kernel/${pname}/${pname}-${version}.tar.xz";
-    sha256 = "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b";
+  # autogen.sh is missing from the release tarball,
+  # and we need to run it to regenerate gtk_doc.make,
+  # because the version in the release tarball is broken.
+  # Possibly this will be fixed in kmod 30?
+  # https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/commit/.gitignore?id=61a93a043aa52ad62a11ba940d4ba93cb3254e78
+  src = fetchzip {
+    url = "https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/snapshot/kmod-${version}.tar.gz";
+    sha256 = "sha256-/dih2LoqgRrAsVdHRwld28T8pXgqnzapnQhqkXnxbbc=";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkg-config libxslt ];
-  buildInputs = [ xz zstd ] ++ lib.optional stdenv.isDarwin elf-header;
+  outputs = [ "out" "dev" "lib" ] ++ lib.optional withDevdoc "devdoc";
+
+  nativeBuildInputs = [
+    autoconf automake docbook_xsl libtool libxslt pkg-config
+
+    docbook_xml_dtd_42 # for the man pages
+  ] ++ lib.optionals withDevdoc [ docbook_xml_dtd_43 gtk-doc ];
+  buildInputs = [ xz zstd ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
 
   configureFlags = [
     "--sysconfdir=/etc"
     "--with-xz"
     "--with-zstd"
     "--with-modulesdirs=${modulesDirs}"
+    (lib.enableFeature withDevdoc "gtk-doc")
   ] ++ lib.optional withStatic "--enable-static";
 
   patches = [ ./module-dir.patch ]
-    ++ lib.optional stdenv.isDarwin ./darwin.patch
     ++ lib.optional withStatic ./enable-static.patch;
 
   postInstall = ''
@@ -39,6 +57,13 @@ in stdenv.mkDerivation rec {
     ln -s bin $out/sbin
   '';
 
+  passthru.updateScript = gitUpdater {
+    inherit pname version;
+    # No nicer place to find latest release.
+    url = "https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git";
+    rev-prefix = "v";
+  };
+
   meta = with lib; {
     description = "Tools for loading and managing Linux kernel modules";
     longDescription = ''
@@ -51,7 +76,7 @@ in stdenv.mkDerivation rec {
     downloadPage = "https://www.kernel.org/pub/linux/utils/kernel/kmod/";
     changelog = "https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/plain/NEWS?h=v${version}";
     license = with licenses; [ lgpl21Plus gpl2Plus ]; # GPLv2+ for tools
-    platforms = platforms.unix;
+    platforms = platforms.linux;
     maintainers = with maintainers; [ artturin ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/kmscube/default.nix b/nixpkgs/pkgs/os-specific/linux/kmscube/default.nix
index 53b4cd60fb1c..b9da37901700 100644
--- a/nixpkgs/pkgs/os-specific/linux/kmscube/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kmscube/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchgit, autoreconfHook, libdrm, libX11, libGL, mesa, pkg-config }:
+{ lib, stdenv, fetchgit, fetchpatch, autoreconfHook, libdrm, libX11, libGL, mesa, pkg-config }:
 
 stdenv.mkDerivation {
   pname = "kmscube";
@@ -10,6 +10,15 @@ stdenv.mkDerivation {
     sha256 = "1q5b5yvyfj3127385mp1bfmcbnpnbdswdk8gspp7g4541xk4k933";
   };
 
+  patches = [
+    # Pull upstream patch for -fno-common toolchains.
+    (fetchpatch {
+      name = "fno-common.patch";
+      url = "https://gitlab.freedesktop.org/mesa/kmscube/-/commit/908ef39864442c0807954af5d3f88a3da1a6f8a5.patch";
+      sha256 = "1gxn3b50mvjlc25234839v5z29r8fd9di4176a3yx4gbsz8cc5vi";
+    })
+  ];
+
   nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ libdrm libX11 libGL mesa ];
 
diff --git a/nixpkgs/pkgs/os-specific/linux/kvdo/default.nix b/nixpkgs/pkgs/os-specific/linux/kvdo/default.nix
new file mode 100644
index 000000000000..7e7c765bd819
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/kvdo/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, lib, fetchFromGitHub, vdo, kernel }:
+
+stdenv.mkDerivation rec {
+  inherit (vdo) version;
+  pname = "kvdo";
+
+  src = fetchFromGitHub {
+    owner = "dm-vdo";
+    repo = "kvdo";
+    rev = version;
+    hash = "sha256-4FYTFUIvGjea3bh2GbQYG7hSswVDdNS3S+jWQ9+inpg=";
+  };
+
+  dontConfigure = true;
+  enableParallelBuilding = true;
+
+  KSRC = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
+  INSTALL_MOD_PATH = placeholder "out";
+
+  preBuild = ''
+    makeFlags="$makeFlags -C ${KSRC} M=$(pwd)"
+'';
+  installTargets = [ "modules_install" ];
+
+  meta = with lib; {
+    inherit (vdo.meta) license maintainers;
+    homepage = "https://github.com/dm-vdo/kvdo";
+    description = "A pair of kernel modules which provide pools of deduplicated and/or compressed block storage";
+    platforms = platforms.linux;
+    broken = kernel.kernelOlder "5.15" || kernel.kernelAtLeast "5.17";
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/kvmfr/default.nix b/nixpkgs/pkgs/os-specific/linux/kvmfr/default.nix
index ed9c58d26266..24fedbf59d78 100644
--- a/nixpkgs/pkgs/os-specific/linux/kvmfr/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/kvmfr/default.nix
@@ -14,6 +14,12 @@ stdenv.mkDerivation rec {
     url = "https://github.com/gnif/LookingGlass/commit/a9b5302a517e19d7a2da114acf71ef1e69cfb497.patch";
     sha256 = "017nxlk2f7kyjp6llwa74dbczdb1jk8v791qld81dxhzkm9dyqqx";
     stripLen = 1;
+  })
+  ++ lib.optional (kernel.kernelAtLeast "5.18") (fetchpatch {
+    name = "kvmfr-5.18.patch";
+    url = "https://github.com/gnif/LookingGlass/commit/c7029f95042fe902843cb6acbfc75889e93dc210.patch";
+    sha256 = "sha256-6DpL17XWj8BKpiBdKdCPC51MWKLIo6PixQ9UaygT2Zg=";
+    stripLen = 1;
   });
 
   makeFlags = [
diff --git a/nixpkgs/pkgs/os-specific/linux/latencytop/default.nix b/nixpkgs/pkgs/os-specific/linux/latencytop/default.nix
index 56e412379f80..a48abf85831f 100644
--- a/nixpkgs/pkgs/os-specific/linux/latencytop/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/latencytop/default.nix
@@ -1,10 +1,16 @@
-{ lib, stdenv, fetchurl, ncurses, glib, pkg-config, gtk2 }:
+{ lib, stdenv, fetchurl, ncurses, glib, pkg-config, gtk2, util-linux }:
 
 stdenv.mkDerivation rec {
   pname = "latencytop";
   version = "0.5";
 
-  patchPhase = "sed -i s,/usr,$out, Makefile";
+  postPatch = ''
+    sed -i s,/usr,$out, Makefile
+
+    # Fix #171609
+    substituteInPlace fsync.c --replace /bin/mount ${util-linux}/bin/mount
+  '';
+
   preInstall = "mkdir -p $out/sbin";
 
   src = fetchurl {
diff --git a/nixpkgs/pkgs/os-specific/linux/ledger-udev-rules/default.nix b/nixpkgs/pkgs/os-specific/linux/ledger-udev-rules/default.nix
index 7b23719c791c..3a6bf9e5d51c 100644
--- a/nixpkgs/pkgs/os-specific/linux/ledger-udev-rules/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/ledger-udev-rules/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation {
   pname = "ledger-udev-rules";
-  version = "unstable-2019-05-30";
+  version = "unstable-2021-09-10";
 
   src = fetchFromGitHub {
     owner = "LedgerHQ";
     repo = "udev-rules";
-    rev = "765b7fdf57b20fd9326cedf48ee52e905024ab4f";
-    sha256 = "10a42al020zpkx918y6b1l9az45vk3921b2l1mx87w3m0ad9qvif";
+    rev = "2776324af6df36c2af4d2e8e92a1c98c281117c9";
+    sha256 = "sha256-yTYI81PXMc32lMfI5uhD14nP20zAI7ZF33V1LRDWg2Y=";
   };
 
   dontBuild = true;
diff --git a/nixpkgs/pkgs/os-specific/linux/libbpf/default.nix b/nixpkgs/pkgs/os-specific/linux/libbpf/default.nix
index 8e6b9fa0663a..2c15e3d49ee1 100644
--- a/nixpkgs/pkgs/os-specific/linux/libbpf/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/libbpf/default.nix
@@ -1,6 +1,5 @@
 { fetchFromGitHub
-, fetchpatch
-, libelf
+, elfutils
 , pkg-config
 , stdenv
 , zlib
@@ -8,21 +7,19 @@
 , nixosTests
 }:
 
-with builtins;
-
 stdenv.mkDerivation rec {
   pname = "libbpf";
-  version = "0.7.0";
+  version = "0.8.1";
 
   src = fetchFromGitHub {
     owner = "libbpf";
     repo = "libbpf";
     rev = "v${version}";
-    sha256 = "sha256-NFVJ8JquWVzu+QoaaOMzhnu6/IqdP1FPhtJFidXA4L4=";
+    sha256 = "sha256-daVS+TErmDU8ksThOvcepg1A61iD8N8GIkC40cmc9/8=";
   };
 
   nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ libelf zlib ];
+  buildInputs = [ elfutils zlib ];
 
   enableParallelBuilding = true;
   makeFlags = [ "PREFIX=$(out)" "-C src" ];
diff --git a/nixpkgs/pkgs/os-specific/linux/libcap-ng/default.nix b/nixpkgs/pkgs/os-specific/linux/libcap-ng/default.nix
index 615f376d79d4..ad01a83ac935 100644
--- a/nixpkgs/pkgs/os-specific/linux/libcap-ng/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/libcap-ng/default.nix
@@ -6,11 +6,11 @@ stdenv.mkDerivation rec {
   pname = "libcap-ng";
   # When updating make sure to test that the version with
   # all of the python bindings still works
-  version = "0.8.2";
+  version = "0.8.3";
 
   src = fetchurl {
     url = "${meta.homepage}/${pname}-${version}.tar.gz";
-    sha256 = "1sasp1n154aqy9fz0knlb966svm7xg1zjhg1vr4q839bgjvq7h2j";
+    sha256 = "sha256-vtb2hI4iuy+Dtfdksq7w7TkwVOgDqOOocRyyo55rSS0=";
   };
 
   nativeBuildInputs = [ swig ];
diff --git a/nixpkgs/pkgs/os-specific/linux/libcap/default.nix b/nixpkgs/pkgs/os-specific/linux/libcap/default.nix
index 2f12d2fea38c..0577107fd026 100644
--- a/nixpkgs/pkgs/os-specific/linux/libcap/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/libcap/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, buildPackages, fetchurl, attr, perl, runtimeShell
+{ stdenv, lib, buildPackages, fetchurl, attr, runtimeShell
 , usePam ? !isStatic, pam ? null
 , isStatic ? stdenv.hostPlatform.isStatic
 }:
@@ -7,18 +7,17 @@ assert usePam -> pam != null;
 
 stdenv.mkDerivation rec {
   pname = "libcap";
-  version = "2.49";
+  version = "2.65";
 
   src = fetchurl {
     url = "mirror://kernel/linux/libs/security/linux-privs/libcap2/${pname}-${version}.tar.xz";
-    sha256 = "sha256-6YvE2TZFCC7Hh3MLD9GnErOIgkZcUFd33hfDOIMe4YE=";
+    sha256 = "sha256-c+NQAgzDH+FTYIedGThP+jOVqCXwZfz2vaOlzfllvr0=";
   };
 
   outputs = [ "out" "dev" "lib" "man" "doc" ]
     ++ lib.optional usePam "pam";
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
-  nativeBuildInputs = [ perl ];
 
   buildInputs = lib.optional usePam pam;
 
@@ -29,9 +28,12 @@ stdenv.mkDerivation rec {
     "PAM_CAP=${if usePam then "yes" else "no"}"
     "BUILD_CC=$(CC_FOR_BUILD)"
     "CC:=$(CC)"
+    "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
   ] ++ lib.optional isStatic "SHARED=no";
 
-  prePatch = ''
+  postPatch = ''
+    patchShebangs ./progs/mkcapshdoc.sh
+
     # use full path to bash
     substituteInPlace progs/capsh.c --replace "/bin/bash" "${runtimeShell}"
 
diff --git a/nixpkgs/pkgs/os-specific/linux/libnl/default.nix b/nixpkgs/pkgs/os-specific/linux/libnl/default.nix
index d6604f9e15b9..08a55134e773 100644
--- a/nixpkgs/pkgs/os-specific/linux/libnl/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/libnl/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libnl";
-  version = "3.5.0";
+  version = "3.7.0";
 
   src = fetchFromGitHub {
     repo = "libnl";
     owner = "thom311";
     rev = "libnl${lib.replaceStrings ["."] ["_"] version}";
-    sha256 = "1ak30jcx52gl5yz1691qq0b76ldbcp2z6vsvdr2mrrwqiplqbcs2";
+    sha256 = "sha256-Ty9NdWKWB29MTRfG5OJlSE0mSTN3Wy+sR4KtuExXcB4=";
   };
 
   outputs = [ "bin" "dev" "out" "man" ] ++ lib.optional pythonSupport "py";
diff --git a/nixpkgs/pkgs/os-specific/linux/libnss-mysql/default.nix b/nixpkgs/pkgs/os-specific/linux/libnss-mysql/default.nix
new file mode 100644
index 000000000000..77e629b03074
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/libnss-mysql/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, which, libmysqlclient }:
+
+stdenv.mkDerivation rec {
+  pname = "libnss-mysql";
+  version = "1.7.1";
+
+  src = fetchFromGitHub {
+    owner = "saknopper";
+    repo = "libnss-mysql";
+    rev = "v${version}";
+    sha256 = "1fhsswa3h2nkhjkyjxxqnj07rlx6bmfvd8j521snimx2jba8h0d6";
+  };
+
+  nativeBuildInputs = [ autoreconfHook which ];
+  buildInputs = [ libmysqlclient ];
+
+  configureFlags = [ "--sysconfdir=/etc" ];
+  installFlags = [ "sysconfdir=$(out)/etc" ];
+  postInstall = ''
+    rm -r $out/etc
+  '';
+
+  meta = with lib; {
+    description = "MySQL module for the Solaris Nameservice Switch (NSS)";
+    homepage = "https://github.com/saknopper/libnss-mysql";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ netali ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/libpsm2/default.nix b/nixpkgs/pkgs/os-specific/linux/libpsm2/default.nix
index 070a18f6984a..ebfe492f7364 100644
--- a/nixpkgs/pkgs/os-specific/linux/libpsm2/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/libpsm2/default.nix
@@ -2,7 +2,7 @@
 
 stdenv.mkDerivation rec {
   pname = "libpsm2";
-  version = "11.2.206";
+  version = "11.2.229";
 
   preConfigure= ''
     export UDEVDIR=$out/etc/udev
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     owner = "intel";
     repo = "opa-psm2";
     rev = "PSM2_${version}";
-    sha256 = "sha256-HsM2OaoX+SdbIednX1MWw1M4kkkPwUs5Dm32q2H7Mg4=";
+    sha256 = "sha256-t3tZCxGmGMscDmeyCATLbHxU7jEJqAzxwPV0Z8pl2ko=";
   };
 
   postInstall = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/libsepol/default.nix b/nixpkgs/pkgs/os-specific/linux/libsepol/default.nix
index 5fa51ac22382..108e65072314 100644
--- a/nixpkgs/pkgs/os-specific/linux/libsepol/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/libsepol/default.nix
@@ -31,6 +31,8 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-Wno-error";
 
+  enableParallelBuilding = true;
+
   passthru = { inherit se_url; };
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/os-specific/linux/libtraceevent/default.nix b/nixpkgs/pkgs/os-specific/linux/libtraceevent/default.nix
index 7ec8ac35e62a..c81949bf39a6 100644
--- a/nixpkgs/pkgs/os-specific/linux/libtraceevent/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/libtraceevent/default.nix
@@ -1,18 +1,19 @@
-{ lib, stdenv, fetchgit, pkg-config, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl }:
+{ lib, stdenv, fetchgit, pkg-config, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, coreutils }:
 
 stdenv.mkDerivation rec {
   pname = "libtraceevent";
-  version = "1.5.1";
+  version = "1.6.2";
 
   src = fetchgit {
     url = "git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git";
     rev = "libtraceevent-${version}";
-    sha256 = "sha256-g4dB8QhCG6SgZVAU3TCtb70vYYh1KN7FrcldzTGAUnI=";
+    sha256 = "sha256-iLy2rEKn0UJguRcY/W8RvUq7uX+snQojb/cXOmMsjwc=";
   };
 
   # Don't build and install html documentation
   postPatch = ''
     sed -i -e '/^all:/ s/html//' -e '/^install:/ s/install-html//' Documentation/Makefile
+    substituteInPlace scripts/utils.mk --replace /bin/pwd ${coreutils}/bin/pwd
   '';
 
   outputs = [ "out" "dev" "devman" ];
diff --git a/nixpkgs/pkgs/os-specific/linux/libtracefs/default.nix b/nixpkgs/pkgs/os-specific/linux/libtracefs/default.nix
index 972a71d50390..3a973b9880d5 100644
--- a/nixpkgs/pkgs/os-specific/linux/libtracefs/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/libtracefs/default.nix
@@ -15,12 +15,12 @@
 
 stdenv.mkDerivation rec {
   pname = "libtracefs";
-  version = "1.3.0";
+  version = "1.4.2";
 
   src = fetchgit {
     url = "git://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git";
     rev = "libtracefs-${version}";
-    sha256 = "sha256-Kg1mPjTZ2UCeco18Fa8GqmLo2R35XvUE/q2J1HAmtEc=";
+    sha256 = "sha256-CmFzonPq91iLflolJaucpPWzb8MCgfuov/OQ6KUD3f4=";
   };
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/light/default.nix b/nixpkgs/pkgs/os-specific/linux/light/default.nix
index 995381c53403..6caa8e394508 100644
--- a/nixpkgs/pkgs/os-specific/linux/light/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/light/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, autoreconfHook, coreutils }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, coreutils }:
 
 stdenv.mkDerivation rec {
   version = "1.2.2";
@@ -10,6 +10,16 @@ stdenv.mkDerivation rec {
     sha256 = "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s";
   };
 
+  patches = [
+    # Pull upstream fix for -fno-common toolchains:
+    #  https://github.com/haikarainen/light/pull/135
+    (fetchpatch {
+      name = "fno-common.patch";
+      url = "https://github.com/haikarainen/light/commit/eae912ca7ff3356805e47739114861d2b6ae7ec0.patch";
+      sha256 = "15jp8hm5scl0myiy1jmvd6m52lhx5jscvi3rgb5siwakmnkgzx9j";
+    })
+  ];
+
   configureFlags = [ "--with-udev" ];
 
   nativeBuildInputs = [ autoreconfHook ];
diff --git a/nixpkgs/pkgs/os-specific/linux/linux-wifi-hotspot/default.nix b/nixpkgs/pkgs/os-specific/linux/linux-wifi-hotspot/default.nix
new file mode 100644
index 000000000000..e5e4e1dca87a
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/linux-wifi-hotspot/default.nix
@@ -0,0 +1,101 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, which
+, pkg-config
+, glib
+, gtk3
+, iw
+, makeWrapper
+, qrencode
+, hostapd
+, getopt
+, dnsmasq
+, iproute2
+, flock
+, iptables
+, gawk
+, coreutils
+, gnugrep
+, gnused
+, kmod
+, networkmanager
+, procps
+}:
+
+
+stdenv.mkDerivation rec {
+  pname = "linux-wifi-hotspot";
+  version = "4.4.0";
+
+  src = fetchFromGitHub {
+    owner = "lakinduakash";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-XCgYWOX7QSdANG6DqYk0yZZqnvZGDl3GaF9KtYRmpJ0=";
+  };
+
+  nativeBuildInputs = [
+    which
+    pkg-config
+    makeWrapper
+    qrencode
+    hostapd
+  ];
+
+  buildInputs = [
+    glib
+    gtk3
+  ];
+
+  outputs = [ "out" ];
+
+  postPatch = ''
+    substituteInPlace ./src/scripts/Makefile \
+      --replace "etc" "$out/etc"
+    substituteInPlace ./src/scripts/wihotspot \
+      --replace "/usr" "$out"
+  '';
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+  ];
+
+  postInstall = ''
+    wrapProgram $out/bin/create_ap \
+      --prefix PATH : ${lib.makeBinPath [
+          coreutils
+          dnsmasq
+          flock
+          gawk
+          getopt
+          gnugrep
+          gnused
+          hostapd
+          iproute2
+          iptables
+          iw
+          kmod
+          networkmanager
+          procps
+          which
+        ]}
+
+    wrapProgram $out/bin/wihotspot-gui \
+      --prefix PATH : ${lib.makeBinPath [ iw ]} \
+      --prefix PATH : "${placeholder "out"}/bin"
+
+    wrapProgram $out/bin/wihotspot \
+      --prefix PATH : ${lib.makeBinPath [ iw ]} \
+      --prefix PATH : "${placeholder "out"}/bin"
+  '';
+
+  meta = with lib; {
+    description = "Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface";
+    homepage = "https://github.com/lakinduakash/linux-wifi-hotspot";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ onny ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/lockdep/default.nix b/nixpkgs/pkgs/os-specific/linux/lockdep/default.nix
index 190941b1633a..047b2499a827 100644
--- a/nixpkgs/pkgs/os-specific/linux/lockdep/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/lockdep/default.nix
@@ -23,6 +23,12 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ flex bison ];
 
+  # Workaround build failure on -fno-common toolchains like upstream
+  # gcc-10. Otherwise build fails as:
+  #   ld: lockdep.o:/build/linux-5.0.21/tools/lib/lockdep/../../include/linux/rcu.h:5: multiple definition of
+  #     `rcu_scheduler_active'; common.o:/build/linux-5.0.21/tools/lib/lockdep/../../include/linux/rcu.h:5: first defined here
+  NIX_CFLAGS_COMPILE = "-fcommon";
+
   buildPhase = ''
     make defconfig
     make headers_install
diff --git a/nixpkgs/pkgs/os-specific/linux/logitech-udev-rules/default.nix b/nixpkgs/pkgs/os-specific/linux/logitech-udev-rules/default.nix
deleted file mode 100644
index 0b0e9e8f203d..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/logitech-udev-rules/default.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ lib, stdenv, solaar }:
-
-# ltunifi and solaar both provide udev rules but solaar's rules are more
-# up-to-date so we simply use that instead of having to maintain our own rules
-
-stdenv.mkDerivation {
-  pname = "logitech-udev-rules";
-  inherit (solaar) version;
-
-  buildCommand = ''
-    install -Dm444 -t $out/etc/udev/rules.d ${solaar.src}/rules.d/*.rules
-  '';
-
-  meta = with lib; {
-    description = "udev rules for Logitech devices";
-    inherit (solaar.meta) homepage license platforms;
-    maintainers = with maintainers; [ peterhoeg ];
-  };
-}
diff --git a/nixpkgs/pkgs/os-specific/linux/lttng-modules/default.nix b/nixpkgs/pkgs/os-specific/linux/lttng-modules/default.nix
index 706ee95fb70a..b2fa10568075 100644
--- a/nixpkgs/pkgs/os-specific/linux/lttng-modules/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/lttng-modules/default.nix
@@ -1,14 +1,41 @@
-{ lib, stdenv, fetchurl, kernel }:
+{ lib, stdenv, fetchgit, fetchpatch, kernel }:
 
 stdenv.mkDerivation rec {
   pname = "lttng-modules-${kernel.version}";
-  version = "2.13.2";
+  version = "2.13.4";
 
-  src = fetchurl {
-    url = "https://lttng.org/files/lttng-modules/lttng-modules-${version}.tar.bz2";
-    sha256 = "sha256-39VH2QQcjFRa5be/7z8O8tnyUg1qtEGIyeqN5W1dKYo=";
+  src = fetchgit {
+    url = "https://git.lttng.org/lttng-modules.git";
+    rev = "v${version}";
+    hash = "sha256-J2Tr1vOiCAilmnf3attF3bz8Irn9IQ2QbapdXJ4MUSg=";
   };
 
+  patches = [
+    # fix: mm/page_alloc: fix tracepoint mm_page_alloc_zone_locked() (v5.19)
+    (fetchpatch {
+      url = "https://git.lttng.org/?p=lttng-modules.git;a=patch;h=6229bbaa423832f6b7c7a658ad11e1d4242752ff";
+      hash = "sha256-pqbKxBzjfN20wfsqSeBLXNQ+/U+3qk9RfTiT32OwSIc=";
+    })
+
+    # fix: fs: Remove flags parameter from aops->write_begin (v5.19)
+    (fetchpatch {
+      url = "https://git.lttng.org/?p=lttng-modules.git;a=patch;h=5e2f832d59d51589ab69479c7db43c7581fb9346";
+      hash = "sha256-auoCbvFEVR76sOCLjIe+q/Q+vunQlR3G3gVcjqAGGPk=";
+    })
+
+    # fix: workqueue: Fix type of cpu in trace event (v5.19)
+    (fetchpatch {
+      url = "https://git.lttng.org/?p=lttng-modules.git;a=patch;h=c6da9604b1666780ea4725b3b3d1bfa1548f9c89";
+      hash = "sha256-qoTwy+P32qg1L+JctqM1+70OkeTbnbL3QJ9LwaBq/bw=";
+    })
+
+    # fix: net: skb: introduce kfree_skb_reason() (v5.15.58..v5.16)
+    (fetchpatch {
+      url = "https://git.lttng.org/?p=lttng-modules.git;a=patch;h=96c477dabaaf6cd1734bebe0972fef877e5a463b";
+      hash = "sha256-b7BhrYZ5SZqeRVGEu0Eo9GfbcZdDPrgEnOl2XU3z+ds=";
+    })
+  ];
+
   nativeBuildInputs = kernel.moduleBuildDependencies;
 
   hardeningDisable = [ "pic" ];
diff --git a/nixpkgs/pkgs/os-specific/linux/lvm2/2_03.nix b/nixpkgs/pkgs/os-specific/linux/lvm2/2_03.nix
index 73f1e9fbdeec..0cca51feab30 100644
--- a/nixpkgs/pkgs/os-specific/linux/lvm2/2_03.nix
+++ b/nixpkgs/pkgs/os-specific/linux/lvm2/2_03.nix
@@ -1,4 +1,4 @@
 import ./common.nix {
-  version = "2.03.15";
-  sha256 = "17n9xl01by7dcbjwjnr6b4rrkp2frz8hwnjl59svsyp13sjq6llk";
+  version = "2.03.16";
+  sha256 = "sha256-5mHs4VtdiNir45pMHh2y9D4YlvAZlIu5iw4V13doB4Y=";
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/lvm2/common.nix b/nixpkgs/pkgs/os-specific/linux/lvm2/common.nix
index 07e8c9cb02da..4cb86bf3d8b9 100644
--- a/nixpkgs/pkgs/os-specific/linux/lvm2/common.nix
+++ b/nixpkgs/pkgs/os-specific/linux/lvm2/common.nix
@@ -4,13 +4,19 @@
 , fetchpatch
 , fetchurl
 , pkg-config
-, util-linux
+, coreutils
 , libuuid
 , libaio
+, substituteAll
 , enableCmdlib ? false
 , enableDmeventd ? false
-, udevSupport ? !stdenv.hostPlatform.isStatic, udev ? null
+, udevSupport ? !stdenv.hostPlatform.isStatic, udev
 , onlyLib ? stdenv.hostPlatform.isStatic
+  # Otherwise we have a infinity recursion during static compilation
+, enableUtilLinux ? !stdenv.hostPlatform.isStatic, util-linux
+, enableVDO ? false, vdo
+, enableMdadm ? false, mdadm
+, enableMultipath ? false, multipath-tools
 , nixosTests
 }:
 
@@ -18,7 +24,7 @@
 assert enableDmeventd -> enableCmdlib;
 
 stdenv.mkDerivation rec {
-  pname = "lvm2" + lib.optionalString enableDmeventd "-with-dmeventd";
+  pname = "lvm2" + lib.optionalString enableDmeventd "-with-dmeventd" + lib.optionalString enableVDO "-with-vdo";
   inherit version;
 
   src = fetchurl {
@@ -33,6 +39,8 @@ stdenv.mkDerivation rec {
     udev
   ] ++ lib.optionals (!onlyLib) [
     libuuid
+  ] ++ lib.optionals enableVDO [
+    vdo
   ];
 
   configureFlags = [
@@ -58,6 +66,8 @@ stdenv.mkDerivation rec {
     "--enable-udev_sync"
   ] ++ lib.optionals stdenv.hostPlatform.isStatic [
     "--enable-static_link"
+  ] ++  lib.optionals enableVDO [
+    "--enable-vdo"
   ];
 
   preConfigure = ''
@@ -77,13 +87,29 @@ stdenv.mkDerivation rec {
     substituteInPlace make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system"
   '' + lib.optionalString (lib.versionAtLeast version "2.03") ''
     substituteInPlace libdm/make.tmpl.in --replace "@systemdsystemunitdir@" "$out/lib/systemd/system"
+
+    substituteInPlace scripts/blk_availability_systemd_red_hat.service.in \
+      --replace '/usr/bin/true' '${coreutils}/bin/true'
   '';
 
   postConfigure = ''
     sed -i 's|^#define LVM_CONFIGURE_LINE.*$|#define LVM_CONFIGURE_LINE "<removed>"|g' ./include/configure.h
   '';
 
-  patches = lib.optionals (lib.versionOlder version "2.03.15") [
+  patches = lib.optionals (lib.versionAtLeast version "2.03.15") [
+    # fixes paths to and checks for tools
+    # TODO: needs backport to LVM 2.02 used by static/musl
+    (substituteAll (let
+      optionalTool = cond: pkg: if cond then pkg else "/run/current-system/sw";
+    in {
+      src = ./fix-blkdeactivate.patch;
+      inherit coreutils;
+      util_linux = optionalTool enableUtilLinux util-linux;
+      mdadm = optionalTool enableMdadm mdadm;
+      multipath_tools = optionalTool enableMultipath multipath-tools;
+      vdo = optionalTool enableVDO vdo;
+    }))
+  ] ++ lib.optionals (lib.versionOlder version "2.03.15") [
     # Musl fixes from Alpine.
     ./fix-stdio-usage.patch
     (fetchpatch {
diff --git a/nixpkgs/pkgs/os-specific/linux/lvm2/fix-blkdeactivate.patch b/nixpkgs/pkgs/os-specific/linux/lvm2/fix-blkdeactivate.patch
new file mode 100644
index 000000000000..db8cfaeae9e3
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/lvm2/fix-blkdeactivate.patch
@@ -0,0 +1,51 @@
+diff --git a/scripts/blkdeactivate.sh.in b/scripts/blkdeactivate.sh.in
+index 7c517b87b..e51a33778 100644
+--- a/scripts/blkdeactivate.sh.in
++++ b/scripts/blkdeactivate.sh.in
+@@ -34,11 +34,11 @@ TOOL=blkdeactivate
+ DEV_DIR="/dev"
+ SYS_BLK_DIR="/sys/block"
+ 
+-MDADM="/sbin/mdadm"
+-MOUNTPOINT="/bin/mountpoint"
+-MPATHD="/sbin/multipathd"
+-UMOUNT="/bin/umount"
+-VDO="/bin/vdo"
++MDADM="@mdadm@/bin/mdadm"
++MOUNTPOINT="@util_linux@/bin/mountpoint"
++MPATHD="@multipath_tools@/bin/multipathd"
++UMOUNT="@util_linux@/bin/umount"
++VDO="@vdo@/bin/vdo"
+ 
+ sbindir="@SBINDIR@"
+ DMSETUP="$sbindir/dmsetup"
+@@ -48,7 +48,7 @@ if "$UMOUNT" --help | grep -- "--all-targets" >"$DEV_DIR/null"; then
+ 	UMOUNT_OPTS="--all-targets "
+ else
+ 	UMOUNT_OPTS=""
+-	FINDMNT="/bin/findmnt -r --noheadings -u -o TARGET"
++	FINDMNT="@util_linux@/bin/findmnt -r --noheadings -u -o TARGET"
+ 	FINDMNT_READ="read -r mnt"
+ fi
+ DMSETUP_OPTS=""
+@@ -57,10 +57,10 @@ MDADM_OPTS=""
+ MPATHD_OPTS=""
+ VDO_OPTS=""
+ 
+-LSBLK="/bin/lsblk -r --noheadings -o TYPE,KNAME,NAME,MOUNTPOINT"
++LSBLK="@util_linux@/bin/lsblk -r --noheadings -o TYPE,KNAME,NAME,MOUNTPOINT"
+ LSBLK_VARS="local devtype local kname local name local mnt"
+ LSBLK_READ="read -r devtype kname name mnt"
+-SORT_MNT="/bin/sort -r -u -k 4"
++SORT_MNT="@coreutils@/bin/sort -r -u -k 4"
+ 
+ # Do not show tool errors by default (only done/skipping summary
+ # message provided by this script) and no verbose mode by default.
+@@ -102,6 +102,7 @@ declare -A SKIP_VG_LIST=()
+ # (list is an associative array!)
+ #
+ declare -A SKIP_UMOUNT_LIST=(["/"]=1 \
++                             ["/nix"]=1 ["/nix/store"]=1 \
+                              ["/lib"]=1 ["/lib64"]=1 \
+                              ["/bin"]=1 ["/sbin"]=1 \
+                              ["/var"]=1 ["/var/log"]=1 \
diff --git a/nixpkgs/pkgs/os-specific/linux/lxc/default.nix b/nixpkgs/pkgs/os-specific/linux/lxc/default.nix
index 62f63a8c3ac3..18c23c46c13c 100644
--- a/nixpkgs/pkgs/os-specific/linux/lxc/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/lxc/default.nix
@@ -94,6 +94,6 @@ stdenv.mkDerivation rec {
     '';
 
     platforms = platforms.linux;
-    maintainers = with maintainers; [ fpletz ];
+    maintainers = with maintainers; [ ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/lxcfs/default.nix b/nixpkgs/pkgs/os-specific/linux/lxcfs/default.nix
index 68bf03552307..67e96289e2ab 100644
--- a/nixpkgs/pkgs/os-specific/linux/lxcfs/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/lxcfs/default.nix
@@ -46,6 +46,6 @@ stdenv.mkDerivation rec {
     changelog = "https://linuxcontainers.org/lxcfs/news/";
     license = licenses.asl20;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ mic92 fpletz ];
+    maintainers = with maintainers; [ mic92 ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/mbpfan/default.nix b/nixpkgs/pkgs/os-specific/linux/mbpfan/default.nix
index 675d9417a01a..26c3d07364ce 100644
--- a/nixpkgs/pkgs/os-specific/linux/mbpfan/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/mbpfan/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   pname = "mbpfan";
-  version = "2.2.1";
+  version = "2.3.0";
   src = fetchFromGitHub {
     owner = "dgraziotin";
     repo = "mbpfan";
     rev = "v${version}";
-    sha256 = "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr";
+    sha256 = "sha256-jIYg9b0c/7mMRS5WF+mOH6t9SCWEP32lsdbCgpWpg24=";
   };
   installPhase = ''
     mkdir -p $out/bin $out/etc
diff --git a/nixpkgs/pkgs/os-specific/linux/mdadm/default.nix b/nixpkgs/pkgs/os-specific/linux/mdadm/default.nix
index 01d2bba32a4d..05e0600928a3 100644
--- a/nixpkgs/pkgs/os-specific/linux/mdadm/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/mdadm/default.nix
@@ -1,12 +1,12 @@
-{ lib, stdenv, util-linux, coreutils, fetchurl, groff, system-sendmail }:
+{ lib, stdenv, util-linux, coreutils, fetchurl, groff, system-sendmail, udev }:
 
 stdenv.mkDerivation rec {
   pname = "mdadm";
-  version = "4.1";
+  version = "4.2";
 
   src = fetchurl {
     url = "mirror://kernel/linux/utils/raid/mdadm/mdadm-${version}.tar.xz";
-    sha256 = "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb";
+    sha256 = "sha256-RhwhVnCGS7dKTRo2IGhKorL4KW3/oGdD8m3aVVes8B0=";
   };
 
   patches = [ ./no-self-references.patch ];
@@ -24,6 +24,8 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  buildInputs = [ udev ];
+
   nativeBuildInputs = [ groff ];
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/mdadm/no-self-references.patch b/nixpkgs/pkgs/os-specific/linux/mdadm/no-self-references.patch
index cf0366e52d11..3b3dc4d84609 100644
--- a/nixpkgs/pkgs/os-specific/linux/mdadm/no-self-references.patch
+++ b/nixpkgs/pkgs/os-specific/linux/mdadm/no-self-references.patch
@@ -1,8 +1,8 @@
 diff --git a/Makefile b/Makefile
-index d82e30f..d231cf9 100644
+index 2a51d813..a31ac48a 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -51,6 +51,9 @@ endif
+@@ -63,6 +63,9 @@ endif
  ifdef DEBIAN
  CPPFLAGS += -DDEBIAN
  endif
@@ -12,7 +12,7 @@ index d82e30f..d231cf9 100644
  ifdef DEFAULT_OLD_METADATA
   CPPFLAGS += -DDEFAULT_OLD_METADATA
   DEFAULT_METADATA=0.90
-@@ -105,6 +108,7 @@ endif
+@@ -129,6 +132,7 @@ endif
  INSTALL = /usr/bin/install
  DESTDIR =
  BINDIR  = /sbin
@@ -20,14 +20,8 @@ index d82e30f..d231cf9 100644
  MANDIR  = /usr/share/man
  MAN4DIR = $(MANDIR)/man4
  MAN5DIR = $(MANDIR)/man5
-@@ -259,20 +263,20 @@ sha1.o : sha1.c sha1.h md5.h
- 	$(CC) $(CFLAGS) -DHAVE_STDINT_H -o sha1.o -c sha1.c
- 
- install : mdadm mdmon install-man install-udev
--	$(INSTALL) -D $(STRIP) -m 755 mdadm $(DESTDIR)$(BINDIR)/mdadm
--	$(INSTALL) -D $(STRIP) -m 755 mdmon $(DESTDIR)$(BINDIR)/mdmon
-+	$(INSTALL) -D $(STRIP) -m 755 mdadm $(DESTDIR)$(INSTALL_BINDIR)/mdadm
-+	$(INSTALL) -D $(STRIP) -m 755 mdmon $(DESTDIR)$(INSTALL_BINDIR)/mdmon
+@@ -253,16 +257,16 @@ sha1.o : sha1.c sha1.h md5.h
+ install : install-bin install-man install-udev
  
  install-static : mdadm.static install-man
 -	$(INSTALL) -D $(STRIP) -m 755 mdadm.static $(DESTDIR)$(BINDIR)/mdadm
@@ -47,8 +41,8 @@ index d82e30f..d231cf9 100644
  
  install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8
  	$(INSTALL) -D -m 644 mdadm.8 $(DESTDIR)$(MAN8DIR)/mdadm.8
-@@ -305,7 +309,7 @@ install-systemd: systemd/mdmon@.service
- 	if [ -f /etc/SuSE-release -o -n "$(SUSE)" ] ;then $(INSTALL) -D -m 755 systemd/SUSE-mdadm_env.sh $(DESTDIR)$(SYSTEMD_DIR)/../scripts/mdadm_env.sh ;fi
+@@ -305,7 +309,7 @@ install-bin: mdadm mdmon
+ 	$(INSTALL) -D $(STRIP) -m 755 mdmon $(DESTDIR)$(BINDIR)/mdmon
  
  uninstall:
 -	rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 $(DESTDIR)$(MAN8DIR)/mdmon.8 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm
@@ -57,10 +51,10 @@ index d82e30f..d231cf9 100644
  test: mdadm mdmon test_stripe swap_super raid6check
  	@echo "Please run './test' as root"
 diff --git a/policy.c b/policy.c
-index 064d349..6b2f2b1 100644
+index eee9ef63..9f916e9d 100644
 --- a/policy.c
 +++ b/policy.c
-@@ -796,12 +796,39 @@ char *find_rule(struct rule *rule, char *rule_type)
+@@ -817,12 +817,39 @@ char *find_rule(struct rule *rule, char *rule_type)
  #define UDEV_RULE_FORMAT \
  "ACTION==\"add\", SUBSYSTEM==\"block\", " \
  "ENV{DEVTYPE}==\"%s\", ENV{ID_PATH}==\"%s\", " \
@@ -102,7 +96,7 @@ index 064d349..6b2f2b1 100644
  
  /* Write rule in the rule file. Use format from UDEV_RULE_FORMAT */
  int write_rule(struct rule *rule, int fd, int force_part)
-@@ -815,9 +842,9 @@ int write_rule(struct rule *rule, int fd, int force_part)
+@@ -836,9 +863,9 @@ int write_rule(struct rule *rule, int fd, int force_part)
  	if (force_part)
  		typ = type_part;
  	if (typ)
@@ -115,10 +109,10 @@ index 064d349..6b2f2b1 100644
  }
  
 diff --git a/util.c b/util.c
-index cc98d3b..1ada2f4 100644
+index 3d05d074..e004a798 100644
 --- a/util.c
 +++ b/util.c
-@@ -1700,7 +1700,9 @@ int start_mdmon(char *devnm)
+@@ -1913,7 +1913,9 @@ int start_mdmon(char *devnm)
  	char pathbuf[1024];
  	char *paths[4] = {
  		pathbuf,
diff --git a/nixpkgs/pkgs/os-specific/linux/mdevd/default.nix b/nixpkgs/pkgs/os-specific/linux/mdevd/default.nix
index 9860c3e73021..2a55676fc767 100644
--- a/nixpkgs/pkgs/os-specific/linux/mdevd/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/mdevd/default.nix
@@ -4,8 +4,8 @@ with skawarePackages;
 
 buildPackage {
   pname = "mdevd";
-  version = "0.1.5.1";
-  sha256 = "1xch9sk3hklf2v9z3qlw0rfhhmikqp85zkij7qzwbs09g039bkll";
+  version = "0.1.5.2";
+  sha256 = "sha256-RgNys9O6yfNXQVbtfkhhj59KNhy1LESUrZBjJIq0pP8=";
 
   description = "mdev-compatible Linux hotplug manager daemon";
   platforms = lib.platforms.linux;
diff --git a/nixpkgs/pkgs/os-specific/linux/microcode/amd.nix b/nixpkgs/pkgs/os-specific/linux/microcode/amd.nix
index 0f3d0f18186a..051ad131be93 100644
--- a/nixpkgs/pkgs/os-specific/linux/microcode/amd.nix
+++ b/nixpkgs/pkgs/os-specific/linux/microcode/amd.nix
@@ -12,13 +12,14 @@ stdenv.mkDerivation {
 
   buildPhase = ''
     mkdir -p kernel/x86/microcode
-    find ${linux-firmware}/lib/firmware/amd-ucode -name \*.bin \
-      -exec sh -c 'cat {} >> kernel/x86/microcode/AuthenticAMD.bin' \;
+    find ${linux-firmware}/lib/firmware/amd-ucode -name \*.bin -print0 | sort -z |\
+      xargs -0 -I{} sh -c 'cat {} >> kernel/x86/microcode/AuthenticAMD.bin'
   '';
 
   installPhase = ''
     mkdir -p $out
-    echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R 0:0 > $out/amd-ucode.img
+    touch -d @$SOURCE_DATE_EPOCH kernel/x86/microcode/AuthenticAMD.bin
+    echo kernel/x86/microcode/AuthenticAMD.bin | bsdtar --uid 0 --gid 0 -cnf - -T - | bsdtar --null -cf - --format=newc @- > $out/amd-ucode.img
   '';
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/os-specific/linux/microcode/intel.nix b/nixpkgs/pkgs/os-specific/linux/microcode/intel.nix
index 923047ead11a..6bb2855719bf 100644
--- a/nixpkgs/pkgs/os-specific/linux/microcode/intel.nix
+++ b/nixpkgs/pkgs/os-specific/linux/microcode/intel.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "microcode-intel";
-  version = "20220207";
+  version = "20220809";
 
   src = fetchFromGitHub {
     owner = "intel";
     repo = "Intel-Linux-Processor-Microcode-Data-Files";
     rev = "microcode-${version}";
-    sha256 = "sha256-yNHYAf8AX8C8iSaFWa6u7knUryaUgvI6nIH9jkD4jjw=";
+    hash = "sha256-vcuLQHAGr5uRkGWWIwA2WXLJadVNxfcPgjmNS82Logg=";
   };
 
   nativeBuildInputs = [ iucode-tool libarchive ];
@@ -18,7 +18,8 @@ stdenv.mkDerivation rec {
 
     mkdir -p $out kernel/x86/microcode
     iucode_tool -w kernel/x86/microcode/GenuineIntel.bin intel-ucode/
-    echo kernel/x86/microcode/GenuineIntel.bin | bsdcpio -o -H newc -R 0:0 > $out/intel-ucode.img
+    touch -d @$SOURCE_DATE_EPOCH kernel/x86/microcode/GenuineIntel.bin
+    echo kernel/x86/microcode/GenuineIntel.bin | bsdtar --uid 0 --gid 0 -cnf - -T - | bsdtar --null -cf - --format=newc @- > $out/intel-ucode.img
 
     runHook postInstall
   '';
diff --git a/nixpkgs/pkgs/os-specific/linux/miraclecast/default.nix b/nixpkgs/pkgs/os-specific/linux/miraclecast/default.nix
index b5efaa40afe9..7b502fa4adee 100644
--- a/nixpkgs/pkgs/os-specific/linux/miraclecast/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/miraclecast/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
     description = "Connect external monitors via Wi-Fi";
     homepage    = "https://github.com/albfan/miraclecast";
     license     = licenses.lgpl21Plus;
-    maintainers = with maintainers; [ tstrobel ];
+    maintainers = with maintainers; [ ];
     platforms   = platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/mmc-utils/default.nix b/nixpkgs/pkgs/os-specific/linux/mmc-utils/default.nix
index 7430182e5d2e..6d737ea6bad3 100644
--- a/nixpkgs/pkgs/os-specific/linux/mmc-utils/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/mmc-utils/default.nix
@@ -1,27 +1,32 @@
-{ lib, stdenv, fetchgit }:
+{ lib, stdenv, fetchzip, unstableGitUpdater }:
 
 stdenv.mkDerivation {
   pname = "mmc-utils";
-  version = "2021-05-11";
+  version = "unstable-2022-07-13";
 
-  src = fetchgit {
-    url = "git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git";
-    rev = "43282e80e174cc73b09b81a4d17cb3a7b4dc5cfc";
-    sha256 = "0l06ahmprqshh75pkdpagb8fgnp2bwn8q8hwp1yl3laww2ghm8i5";
+  src = fetchzip rec {
+    url = "https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git/snapshot/mmc-utils-${passthru.rev}.tar.gz";
+    passthru.rev = "d7b343fd262880994f041ce2335442e7bd1071f5";
+    sha256 = "cTF3xSNvZ1wifItPmflNFd+fpYArPRvinM7Cyg3JoeE=";
   };
 
-  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
+  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "prefix=$(out)" ];
 
-  installPhase = ''
-    make install prefix=$out
+  postInstall = ''
     mkdir -p $out/share/man/man1
     cp man/mmc.1 $out/share/man/man1/
   '';
 
+  enableParallelBuilding = true;
+
+  passthru.updateScript = unstableGitUpdater {
+    url = "https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git";
+  };
+
   meta = with lib; {
     description = "Configure MMC storage devices from userspace";
-    homepage = "http://git.kernel.org/cgit/linux/kernel/git/cjb/mmc-utils.git/";
-    license = licenses.gpl2;
+    homepage = "https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git/";
+    license = licenses.gpl2Only;
     maintainers = [ maintainers.dezgeg ];
     platforms = platforms.linux;
   };
diff --git a/nixpkgs/pkgs/os-specific/linux/multipath-tools/default.nix b/nixpkgs/pkgs/os-specific/linux/multipath-tools/default.nix
index 184d2e1fe6eb..437fe9bd1bd9 100644
--- a/nixpkgs/pkgs/os-specific/linux/multipath-tools/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/multipath-tools/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, fetchpatch, pkg-config, perl, lvm2, libaio, gzip, readline, systemd, liburcu, json_c, kmod, nixosTests }:
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, perl, lvm2, libaio, readline, systemd, liburcu, json_c, kmod, nixosTests }:
 
 stdenv.mkDerivation rec {
   pname = "multipath-tools";
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
       $(find * -name Makefile\*)
   '';
 
-  nativeBuildInputs = [ gzip pkg-config perl ];
+  nativeBuildInputs = [ pkg-config perl ];
   buildInputs = [ systemd lvm2 libaio readline liburcu json_c ];
 
   makeFlags = [
diff --git a/nixpkgs/pkgs/os-specific/linux/musl-obstack/default.nix b/nixpkgs/pkgs/os-specific/linux/musl-obstack/default.nix
index f7682d37efd9..ec183da7048c 100644
--- a/nixpkgs/pkgs/os-specific/linux/musl-obstack/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/musl-obstack/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "musl-obstack";
-  version = "1.2.2";
+  version = "1.2.3";
 
   src = fetchFromGitHub {
     owner = "void-linux";
     repo = "musl-obstack";
     rev = "v${version}";
-    sha256 = "v0RTnrqAmJfOeGsJFc04lqFR8QZhYiLyvy8oRYiuC80=";
+    sha256 = "sha256-oydS7FubUniMHAUWfg84OH9+CZ0JCrTXy7jzwOyJzC8=";
   };
 
   nativeBuildInputs = [ autoreconfHook pkg-config ];
diff --git a/nixpkgs/pkgs/os-specific/linux/musl/default.nix b/nixpkgs/pkgs/os-specific/linux/musl/default.nix
index f19c7ea7a44b..fb0d19115da3 100644
--- a/nixpkgs/pkgs/os-specific/linux/musl/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/musl/default.nix
@@ -40,11 +40,11 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "musl";
-  version = "1.2.2";
+  version = "1.2.3";
 
   src = fetchurl {
     url    = "https://musl.libc.org/releases/${pname}-${version}.tar.gz";
-    sha256 = "1p8r6bac64y98ln0wzmnixysckq3crca69ys7p16sy9d04i975lv";
+    sha256 = "sha256-fVsLYGJSHkYn4JnkydyCSNMqMChelZt+7Kp4DPjP1KQ=";
   };
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/os-specific/linux/mwprocapture/default.nix b/nixpkgs/pkgs/os-specific/linux/mwprocapture/default.nix
index 0de982c3d5ee..2286e86df72c 100644
--- a/nixpkgs/pkgs/os-specific/linux/mwprocapture/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/mwprocapture/default.nix
@@ -7,7 +7,7 @@ let
     if stdenv.is64bit then "64"
     else "32";
 
-  libpath = makeLibraryPath [ stdenv.cc.cc stdenv.glibc alsa-lib ];
+  libpath = makeLibraryPath [ stdenv.cc.cc stdenv.cc.libc alsa-lib ];
 
 in
 stdenv.mkDerivation rec {
@@ -55,6 +55,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
+    broken = kernel.kernelAtLeast "5.16";
     homepage = "http://www.magewell.com/";
     description = "Linux driver for the Magewell Pro Capture family";
     license = licenses.unfreeRedistributable;
diff --git a/nixpkgs/pkgs/os-specific/linux/netatop/default.nix b/nixpkgs/pkgs/os-specific/linux/netatop/default.nix
index dec1399d1695..b892292477ce 100644
--- a/nixpkgs/pkgs/os-specific/linux/netatop/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/netatop/default.nix
@@ -16,6 +16,7 @@ stdenv.mkDerivation {
   buildInputs = [ kmod zlib ];
 
   hardeningDisable = [ "pic" ];
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=implicit-fallthrough" ];
 
   patches = [
     # fix paths in netatop.service
diff --git a/nixpkgs/pkgs/os-specific/linux/new-lg4ff/default.nix b/nixpkgs/pkgs/os-specific/linux/new-lg4ff/default.nix
new file mode 100644
index 000000000000..df2b66e9079a
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/new-lg4ff/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, kernel, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "new-lg4ff";
+  version = "0.3.3";
+
+  src = fetchFromGitHub {
+    owner = "berarma";
+    repo = "new-lg4ff";
+    rev = "${version}";
+    sha256 = "+05xDpNI4m6wTS+YPgA0fP4iM10nMOZOtCrdQxpevBU=";
+  };
+
+  preBuild = ''
+    substituteInPlace Makefile --replace "modules_install" "INSTALL_MOD_PATH=$out modules_install"
+    sed -i '/depmod/d' Makefile
+    sed -i "10i\\\trmmod hid-logitech 2> /dev/null || true" Makefile
+    sed -i "11i\\\trmmod hid-logitech-new 2> /dev/null || true" Makefile
+  '';
+
+  nativeBuildInputs = kernel.moduleBuildDependencies;
+
+  makeFlags = [
+    "KVERSION=${kernel.modDirVersion}"
+    "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
+  ];
+
+  meta = with lib; {
+    description = "Experimental Logitech force feedback module for Linux";
+    homepage = "https://github.com/berarma/new-lg4ff";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ matthiasbenaets ];
+    platforms = platforms.linux;
+    broken = stdenv.isAarch64;
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/nftables/default.nix b/nixpkgs/pkgs/os-specific/linux/nftables/default.nix
index 0b6291226bc8..8339eabb495a 100644
--- a/nixpkgs/pkgs/os-specific/linux/nftables/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/nftables/default.nix
@@ -1,47 +1,43 @@
-{ lib, stdenv, fetchurl, pkg-config, bison, file, flex
+{ lib, stdenv, fetchurl, pkg-config, bison, flex
 , asciidoc, libxslt, findXMLCatalogs, docbook_xml_dtd_45, docbook_xsl
 , libmnl, libnftnl, libpcap
-, gmp, jansson, readline
+, gmp, jansson, libedit
+, autoreconfHook
 , withDebugSymbols ? false
 , withPython ? false , python3
 , withXtables ? true , iptables
 }:
 
-with lib;
-
 stdenv.mkDerivation rec {
-  version = "1.0.1";
+  version = "1.0.4";
   pname = "nftables";
 
   src = fetchurl {
     url = "https://netfilter.org/projects/nftables/files/${pname}-${version}.tar.bz2";
-    sha256 = "08x4xw0s5sap3q7jfr91v7mrkxrydi4dvsckw85ims0qb1ibmviw";
+    hash = "sha256-kn+x/qH2haMowQz3ketlXX4e1J0xDupcsxAd/Y1sujU=";
   };
 
   nativeBuildInputs = [
-    pkg-config bison file flex
+    autoreconfHook
+    pkg-config bison flex
     asciidoc docbook_xml_dtd_45 docbook_xsl findXMLCatalogs libxslt
   ];
 
   buildInputs = [
     libmnl libnftnl libpcap
-    gmp jansson readline
-  ] ++ optional withXtables iptables
-    ++ optional withPython python3;
-
-  preConfigure = ''
-    substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file
-  '';
+    gmp jansson libedit
+  ] ++ lib.optional withXtables iptables
+    ++ lib.optional withPython python3;
 
   configureFlags = [
     "--with-json"
-    "--with-cli=readline"  # TODO: maybe switch to editline
-  ] ++ optional (!withDebugSymbols) "--disable-debug"
-    ++ optional (!withPython) "--disable-python"
-    ++ optional withPython "--enable-python"
-    ++ optional withXtables "--with-xtables";
+    "--with-cli=editline"
+  ] ++ lib.optional (!withDebugSymbols) "--disable-debug"
+    ++ lib.optional (!withPython) "--disable-python"
+    ++ lib.optional withPython "--enable-python"
+    ++ lib.optional withXtables "--with-xtables";
 
-  meta = {
+  meta = with lib; {
     description = "The project that aims to replace the existing {ip,ip6,arp,eb}tables framework";
     homepage = "https://netfilter.org/projects/nftables/";
     license = licenses.gpl2Only;
diff --git a/nixpkgs/pkgs/os-specific/linux/nix-ld/default.nix b/nixpkgs/pkgs/os-specific/linux/nix-ld/default.nix
index dcab99cabfe4..b54f9e36515d 100644
--- a/nixpkgs/pkgs/os-specific/linux/nix-ld/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/nix-ld/default.nix
@@ -1,49 +1,56 @@
-{ stdenv, meson, ninja, lib, nixosTests, fetchFromGitHub }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, meson
+, ninja
+, nixosTests
+}:
 let
-  self = stdenv.mkDerivation {
-    name = "nix-ld";
-    src = fetchFromGitHub {
-      owner = "Mic92";
-      repo = "nix-ld";
-      rev = "1.0.0";
-      sha256 = "sha256-QYPg8wPpq7q5Xd1jW17Lh36iKFSsVkN/gWYoQRv2XoU=";
-    };
-
-    doCheck = true;
-
-    nativeBuildInputs = [ meson ninja ];
-
-    mesonFlags = [
-      "-Dnix-system=${stdenv.system}"
-    ];
-
-    hardeningDisable = [
-      "stackprotector"
-    ];
-
-    postInstall = ''
-      mkdir -p $out/nix-support
-      basename $(< ${stdenv.cc}/nix-support/dynamic-linker) > $out/nix-support/ld-name
-    '';
-
-    passthru.tests.nix-ld = nixosTests.nix-ld;
-    passthru.ldPath = let
-      libDir = if stdenv.system == "x86_64-linux" ||
-                  stdenv.system == "mips64-linux" ||
-                  stdenv.system == "powerpc64le-linux"
-               then
-                 "/lib64"
-               else
-                 "/lib";
-      ldName = lib.fileContents "${self}/nix-support/ld-name";
-    in "${libDir}/${ldName}";
-
-    meta = with lib; {
-      description = "Run unpatched dynamic binaries on NixOS";
-      homepage = "https://github.com/Mic92/nix-ld";
-      license = licenses.mit;
-      maintainers = with maintainers; [ mic92 ];
-      platforms = platforms.linux;
-    };
+  libDir = if builtins.elem stdenv.system [ "x86_64-linux" "mips64-linux" "powerpc64le-linux" ]
+           then "/lib64"
+           else "/lib";
+in
+stdenv.mkDerivation rec {
+  pname = "nix-ld";
+  version = "1.0.2";
+
+  src = fetchFromGitHub {
+    owner = "mic92";
+    repo = "nix-ld";
+    rev = version;
+    sha256 = "sha256-DlWU5i/MykqWgB9vstYbECy3e+XagXWCxi+XDJNey0s=";
+  };
+
+  doCheck = true;
+
+  nativeBuildInputs = [ meson ninja ];
+
+  mesonFlags = [
+    "-Dnix-system=${stdenv.system}"
+  ];
+
+  hardeningDisable = [
+    "stackprotector"
+  ];
+
+  postInstall = ''
+    mkdir -p $out/nix-support
+
+    ldpath=${libDir}/$(basename $(< ${stdenv.cc}/nix-support/dynamic-linker))
+    echo "$ldpath" > $out/nix-support/ldpath
+    mkdir -p $out/lib/tmpfiles.d/
+    cat > $out/lib/tmpfiles.d/nix-ld.conf <<EOF
+      L+ $ldpath - - - - $out/libexec/nix-ld
+    EOF
+  '';
+
+  passthru.tests.nix-ld = nixosTests.nix-ld;
+
+  meta = with lib; {
+    description = "Run unpatched dynamic binaries on NixOS";
+    homepage = "https://github.com/Mic92/nix-ld";
+    license = licenses.mit;
+    maintainers = with maintainers; [ mic92 ];
+    platforms = platforms.linux;
   };
-in self
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh b/nixpkgs/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
index 795bedb99d4d..ebbb596f91f6 100755
--- a/nixpkgs/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
+++ b/nixpkgs/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
@@ -20,7 +20,7 @@ origArgs=("$@")
 copyClosureFlags=()
 extraBuildFlags=()
 lockFlags=()
-flakeFlags=()
+flakeFlags=(--extra-experimental-features 'nix-command flakes')
 action=
 buildNix=1
 fast=
@@ -49,6 +49,8 @@ while [ "$#" -gt 0 ]; do
         ;;
       switch|boot|test|build|edit|dry-build|dry-run|dry-activate|build-vm|build-vm-with-bootloader)
         if [ "$i" = dry-run ]; then i=dry-build; fi
+        # exactly one action mandatory, bail out if multiple are given
+        if [ -n "$action" ]; then showSyntax; fi
         action="$i"
         ;;
       --install-grub)
@@ -118,7 +120,6 @@ while [ "$#" -gt 0 ]; do
         ;;
       --flake)
         flake="$1"
-        flakeFlags=(--extra-experimental-features 'nix-command flakes')
         shift 1
         ;;
       --no-flake)
@@ -252,7 +253,7 @@ nixBuild() {
 
 nixFlakeBuild() {
     logVerbose "Building in flake mode."
-    if [[ -z "$buildHost" && -z "$targetHost" && "$action" != switch && "$action" != boot ]]
+    if [[ -z "$buildHost" && -z "$targetHost" && "$action" != switch && "$action" != boot && "$action" != test && "$action" != dry-activate ]]
     then
         runCmd nix "${flakeFlags[@]}" build "$@"
         readlink -f ./result
diff --git a/nixpkgs/pkgs/os-specific/linux/nmon/default.nix b/nixpkgs/pkgs/os-specific/linux/nmon/default.nix
index 9372018f5b70..41c16f9f394c 100644
--- a/nixpkgs/pkgs/os-specific/linux/nmon/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/nmon/default.nix
@@ -13,8 +13,8 @@ stdenv.mkDerivation rec {
   dontUnpack = true;
   buildPhase = "${stdenv.cc.targetPrefix}cc -o nmon ${src} -g -O2 -D JFS -D GETUSER -Wall -D LARGEMEM -lncurses -lm -g -D ${
     with stdenv.targetPlatform;
-    if isx86_32 || isx86_64 then "X86"
-    else if isAarch32 || isAarch64 then "ARM"
+    if isx86 then "X86"
+    else if isAarch then "ARM"
     else if isPower then "POWER"
     else "UNKNOWN"
   }";
diff --git a/nixpkgs/pkgs/os-specific/linux/nvidia-x11/builder.sh b/nixpkgs/pkgs/os-specific/linux/nvidia-x11/builder.sh
index 75eb5d8757be..a7746194570c 100755
--- a/nixpkgs/pkgs/os-specific/linux/nvidia-x11/builder.sh
+++ b/nixpkgs/pkgs/os-specific/linux/nvidia-x11/builder.sh
@@ -119,6 +119,10 @@ installPhase() {
             fi
         fi
 
+        # Install libraries needed by Proton to support DLSS
+        if [ -e nvngx.dll ] && [ -e _nvngx.dll ]; then
+            install -Dm644 -t $i/lib/nvidia/wine/ nvngx.dll _nvngx.dll
+        fi
     done
 
     if [ -n "$bin" ]; then
@@ -147,6 +151,11 @@ installPhase() {
         fi
     fi
 
+    if [ -n "$firmware" ]; then
+        # Install the GSP firmware
+        install -Dm644 firmware/gsp.bin $firmware/lib/firmware/nvidia/$version/gsp.bin
+    fi
+
     # All libs except GUI-only are installed now, so fixup them.
     for libname in $(find "$out/lib/" $(test -n "$lib32" && echo "$lib32/lib/") $(test -n "$bin" && echo "$bin/lib/") -name '*.so.*')
     do
diff --git a/nixpkgs/pkgs/os-specific/linux/nvidia-x11/default.nix b/nixpkgs/pkgs/os-specific/linux/nvidia-x11/default.nix
index 246295eb7340..bc66e3c8b7eb 100644
--- a/nixpkgs/pkgs/os-specific/linux/nvidia-x11/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/nvidia-x11/default.nix
@@ -3,9 +3,7 @@
 let
   generic = args: let
     imported = import ./generic.nix args;
-  in if ((!lib.versionOlder args.version "391")
-    && stdenv.hostPlatform.system != "x86_64-linux") then null
-  else callPackage imported {
+  in callPackage imported {
     lib32 = (pkgsi686Linux.callPackage imported {
       libsOnly = true;
       kernel = null;
@@ -14,38 +12,52 @@ let
 
   kernel = callPackage # a hacky way of extracting parameters from callPackage
     ({ kernel, libsOnly ? false }: if libsOnly then { } else kernel) { };
+
+  selectHighestVersion = a: b: if lib.versionOlder a.version b.version
+    then b
+    else a;
 in
 rec {
-  # Policy: use the highest stable version as the default (on our master).
-  stable = if stdenv.hostPlatform.system == "x86_64-linux"
-    then generic {
-      version = "510.60.02";
-      sha256_64bit = "sha256-qADfwFSQeP2Mbo5ngO+47uh4cuYFXH9fOGpHaM4H4AM=";
-      settingsSha256 = "sha256-Voa1JZ2qqJ1t+bfwKh/mssEi/hjzLTPwef2XG/gAC+0=";
-      persistencedSha256 = "sha256-THgK2GpRcttqSN2WxcuJu5My++Q+Y34jG8hm7daxhAQ=";
-    }
-    else legacy_390;
+  # Official Unix Drivers - https://www.nvidia.com/en-us/drivers/unix/
+  # Branch/Maturity data - http://people.freedesktop.org/~aplattner/nvidia-versions.txt
 
-  # see https://www.nvidia.com/en-us/drivers/unix/ "Production branch"
-  production = legacy_470;
+  # Policy: use the highest stable version as the default (on our master).
+  stable = if stdenv.hostPlatform.system == "i686-linux" then legacy_390 else latest;
 
-  beta = generic {
-    version = "510.39.01";
-    sha256_64bit = "sha256-Lj7cOvulhApeuRycIiyYy5kcPv3ZlM8qqpPUWl0bmRs=";
-    settingsSha256 = "sha256-qlSwNq0wC/twvrbQjY+wSTcDaV5KG4Raq6WkzTizyXw=";
-    persistencedSha256 = "sha256-UNrl/hfiNXKGACQ7aHpsNcfcHPWVnycQ51yaa3eKXhI=";
+  production = generic {
+    version = "515.65.01";
+    sha256_64bit = "sha256-BJLdxbXmWqAMvHYujWaAIFyNCOEDtxMQh6FRJq7klek=";
+    openSha256 = "sha256-GCCDnaDsbXTmbCYZBCM3fpHmOSWti/DkBJwYrRGAMPI=";
+    settingsSha256 = "sha256-kBELMJCIWD9peZba14wfCoxsi3UXO3ehFYcVh4nvzVg=";
+    persistencedSha256 = "sha256-P8oT7g944HvNk2Ot/0T0sJM7dZs+e0d+KwbwRrmsuDY=";
   };
 
+  latest = selectHighestVersion production (generic {
+    version = "495.46";
+    sha256_64bit = "2Dt30X2gxUZnqlsT1uqVpcUTBCV7Hs8vjUo7WuMcYvU=";
+    settingsSha256 = "vbcZYn+UBBGwjfrJ6SyXt3+JLBeNcXK4h8mjj7qxZPk=";
+    persistencedSha256 = "ieYqkVxe26cLw1LUgBsFSSowAyfZkTcItIzQCestCXI=";
+  });
+
+  beta = selectHighestVersion latest (generic {
+    version = "515.43.04";
+    sha256_64bit = "sha256-PodaTTUOSyMW8rtdtabIkSLskgzAymQyfToNlwxPPcc=";
+    openSha256 = "sha256-1bAr5dWZ4jnY3Uo2JaEz/rhw2HuW9LZ5bACmA1VG068=";
+    settingsSha256 = "sha256-j47LtP6FNTPfiXFh9KwXX8vZOQzlytA30ZfW9N5F2PY=";
+    persistencedSha256 = "sha256-hULBy0wnVpLH8I0L6O9/HfgvJURtE2whpXOgN/vb3Wo=";
+  });
+
   # Vulkan developer beta driver
   # See here for more information: https://developer.nvidia.com/vulkan-driver
   vulkan_beta = generic rec {
-    version = "455.46.04";
-    persistencedVersion = "455.45.01";
-    settingsVersion = "455.45.01";
-    sha256_64bit = "1iv42w3x1vc00bgn6y4w1hnfsvnh6bvj3vcrq8hw47760sqwa4xa";
-    settingsSha256 = "09v86y2c8xas9ql0bqr7vrjxx3if6javccwjzyly11dzffm02h7g";
-    persistencedSha256 = "13s4b73il0lq2hs81q03176n16mng737bfsp3bxnxgnrv3whrayz";
+    version = "470.62.13";
+    persistencedVersion = "470.86";
+    settingsVersion = "470.86";
+    sha256_64bit = "sha256-itBFNPMy+Nn0g8V8qdkRb+ELHj57GRso1lXhPHUxKVI=";
+    settingsSha256 = "sha256-fq6RlD6g3uylvvTjE4MmaQwxPJYU0u6IMfpPVzks0tI=";
+    persistencedSha256 = "sha256-eHvauvh8Wd+b8DK6B3ZWNjoWGztupWrR8iog9ok58io=";
     url = "https://developer.nvidia.com/vulkan-beta-${lib.concatStrings (lib.splitString "." version)}-linux";
+    broken = kernel.kernelAtLeast "5.17";
   };
 
   # Update note:
@@ -54,19 +66,35 @@ rec {
 
   # Last one supporting Kepler architecture
   legacy_470 = generic {
-      version = "470.94";
-      sha256_64bit = "lYWqKTMOutm98izjyiusICbIWpoy8D18WfcUp3mFAOs=";
-      settingsSha256 = "blJNKuFu/Th/ceexkKhTH/eYk8miUlTT+ESrcIyJNn0=";
-      persistencedSha256 = "xnccQ/EgafwnReBlk5Y7iClAj4hwXyFq9gUmwqyEuwE=";
+      version = "470.141.03";
+      sha256_64bit = "sha256-vpjSR6Q9dJGmW/3Jl/tlMeFZQ0brEqD6qgRGcs21cJ8=";
+      settingsSha256 = "sha256-OWSUmUBqAxsR3e6EPzcIotpd6nm4Le8hIj4pzJ5WnhE=";
+      persistencedSha256 = "sha256-XsGYGgucDhvPpqtM9IBLfo3tbn7sIobpo5JW/XqOkTo=";
   };
 
   # Last one supporting x86
   legacy_390 = generic {
-    version = "390.147";
-    sha256_32bit = "00avsns7l0j1ai8bf8gav2qshvphfdngy388bwzz24p61mfv1i1a";
-    sha256_64bit = "09qcdfn4j5jza3iw59wqwgq4a489qf7kx355yssrcahaw9g87lxz";
-    settingsSha256 = "16qqw0jy31da65cdi17y3j2kcdhw09vra7g17bkcimaqnf70j0ni";
-    persistencedSha256 = "1ad81y4qfpxrx0vqsk81a3h0bi1yg8hw5gi5y5d58p76vc8083i9";
+    version = "390.154";
+    sha256_32bit = "sha256-XuhxuEvZ8o4iW3o+Xxvh+eLQBn83uNa40MJRcC8G0+c=";
+    sha256_64bit = "sha256-9EICgMVSEJZMAI1bck8mFYRdR61MnAXY7SamL8YzH3w=";
+    settingsSha256 = "sha256-iNT6//EvtasivDfXPY6j6OrpymbslO/q45uKd5smFUw=";
+    persistencedSha256 = "sha256-y+MkudjQBkuVzHrY/rh7IGRN8VjLsJQ3a+fYDXdrzzk=";
+
+    broken = kernel.kernelAtLeast "5.18";
+
+    patches =
+      let patch390 = o:
+        (lib.optional ((lib.versions.majorMinor kernel.modDirVersion) == o.version) (fetchpatch {
+          inherit (o) sha256;
+          url = "https://gitlab.com/herecura/packages/nvidia-390xx-dkms/-/raw/herecura/kernel-${o.version}.patch";
+        }));
+      in
+        []
+        ++ (patch390 {
+          version = "5.18";
+          sha256 = "sha256-A6itoozgDWmXKQAU0D8bT2vUaZqh5G5Tg3d3E+CLOTs=";
+        })
+      ;
   };
 
   legacy_340 = generic {
@@ -77,7 +105,7 @@ rec {
     persistencedSha256 = "1ax4xn3nmxg1y6immq933cqzw6cj04x93saiasdc0kjlv0pvvnkn";
     useGLVND = false;
 
-    broken = with kernel; kernelAtLeast "5.5";
+    broken = kernel.kernelAtLeast "5.5";
     patches = [ ./vm_operations_struct-fault.patch ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/nvidia-x11/generic.nix b/nixpkgs/pkgs/os-specific/linux/nvidia-x11/generic.nix
index c7e062534a4d..d6dcc7ad6cd0 100644
--- a/nixpkgs/pkgs/os-specific/linux/nvidia-x11/generic.nix
+++ b/nixpkgs/pkgs/os-specific/linux/nvidia-x11/generic.nix
@@ -2,6 +2,7 @@
 , url ? null
 , sha256_32bit ? null
 , sha256_64bit
+, openSha256 ? null
 , settingsSha256
 , settingsVersion ? version
 , persistencedSha256
@@ -27,13 +28,14 @@
   disable32Bit ? false
   # 32 bit libs only version of this package
 , lib32 ? null
+  # Whether to extract the GSP firmware
+, firmware ? openSha256 != null
 }:
 
 with lib;
 
 assert !libsOnly -> kernel != null;
 assert versionOlder version "391" -> sha256_32bit != null;
-assert ! versionOlder version "391" -> stdenv.hostPlatform.system == "x86_64-linux";
 
 let
   nameSuffix = optionalString (!libsOnly) "-${kernel.version}";
@@ -72,7 +74,8 @@ let
 
     outputs = [ "out" ]
         ++ optional i686bundled "lib32"
-        ++ optional (!libsOnly) "bin";
+        ++ optional (!libsOnly) "bin"
+        ++ optional (!libsOnly && firmware) "firmware";
     outputDev = if libsOnly then null else "bin";
 
     kernel = if libsOnly then null else kernel.dev;
@@ -100,6 +103,10 @@ let
     disallowedReferences = optional (!libsOnly) [ kernel.dev ];
 
     passthru = {
+      open = mapNullable (hash: callPackage ./open.nix {
+        inherit hash broken;
+        nvidia_x11 = self;
+      }) openSha256;
       settings = (if settings32Bit then pkgsi686Linux.callPackage else callPackage) (import ./settings.nix self settingsSha256) {
         withGtk2 = preferGtk2;
         withGtk3 = !preferGtk2;
diff --git a/nixpkgs/pkgs/os-specific/linux/nvidia-x11/open.nix b/nixpkgs/pkgs/os-specific/linux/nvidia-x11/open.nix
new file mode 100644
index 000000000000..3e21dade83ae
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/nvidia-x11/open.nix
@@ -0,0 +1,40 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, kernel
+, nvidia_x11
+, hash
+, broken ? false
+}:
+
+stdenv.mkDerivation {
+  pname = "nvidia-open";
+  version = "${kernel.version}-${nvidia_x11.version}";
+
+  src = fetchFromGitHub {
+    owner = "NVIDIA";
+    repo = "open-gpu-kernel-modules";
+    rev = nvidia_x11.version;
+    inherit hash;
+  };
+
+  nativeBuildInputs = kernel.moduleBuildDependencies;
+
+  makeFlags = kernel.makeFlags ++ [
+    "SYSSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
+    "SYSOUT=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
+    "MODLIB=$(out)/lib/modules/${kernel.modDirVersion}"
+  ];
+
+  installTargets = [ "modules_install" ];
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "NVIDIA Linux Open GPU Kernel Module";
+    homepage = "https://github.com/NVIDIA/open-gpu-kernel-modules";
+    license = with licenses; [ gpl2Plus mit ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ nickcao ];
+    inherit broken;
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/nvidia-x11/settings.nix b/nixpkgs/pkgs/os-specific/linux/nvidia-x11/settings.nix
index 873e09df8dfb..884ccdd6c52d 100644
--- a/nixpkgs/pkgs/os-specific/linux/nvidia-x11/settings.nix
+++ b/nixpkgs/pkgs/os-specific/linux/nvidia-x11/settings.nix
@@ -1,6 +1,7 @@
 nvidia_x11: sha256:
 
-{ stdenv, lib, fetchFromGitHub, pkg-config, m4, jansson, gtk2, dbus, gtk3, libXv, libXrandr, libXext, libXxf86vm, libvdpau
+{ stdenv, lib, fetchFromGitHub, fetchpatch, pkg-config, m4, jansson, gtk2, dbus, gtk3
+, libXv, libXrandr, libXext, libXxf86vm, libvdpau
 , librsvg, wrapGAppsHook
 , withGtk2 ? false, withGtk3 ? true
 }:
@@ -43,21 +44,23 @@ in
 stdenv.mkDerivation {
   pname = "nvidia-settings";
   version = nvidia_x11.settingsVersion;
-  inherit src;
-
-  nativeBuildInputs = [ pkg-config m4 ];
 
-  buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 gtk2 dbus ]
-             ++ lib.optionals withGtk3 [ gtk3 librsvg wrapGAppsHook ];
+  inherit src;
 
-  enableParallelBuilding = true;
-  makeFlags = nvidia_x11.makeFlags ++ [ "NV_USE_BUNDLED_LIBJANSSON=0" ];
-  installFlags = [ "PREFIX=$(out)" ];
+  patches = lib.optional (lib.versionOlder nvidia_x11.settingsVersion "440")
+    (fetchpatch {
+      # fixes "multiple definition of `VDPAUDeviceFunctions'" linking errors
+      url = "https://github.com/NVIDIA/nvidia-settings/commit/a7c1f5fce6303a643fadff7d85d59934bd0cf6b6.patch";
+      hash = "sha256-ZwF3dRTYt/hO8ELg9weoz1U/XcU93qiJL2d1aq1Jlak=";
+    });
 
   postPatch = lib.optionalString nvidia_x11.useProfiles ''
     sed -i 's,/usr/share/nvidia/,${nvidia_x11.bin}/share/nvidia/,g' src/gtk+-2.x/ctkappprofile.c
   '';
 
+  enableParallelBuilding = true;
+  makeFlags = nvidia_x11.makeFlags ++ [ "NV_USE_BUNDLED_LIBJANSSON=0" ];
+
   preBuild = ''
     if [ -e src/libXNVCtrl/libXNVCtrl.a ]; then
       ( cd src/libXNVCtrl
@@ -66,6 +69,13 @@ stdenv.mkDerivation {
     fi
   '';
 
+  nativeBuildInputs = [ pkg-config m4 ];
+
+  buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 gtk2 dbus ]
+             ++ lib.optionals withGtk3 [ gtk3 librsvg wrapGAppsHook ];
+
+  installFlags = [ "PREFIX=$(out)" ];
+
   postInstall = ''
     ${lib.optionalString (!withGtk2) ''
       rm -f $out/lib/libnvidia-gtk2.so.*
@@ -87,7 +97,6 @@ stdenv.mkDerivation {
   '';
 
   binaryName = if withGtk3 then ".nvidia-settings-wrapped" else "nvidia-settings";
-
   postFixup = ''
     patchelf --set-rpath "$(patchelf --print-rpath $out/bin/$binaryName):$out/lib:${libXv}/lib" \
       $out/bin/$binaryName
diff --git a/nixpkgs/pkgs/os-specific/linux/nvidiabl/default.nix b/nixpkgs/pkgs/os-specific/linux/nvidiabl/default.nix
index 7ce7c313485d..0f4d485a4edc 100644
--- a/nixpkgs/pkgs/os-specific/linux/nvidiabl/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/nvidiabl/default.nix
@@ -28,9 +28,10 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     description = "Linux driver for setting the backlight brightness on laptops using NVIDIA GPU";
-    homepage = "https://github.com/guillaumezin/nvidiabl";
+    homepage = "https://github.com/yorickvP/nvidiabl";
     license = licenses.gpl2;
     platforms = [ "x86_64-linux" "i686-linux" ];
     maintainers = with maintainers; [ yorickvp ];
+    broken = kernel.kernelAtLeast "5.18";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/oci-seccomp-bpf-hook/default.nix b/nixpkgs/pkgs/os-specific/linux/oci-seccomp-bpf-hook/default.nix
index 1952d31b0247..75f210f4c228 100644
--- a/nixpkgs/pkgs/os-specific/linux/oci-seccomp-bpf-hook/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/oci-seccomp-bpf-hook/default.nix
@@ -10,12 +10,12 @@
 
 buildGoModule rec {
   pname = "oci-seccomp-bpf-hook";
-  version = "1.2.5";
+  version = "1.2.6";
   src = fetchFromGitHub {
     owner = "containers";
     repo = "oci-seccomp-bpf-hook";
     rev = "v${version}";
-    sha256 = "sha256-PU7WX5RAV6wWVRsqq6MdEjr00AtlTT4cSacRaxrEF2s=";
+    sha256 = "sha256-+HGVxPBCPIdFwzZf3lFE0MWA2xMKsHQkfDo4zyNgzpg=";
   };
   vendorSha256 = null;
 
diff --git a/nixpkgs/pkgs/os-specific/linux/odp-dpdk/default.nix b/nixpkgs/pkgs/os-specific/linux/odp-dpdk/default.nix
index 66b39b2c89e6..a9dac153b15d 100644
--- a/nixpkgs/pkgs/os-specific/linux/odp-dpdk/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/odp-dpdk/default.nix
@@ -2,10 +2,10 @@
 , dpdk, libbpf, libconfig, libpcap, numactl, openssl, zlib, libbsd, libelf, jansson
 }: let
   dpdk_19_11 = dpdk.overrideAttrs (old: rec {
-    version = "19.11";
+    version = "19.11.12";
     src = fetchurl {
       url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
-      sha256 = "sha256-RnEzlohDZ3uxwna7dKNFiqfAAswh4pXFHjvWVJexEqs=";
+      sha256 = "sha256-F9m2+MZi3n0psPIwjWwhiIbbNkoGlxqtru2OlV7TbzQ=";
     };
     mesonFlags = old.mesonFlags ++ [
       "-Denable_docs=false"
@@ -14,11 +14,11 @@
 
 in stdenv.mkDerivation rec {
   pname = "odp-dpdk";
-  version = "1.30.1.0_DPDK_19.11";
+  version = "1.35.0.0_DPDK_19.11";
 
   src = fetchurl {
     url = "https://git.linaro.org/lng/odp-dpdk.git/snapshot/${pname}-${version}.tar.gz";
-    sha256 = "sha256-R3PsqQiHlHPzIYYWTVEC7Ikg3KR5I0jWGgftDA9Jj1o=";
+    sha256 = "sha256-R4cRfz0uUDbeQmJfFSIAmq3KfD6CE9hIW2yvFqL+b0M=";
   };
 
   nativeBuildInputs = [
@@ -47,7 +47,7 @@ in stdenv.mkDerivation rec {
     description = "Open Data Plane optimized for DPDK";
     homepage = "https://www.opendataplane.org";
     license = licenses.bsd3;
-    platforms =  platforms.linux;
+    platforms = platforms.linux;
     maintainers = [ maintainers.abuibrahim ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/open-iscsi/default.nix b/nixpkgs/pkgs/os-specific/linux/open-iscsi/default.nix
index a4f6565f0c70..32b3e636ac56 100644
--- a/nixpkgs/pkgs/os-specific/linux/open-iscsi/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/open-iscsi/default.nix
@@ -4,7 +4,7 @@
 
 stdenv.mkDerivation rec {
   pname = "open-iscsi";
-  version = "2.1.4";
+  version = "2.1.7";
 
   nativeBuildInputs = [ autoconf automake gettext libtool perl pkgconf ];
   buildInputs = [ kmod open-isns.lib openssl systemd util-linux ];
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     owner = "open-iscsi";
     repo = "open-iscsi";
     rev = version;
-    sha256 = "sha256-HnvLLwxOnu7Oiige6A6zk9NmAI2ImcILp9eCfbdGiyI=";
+    sha256 = "sha256-R1ttHHxVSQ5TGtWVy4I9BAmEJfcRhKRD5jThoeddjUw=";
   };
 
   DESTDIR = "$(out)";
@@ -22,12 +22,20 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = "-DUSE_KMOD";
 
   preConfigure = ''
-    sed -i 's|/usr|/|' Makefile
+    # Remove blanket -Werror. Fails for minor error on gcc-11.
+    substituteInPlace usr/Makefile --replace ' -Werror ' ' '
   '';
 
+  # avoid /usr/bin/install
+  makeFlags = [
+    "INSTALL=install"
+    "SED=sed"
+    "prefix=/"
+    "manprefix=/share"
+  ];
+
   installFlags = [
     "install"
-    "install_systemd"
   ];
 
   postInstall = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/openrazer/driver.nix b/nixpkgs/pkgs/os-specific/linux/openrazer/driver.nix
index 2de63580ac33..f98fe5cfc743 100644
--- a/nixpkgs/pkgs/os-specific/linux/openrazer/driver.nix
+++ b/nixpkgs/pkgs/os-specific/linux/openrazer/driver.nix
@@ -41,6 +41,8 @@ stdenv.mkDerivation (common // {
     runHook postInstall
   '';
 
+  enableParallelBuilding = true;
+
   meta = common.meta // {
     description = "An entirely open source Linux driver that allows you to manage your Razer peripherals on GNU/Linux";
     broken = kernel.kernelOlder "4.19";
diff --git a/nixpkgs/pkgs/os-specific/linux/pam_gnupg/default.nix b/nixpkgs/pkgs/os-specific/linux/pam_gnupg/default.nix
index ffb397334c16..1c54c42120ab 100644
--- a/nixpkgs/pkgs/os-specific/linux/pam_gnupg/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/pam_gnupg/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "pam_gnupg";
-  version = "0.3";
+  version = "0.4";
 
   src = fetchFromGitHub {
     owner = "cruegge";
     repo = "pam-gnupg";
     rev = "v${version}";
-    sha256 = "sha256-NDl6MsvIDAXkaLqXt7Wa0T7aulT31P5Z/d/Vb+ILya0=";
+    sha256 = "sha256-6I9a841qohA42lhOgZf/hharnjkthuB8lRptPDxUgMI=";
   };
 
   configureFlags = [
diff --git a/nixpkgs/pkgs/os-specific/linux/pam_mount/default.nix b/nixpkgs/pkgs/os-specific/linux/pam_mount/default.nix
index 5e4e15c364bd..c49351f3249d 100644
--- a/nixpkgs/pkgs/os-specific/linux/pam_mount/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/pam_mount/default.nix
@@ -1,12 +1,12 @@
-{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, libtool, pam, libHX, libxml2, pcre, perl, openssl, cryptsetup, util-linux }:
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, libtool, pam, libHX, libxml2, pcre2, perl, openssl, cryptsetup, util-linux }:
 
 stdenv.mkDerivation rec {
   pname = "pam_mount";
-  version = "2.17";
+  version = "2.19";
 
   src = fetchurl {
     url = "mirror://sourceforge/pam-mount/pam_mount/${pname}-${version}.tar.xz";
-    sha256 = "1q2n6a2ah6nghdn8i6ad2wj247njwb5nx48cggxknaa6lqxylidy";
+    sha256 = "02m6w04xhgv2yx69yxph8giw0sp39s9lvvlffslyna46fnr64qvb";
   };
 
   patches = [
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook libtool pkg-config ];
 
-  buildInputs = [ pam libHX util-linux libxml2 pcre perl openssl cryptsetup ];
+  buildInputs = [ pam libHX util-linux libxml2 pcre2 perl openssl cryptsetup ];
 
   enableParallelBuilding = true;
 
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
     description = "PAM module to mount volumes for a user session";
     homepage = "https://pam-mount.sourceforge.net/";
     license = with licenses; [ gpl2 gpl3 lgpl21 lgpl3 ];
-    maintainers = with maintainers; [ tstrobel ];
+    maintainers = with maintainers; [ netali ];
     platforms = platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/pam_mysql/default.nix b/nixpkgs/pkgs/os-specific/linux/pam_mysql/default.nix
new file mode 100644
index 000000000000..807899cf2b28
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/pam_mysql/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pam, pkg-config, libmysqlclient, mariadb }:
+
+stdenv.mkDerivation rec {
+  pname = "pam_mysql";
+  version = "1.0.0-beta2";
+
+  src = fetchFromGitHub {
+    owner = "NigelCunningham";
+    repo = "pam-MySQL";
+    rev = version;
+    sha256 = "07acf0hbhkd0kg49gnj4nb5ilnv3v4xx3dsggvzvjg8gi3cjmsap";
+  };
+
+  nativeBuildInputs = [ meson pkg-config ninja ];
+  buildInputs = [ pam libmysqlclient mariadb ];
+
+  meta = with lib; {
+    description = "PAM authentication module against a MySQL database";
+    homepage = "https://github.com/NigelCunningham/pam-MySQL";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ netali ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/pam_tmpdir/default.nix b/nixpkgs/pkgs/os-specific/linux/pam_tmpdir/default.nix
new file mode 100644
index 000000000000..859ebedc3340
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/pam_tmpdir/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pam }:
+
+stdenv.mkDerivation rec {
+  pname = "pam_tmpdir";
+  version = "0.09";
+
+  src = fetchurl {
+    url = "http://deb.debian.org/debian/pool/main/p/pam-tmpdir/pam-tmpdir_${version}.tar.gz";
+    hash = "sha256-MXa1CY6alD83E/Q+MJmsv8NaImWd0pPJKZd/7nbe4J8=";
+  };
+
+  postPatch = ''
+    substituteInPlace pam_tmpdir.c \
+      --replace /sbin/pam-tmpdir-helper $out/sbin/pam-tmpdir-helper
+
+    # chmod/chown fails on files in /nix/store
+    sed -i -E -e '/^\s*(chmod|chown)/d' Makefile.{am,in}
+
+    # the symlinks in m4 assume FHS
+    rm -rf m4
+  '';
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  buildInputs = [ pam ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://tracker.debian.org/pkg/pam-tmpdir";
+    description = "PAM module for creating safe per-user temporary directories";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/pam_u2f/default.nix b/nixpkgs/pkgs/os-specific/linux/pam_u2f/default.nix
index 5e4b190c7a32..bcccd20cd6f0 100644
--- a/nixpkgs/pkgs/os-specific/linux/pam_u2f/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/pam_u2f/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "pam_u2f";
-  version = "1.2.0";
+  version = "1.2.1";
 
   src     = fetchurl {
     url = "https://developers.yubico.com/pam-u2f/Releases/${pname}-${version}.tar.gz";
-    sha256 = "sha256-IwPm+Zsf3o7jw6sopN4tpt3SJclTaT6EXWstg4giH7M=";
+    sha256 = "sha256-cOdBvKGXtktPvo3R9tV84ritWMp4Y1LFJfPy1EEliUw=";
   };
 
   nativeBuildInputs = [ pkg-config ];
@@ -27,8 +27,10 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     homepage = "https://developers.yubico.com/pam-u2f/";
     description = "A PAM module for allowing authentication with a U2F device";
+    changelog = "https://github.com/Yubico/pam-u2f/raw/pam_u2f-${version}/NEWS";
     license = licenses.bsd2;
     platforms = platforms.unix;
     maintainers = with maintainers; [ philandstuff ];
+    mainProgram = "pamu2fcfg";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/pam_usb/default.nix b/nixpkgs/pkgs/os-specific/linux/pam_usb/default.nix
index 0091accd57a7..ebd45246ae8d 100644
--- a/nixpkgs/pkgs/os-specific/linux/pam_usb/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/pam_usb/default.nix
@@ -41,8 +41,12 @@ stdenv.mkDerivation rec {
     sha256 = "1g1w0s9d8mfld8abrn405ll5grv3xgs0b0hsganrz6qafdq9j7q1";
   };
 
-  buildInputs = [
+  nativeBuildInputs = [
     makeWrapper
+    pkg-config
+  ];
+
+  buildInputs = [
     # pam_usb dependencies
     dbus libxml2 pam pmount pkg-config
     # pam_usb's tools dependencies
diff --git a/nixpkgs/pkgs/os-specific/linux/pam_ussh/default.nix b/nixpkgs/pkgs/os-specific/linux/pam_ussh/default.nix
new file mode 100644
index 000000000000..889c8bc6f57c
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/pam_ussh/default.nix
@@ -0,0 +1,67 @@
+{ buildGoModule
+, fetchFromGitHub
+, pam
+, lib
+, nixosTests
+}:
+
+buildGoModule rec {
+  pname = "pam_ussh";
+  version = "unstable-20210615";
+
+  src = fetchFromGitHub {
+    owner = "uber";
+    repo = "pam-ussh";
+    rev = "e9524bda90ba19d3b9eb24f49cb63a6a56a19193";  # HEAD as of 2022-03-13
+    sha256 = "0nb9hpqbghgi3zvq41kabydzyc6ffaaw9b4jkc5jrwn1klpw1xk8";
+  };
+
+  prePatch = ''
+    cp ${./go.mod} go.mod
+  '';
+  overrideModAttrs = (_: {
+    inherit prePatch;
+  });
+
+  vendorSha256 = "0hjifc3kbwmx7kjn858vi05cwwra6q19cqjfd94k726pwhk37qkw";
+
+  buildInputs = [
+    pam
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+
+    if [ -z "$enableParallelBuilding" ]; then
+      export NIX_BUILD_CORES=1
+    fi
+    go build -buildmode=c-shared -o pam_ussh.so -v -p $NIX_BUILD_CORES .
+
+    runHook postBuild
+  '';
+  checkPhase = ''
+    runHook preCheck
+
+    go test -v -p $NIX_BUILD_CORES .
+
+    runHook postCheck
+  '';
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/lib/security
+    cp pam_ussh.so $out/lib/security
+
+    runHook postInstall
+  '';
+
+  passthru.tests = { inherit (nixosTests) pam-ussh; };
+
+  meta = with lib; {
+    homepage = "https://github.com/uber/pam-ussh";
+    description = "PAM module to authenticate using SSH certificates";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ lukegb ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/pam_ussh/go.mod b/nixpkgs/pkgs/os-specific/linux/pam_ussh/go.mod
new file mode 100644
index 000000000000..9adc453560a4
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/pam_ussh/go.mod
@@ -0,0 +1,15 @@
+module github.com/uber/pam-ussh
+
+go 1.17
+
+require (
+	github.com/stretchr/testify v1.7.0
+	golang.org/x/crypto v0.0.0-20220313003712-b769efc7c000
+)
+
+require (
+	github.com/davecgh/go-spew v1.1.0 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
+	gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
+)
diff --git a/nixpkgs/pkgs/os-specific/linux/pax-utils/default.nix b/nixpkgs/pkgs/os-specific/linux/pax-utils/default.nix
index b22af8d70838..844dc61dac37 100644
--- a/nixpkgs/pkgs/os-specific/linux/pax-utils/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/pax-utils/default.nix
@@ -1,19 +1,38 @@
-{ stdenv, lib, fetchurl, bash }:
+{ stdenv
+, lib
+, fetchurl
+, buildPackages
+, docbook_xml_dtd_44
+, docbook_xsl
+, libcap
+, pkg-config
+, meson
+, ninja
+, xmlto
+
+, gitUpdater
+}:
 
 stdenv.mkDerivation rec {
   pname = "pax-utils";
-  version = "1.3.3";
+  version = "1.3.5";
 
   src = fetchurl {
     url = "mirror://gentoo/distfiles/${pname}-${version}.tar.xz";
-    sha256 = "sha256-7sp/vZi8Zr6tSncADCAl2fF+qCAbhCRYgkBs4AubaxQ=";
+    sha256 = "sha256-8KWwPfIwiqLdeq9TuewLK0hFW4YSnkd6FkPeYpBKuHQ=";
   };
 
   strictDeps = true;
 
-  buildInputs = [ bash ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ docbook_xml_dtd_44 docbook_xsl meson ninja pkg-config xmlto ];
+  buildInputs = [ libcap ];
 
-  makeFlags = [ "PREFIX=$(out)" ];
+  passthru.updateScript = gitUpdater {
+    inherit pname version;
+    url = "https://anongit.gentoo.org/git/proj/pax-utils.git";
+    rev-prefix = "v";
+  };
 
   meta = with lib; {
     description = "ELF utils that can check files for security relevant properties";
diff --git a/nixpkgs/pkgs/os-specific/linux/pflask/default.nix b/nixpkgs/pkgs/os-specific/linux/pflask/default.nix
index deb3e06ca49d..1270a9b9494f 100644
--- a/nixpkgs/pkgs/os-specific/linux/pflask/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/pflask/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, python3, wafHook }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, python3, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "pflask";
@@ -11,6 +11,16 @@ stdenv.mkDerivation rec {
     hash = "sha256-bAKPUj/EipZ98kHbZiFZZI3hLVMoQpCrYKMmznpSDhg=";
   };
 
+  patches = [
+    # Pull patch pending upstream inclusion for -fno-common toolchain support:
+    #  https://github.com/ghedo/pflask/pull/30
+    (fetchpatch {
+      name = "fno-common.patch";
+      url = "https://github.com/ghedo/pflask/commit/73ba32ec48e1e0e4a56b1bceed4635711526e079.patch";
+      hash = "sha256-KVuBS7LbYJQv6NXljpSiGGja7ar7W6A6SKzkEjB1B6U=";
+    })
+  ];
+
   nativeBuildInputs = [ python3 wafHook ];
 
   postInstall = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/pipework/default.nix b/nixpkgs/pkgs/os-specific/linux/pipework/default.nix
index 33192392888a..ea274377ced9 100644
--- a/nixpkgs/pkgs/os-specific/linux/pipework/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/pipework/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchFromGitHub, makeWrapper
-, bridge-utils, iproute2, lxc, openvswitch, docker, busybox, dhcpcd, dhcp
+, bridge-utils, iproute2, lxc, openvswitch, docker, busybox, dhcpcd
 }:
 
 stdenv.mkDerivation {
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   installPhase = ''
     install -D pipework $out/bin/pipework
     wrapProgram $out/bin/pipework --prefix PATH : \
-      ${lib.makeBinPath [ bridge-utils iproute2 lxc openvswitch docker busybox dhcpcd dhcp ]};
+      ${lib.makeBinPath [ bridge-utils iproute2 lxc openvswitch docker busybox dhcpcd ]};
   '';
   meta = with lib; {
     description = "Software-Defined Networking tools for LXC";
diff --git a/nixpkgs/pkgs/os-specific/linux/pktgen/default.nix b/nixpkgs/pkgs/os-specific/linux/pktgen/default.nix
index 36dea8ed6e0e..0ddda99bf592 100644
--- a/nixpkgs/pkgs/os-specific/linux/pktgen/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/pktgen/default.nix
@@ -5,13 +5,13 @@
 
 stdenv.mkDerivation rec {
   pname = "pktgen";
-  version = "21.11.0";
+  version = "22.04.1";
 
   src = fetchFromGitHub {
     owner = "pktgen";
     repo = "Pktgen-DPDK";
     rev = "pktgen-${version}";
-    sha256 = "sha256-3z5DSkggHTwjzsRzRG5zzZTcNsn/5YankJT8CKSN8b4=";
+    sha256 = "0gbag98i2jq0p2hpvfgc3fiqy2sark1dm72hla4sxmn3gljy3p70";
   };
 
   nativeBuildInputs = [ meson ninja pkg-config ];
diff --git a/nixpkgs/pkgs/os-specific/linux/ply/default.nix b/nixpkgs/pkgs/os-specific/linux/ply/default.nix
index 916aa39eee22..dbd8925a5cb3 100644
--- a/nixpkgs/pkgs/os-specific/linux/ply/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/ply/default.nix
@@ -35,6 +35,5 @@ stdenv.mkDerivation rec {
     homepage = "https://wkz.github.io/ply/";
     license = [ licenses.gpl2Only ];
     maintainers = with maintainers; [ mic92 mbbx6spp ];
-    broken = lib.versionOlder kernel.version "4.0";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/plymouth/default.nix b/nixpkgs/pkgs/os-specific/linux/plymouth/default.nix
index 62950b085258..4e755a28db8b 100644
--- a/nixpkgs/pkgs/os-specific/linux/plymouth/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/plymouth/default.nix
@@ -96,7 +96,7 @@ stdenv.mkDerivation rec {
     homepage = "https://www.freedesktop.org/wiki/Software/Plymouth/";
     description = "Boot splash and boot logger";
     license = licenses.gpl2Plus;
-    maintainers = [ maintainers.goibhniu teams.gnome.members ];
+    maintainers = [ maintainers.goibhniu ] ++ teams.gnome.members;
     platforms = platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/pommed-light/default.nix b/nixpkgs/pkgs/os-specific/linux/pommed-light/default.nix
index e86658ccb0ac..113cedfab2e9 100644
--- a/nixpkgs/pkgs/os-specific/linux/pommed-light/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/pommed-light/default.nix
@@ -1,5 +1,6 @@
 { lib, stdenv
 , fetchFromGitHub
+, fetchpatch
 , pciutils
 , libconfuse
 , alsa-lib
@@ -20,6 +21,16 @@ stdenv.mkDerivation rec {
     sha256 = "18fvdwwhcl6s4bpf2f2i389s71c8k4g0yb81am9rdddqmzaw27iy";
   };
 
+  patches = [
+    # Pull fix pending upstream inclusion for -fno-common toolchain support:
+    #   https://github.com/bytbox/pommed-light/pull/38
+    (fetchpatch {
+      name = "fno-common.patch";
+      url = "https://github.com/bytbox/pommed-light/commit/5848b49b45a9c3ab047ebd17deb2162daab1e0b8.patch";
+      sha256 = "15rsq2i4rqp4ssab20486a1wgxi2cp87b7nxyk9h23gdwld713vf";
+    })
+  ];
+
   postPatch = ''
     substituteInPlace pommed.conf.mactel --replace /usr $out
     substituteInPlace pommed.conf.pmac --replace /usr $out
diff --git a/nixpkgs/pkgs/os-specific/linux/power-profiles-daemon/default.nix b/nixpkgs/pkgs/os-specific/linux/power-profiles-daemon/default.nix
index 9f96eb2576dc..402b2536163c 100644
--- a/nixpkgs/pkgs/os-specific/linux/power-profiles-daemon/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/power-profiles-daemon/default.nix
@@ -8,6 +8,7 @@
 , libgudev
 , glib
 , polkit
+, dbus
 , gobject-introspection
 , gettext
 , gtk-doc
@@ -29,34 +30,21 @@ let
     dbus-python
     python-dbusmock
   ];
-  testTypelibPath = lib.makeSearchPathOutput "lib" "lib/girepository-1.0" [ umockdev ];
 in
 stdenv.mkDerivation rec {
   pname = "power-profiles-daemon";
-  version = "0.10.1";
+  version = "0.12";
 
-  outputs = [ "out" "devdoc" "installedTests" ];
+  outputs = [ "out" "devdoc" ];
 
   src = fetchFromGitLab {
     domain = "gitlab.freedesktop.org";
     owner = "hadess";
     repo = "power-profiles-daemon";
     rev = version;
-    sha256 = "sha256-sQWiCHc0kEELdmPq9Qdk7OKDUgbM5R44639feC7gjJc=";
+    sha256 = "sha256-2eMFPGVLwTBIlaB1zM3BzHrhydgBEm+kvx+VIZdUDPM=";
   };
 
-  patches = [
-    # Enable installed tests.
-    # https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/merge_requests/92
-    (fetchpatch {
-      url = "https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/commit/3c64d9e1732eb6425e33013c452f1c4aa7a26f7e.patch";
-      sha256 = "din5VuZZwARNDInHtl44yJK8pLmlxr5eoD4iMT4a8HA=";
-    })
-
-    # Install installed tests to separate output.
-    ./installed-tests-path.patch
-  ];
-
   nativeBuildInputs = [
     pkg-config
     meson
@@ -70,9 +58,6 @@ stdenv.mkDerivation rec {
     gobject-introspection
     wrapGAppsNoGuiHook
     python3.pkgs.wrapPython
-
-    # For finding tests.
-    (python3.withPackages testPythonPkgs)
   ];
 
   buildInputs = [
@@ -82,6 +67,8 @@ stdenv.mkDerivation rec {
     glib
     polkit
     python3 # for cli tool
+    # Duplicate from checkInputs until https://github.com/NixOS/nixpkgs/issues/161570 is solved
+    umockdev
   ];
 
   strictDeps = true;
@@ -91,31 +78,29 @@ stdenv.mkDerivation rec {
     python3.pkgs.pygobject3
   ];
 
+  checkInputs = [
+    umockdev
+    dbus
+    (python3.withPackages testPythonPkgs)
+  ];
+
   mesonFlags = [
-    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
     "-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
     "-Dgtk_doc=true"
+    "-Dtests=true"
   ];
 
+  doCheck = true;
+
   PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions";
 
   # Avoid double wrapping
   dontWrapGApps = true;
 
   postPatch = ''
-    patchShebangs tests/unittest_inspector.py
-  '';
-
-  preConfigure = ''
-    # For finding tests.
-    GI_TYPELIB_PATH_original=$GI_TYPELIB_PATH
-    addToSearchPath GI_TYPELIB_PATH "${testTypelibPath}"
-  '';
-
-  postConfigure = ''
-    # Restore the original value to prevent the program from depending on umockdev.
-    export GI_TYPELIB_PATH=$GI_TYPELIB_PATH_original
-    unset GI_TYPELIB_PATH_original
+    patchShebangs --build \
+      tests/integration-test.py \
+      tests/unittest_inspector.py
   '';
 
   preInstall = ''
@@ -128,33 +113,22 @@ stdenv.mkDerivation rec {
     export PKEXEC_UID=-1
   '';
 
+  postCheck = ''
+    # Do not contaminate the wrapper with test dependencies.
+    unset GI_TYPELIB_PATH
+    unset XDG_DATA_DIRS
+  '';
+
   postFixup = ''
     # Avoid double wrapping
     makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
     # Make Python libraries available
     wrapPythonProgramsIn "$out/bin" "$pythonPath"
-
-    # Make Python libraries available for installed tests
-    makeWrapperArgs+=(
-      --prefix GI_TYPELIB_PATH : "${testTypelibPath}"
-      --prefix PATH : "${lib.makeBinPath [ umockdev ]}"
-      # Vala does not use absolute paths in typelibs
-      # https://github.com/NixOS/nixpkgs/issues/47226
-      # Also umockdev binaries use relative paths for LD_PRELOAD.
-      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ umockdev ]}"
-      # dbusmock calls its templates using exec so our regular patching of Python scripts
-      # to add package directories to site will not carry over.
-      # https://github.com/martinpitt/python-dbusmock/blob/2254e69279a02fb3027b500ed7288b77c7a80f2a/dbusmock/mockobject.py#L51
-      # https://github.com/martinpitt/python-dbusmock/blob/2254e69279a02fb3027b500ed7288b77c7a80f2a/dbusmock/__main__.py#L60-L62
-      --prefix PYTHONPATH : "${lib.makeSearchPath python3.sitePackages (testPythonPkgs python3.pkgs)}"
-    )
-    wrapPythonProgramsIn "$installedTests/libexec/installed-tests" "$pythonPath ${lib.concatStringsSep " " (testPythonPkgs python3.pkgs)}"
   '';
 
   passthru = {
     tests = {
       nixos = nixosTests.power-profiles-daemon;
-      installed-tests = nixosTests.installed-tests.power-profiles-daemon;
     };
   };
 
diff --git a/nixpkgs/pkgs/os-specific/linux/power-profiles-daemon/installed-tests-path.patch b/nixpkgs/pkgs/os-specific/linux/power-profiles-daemon/installed-tests-path.patch
deleted file mode 100644
index 63059f3ac73c..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/power-profiles-daemon/installed-tests-path.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff --git a/meson_options.txt b/meson_options.txt
-index 7e89619..76497db 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -1,3 +1,4 @@
-+option('installed_test_prefix', type: 'string', description: 'Prefix for installed tests')
- option('systemdsystemunitdir',
-        description: 'systemd unit directory',
-        type: 'string',
-diff --git a/tests/meson.build b/tests/meson.build
-index b306a7f..7670e1b 100644
---- a/tests/meson.build
-+++ b/tests/meson.build
-@@ -2,8 +2,8 @@ envs = environment()
- envs.set ('top_builddir', meson.build_root())
- envs.set ('top_srcdir', meson.source_root())
- 
--installed_test_bindir = libexecdir / 'installed-tests' / meson.project_name()
--installed_test_datadir = datadir / 'installed-tests' / meson.project_name()
-+installed_test_bindir = get_option('installed_test_prefix') / 'libexec' / 'installed-tests' / meson.project_name()
-+installed_test_datadir = get_option('installed_test_prefix') / 'share' / 'installed-tests' / meson.project_name()
- 
- python3 = find_program('python3')
- unittest_inspector = find_program('unittest_inspector.py')
-diff --git a/tests/integration-test.py b/tests/integration-test.py
-index 22dc42c..0f92b76 100755
---- a/tests/integration-test.py
-+++ b/tests/integration-test.py
-@@ -67,7 +67,7 @@ class Tests(dbusmock.DBusTestCase):
-             print('Testing binaries from JHBuild (%s)' % cls.daemon_path)
-         else:
-             cls.daemon_path = None
--            with open('/usr/lib/systemd/system/power-profiles-daemon.service') as f:
-+            with open('/run/current-system/sw/lib/systemd/system/power-profiles-daemon.service') as f:
-                 for line in f:
-                     if line.startswith('ExecStart='):
-                         cls.daemon_path = line.split('=', 1)[1].strip()
diff --git a/nixpkgs/pkgs/os-specific/linux/powercap/default.nix b/nixpkgs/pkgs/os-specific/linux/powercap/default.nix
index 24832e5fdff9..96ec83852d9d 100644
--- a/nixpkgs/pkgs/os-specific/linux/powercap/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/powercap/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "powercap";
-  version = "0.5.0";
+  version = "0.6.0";
 
   src = fetchFromGitHub {
     owner = "powercap";
     repo = "powercap";
     rev = "v${version}";
-    sha256 = "sha256-VvepbABc7daRE0/sJqsCb+m2my8O3B1ICXywBqsjSO8=";
+    sha256 = "sha256-l+IpFqBnCYUU825++sUPySD/Ku0TEIX2kt+S0Wml6iA=";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/os-specific/linux/prl-tools/default.nix b/nixpkgs/pkgs/os-specific/linux/prl-tools/default.nix
index e6c246de0d27..0b4acc44400e 100644
--- a/nixpkgs/pkgs/os-specific/linux/prl-tools/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/prl-tools/default.nix
@@ -1,50 +1,73 @@
-{ stdenv, lib, makeWrapper, p7zip
-, gawk, util-linux, xorg, glib, dbus-glib, zlib
-, kernel ? null, libsOnly ? false
-, undmg, fetchurl
+{ stdenv
+, lib
+, makeWrapper
+, p7zip
+, gawk
+, util-linux
+, xorg
+, glib
+, dbus-glib
+, zlib
+, bbe
+, bash
+, timetrap
+, netcat
+, cups
+, kernel ? null
+, libsOnly ? false
+, fetchurl
+, undmg
+, perl
+, autoPatchelfHook
 }:
 
 assert (!libsOnly) -> kernel != null;
 
-let xorgFullVer = lib.getVersion xorg.xorgserver;
-    xorgVer = lib.versions.majorMinor xorgFullVer;
-    x64 = if stdenv.hostPlatform.system == "x86_64-linux" then true
-          else if stdenv.hostPlatform.system == "i686-linux" then false
-          else throw "Parallels Tools for Linux only support {x86-64,i686}-linux targets";
-in
 stdenv.mkDerivation rec {
-  version = "${prl_major}.2.1-41615";
-  prl_major = "12";
+  version = "18.0.0-53049";
   pname = "prl-tools";
 
   # We download the full distribution to extract prl-tools-lin.iso from
   # => ${dmg}/Parallels\ Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso
   src = fetchurl {
-    url =  "https://download.parallels.com/desktop/v${prl_major}/${version}/ParallelsDesktop-${version}.dmg";
-    sha256 = "1jwzwif69qlhmfky9kigjaxpxfj0lyrl1iyrpqy4iwqvajdgbbym";
+    url = "https://download.parallels.com/desktop/v${lib.versions.major version}/${version}/ParallelsDesktop-${version}.dmg";
+    sha256 = "sha256-MGiqCvOsu/sKz6JHJFGP5bT12XYnm2kTMdOiflg9ses=";
   };
 
   hardeningDisable = [ "pic" "format" ];
 
-  # also maybe python2 to generate xorg.conf
-  nativeBuildInputs = [ p7zip undmg ] ++ lib.optionals (!libsOnly) [ makeWrapper ] ++ kernel.moduleBuildDependencies;
+  nativeBuildInputs = [ p7zip undmg perl bbe autoPatchelfHook ]
+    ++ lib.optionals (!libsOnly) [ makeWrapper ] ++ kernel.moduleBuildDependencies;
+
+  buildInputs = with xorg; [ libXrandr libXext libX11 libXcomposite libXinerama ]
+    ++ lib.optionals (!libsOnly) [ libXi glib dbus-glib zlib ];
+
+  runtimeDependencies = [ glib xorg.libXrandr ];
 
   inherit libsOnly;
 
   unpackPhase = ''
     undmg "${src}"
-
     export sourceRoot=prl-tools-build
-    7z x "Parallels Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso" -o$sourceRoot
+    7z x "Parallels Desktop.app/Contents/Resources/Tools/prl-tools-lin${lib.optionalString stdenv.isAarch64 "-arm"}.iso" -o$sourceRoot
     if test -z "$libsOnly"; then
       ( cd $sourceRoot/kmods; tar -xaf prl_mod.tar.gz )
     fi
-    ( cd $sourceRoot/tools; tar -xaf prltools${if x64 then ".x64" else ""}.tar.gz )
   '';
 
-  kernelVersion = if libsOnly then "" else lib.getName kernel.name;
-  kernelDir = if libsOnly then "" else "${kernel.dev}/lib/modules/${kernelVersion}";
-  scriptPath = lib.concatStringsSep ":" (lib.optionals (!libsOnly) [ "${util-linux}/bin" "${gawk}/bin" ]);
+  kernelVersion = lib.optionalString (!libsOnly) kernel.modDirVersion;
+  kernelDir = lib.optionalString (!libsOnly) "${kernel.dev}/lib/modules/${kernelVersion}";
+
+  libPath = lib.concatStringsSep ":" [ "${glib.out}/lib" "${xorg.libXrandr}/lib" ];
+
+  scriptPath = lib.concatStringsSep ":" (lib.optionals (!libsOnly) [
+    "${util-linux}/bin"
+    "${gawk}/bin"
+    "${bash}/bin"
+    "${timetrap}/bin"
+    "${netcat}/bin"
+    "${cups}/sbin"
+  ]);
 
   buildPhase = ''
     if test -z "$libsOnly"; then
@@ -57,112 +80,80 @@ stdenv.mkDerivation rec {
           SRC=$kernelDir/build \
           KVER=$kernelVersion
       )
-
-      # Xorg config (maybe would be useful for other versions)
-      #python2 installer/xserver-config.py xorg ${xorgVer} /dev/null parallels.conf
     fi
   '';
 
-  libPath = with xorg;
-            lib.makeLibraryPath ([ stdenv.cc.cc libXrandr libXext libX11 libXcomposite libXinerama ]
-            ++ lib.optionals (!libsOnly) [ libXi glib dbus-glib zlib ]);
-
-
   installPhase = ''
     if test -z "$libsOnly"; then
       ( # kernel modules
         cd kmods
         mkdir -p $out/lib/modules/${kernelVersion}/extra
-        cp prl_eth/pvmnet/prl_eth.ko $out/lib/modules/${kernelVersion}/extra
-        cp prl_tg/Toolgate/Guest/Linux/prl_tg/prl_tg.ko $out/lib/modules/${kernelVersion}/extra
         cp prl_fs/SharedFolders/Guest/Linux/prl_fs/prl_fs.ko $out/lib/modules/${kernelVersion}/extra
         cp prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.ko $out/lib/modules/${kernelVersion}/extra
+        cp prl_tg/Toolgate/Guest/Linux/prl_tg/prl_tg.ko $out/lib/modules/${kernelVersion}/extra
+        ${lib.optionalString stdenv.isAarch64
+        "cp prl_notifier/Installation/lnx/prl_notifier/prl_notifier.ko $out/lib/modules/${kernelVersion}/extra"}
       )
     fi
 
     ( # tools
-      cd tools
+      cd tools/tools${if stdenv.isAarch64 then "-arm64" else if stdenv.isx86_64 then "64" else "32"}
       mkdir -p $out/lib
 
       if test -z "$libsOnly"; then
+        # prltoolsd contains hardcoded /bin/bash path
+        # we're lucky because it uses only -c command
+        # => replace to /bin/sh
+        bbe -e "s:/bin/bash:/bin/sh\x00\x00:" -o bin/prltoolsd.tmp bin/prltoolsd
+        rm -f bin/prltoolsd
+        mv bin/prltoolsd.tmp bin/prltoolsd
+
         # install binaries
         for i in bin/* sbin/prl_nettool sbin/prl_snapshot; do
+          # also patch binaries to replace /usr/bin/XXX to XXX
+          # here a two possible cases:
+          # 1. it is uses as null terminated string and should be truncated by null;
+          # 2. it is uses inside shell script and should be truncated by space.
+          for p in bin/* sbin/prl_nettool sbin/prl_snapshot sbin/prlfsmountd; do
+            p=$(basename $p)
+            bbe -e "s:/usr/bin/$p\x00:./$p\x00\x00\x00\x00\x00\x00\x00\x00:" -o $i.tmp $i
+            bbe -e "s:/usr/sbin/$p\x00:./$p\x00\x00\x00\x00\x00\x00\x00\x00 :" -o $i $i.tmp
+            bbe -e "s:/usr/bin/$p:$p         :" -o $i.tmp $i
+            bbe -e "s:/usr/sbin/$p:$p          :" -o $i $i.tmp
+          done
+
           install -Dm755 $i $out/$i
         done
-        # other binaries
-        for i in xorg.7.1/usr/bin/*; do
-          cp $i $out/bin
-        done
 
-        for i in $out/bin/* $out/sbin/*; do
-          patchelf \
-            --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-            --set-rpath "$out/lib:$libPath" \
-            $i || true
+        install -Dm755 ../../tools/prlfsmountd.sh $out/sbin/prlfsmountd
+        for f in $out/bin/* $out/sbin/*; do
+          wrapProgram $f \
+            --prefix LD_LIBRARY_PATH ':' "$libPath" \
+            --prefix PATH ':' "$scriptPath"
         done
 
-        mkdir -p $out/bin
-        install -Dm755 ../installer/prlfsmountd.sh $out/sbin/prlfsmountd
-        wrapProgram $out/sbin/prlfsmountd \
-          --prefix PATH ':' "$scriptPath"
-
-        for i in lib/*.a; do
+        for i in lib/libPrl*.0.0; do
           cp $i $out/lib
+          ln -s $out/$i $out/''${i%.0.0}
         done
 
-        for i in xorg.7.1/usr/lib/libprl_wmouse_watcher.*; do
-          cp $i $out/lib
-        done
+        mkdir -p $out/share/man/man8
+        install -Dm644 ../mount.prl_fs.8 $out/share/man/man8
 
-        mkdir -p $out/lib/udev/rules.d
-        for i in *.rules; do
-          sed 's,/bin/bash,${stdenv.shell},g' $i > $out/lib/udev/rules.d/$i
-        done
+        substituteInPlace ../99prltoolsd-hibernate \
+          --replace "/bin/bash" "${bash}/bin/bash"
 
-        (
-          cd xorg.${xorgVer}
-          # Install the X modules.
-          (
-            cd x-server/modules
-            for i in */*; do
-              install -Dm755 $i $out/lib/xorg/modules/$i
-            done
-          )
-          (
-            cd usr/lib
-            libGLXname=$(echo libglx.so*)
-            install -Dm755 $libGLXname $out/lib/xorg/modules/extensions/$libGLXname
-            ln -s $libGLXname $out/lib/xorg/modules/extensions/libglx.so
-            ln -s $libGLXname $out/lib/xorg/modules/extensions/libglx.so.1
-          )
-        )
+        mkdir -p $out/etc/pm/sleep.d
+        install -Dm644 ../99prltoolsd-hibernate $out/etc/pm/sleep.d
       fi
-
-      for i in xorg.7.1/usr/lib/libGL.*; do
-        cp $i $out/lib
-      done
-
-      cd $out
-      find -name \*.so\* -type f -exec \
-        patchelf --set-rpath "$out/lib:$libPath" {} \;
-
-      cd lib
-      libGLname=$(echo libGL.so*)
-      ln -s $libGLname libGL.so
-      ln -s $libGLname libGL.so.1
     )
   '';
 
-  dontStrip = true;
-  dontPatchELF = true;
-
   meta = with lib; {
     description = "Parallels Tools for Linux guests";
     homepage = "https://parallels.com";
-    platforms = [ "i686-linux" "x86_64-linux" ];
+    platforms = platforms.linux;
     license = licenses.unfree;
-    # I was making this package blindly and requesting testing from the real user,
-    # so I can't even test it by myself and won't provide future updates.
-    maintainers = with maintainers; [ abbradar ];
+    maintainers = with maintainers; [ catap wegank ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/pscircle/default.nix b/nixpkgs/pkgs/os-specific/linux/pscircle/default.nix
index ef7dbc55a9ab..a293790cc97c 100644
--- a/nixpkgs/pkgs/os-specific/linux/pscircle/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/pscircle/default.nix
@@ -11,11 +11,14 @@ stdenv.mkDerivation rec {
     sha256 = "1sm99423hh90kr4wdjqi9sdrrpk65j2vz2hzj65zcxfxyr6khjci";
   };
 
+  nativeBuildInputs = [
+    meson
+    pkg-config
+    ninja
+  ];
+
   buildInputs = [
-      meson
-      pkg-config
-      cairo
-      ninja
+    cairo
   ];
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/os-specific/linux/psmisc/default.nix b/nixpkgs/pkgs/os-specific/linux/psmisc/default.nix
index 4cf3e1f7dd1b..e2f0fe59a075 100644
--- a/nixpkgs/pkgs/os-specific/linux/psmisc/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/psmisc/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "psmisc";
-  version = "23.4";
+  version = "23.5";
 
   src = fetchFromGitLab {
     owner = pname;
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-s7omgtsNooYqhr4JUTZ6WCtPaZVC1ujJGz6KxUBWIs8=";
+    sha256 = "sha256-02jvRPqN8DS30ID42hQFu400NoFC5QiH5YA3NB+EoFI=";
   };
 
   nativeBuildInputs = [ autoconf automake gettext ];
diff --git a/nixpkgs/pkgs/os-specific/linux/qc71_laptop/default.nix b/nixpkgs/pkgs/os-specific/linux/qc71_laptop/default.nix
new file mode 100644
index 000000000000..92818ccfb096
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/qc71_laptop/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, kernel }:
+
+stdenv.mkDerivation rec {
+  pname = "qc71_laptop";
+  version = "unstable-2022-06-01";
+
+  src = fetchFromGitHub {
+    owner = "pobrn";
+    repo = "qc71_laptop";
+    rev = "28106e0602807d78d1f5fa220ab6148dd6477c1c";
+    hash = "sha256-3bhw2HbEVuxPfGMt/eE2nCuMLHzYHRY3nRWPzZxKHro=";
+  };
+
+  nativeBuildInputs = kernel.moduleBuildDependencies;
+
+  makeFlags = kernel.makeFlags ++ [
+    "VERSION=${version}"
+    "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    install -D qc71_laptop.ko -t $out/lib/modules/${kernel.modDirVersion}/extra
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Linux driver for QC71 laptop";
+    homepage = "https://github.com/pobrn/qc71_laptop/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ aacebedo ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/rasdaemon/default.nix b/nixpkgs/pkgs/os-specific/linux/rasdaemon/default.nix
index 22ca59bff536..cccd91fff8e1 100644
--- a/nixpkgs/pkgs/os-specific/linux/rasdaemon/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rasdaemon/default.nix
@@ -7,13 +7,13 @@
 
 stdenv.mkDerivation rec {
   pname = "rasdaemon";
-  version = "0.6.7";
+  version = "0.6.8";
 
   src = fetchFromGitHub {
     owner = "mchehab";
     repo = "rasdaemon";
     rev = "v${version}";
-    sha256 = "sha256-vyUDwqDe+HD4mka6smdQuVSM5U9uMv/TrfHkyqVJMIo=";
+    sha256 = "sha256-gcwoc9lIJyqUiCSAHf1U8geLG58CxzjMFYFl8moaA2Q=";
   };
 
   nativeBuildInputs = [ autoreconfHook ];
diff --git a/nixpkgs/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix b/nixpkgs/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix
index c68d40583968..c2ce195faf1c 100644
--- a/nixpkgs/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix
@@ -3,18 +3,13 @@
 }:
 stdenvNoCC.mkDerivation rec {
   pname = "raspberrypi-eeprom";
-  version = "2021.12.02";
-  # From 3fdf703f3f7bbe57eacceada3b558031229a34b0 Mon Sep 17 00:00:00 2001
-  # From: Peter Harper <peter.harper@raspberrypi.com>
-  # Date: Mon, 13 Dec 2021 11:56:11 +0000
-  # Subject: [PATCH] 2021-12-02: Promote the 2021-12-02 beta release to LATEST/STABLE
-  commit = "3fdf703f3f7bbe57eacceada3b558031229a34b0";
+  version = "unstable-2022-03-10";
 
   src = fetchFromGitHub {
     owner = "raspberrypi";
     repo = "rpi-eeprom";
-    rev = commit;
-    sha256 = "sha256-JTL2ziOkT0tnOrOS08ttNtxj3qegsacP73xZBVur7xM=";
+    rev = "e8927007e3800db3a72100ee6cd38b0d9b687c16";
+    hash = "sha256-/hn6l5gheh6E3zoANwU1SXYgdry2IjOT9Muw2jkrtCU=";
   };
 
   buildInputs = [ python3 ];
diff --git a/nixpkgs/pkgs/os-specific/linux/rdma-core/default.nix b/nixpkgs/pkgs/os-specific/linux/rdma-core/default.nix
index f7543291deda..aeed100fd84c 100644
--- a/nixpkgs/pkgs/os-specific/linux/rdma-core/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rdma-core/default.nix
@@ -5,13 +5,13 @@
 
 stdenv.mkDerivation rec {
   pname = "rdma-core";
-  version = "39.0";
+  version = "41.0";
 
   src = fetchFromGitHub {
     owner = "linux-rdma";
     repo = "rdma-core";
     rev = "v${version}";
-    sha256 = "sha256-7Z06bdCtv/gdZKzKfcU+JrWl4+b6b/cdKp8pMLCZZo0=";
+    sha256 = "sha256-D6pgWdJKA6ZL+atFChqSW7hI6/dYfDBRzvb6hu1wxPg=";
   };
 
   strictDeps = true;
diff --git a/nixpkgs/pkgs/os-specific/linux/read-edid/default.nix b/nixpkgs/pkgs/os-specific/linux/read-edid/default.nix
index 7f6d224ff4d5..6e040d3cbffb 100644
--- a/nixpkgs/pkgs/os-specific/linux/read-edid/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/read-edid/default.nix
@@ -9,14 +9,17 @@ stdenv.mkDerivation rec {
     sha256 = "0vqqmwsgh2gchw7qmpqk6idgzcm5rqf2fab84y7gk42v1x2diin7";
   };
 
+  patches = [ ./fno-common.patch ];
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt --replace 'COPYING' 'LICENSE'
+  '';
+
   nativeBuildInputs = [ cmake ];
   buildInputs = lib.optional stdenv.hostPlatform.isx86 libx86;
 
   cmakeFlags = [ "-DCLASSICBUILD=${if stdenv.hostPlatform.isx86 then "ON" else "OFF"}" ];
 
-  patchPhase = ''
-    substituteInPlace CMakeLists.txt --replace 'COPYING' 'LICENSE'
-  '';
 
   meta = with lib; {
     description = "Tool for reading and parsing EDID data from monitors";
diff --git a/nixpkgs/pkgs/os-specific/linux/read-edid/fno-common.patch b/nixpkgs/pkgs/os-specific/linux/read-edid/fno-common.patch
new file mode 100644
index 000000000000..336b48b66ad8
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/read-edid/fno-common.patch
@@ -0,0 +1,22 @@
+--- a/get-edid/classic.c
++++ b/get-edid/classic.c
+@@ -26,7 +26,7 @@ typedef byte* real_ptr;
+ #define dosmemput(buffer,length,offset) memcpy(offset,buffer,length)
+ 
+ #define display(...) if (quiet == 0) { fprintf(stderr, __VA_ARGS__); }
+-int quiet;
++extern int quiet;
+ 
+ real_ptr far_ptr_to_real_ptr( uint32 farptr )
+ {
+--- a/get-edid/i2c.c
++++ b/get-edid/i2c.c
+@@ -15,7 +15,7 @@
+ 
+ //Ideas (but not too much actual code) taken from i2c-tools. Thanks guys.
+ 
+-int quiet;
++extern int quiet;
+ 
+ #define display(...) if (quiet == 0) { fprintf(stderr, __VA_ARGS__); }
+ 
diff --git a/nixpkgs/pkgs/os-specific/linux/reap/default.nix b/nixpkgs/pkgs/os-specific/linux/reap/default.nix
new file mode 100644
index 000000000000..fbbabc96c781
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/reap/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "reap";
+  version = "0.3-unreleased";
+
+  src = fetchFromGitHub {
+    owner = "leahneukirchen";
+    repo = "reap";
+    rev = "0e68d09804fb9ec82af37045fb37c2ceefa391d5";
+    hash = "sha256-4Bv7stW5PKcODQanup37YbiUWrEGR6BuSFXibAHmwn0=";
+  };
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  postInstall = ''
+    install -dm755 "$out/share/licenses/reap/"
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/leahneukirchen/reap";
+    description = "run process until all its spawned processes are dead ";
+    license = with licenses; [ publicDomain ];
+    platforms = platforms.linux;
+    maintainers = [ maintainers.leahneukirchen ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/reptyr/default.nix b/nixpkgs/pkgs/os-specific/linux/reptyr/default.nix
index 0e635583d644..f02b0acd3492 100644
--- a/nixpkgs/pkgs/os-specific/linux/reptyr/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/reptyr/default.nix
@@ -1,24 +1,16 @@
-{ stdenv, lib, fetchFromGitHub, fetchpatch, python2 }:
+{ stdenv, lib, fetchFromGitHub, python2 }:
 
 stdenv.mkDerivation rec {
-  version = "0.7.0";
+  version = "0.9.0";
   pname = "reptyr";
 
   src = fetchFromGitHub {
     owner = "nelhage";
     repo = "reptyr";
     rev = "reptyr-${version}";
-    sha256 = "1hnijfz1ab34j2h2cxc3f43rmbclyihgn9x9wxa7jqqgb2xm71hj";
+    sha256 = "sha256-gM3aMEqk71RWUN1NxByd21tIzp6PmJ54Cqrh5MsjHtI=";
   };
 
-  patches = [
-    # Fix tests hanging
-    (fetchpatch {
-      url = "https://github.com/nelhage/reptyr/commit/bca3070ac0f3888b5d37ee162505be81b3b496ff.patch";
-      sha256 = "0w6rpv9k4a80q0ijzdq5hlpr37ncr284piqjv5agy8diniwlilab";
-    })
-  ];
-
   makeFlags = [ "PREFIX=" "DESTDIR=$(out)" ];
 
   checkInputs = [ (python2.withPackages (p: [ p.pexpect ])) ];
@@ -34,6 +26,7 @@ stdenv.mkDerivation rec {
       "armv6l-linux"
       "armv7l-linux"
       "aarch64-linux"
+      "riscv64-linux"
     ];
     maintainers = with lib.maintainers; [raskin];
     license = lib.licenses.mit;
diff --git a/nixpkgs/pkgs/os-specific/linux/restool/default.nix b/nixpkgs/pkgs/os-specific/linux/restool/default.nix
index 4f488c28323e..add68522e7f9 100644
--- a/nixpkgs/pkgs/os-specific/linux/restool/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/restool/default.nix
@@ -1,23 +1,32 @@
-{ stdenv, lib, fetchgit, bash, coreutils, dtc, file, gawk, gnugrep, gnused }:
+{ stdenv, lib, fetchgit, bash, coreutils, dtc, file, gawk, gnugrep, gnused, pandoc, which }:
 
 stdenv.mkDerivation rec {
   pname = "restool";
-  version = "20.12";
+  version = "2.4";
 
   src = fetchgit {
     url = "https://source.codeaurora.org/external/qoriq/qoriq-components/restool";
-    rev = "LSDK-${version}";
-    sha256 = "137xvvms3n4wwb5v2sv70vsib52s3s314306qa0mqpgxf9fb19zl";
+    rev = "abd2f5b7181db9d03db9e6ccda0194923b73e9a2";
+    sha256 = "sha256-ryTDyqSy39e8Omf7l8lK4mLWr8jccDhMVPldkVGSQVo=";
   };
 
-  nativeBuildInputs = [ file ];
-  buildInputs = [ bash coreutils dtc gawk gnugrep gnused ];
+  nativeBuildInputs = [ file pandoc ];
+  buildInputs = [ bash coreutils dtc gawk gnugrep gnused which ];
 
+  enableParallelBuilding = true;
   makeFlags = [
-    "prefix=$(out)"
+    "prefix="
+    "bindir_completion=/share/bash-completion/completions"
+    "DESTDIR=$(out)"
     "VERSION=${version}"
   ];
 
+  postPatch = ''
+    # -Werror makes this derivation fragile on compiler version upgrades, patch
+    # it out.
+    sed -i /-Werror/d Makefile
+  '';
+
   preFixup = ''
     # wrapProgram interacts badly with the ls-main tool, which relies on the
     # shell's $0 argument to figure out which operation to run (busybox-style
diff --git a/nixpkgs/pkgs/os-specific/linux/roccat-tools/default.nix b/nixpkgs/pkgs/os-specific/linux/roccat-tools/default.nix
index 1eba2511b987..bea79c2007db 100644
--- a/nixpkgs/pkgs/os-specific/linux/roccat-tools/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/roccat-tools/default.nix
@@ -31,7 +31,14 @@ stdenv.mkDerivation rec {
     "-DLIBDIR=lib"
   ];
 
-  NIX_CFLAGS_COMPILE = [ "-I${harfbuzz.dev}/include/harfbuzz" ];
+  NIX_CFLAGS_COMPILE = [
+    "-I${harfbuzz.dev}/include/harfbuzz"
+
+    # Workaround build failure on -fno-common toolchains:
+    #   ld: ryos_talk.c.o:(.bss+0x0): multiple definition of `RyosWriteCheckWait';
+    #     ryos_custom_lights.c.o:(.bss+0x0): first defined here
+    "-fcommon"
+  ];
 
   meta = {
     description = "Tools to configure ROCCAT devices";
diff --git a/nixpkgs/pkgs/os-specific/linux/rt-tests/default.nix b/nixpkgs/pkgs/os-specific/linux/rt-tests/default.nix
new file mode 100644
index 000000000000..67000776256c
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/rt-tests/default.nix
@@ -0,0 +1,34 @@
+{ stdenv
+, lib
+, makeWrapper
+, fetchurl
+, numactl
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rt-tests";
+  version = "2.4";
+
+  src = fetchurl {
+    url = "https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/snapshot/${pname}-${version}.tar.gz";
+    sha256 = "sha256-yuSfeYTaCZ0F1GXQkDnH8PBvyzR2w/XDitN8csHB9xE=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ numactl python3 ];
+
+  makeFlags = [ "prefix=$(out)" "DESTDIR=" "PYLIB=$(out)/${python3.sitePackages}" ];
+
+  postInstall = ''
+    wrapProgram "$out/bin/determine_maximum_mpps.sh" --prefix PATH : $out/bin
+  '';
+
+  meta = with lib; {
+    homepage = "https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git";
+    description = "Suite of real-time tests - cyclictest, hwlatdetect, pip_stress, pi_stress, pmqtest, ptsematest, rt-migrate-test, sendme, signaltest, sigwaittest, svsematest";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ poelzi ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/rtl8188eus-aircrack/default.nix b/nixpkgs/pkgs/os-specific/linux/rtl8188eus-aircrack/default.nix
index f9f3ce47cb32..0f2e00c8382f 100644
--- a/nixpkgs/pkgs/os-specific/linux/rtl8188eus-aircrack/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rtl8188eus-aircrack/default.nix
@@ -1,22 +1,16 @@
-{ lib, stdenv, fetchFromGitHub, kernel, bc }:
+{ lib, stdenv, fetchFromGitHub, kernel, bc, fetchpatch }:
 
 stdenv.mkDerivation {
   pname = "rtl8188eus-aircrack";
-  version = "${kernel.version}-unstable-2021-05-04";
+  version = "${kernel.version}-unstable-2022-03-19";
 
   src = fetchFromGitHub {
     owner = "aircrack-ng";
     repo = "rtl8188eus";
-    rev = "6146193406b62e942d13d4d43580ed94ac70c218";
-    sha256 = "sha256-85STELbFB7QmTaM8GvJNlWvAg6KPAXeYRiMb4cGA6RY=";
+    rev = "0958f294f90b49d6bad4972b14f90676e5d858d3";
+    sha256 = "sha256-dkCcwvOLxqU1IZ/OXTp67akjWgsaH1Cq4N8d9slMRI8=";
   };
 
-  nativeBuildInputs = [ bc ];
-
-  buildInputs = kernel.moduleBuildDependencies;
-
-  hardeningDisable = [ "pic" ];
-
   prePatch = ''
     substituteInPlace ./Makefile \
       --replace /lib/modules/ "${kernel.dev}/lib/modules/" \
@@ -25,17 +19,30 @@ stdenv.mkDerivation {
       --replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
   '';
 
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/aircrack-ng/rtl8188eus/commit/daa3a2e12290050be3af956915939a55aed50d5f.patch";
+      hash = "sha256-VsvaAhO74LzqUxbmdDT9qwVl6Y9lXfGfrHHK3SbnOVA=";
+    })
+  ];
+
+  hardeningDisable = [ "pic" ];
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ bc ];
+
+  buildInputs = kernel.moduleBuildDependencies;
+
   preInstall = ''
     mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
   '';
 
-  enableParallelBuilding = true;
-
   meta = with lib; {
     description = "RealTek RTL8188eus WiFi driver with monitor mode & frame injection support";
     homepage = "https://github.com/aircrack-ng/rtl8188eus";
     license = licenses.gpl2Only;
     maintainers = with maintainers; [ fortuneteller2k ];
-    broken = kernel.kernelAtLeast "5.15" || kernel.isHardened;
+    broken = (lib.versionAtLeast kernel.version "5.17") || ((lib.versions.majorMinor kernel.version) == "5.4" && kernel.isHardened);
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/rtl8189es/default.nix b/nixpkgs/pkgs/os-specific/linux/rtl8189es/default.nix
index c1032473db10..a755404e6e5d 100644
--- a/nixpkgs/pkgs/os-specific/linux/rtl8189es/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rtl8189es/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   makeFlags = kernel.makeFlags ++ [
     "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
     ("CONFIG_PLATFORM_I386_PC=" + (if (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) then "y" else "n"))
-    ("CONFIG_PLATFORM_ARM_RPI=" + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n"))
+    ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n"))
   ];
 
   preInstall = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/rtl8189fs/default.nix b/nixpkgs/pkgs/os-specific/linux/rtl8189fs/default.nix
new file mode 100644
index 000000000000..c1fe5e9733fa
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/rtl8189fs/default.nix
@@ -0,0 +1,22 @@
+{ lib, kernel, rtl8189es, fetchFromGitHub }:
+
+# rtl8189fs is a branch of the rtl8189es driver
+rtl8189es.overrideAttrs (drv: rec {
+  name = "rtl8189fs-${kernel.version}-${version}";
+  version = "2022-05-20";
+
+  src = fetchFromGitHub {
+    owner = "jwrdegoede";
+    repo = "rtl8189ES_linux";
+    rev = "71500c28164369800041d1716ac513457179ce93";
+    sha256 = "sha256-JTv+ssSv5toNcZ5wR6p0Cywdk87z9Bdq0ftU0ekr/98=";
+  };
+
+  meta = with lib; {
+    description = "Driver for Realtek rtl8189fs";
+    homepage = "https://github.com/jwrdegoede/rtl8189ES_linux/tree/rtl8189fs";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ puffnfresh ];
+  };
+})
diff --git a/nixpkgs/pkgs/os-specific/linux/rtl8192eu/default.nix b/nixpkgs/pkgs/os-specific/linux/rtl8192eu/default.nix
index de4dd52e511c..c91353e465e3 100644
--- a/nixpkgs/pkgs/os-specific/linux/rtl8192eu/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rtl8192eu/default.nix
@@ -6,13 +6,13 @@ let modDestDir = "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/net/wi
 
 in stdenv.mkDerivation rec {
   pname = "rtl8192eu";
-  version = "${kernel.version}-4.4.1.20220313";
+  version = "${kernel.version}-4.4.1.20220614";
 
   src = fetchFromGitHub {
     owner = "Mange";
     repo = "rtl8192eu-linux-driver";
-    rev = "e0f967cea1d0037c730246c572f7fef000865ff7";
-    sha256 = "sha256-Wgp1MZ/z8AxbZPYsmR6t7Q4nsL0TFEqTEsrkkWPI6gI=";
+    rev = "6ba1f320963376f15ea216238c0b62ff3e71fa82";
+    sha256 = "sha256-c5swRxSjWT1tCcR7tfFKdAdVVmAEYgMZuOwUxGYYESI=";
   };
 
   hardeningDisable = [ "pic" ];
@@ -38,7 +38,7 @@ in stdenv.mkDerivation rec {
     homepage = "https://github.com/Mange/rtl8192eu-linux-driver";
     license = licenses.gpl2Only;
     platforms = platforms.linux;
-    broken = stdenv.hostPlatform.isAarch64;
+    broken = stdenv.hostPlatform.isAarch64 || kernel.kernelAtLeast "5.18";
     maintainers = with maintainers; [ troydm ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/rtl8723bs/default.nix b/nixpkgs/pkgs/os-specific/linux/rtl8723bs/default.nix
index a862b3517160..b6ab883ca751 100644
--- a/nixpkgs/pkgs/os-specific/linux/rtl8723bs/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rtl8723bs/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     homepage = "https://github.com/hadess/rtl8723bs";
     license = lib.licenses.gpl2;
     platforms = lib.platforms.linux;
-    broken = (! versionOlder kernel.version "4.12"); # Now in kernel staging drivers
+    broken = versionAtLeast kernel.version "4.12"; # Now in kernel staging drivers
     maintainers = with maintainers; [ elitak ];
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/rtl8812au/default.nix b/nixpkgs/pkgs/os-specific/linux/rtl8812au/default.nix
index b385b9a27da0..30f04c1eb8b3 100644
--- a/nixpkgs/pkgs/os-specific/linux/rtl8812au/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rtl8812au/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     "ARCH=${stdenv.hostPlatform.linuxArch}"
     "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
     ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n"))
-    ("CONFIG_PLATFORM_ARM_RPI=" + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n"))
+    ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n"))
   ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
     "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
   ];
diff --git a/nixpkgs/pkgs/os-specific/linux/rtl8814au/default.nix b/nixpkgs/pkgs/os-specific/linux/rtl8814au/default.nix
index dce8733c0cca..cab36054f516 100644
--- a/nixpkgs/pkgs/os-specific/linux/rtl8814au/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rtl8814au/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation {
   pname = "rtl8814au";
-  version = "${kernel.version}-unstable-2022-02-21";
+  version = "${kernel.version}-unstable-2022-05-23";
 
   src = fetchFromGitHub {
     owner = "morrownr";
     repo = "8814au";
-    rev = "a538e3878c4b7b0b012f2d2fe7804390caaebd90";
-    sha256 = "sha256-xBGbcy/WonFrNflMlFCD/JQOFKhPrv0J3j2XcXWc6hk=";
+    rev = "687f05c73e22dc14d5f24f2bb92f2ecac3cc71d5";
+    sha256 = "08znnihk9rdrwgyzazxqcrzwdjnm5q8ah92bfb552wjv11r87zv1";
   };
 
   nativeBuildInputs = kernel.moduleBuildDependencies;
diff --git a/nixpkgs/pkgs/os-specific/linux/rtl8821ce/default.nix b/nixpkgs/pkgs/os-specific/linux/rtl8821ce/default.nix
index 039d4b3fb7bb..f841ba471a42 100644
--- a/nixpkgs/pkgs/os-specific/linux/rtl8821ce/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rtl8821ce/default.nix
@@ -8,21 +8,15 @@
 
 stdenv.mkDerivation rec {
   pname = "rtl8821ce";
-  version = "${kernel.version}-unstable-2021-11-19";
+  version = "${kernel.version}-unstable-2022-06-01";
 
   src = fetchFromGitHub {
     owner = "tomaspinho";
     repo = "rtl8821ce";
-    rev = "ca204c60724d23ab10244f920d4e50759ed1affb";
-    sha256 = "18ma8a8h1l90dss0k6al7q6plwr57jc9g67p22g9917k1jfbhm97";
+    rev = "be733dc86781c68571650b395dd0fa6b53c0a039";
+    sha256 = "sha256-4PgISOjCSSGymz96VwE4jzcUiOEO+Ocuk2kJVIA+TQM=";
   };
 
-  # Fixes the build on kernel >= 5.17. Can be removed once https://github.com/tomaspinho/rtl8821ce/pull/267 is merged
-  patches = [(fetchpatch {
-    url = "https://github.com/tomaspinho/rtl8821ce/commit/7b9e55df64b10fed785f22df9f36ed4a30b59d0e.patch";
-    sha256 = "sha256-mpAWOG1aXsklGuDbrRB9Vd36mgeCdctKQaWuuoqEEp0=";
-  })];
-
   hardeningDisable = [ "pic" ];
 
   nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
diff --git a/nixpkgs/pkgs/os-specific/linux/rtl8821cu/default.nix b/nixpkgs/pkgs/os-specific/linux/rtl8821cu/default.nix
index a3d767d2ee67..3af4fee9eda2 100644
--- a/nixpkgs/pkgs/os-specific/linux/rtl8821cu/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rtl8821cu/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "rtl8821cu";
-  version = "${kernel.version}-unstable-2022-03-08";
+  version = "${kernel.version}-unstable-2022-05-07";
 
   src = fetchFromGitHub {
     owner = "morrownr";
     repo = "8821cu-20210118";
-    rev = "4bdd7c8668562e43564cd5d786055633e591ad4d";
-    sha256 = "sha256-dfvDpjsra/nHwIGywOkZICTEP/Ex7ooH4zzkXqAaDkI=";
+    rev = "e3cf788e1dddaba3273190755ce424f93fe593e4";
+    hash = "sha256-VUZU/oFSaxewy/BF/2k4OssAi4AWSWweqXYZPHmsQvY=";
   };
 
   hardeningDisable = [ "pic" ];
diff --git a/nixpkgs/pkgs/os-specific/linux/rtl88x2bu/default.nix b/nixpkgs/pkgs/os-specific/linux/rtl88x2bu/default.nix
index e092d145abd2..cd13c48779ea 100644
--- a/nixpkgs/pkgs/os-specific/linux/rtl88x2bu/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rtl88x2bu/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "rtl88x2bu";
-  version = "${kernel.version}-unstable-2022-02-22";
+  version = "${kernel.version}-unstable-2022-05-23";
 
   src = fetchFromGitHub {
     owner = "morrownr";
     repo = "88x2bu-20210702";
-    rev = "6a5b7f005c071ffa179b6183ee034c98ed30db80";
-    sha256 = "sha256-BqTyJpICW3D4EfHHoN5svasteJnunu2Uz449u/CmNE0=";
+    rev = "3fbe980a9a8cee223e4671449128212cf7514b3c";
+    sha256 = "1p4bp8g94ny385nl3m2ca824dbm6lhjvh7s5rqyzk220il2sa0nd";
   };
 
   hardeningDisable = [ "pic" ];
diff --git a/nixpkgs/pkgs/os-specific/linux/rtl88xxau-aircrack/default.nix b/nixpkgs/pkgs/os-specific/linux/rtl88xxau-aircrack/default.nix
index f975cc2b420b..de5c79a56013 100644
--- a/nixpkgs/pkgs/os-specific/linux/rtl88xxau-aircrack/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rtl88xxau-aircrack/default.nix
@@ -40,5 +40,6 @@ stdenv.mkDerivation rec {
     license = licenses.gpl2Only;
     maintainers = [ maintainers.jethro ];
     platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
+    broken = kernel.kernelAtLeast "5.18";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/rtw88/default.nix b/nixpkgs/pkgs/os-specific/linux/rtw88/default.nix
index 529ee621892b..bbff4f6e4a71 100644
--- a/nixpkgs/pkgs/os-specific/linux/rtw88/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/rtw88/default.nix
@@ -5,13 +5,13 @@ let
 in
 stdenv.mkDerivation {
   pname = "rtw88";
-  version = "unstable-2021-04-19";
+  version = "unstable-2022-06-03";
 
   src = fetchFromGitHub {
     owner = "lwfinger";
     repo = "rtw88";
-    rev = "0f3cc6a5973bc386d9cb542fc85a6ba027edff5d";
-    hash = "sha256-PRzWXC1lre8gt1GfVdnaG836f5YK57P9a8tG20yef0w=";
+    rev = "03da251c76ea1005b42625825c39181e12d75693";
+    sha256 = "0l5ysp4x5wzrn48sfjv3rciqhq5ldcmk86b9x6j9775zjj7yw8hw";
   };
 
   nativeBuildInputs = kernel.moduleBuildDependencies;
@@ -33,9 +33,9 @@ stdenv.mkDerivation {
     description = "The newest Realtek rtlwifi codes";
     homepage = "https://github.com/lwfinger/rtw88";
     license = with licenses; [ bsd3 gpl2Only ];
-    maintainers = with maintainers; [ tvorog ];
+    maintainers = with maintainers; [ tvorog atila ];
     platforms = platforms.linux;
-    broken = kernel.kernelOlder "4.14" || kernel.kernelAtLeast "5.14";
+    broken = kernel.kernelOlder "4.14";
     priority = -1;
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/ryzenadj/default.nix b/nixpkgs/pkgs/os-specific/linux/ryzenadj/default.nix
index 3013df7e2913..c7d9c1f8fb96 100644
--- a/nixpkgs/pkgs/os-specific/linux/ryzenadj/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/ryzenadj/default.nix
@@ -1,13 +1,13 @@
 { lib, stdenv, fetchFromGitHub, pciutils, cmake }:
 stdenv.mkDerivation rec {
   pname = "ryzenadj";
-  version = "0.9.0";
+  version = "0.10.0";
 
   src = fetchFromGitHub {
     owner = "FlyGoat";
     repo = "RyzenAdj";
     rev = "v${version}";
-    sha256 = "sha256-RoKRqqIVY9zjyXzGxHo+J4OV7cKc7CkqsdbpreB7EHc=";
+    sha256 = "sha256-SEM+HN5ecxp64jZTOouWuFO1HICtc6M+GitnS+bdfb4=";
   };
 
   nativeBuildInputs = [ pciutils cmake ];
diff --git a/nixpkgs/pkgs/os-specific/linux/s6-linux-init/default.nix b/nixpkgs/pkgs/os-specific/linux/s6-linux-init/default.nix
index ab9843d07f1f..27773a90e283 100644
--- a/nixpkgs/pkgs/os-specific/linux/s6-linux-init/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/s6-linux-init/default.nix
@@ -4,8 +4,8 @@ with skawarePackages;
 
 buildPackage {
   pname = "s6-linux-init";
-  version = "1.0.7.0";
-  sha256 = "16bzijmzxi91ycayhpn398yjgag3c5pnlghs6sqdmzlf2fiirif5";
+  version = "1.0.8.0";
+  sha256 = "sha256-kgVaeWTPZmBAZq2WSiwjku58XmSCG+AxRsE0Hg2MPcY=";
 
   description = "A set of minimalistic tools used to create a s6-based init system, including a /sbin/init binary, on a Linux kernel";
   platforms = lib.platforms.linux;
diff --git a/nixpkgs/pkgs/os-specific/linux/s6-linux-utils/default.nix b/nixpkgs/pkgs/os-specific/linux/s6-linux-utils/default.nix
index 753a77aa1c72..98199516a04e 100644
--- a/nixpkgs/pkgs/os-specific/linux/s6-linux-utils/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/s6-linux-utils/default.nix
@@ -4,8 +4,8 @@ with skawarePackages;
 
 buildPackage {
   pname = "s6-linux-utils";
-  version = "2.5.1.7";
-  sha256 = "1n6zmnczbybwcchkhg5zqixz8mdk5bfn0sxq0kxifgpi9ggw5a46";
+  version = "2.6.0.0";
+  sha256 = "sha256-bHEyc0oMgocALuaRDEafF1qX12aoAjwMM6+LqSZD7Vk=";
 
   description = "A set of minimalistic Linux-specific system utilities";
   platforms = lib.platforms.linux;
@@ -24,7 +24,7 @@ buildPackage {
 
   postInstall = ''
     # remove all s6 executables from build directory
-    rm $(find -name "s6-*" -type f -mindepth 1 -maxdepth 1 -executable)
+    rm $(find -name "s6-*" -type f -mindepth 1 -maxdepth 1 -executable) rngseed
 
     mv doc $doc/share/doc/s6-linux-utils/html
   '';
diff --git a/nixpkgs/pkgs/os-specific/linux/sasutils/default.nix b/nixpkgs/pkgs/os-specific/linux/sasutils/default.nix
new file mode 100644
index 000000000000..fd1a6f0b049b
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/sasutils/default.nix
@@ -0,0 +1,28 @@
+{ lib, python3Packages, fetchFromGitHub, installShellFiles, sg3_utils }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "sasutils";
+  version = "0.3.12";
+
+  src = fetchFromGitHub {
+    owner = "stanford-rc";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0kh5pcc2shdmrvqqi2y1zamzsfvk56pqgwqgqhjfz4r6yfpm04wl";
+  };
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  propagatedBuildInputs = [ sg3_utils ];
+
+  postInstall = ''
+    installManPage doc/man/man1/*.1
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/stanford-rc/sasutils";
+    description = "A set of command-line tools to ease the administration of Serial Attached SCSI (SAS) fabrics";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ aij ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/sch_cake/default.nix b/nixpkgs/pkgs/os-specific/linux/sch_cake/default.nix
index facf690a9bd4..f93713344efb 100644
--- a/nixpkgs/pkgs/os-specific/linux/sch_cake/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/sch_cake/default.nix
@@ -1,7 +1,5 @@
 { stdenv, lib, fetchFromGitHub, kernel }:
 
-assert lib.versionAtLeast kernel.version "4.4";
-
 stdenv.mkDerivation {
   pname = "sch_cake";
   version = "unstable-2017-07-16";
@@ -31,6 +29,6 @@ stdenv.mkDerivation {
     license = with licenses; [ bsd3 gpl2 ];
     maintainers = with maintainers; [ fpletz ];
     platforms = platforms.linux;
-    broken = !lib.versionOlder kernel.version "4.13";
+    broken = lib.versionAtLeast kernel.version "4.13";
   };
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/sdnotify-wrapper/default.nix b/nixpkgs/pkgs/os-specific/linux/sdnotify-wrapper/default.nix
index cf09f0476767..b4b6a7f42a7e 100644
--- a/nixpkgs/pkgs/os-specific/linux/sdnotify-wrapper/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/sdnotify-wrapper/default.nix
@@ -1,4 +1,4 @@
-{ lib, runCommandCC, skawarePackages }:
+{ stdenv, lib, runCommandCC, skawarePackages }:
 
 with skawarePackages;
 
@@ -14,7 +14,7 @@ in runCommandCC "sdnotify-wrapper" {
    meta = {
      homepage = "https://skarnet.org/software/misc/sdnotify-wrapper.c";
      description = "Use systemd sd_notify without having to link against libsystemd";
-     platforms = lib.platforms.all;
+     platforms = lib.platforms.linux;
      license = lib.licenses.isc;
      maintainers = with lib.maintainers; [ Profpatsch ];
    };
diff --git a/nixpkgs/pkgs/os-specific/linux/sgx/psw/default.nix b/nixpkgs/pkgs/os-specific/linux/sgx/psw/default.nix
index b418d5c18225..2077d23bc9d7 100644
--- a/nixpkgs/pkgs/os-specific/linux/sgx/psw/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/sgx/psw/default.nix
@@ -28,11 +28,11 @@ stdenv.mkDerivation rec {
         hash = "sha256-JriA9UGYFkAPuCtRizk8RMM1YOYGR/eO9ILnx47A40s=";
       };
       dcap = rec {
-        version = "1.12.1";
+        version = "1.13";
         filename = "prebuilt_dcap_${version}.tar.gz";
         prebuilt = fetchurl {
           url = "https://download.01.org/intel-sgx/sgx-dcap/${version}/linux/${filename}";
-          hash = "sha256-V/XHva9Sq3P36xSW+Sd0G6Dnk4H0ANO1Ns/u+FI1eGI=";
+          hash = "sha256-0kD6hxN8qZ/7/H99aboQx7Qg7ewmYPEexoU6nqczAik=";
         };
       };
     in
@@ -64,19 +64,6 @@ stdenv.mkDerivation rec {
   ];
 
   postPatch = ''
-    # https://github.com/intel/linux-sgx/pull/730
-    substituteInPlace buildenv.mk --replace '/bin/cp' 'cp'
-    substituteInPlace psw/ae/aesm_service/source/CMakeLists.txt \
-      --replace '/usr/bin/getconf' 'getconf'
-
-    # https://github.com/intel/SGXDataCenterAttestationPrimitives/pull/205
-    substituteInPlace ./external/dcap_source/QuoteGeneration/buildenv.mk \
-      --replace '/bin/cp' 'cp'
-    substituteInPlace external/dcap_source/tools/SGXPlatformRegistration/Makefile \
-      --replace '/bin/cp' 'cp'
-    substituteInPlace external/dcap_source/tools/SGXPlatformRegistration/buildenv.mk \
-      --replace '/bin/cp' 'cp'
-
     patchShebangs \
       linux/installer/bin/build-installpkg.sh \
       linux/installer/common/psw/createTarball.sh \
@@ -135,7 +122,7 @@ stdenv.mkDerivation rec {
     mkdir $out/bin
     makeWrapper $out/aesm/aesm_service $out/bin/aesm_service \
       --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ protobuf ]}:$out/aesm \
-      --run "cd $out/aesm"
+      --chdir "$out/aesm"
 
     # Make sure we didn't forget to handle any files
     rmdir $sgxPswDir || (echo "Error: The directory $installDir still contains unhandled files: $(ls -A $installDir)" >&2 && exit 1)
@@ -166,14 +153,6 @@ stdenv.mkDerivation rec {
     substituteInPlace $out/lib/systemd/system/remount-dev-exec.service \
       --replace '/bin/mount' \
                 "${util-linux}/bin/mount"
-
-    header "Fixing linksgx.sh"
-    # https://github.com/intel/linux-sgx/pull/736
-    substituteInPlace $out/aesm/linksgx.sh \
-      --replace '/usr/bin/getent' \
-                '${glibc.bin}/bin/getent' \
-      --replace '/usr/sbin/usermod' \
-                '${shadow}/bin/usermod'
   '';
 
   passthru.tests = {
diff --git a/nixpkgs/pkgs/os-specific/linux/sgx/samples/default.nix b/nixpkgs/pkgs/os-specific/linux/sgx/samples/default.nix
index f9c5ae450545..2afd62de75d4 100644
--- a/nixpkgs/pkgs/os-specific/linux/sgx/samples/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/sgx/samples/default.nix
@@ -41,7 +41,7 @@ let
       install *.so $out/lib
 
       wrapProgram "$out/bin/app" \
-        --run "cd $out/lib" \
+        --chdir "$out/lib" \
         ${lib.optionalString (!isSimulation)
         ''--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ sgx-psw ]}"''}
 
@@ -76,7 +76,7 @@ in
 
       for bin in $out/bin/*; do
         wrapProgram $bin \
-          --run "cd $out/lib" \
+          --chdir "$out/lib" \
           ${lib.optionalString (!isSimulation)
           ''--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ sgx-psw ]}"''}
       done
diff --git a/nixpkgs/pkgs/os-specific/linux/sgx/sdk/default.nix b/nixpkgs/pkgs/os-specific/linux/sgx/sdk/default.nix
index baa4ad2a3375..977139406fe9 100644
--- a/nixpkgs/pkgs/os-specific/linux/sgx/sdk/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/sgx/sdk/default.nix
@@ -29,15 +29,15 @@
 stdenv.mkDerivation rec {
   pname = "sgx-sdk";
   # Version as given in se_version.h
-  version = "2.15.101.1";
+  version = "2.16.100.4";
   # Version as used in the Git tag
-  versionTag = "2.15.1";
+  versionTag = "2.16";
 
   src = fetchFromGitHub {
     owner = "intel";
     repo = "linux-sgx";
     rev = "sgx_${versionTag}";
-    hash = "sha256-e11COTR5eDPMB81aPRKatvIkAOeX+OZgnvn2utiv78M=";
+    hash = "sha256-qgXuJJWiqmcU11umCsE3DnlK4VryuTDAsNf53YPw6UY=";
     fetchSubmodules = true;
   };
 
@@ -53,18 +53,9 @@ stdenv.mkDerivation rec {
       url = "https://github.com/intel/linux-sgx/commit/254b58f922a6bd49c308a4f47f05f525305bd760.patch";
       sha256 = "sha256-sHU++K7NJ+PdITx3y0PwstA9MVh10rj2vrLn01N9F4w=";
     })
-    # Commit to add missing sgx_ippcp.h not yet part of this release
-    (fetchpatch {
-      name = "add-missing-sgx_ippcp-header.patch";
-      url = "https://github.com/intel/linux-sgx/commit/51d1087b707a47e18588da7bae23e5f686d44be6.patch";
-      sha256 = "sha256-RZC14H1oEuGp0zn8CySDPy1KNqP/POqb+KMYoQt2A7M=";
-    })
   ];
 
   postPatch = ''
-    # https://github.com/intel/linux-sgx/pull/730
-    substituteInPlace buildenv.mk --replace '/bin/cp' 'cp'
-
     patchShebangs linux/installer/bin/build-installpkg.sh \
       linux/installer/common/sdk/createTarball.sh \
       linux/installer/common/sdk/install.sh
diff --git a/nixpkgs/pkgs/os-specific/linux/sgx/ssl/default.nix b/nixpkgs/pkgs/os-specific/linux/sgx/ssl/default.nix
index c54eda19d6a2..f3f6ce485063 100644
--- a/nixpkgs/pkgs/os-specific/linux/sgx/ssl/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/sgx/ssl/default.nix
@@ -14,12 +14,12 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "sgx-ssl" + lib.optionalString debug "-debug";
-  version = "lin_${sgxVersion}_${opensslVersion}";
+  version = "${sgxVersion}_${opensslVersion}";
 
   src = fetchFromGitHub {
     owner = "intel";
     repo = "intel-sgx-ssl";
-    rev = version;
+    rev = "lin_${sgxVersion}_${opensslVersion}";
     hash = "sha256-ibPXs90ni2fkxJ09fNO6wWVpfCFdko6MjBFkEsyIih8=";
   };
 
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     perl
     sgx-sdk
-    stdenv.glibc
+    stdenv.cc.libc
     which
   ];
 
diff --git a/nixpkgs/pkgs/os-specific/linux/shadow/default.nix b/nixpkgs/pkgs/os-specific/linux/shadow/default.nix
index 2e4ae1649ea8..5537f9f6aacb 100644
--- a/nixpkgs/pkgs/os-specific/linux/shadow/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/shadow/default.nix
@@ -19,13 +19,13 @@ in
 
 stdenv.mkDerivation rec {
   pname = "shadow";
-  version = "4.8.1";
+  version = "4.11.1";
 
   src = fetchFromGitHub {
     owner = "shadow-maint";
     repo = "shadow";
-    rev = version;
-    sha256 = "13407r6qwss00504qy740jghb2dzd561la7dhp47rg8w3g8jarpn";
+    rev = "v${version}";
+    sha256 = "sha256-PxLX5V0t18JftT5wT41krNv18Ew7Kz3MfZkOi/80ODA=";
   };
 
   buildInputs = lib.optional (pam != null && stdenv.isLinux) pam;
diff --git a/nixpkgs/pkgs/os-specific/linux/speedometer/default.nix b/nixpkgs/pkgs/os-specific/linux/speedometer/default.nix
deleted file mode 100644
index 2802fddf8ce5..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/speedometer/default.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ lib, fetchurl, python2Packages }:
-
-python2Packages.buildPythonApplication rec {
-  pname = "speedometer";
-  version = "2.8";
-
-  src = fetchurl {
-    url = "https://excess.org/speedometer/speedometer-${version}.tar.gz";
-    sha256 = "060bikv3gwr203jbdmvawsfhc0yq0bg1m42dk8czx1nqvwvgv6fm";
-  };
-
-  propagatedBuildInputs = [ python2Packages.urwid ];
-
-  postPatch = ''
-    sed -i "/'entry_points': {/d" setup.py
-    sed -i "/'console_scripts': \['speedometer = speedometer:console'\],},/d" setup.py
-  '';
-
-  meta = with lib; {
-    description = "Measure and display the rate of data across a network connection or data being stored in a file";
-    homepage = "https://excess.org/speedometer/";
-    license = licenses.lgpl21Plus;
-    platforms = platforms.linux;
-    maintainers = with maintainers; [ Baughn ];
-  };
-}
diff --git a/nixpkgs/pkgs/os-specific/linux/sssd/default.nix b/nixpkgs/pkgs/os-specific/linux/sssd/default.nix
index 22602d12bd5a..054d0c9fa1a4 100644
--- a/nixpkgs/pkgs/os-specific/linux/sssd/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/sssd/default.nix
@@ -1,9 +1,9 @@
-{ lib, stdenv, fetchFromGitHub, autoreconfHook, glibc, augeas, dnsutils, c-ares, curl,
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, makeWrapper, glibc, augeas, dnsutils, c-ares, curl,
   cyrus_sasl, ding-libs, libnl, libunistring, nss, samba, nfs-utils, doxygen,
   python3, pam, popt, talloc, tdb, tevent, pkg-config, ldb, openldap,
   pcre2, libkrb5, cifs-utils, glib, keyutils, dbus, fakeroot, libxslt, libxml2,
   libuuid, systemd, nspr, check, cmocka, uid_wrapper, p11-kit,
-  nss_wrapper, ncurses, Po4a, http-parser, jansson,
+  nss_wrapper, ncurses, Po4a, http-parser, jansson, jose,
   docbook_xsl, docbook_xml_dtd_44,
   nixosTests,
   withSudo ? false }:
@@ -13,13 +13,13 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "sssd";
-  version = "2.6.3";
+  version = "2.7.3";
 
   src = fetchFromGitHub {
     owner = "SSSD";
     repo = pname;
     rev = version;
-    sha256 = "sha256-m0ArsN9xopfBPnHTiPDEOPuhQHQ2zoICGwVM7P05k3U=";
+    sha256 = "sha256-mdgBRFqIT5SvDTeNiv1IbTyd9tcu8YJVfbw49gR6bKI=";
   };
 
   postPatch = ''
@@ -54,13 +54,13 @@ stdenv.mkDerivation rec {
   '';
 
   enableParallelBuilding = true;
-  nativeBuildInputs = [ autoreconfHook pkg-config doxygen ];
+  nativeBuildInputs = [ autoreconfHook makeWrapper pkg-config doxygen ];
   buildInputs = [ augeas dnsutils c-ares curl cyrus_sasl ding-libs libnl libunistring nss
                   samba nfs-utils p11-kit python3 popt
                   talloc tdb tevent ldb pam openldap pcre2 libkrb5
                   cifs-utils glib keyutils dbus fakeroot libxslt libxml2
                   libuuid python3.pkgs.ldap systemd nspr check cmocka uid_wrapper
-                  nss_wrapper ncurses Po4a http-parser jansson ];
+                  nss_wrapper ncurses Po4a http-parser jansson jose ];
 
   makeFlags = [
     "SGML_CATALOG_FILES=${docbookFiles}"
@@ -87,6 +87,11 @@ stdenv.mkDerivation rec {
     rm -f "$out"/modules/ldb/memberof.la
     find "$out" -depth -type d -exec rmdir --ignore-fail-on-non-empty {} \;
   '';
+  postFixup = ''
+    for f in $out/bin/sss{ctl,_cache,_debuglevel,_override,_seed}; do
+      wrapProgram $f --prefix LDB_MODULES_PATH : $out/modules/ldb
+    done
+  '';
 
   passthru.tests = { inherit (nixosTests) sssd sssd-ldap; };
 
diff --git a/nixpkgs/pkgs/os-specific/linux/sysdig/default.nix b/nixpkgs/pkgs/os-specific/linux/sysdig/default.nix
index 39c07f48a29a..4f5f3b585dad 100644
--- a/nixpkgs/pkgs/os-specific/linux/sysdig/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/sysdig/default.nix
@@ -1,27 +1,50 @@
 { lib, stdenv, fetchFromGitHub, fetchpatch, cmake, kernel, installShellFiles, pkg-config
 , luajit, ncurses, perl, jsoncpp, libb64, openssl, curl, jq, gcc, elfutils, tbb, protobuf, grpc
+, libyamlcpp, nlohmann_json
 }:
 
 with lib;
 let
   # Compare with https://github.com/draios/sysdig/blob/dev/cmake/modules/falcosecurity-libs.cmake
-  libsRev = "2160111cd088aea9ae2235d3385ecb0b1ab6623c";
-  libsSha256 = "sha256-TOuxXtrxujyAjzAtlX3/eCfM16mwxnmZ6Wg44SG0dTs=";
+  libsRev = "e5c53d648f3c4694385bbe488e7d47eaa36c229a";
+  libsSha256 = "sha256-pG10y5PpDqaF/cq8oAvax5B/ls2UTRQd7tCfBjWVf0U=";
+
+  # Compare with https://github.com/falcosecurity/libs/blob/master/cmake/modules/valijson.cmake#L17
+  valijson = fetchFromGitHub {
+    owner = "tristanpenman";
+    repo = "valijson";
+    rev = "v0.6";
+    sha256 = "sha256-ZD19Q2MxMQd3yEKbY90GFCrerie5/jzgO8do4JQDoKM=";
+  };
+
 in
 stdenv.mkDerivation rec {
   pname = "sysdig";
-  version = "0.28.0";
+  version = "0.29.3";
 
   src = fetchFromGitHub {
     owner = "draios";
     repo = "sysdig";
     rev = version;
-    sha256 = "sha256-oE3vCmOw+gcmvGqj7Xk5injpNC/YThckJMNg5XRFhME=";
+    sha256 = "sha256-dMLeroOd9CgvmgQdPfX8oBxQSyksZi/hP4vO03JhlF0=";
   };
 
   nativeBuildInputs = [ cmake perl installShellFiles pkg-config ];
   buildInputs = [
-    luajit ncurses jsoncpp libb64 openssl curl jq gcc elfutils tbb protobuf grpc
+    luajit
+    ncurses
+    libb64
+    openssl
+    curl
+    jq
+    gcc
+    elfutils
+    tbb
+    protobuf
+    grpc
+    libyamlcpp
+    jsoncpp
+    nlohmann_json
   ] ++ optionals (kernel != null) kernel.moduleBuildDependencies;
 
   hardeningDisable = [ "pic" ];
@@ -34,7 +57,7 @@ stdenv.mkDerivation rec {
       sha256 = libsSha256;
     }} libs
     chmod -R +w libs
-    cmakeFlagsArray+=("-DFALCOSECURITY_LIBS_SOURCE_DIR=$(pwd)/libs")
+    cmakeFlagsArray+=("-DFALCOSECURITY_LIBS_SOURCE_DIR=$(pwd)/libs" "-DVALIJSON_INCLUDE=${valijson}/include")
   '';
 
   cmakeFlags = [
@@ -47,6 +70,10 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg -DluaL_getn(L,i)=((int)lua_objlen(L,i))";
 
   preConfigure = ''
+    if ! grep -q "${libsRev}" cmake/modules/falcosecurity-libs.cmake; then
+      echo "falcosecurity-libs checksum needs to be updated!"
+      exit 1
+    fi
     cmakeFlagsArray+=(-DCMAKE_EXE_LINKER_FLAGS="-ltbb -lcurl -labsl_synchronization")
   '' + optionalString (kernel != null) ''
     export INSTALL_MOD_PATH="$out"
diff --git a/nixpkgs/pkgs/os-specific/linux/syslinux/default.nix b/nixpkgs/pkgs/os-specific/linux/syslinux/default.nix
index 4ca7f50b7d1a..821d51133087 100644
--- a/nixpkgs/pkgs/os-specific/linux/syslinux/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/syslinux/default.nix
@@ -1,53 +1,70 @@
-{ lib, stdenv, fetchgit, fetchurl, fetchpatch, nasm, perl, python3, libuuid, mtools, makeWrapper }:
+{ lib
+, stdenv
+, fetchgit
+, fetchurl
+, libuuid
+, makeWrapper
+, mtools
+, nasm
+, perl
+, python3
+}:
 
 stdenv.mkDerivation {
   pname = "syslinux";
-  version = "unstable-20190207";
+  version = "unstable-2019-02-07";
 
   # This is syslinux-6.04-pre3^1; syslinux-6.04-pre3 fails to run.
   # Same issue here https://www.syslinux.org/archives/2019-February/026330.html
   src = fetchgit {
     url = "https://repo.or.cz/syslinux";
     rev = "b40487005223a78c3bb4c300ef6c436b3f6ec1f7";
-    sha256 = "1acf6byx7i6vz8hq6mra526g8mf7fmfhid211y8nq0v6px7d3aqs";
+    sha256 = "sha256-GqvRTr9mA2yRD0G0CF11x1X0jCgqV4Mh+tvE0/0yjqk=";
     fetchSubmodules = true;
   };
 
   patches = let
-    mkURL = commit: patchName:
-      "https://salsa.debian.org/images-team/syslinux/raw/${commit}/debian/patches/"
-      + patchName;
+    fetchDebianPatch = name: commit: hash:
+      fetchurl {
+        url = "https://salsa.debian.org/images-team/syslinux/raw/"
+              + commit + "/debian/patches/" + name;
+        inherit name hash;
+      };
+    fetchArchlinuxPatch = name: commit: hash:
+      fetchurl {
+        url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/"
+              + commit + "/trunk/" + name;
+        inherit name hash;
+      };
   in [
-    (fetchurl {
-      url = mkURL "fa1349f1" "0002-gfxboot-menu-label.patch";
-      sha256 = "06ifgzbpjj4picpj17zgprsfi501zf4pp85qjjgn29i5rs291zni";
-    })
-    (fetchurl {
-      url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/821c3da473d1399d930d5b4a086e46a4179eaa45/trunk/0005-gnu-efi-version-compatibility.patch";
-      name = "0005-gnu-efi-version-compatibility.patch";
-      sha256 = "1mz2idg8cwn0mvd3jixxynhkn7rhmi5fp8cc8zznh5f0ysfra446";
-    })
-    (fetchurl {
-      url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/821c3da473d1399d930d5b4a086e46a4179eaa45/trunk/0025-reproducible-build.patch";
-      name = "0025-reproducible-build.patch";
-      sha256 = "0qk6wc6z3648828y3961pn4pi7xhd20a6fqn6z1mnj22bbvzcxls";
-    })
-    (fetchurl {
+    ./gcc10.patch
+    (fetchDebianPatch
+      "0002-gfxboot-menu-label.patch"
+      "fa1349f1"
+      "sha256-0f6QhM4lJmGflLige4n7AZTodL7vnyAvi5dIedd/Lho=")
+    (fetchArchlinuxPatch
+      "0005-gnu-efi-version-compatibility.patch"
+      "821c3da473d1399d930d5b4a086e46a4179eaa45"
+      "sha256-hhCVnfbAFWj/R4yh60qsMB87ofW9RznarsByhl6L4tc=")
+    (fetchArchlinuxPatch
+      "0025-reproducible-build.patch"
+      "821c3da473d1399d930d5b4a086e46a4179eaa45"
+      "sha256-mnb291pCSFvDNxY7o4BosJ94ib3BpOGRQIiY8Q3jZmI=")
+    (fetchDebianPatch
       # mbr.bin: too big (452 > 440)
       # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906414
-      url = mkURL "7468ef0e38c43" "0016-strip-gnu-property.patch";
-      sha256 = "17n63b8wz6szv8npla1234g1ip7lqgzx2whrpv358ppf67lq8vwm";
-    })
-    (fetchurl {
+      "0016-strip-gnu-property.patch"
+      "7468ef0e38c43"
+      "sha256-lW+E6THuXlTGvhly0f/D9NwYHhkiKHot2l+bz9Eaxp4=")
+    (fetchDebianPatch
       # mbr.bin: too big (452 > 440)
-      url = mkURL "012e1dd312eb" "0017-single-load-segment.patch";
-      sha256 = "0azqzicsjw47b9ppyikhzaqmjl4lrvkxris1356bkmgcaiv6d98b";
-    })
-    (fetchurl {
-      url = mkURL "26f0e7b2" "0018-prevent-pow-optimization.patch";
-      sha256 = "1c8g0jz5yj9a0rsmryx9vdjsw4hw8mjfcg05c9pmyjg85w3dfp3m";
-    })
-    ./gcc10.patch
+      "0017-single-load-segment.patch"
+      "012e1dd312eb"
+      "sha256-C6VmdlTs1blMGUHH3OfOlFBZsfpwRn9vWodwqVn8+Cs=")
+    (fetchDebianPatch
+      "0018-prevent-pow-optimization.patch"
+      "26f0e7b2"
+      "sha256-dVzXBi/oSV9vYgU85mRFHBKuZdup+1x1BipJX74ED7E=")
   ];
 
   postPatch = ''
@@ -63,14 +80,30 @@ stdenv.mkDerivation {
     touch gnu-efi/inc/ia32/gnu/stubs-32.h
   '';
 
-  nativeBuildInputs = [ nasm perl python3 makeWrapper ];
-  buildInputs = [ libuuid ];
+  nativeBuildInputs = [
+    nasm
+    perl
+    python3
+    makeWrapper
+  ];
+
+  buildInputs = [
+    libuuid
+  ];
+
+  # Fails very rarely with 'No rule to make target: ...'
+  enableParallelBuilding = false;
 
-  enableParallelBuilding = false; # Fails very rarely with 'No rule to make target: ...'
   hardeningDisable = [ "pic" "stackprotector" "fortify" ];
 
   stripDebugList = [ "bin" "sbin" "share/syslinux/com32" ];
 
+  # Workaround build failure on -fno-common toolchains like upstream
+  # gcc-10. Otherwise build fails as:
+  #   ld: acpi/xsdt.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: multiple definition of
+  #     `e820_types'; memory.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: first defined here
+  NIX_CFLAGS_COMPILE="-fcommon";
+
   makeFlags = [
     "BINDIR=$(out)/bin"
     "SBINDIR=$(out)/sbin"
@@ -79,9 +112,10 @@ stdenv.mkDerivation {
     "PERL=perl"
     "HEXDATE=0x00000000"
   ]
-    ++ lib.optionals stdenv.hostPlatform.isi686 [ "bios" "efi32" ];
+  ++ lib.optionals stdenv.hostPlatform.isi686 [ "bios" "efi32" ];
 
-  doCheck = false; # fails. some fail in a sandbox, others require qemu
+  # Some tests require qemu, some others fail in a sandboxed environment
+  doCheck = false;
 
   postInstall = ''
     wrapProgram $out/bin/syslinux \
@@ -94,7 +128,7 @@ stdenv.mkDerivation {
   meta = with lib; {
     homepage = "http://www.syslinux.org/";
     description = "A lightweight bootloader";
-    license = licenses.gpl2;
+    license = licenses.gpl2Plus;
     maintainers = [ maintainers.samueldr ];
     platforms = [ "i686-linux" "x86_64-linux" ];
   };
diff --git a/nixpkgs/pkgs/os-specific/linux/sysstat/default.nix b/nixpkgs/pkgs/os-specific/linux/sysstat/default.nix
index 5389caaa33fb..f28b163a2fc7 100644
--- a/nixpkgs/pkgs/os-specific/linux/sysstat/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/sysstat/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "sysstat";
-  version = "12.4.4";
+  version = "12.4.5";
 
   src = fetchurl {
     url = "http://pagesperso-orange.fr/sebastien.godard/sysstat-${version}.tar.xz";
-    sha256 = "sha256-lRLnR54E+S4lHFxrS9lLj2Q9ISvQ6Yao6k0Uem6UPSQ=";
+    sha256 = "sha256-70RazqMBu7mW5BCEL2KQqNBJ6ITUhoz+9+hdwEt+7ls=";
   };
 
   buildInputs = [ gettext ];
@@ -16,6 +16,7 @@ stdenv.mkDerivation rec {
     export PATH_CHKCONFIG=/no-such-program
     export BZIP=${bzip2.bin}/bin/bzip2
     export SYSTEMCTL=systemctl
+    export COMPRESS_MANPG=n
   '';
 
   makeFlags = [ "SYSCONFIG_DIR=$(out)/etc" "IGNORE_FILE_ATTRIBUTES=y" "CHOWN=true" ];
diff --git a/nixpkgs/pkgs/os-specific/linux/system76-io/default.nix b/nixpkgs/pkgs/os-specific/linux/system76-io/default.nix
index fb697430f61c..54af222bc7d8 100644
--- a/nixpkgs/pkgs/os-specific/linux/system76-io/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/system76-io/default.nix
@@ -1,7 +1,7 @@
 { lib, stdenv, fetchFromGitHub, kernel }:
 let
-  version = "1.0.1";
-  sha256 = "0qkgkkjy1isv6ws6hrcal75dxjz98rpnvqbm7agdcc6yv0c17wwh";
+  version = "1.0.2";
+  sha256 = "sha256-DWUjQmoojkzFv1p4Xyt0kOwwqQ216ocO5yR/ujhhMPA=";
 in
 stdenv.mkDerivation {
   name = "system76-io-module-${version}-${kernel.version}";
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0001-Start-device-units-for-uninitialised-encrypted-devic.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0001-Start-device-units-for-uninitialised-encrypted-devic.patch
index a87c59558e01..2699c38440ce 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0001-Start-device-units-for-uninitialised-encrypted-devic.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0001-Start-device-units-for-uninitialised-encrypted-devic.patch
@@ -1,7 +1,7 @@
-From 93b2d29de784c68d1b4d70d7f214b19432aec6a8 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Eelco Dolstra <eelco.dolstra@logicblox.com>
 Date: Tue, 8 Jan 2013 15:46:30 +0100
-Subject: [PATCH 01/19] Start device units for uninitialised encrypted devices
+Subject: [PATCH] Start device units for uninitialised encrypted devices
 
 This is necessary because the NixOS service that initialises the
 filesystem depends on the appearance of the device unit.  Also, this
@@ -27,6 +27,3 @@ index 25b8a590a6..d18999ea87 100644
  # add symlink to GPT root disk
  SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}!="crypto_LUKS", SYMLINK+="gpt-auto-root"
  SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}=="crypto_LUKS", SYMLINK+="gpt-auto-root-luks"
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0002-Don-t-try-to-unmount-nix-or-nix-store.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0002-Don-t-try-to-unmount-nix-or-nix-store.patch
index e9fedd239f47..f46480d32feb 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0002-Don-t-try-to-unmount-nix-or-nix-store.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0002-Don-t-try-to-unmount-nix-or-nix-store.patch
@@ -1,7 +1,7 @@
-From 41edb381df0326e216b3c569d2cd5764591267d9 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Eelco Dolstra <eelco.dolstra@logicblox.com>
 Date: Fri, 12 Apr 2013 13:16:57 +0200
-Subject: [PATCH 02/19] Don't try to unmount /nix or /nix/store
+Subject: [PATCH] Don't try to unmount /nix or /nix/store
 
 They'll still be remounted read-only.
 
@@ -25,10 +25,10 @@ index f683f05981..5a04c2c2a6 100644
                          "/etc"))
                  return true;
 diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c
-index 1f945b7875..6df9d383ba 100644
+index 820aa8e286..653e43053d 100644
 --- a/src/shutdown/umount.c
 +++ b/src/shutdown/umount.c
-@@ -508,6 +508,8 @@ static int delete_md(MountPoint *m) {
+@@ -518,6 +518,8 @@ static int delete_md(MountPoint *m) {
  
  static bool nonunmountable_path(const char *path) {
          return path_equal(path, "/")
@@ -37,6 +37,3 @@ index 1f945b7875..6df9d383ba 100644
  #if ! HAVE_SPLIT_USR
                  || path_equal(path, "/usr")
  #endif
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0003-Fix-NixOS-containers.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0003-Fix-NixOS-containers.patch
index 217629f7d6ac..a669350dbed8 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0003-Fix-NixOS-containers.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0003-Fix-NixOS-containers.patch
@@ -1,7 +1,7 @@
-From 43620479f6bfbbc4c3eed28947e0676c817acb7c Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Eelco Dolstra <eelco.dolstra@logicblox.com>
 Date: Wed, 16 Apr 2014 10:59:28 +0200
-Subject: [PATCH 03/19] Fix NixOS containers
+Subject: [PATCH] Fix NixOS containers
 
 In NixOS containers, the init script is bind-mounted into the
 container, so checking early whether it exists will fail.
@@ -10,25 +10,22 @@ container, so checking early whether it exists will fail.
  1 file changed, 2 insertions(+)
 
 diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
-index 575b9da447..438ca294db 100644
+index 4ce80bba70..bb149192bd 100644
 --- a/src/nspawn/nspawn.c
 +++ b/src/nspawn/nspawn.c
-@@ -5590,6 +5590,7 @@ static int run(int argc, char *argv[]) {
+@@ -5651,6 +5651,7 @@ static int run(int argc, char *argv[]) {
                                  goto finish;
                          }
                  } else {
 +#if 0
-                         const char *p, *q;
+                         _cleanup_free_ char *p = NULL;
  
                          if (arg_pivot_root_new)
-@@ -5604,6 +5605,7 @@ static int run(int argc, char *argv[]) {
-                                 r = -EINVAL;
+@@ -5665,6 +5666,7 @@ static int run(int argc, char *argv[]) {
+                                                     "Directory %s doesn't look like it has an OS tree (/usr/ directory is missing). Refusing.", arg_directory);
                                  goto finish;
                          }
 +#endif
                  }
  
          } else {
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0004-Look-for-fsck-in-the-right-place.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0004-Look-for-fsck-in-the-right-place.patch
index f7b768af515f..dfaf53e4a314 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0004-Look-for-fsck-in-the-right-place.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0004-Look-for-fsck-in-the-right-place.patch
@@ -1,14 +1,14 @@
-From a08ed6697974d7f7dabe60d42bbc9e31a10f7e23 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Eelco Dolstra <eelco.dolstra@logicblox.com>
 Date: Thu, 1 May 2014 14:10:10 +0200
-Subject: [PATCH 04/19] Look for fsck in the right place
+Subject: [PATCH] Look for fsck in the right place
 
 ---
  src/fsck/fsck.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
-index cd7adfaeb9..68cebdd158 100644
+index 745d01ff50..dd4eef45c3 100644
 --- a/src/fsck/fsck.c
 +++ b/src/fsck/fsck.c
 @@ -368,7 +368,7 @@ static int run(int argc, char *argv[]) {
@@ -20,6 +20,3 @@ index cd7adfaeb9..68cebdd158 100644
                  cmdline[i++] =  arg_repair;
                  cmdline[i++] = "-T";
  
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0005-Add-some-NixOS-specific-unit-directories.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0005-Add-some-NixOS-specific-unit-directories.patch
index 7ebf07d0a82b..8a06e2cf69cb 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0005-Add-some-NixOS-specific-unit-directories.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0005-Add-some-NixOS-specific-unit-directories.patch
@@ -1,7 +1,7 @@
-From ddcfae6de8c460903c5db8c536ffeb5771e976f8 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Eelco Dolstra <eelco.dolstra@logicblox.com>
 Date: Fri, 19 Dec 2014 14:46:17 +0100
-Subject: [PATCH 05/19] Add some NixOS-specific unit directories
+Subject: [PATCH] Add some NixOS-specific unit directories
 
 Look in `/nix/var/nix/profiles/default/lib/systemd/{system,user}` for
 units provided by packages installed into the default profile via
@@ -14,10 +14,10 @@ Also, remove /usr and /lib as these don't exist on NixOS.
  2 files changed, 6 insertions(+), 19 deletions(-)
 
 diff --git a/src/basic/path-lookup.c b/src/basic/path-lookup.c
-index 05eb17d66c..1cd141d012 100644
+index 1f4331a8bf..4b9a8ae26e 100644
 --- a/src/basic/path-lookup.c
 +++ b/src/basic/path-lookup.c
-@@ -91,11 +91,7 @@ int xdg_user_data_dir(char **ret, const char *suffix) {
+@@ -92,11 +92,7 @@ int xdg_user_data_dir(char **ret, const char *suffix) {
  }
  
  static const char* const user_data_unit_paths[] = {
@@ -29,7 +29,7 @@ index 05eb17d66c..1cd141d012 100644
          NULL
  };
  
-@@ -613,15 +609,13 @@ int lookup_paths_init(
+@@ -617,15 +613,13 @@ int lookup_paths_init(
                                          persistent_config,
                                          SYSTEM_CONFIG_UNIT_DIR,
                                          "/etc/systemd/system",
@@ -46,7 +46,7 @@ index 05eb17d66c..1cd141d012 100644
                                          STRV_IFNOTNULL(generator_late));
                          break;
  
-@@ -637,14 +631,11 @@ int lookup_paths_init(
+@@ -641,14 +635,11 @@ int lookup_paths_init(
                                          persistent_config,
                                          USER_CONFIG_UNIT_DIR,
                                          "/etc/systemd/user",
@@ -62,23 +62,23 @@ index 05eb17d66c..1cd141d012 100644
                                          STRV_IFNOTNULL(generator_late));
                          break;
  
-@@ -794,7 +785,6 @@ char **generator_binary_paths(UnitFileScope scope) {
-                 case UNIT_FILE_SYSTEM:
+@@ -808,7 +799,6 @@ char **generator_binary_paths(LookupScope scope) {
+                 case LOOKUP_SCOPE_SYSTEM:
                          add = strv_new("/run/systemd/system-generators",
                                         "/etc/systemd/system-generators",
 -                                       "/usr/local/lib/systemd/system-generators",
                                         SYSTEM_GENERATOR_DIR);
                          break;
  
-@@ -802,7 +792,6 @@ char **generator_binary_paths(UnitFileScope scope) {
-                 case UNIT_FILE_USER:
+@@ -816,7 +806,6 @@ char **generator_binary_paths(LookupScope scope) {
+                 case LOOKUP_SCOPE_USER:
                          add = strv_new("/run/systemd/user-generators",
                                         "/etc/systemd/user-generators",
 -                                       "/usr/local/lib/systemd/user-generators",
                                         USER_GENERATOR_DIR);
                          break;
  
-@@ -841,12 +830,10 @@ char **env_generator_binary_paths(bool is_system) {
+@@ -855,12 +844,10 @@ char **env_generator_binary_paths(bool is_system) {
                  if (is_system)
                          add = strv_new("/run/systemd/system-environment-generators",
                                          "/etc/systemd/system-environment-generators",
@@ -92,7 +92,7 @@ index 05eb17d66c..1cd141d012 100644
  
                  if (!add)
 diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in
-index fc0f8c34fa..162432e77f 100644
+index 693433b34b..5932a21b5b 100644
 --- a/src/core/systemd.pc.in
 +++ b/src/core/systemd.pc.in
 @@ -38,10 +38,10 @@ systemdsystemconfdir=${systemd_system_conf_dir}
@@ -121,6 +121,3 @@ index fc0f8c34fa..162432e77f 100644
  systemdusergeneratorpath=${systemd_user_generator_path}
  
  systemd_sleep_dir=${root_prefix}/lib/systemd/system-sleep
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0006-Get-rid-of-a-useless-message-in-user-sessions.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0006-Get-rid-of-a-useless-message-in-user-sessions.patch
index 0c09107c5ef2..c06f12550261 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0006-Get-rid-of-a-useless-message-in-user-sessions.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0006-Get-rid-of-a-useless-message-in-user-sessions.patch
@@ -1,7 +1,7 @@
-From b39b8871bcaa07280d6b0cf2226b1a3be31232b8 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Eelco Dolstra <eelco.dolstra@logicblox.com>
 Date: Mon, 11 May 2015 15:39:38 +0200
-Subject: [PATCH 06/19] Get rid of a useless message in user sessions
+Subject: [PATCH] Get rid of a useless message in user sessions
 
 Namely lots of variants of
 
@@ -13,10 +13,10 @@ in containers.
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/src/core/manager.c b/src/core/manager.c
-index 34891a8754..b9b4789720 100644
+index 296b759959..71ef7f27b4 100644
 --- a/src/core/manager.c
 +++ b/src/core/manager.c
-@@ -1375,7 +1375,8 @@ static unsigned manager_dispatch_stop_when_bound_queue(Manager *m) {
+@@ -1428,7 +1428,8 @@ static unsigned manager_dispatch_stop_when_bound_queue(Manager *m) {
                  if (!unit_is_bound_by_inactive(u, &culprit))
                          continue;
  
@@ -26,6 +26,3 @@ index 34891a8754..b9b4789720 100644
  
                  /* If stopping a unit fails continuously we might enter a stop loop here, hence stop acting on the
                   * service being unnecessary after a while. */
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0007-hostnamed-localed-timedated-disable-methods-that-cha.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0007-hostnamed-localed-timedated-disable-methods-that-cha.patch
index d7649b5e44a7..174cca335b8e 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0007-hostnamed-localed-timedated-disable-methods-that-cha.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0007-hostnamed-localed-timedated-disable-methods-that-cha.patch
@@ -1,8 +1,8 @@
-From 566208aea81057789218b959f4d0e898eec54fc9 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Gabriel Ebner <gebner@gebner.org>
 Date: Sun, 6 Dec 2015 14:26:36 +0100
-Subject: [PATCH 07/19] hostnamed, localed, timedated: disable methods that
- change system settings.
+Subject: [PATCH] hostnamed, localed, timedated: disable methods that change
+ system settings.
 
 ---
  src/hostname/hostnamed.c |  6 ++++++
@@ -11,10 +11,10 @@ Subject: [PATCH 07/19] hostnamed, localed, timedated: disable methods that
  3 files changed, 25 insertions(+)
 
 diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
-index 36702f2fb0..669257ea2f 100644
+index 5f09e6d0eb..46bef3b59d 100644
 --- a/src/hostname/hostnamed.c
 +++ b/src/hostname/hostnamed.c
-@@ -797,6 +797,9 @@ static int method_set_static_hostname(sd_bus_message *m, void *userdata, sd_bus_
+@@ -910,6 +910,9 @@ static int method_set_static_hostname(sd_bus_message *m, void *userdata, sd_bus_
          if (r < 0)
                  return r;
  
@@ -24,7 +24,7 @@ index 36702f2fb0..669257ea2f 100644
          name = empty_to_null(name);
  
          context_read_etc_hostname(c);
-@@ -860,6 +863,9 @@ static int set_machine_info(Context *c, sd_bus_message *m, int prop, sd_bus_mess
+@@ -973,6 +976,9 @@ static int set_machine_info(Context *c, sd_bus_message *m, int prop, sd_bus_mess
          if (r < 0)
                  return r;
  
@@ -35,10 +35,10 @@ index 36702f2fb0..669257ea2f 100644
  
          context_read_machine_info(c);
 diff --git a/src/locale/localed.c b/src/locale/localed.c
-index c228385d0e..942ccaa038 100644
+index 89bf9c6fba..af2f37a4ca 100644
 --- a/src/locale/localed.c
 +++ b/src/locale/localed.c
-@@ -360,6 +360,9 @@ static int method_set_locale(sd_bus_message *m, void *userdata, sd_bus_error *er
+@@ -359,6 +359,9 @@ static int method_set_locale(sd_bus_message *m, void *userdata, sd_bus_error *er
          if (r < 0)
                  return r;
  
@@ -48,7 +48,7 @@ index c228385d0e..942ccaa038 100644
          use_localegen = locale_gen_check_available();
  
          /* If single locale without variable name is provided, then we assume it is LANG=. */
-@@ -485,6 +488,9 @@ static int method_set_vc_keyboard(sd_bus_message *m, void *userdata, sd_bus_erro
+@@ -484,6 +487,9 @@ static int method_set_vc_keyboard(sd_bus_message *m, void *userdata, sd_bus_erro
          if (r < 0)
                  return r;
  
@@ -58,7 +58,7 @@ index c228385d0e..942ccaa038 100644
          keymap = empty_to_null(keymap);
          keymap_toggle = empty_to_null(keymap_toggle);
  
-@@ -665,6 +671,9 @@ static int method_set_x11_keyboard(sd_bus_message *m, void *userdata, sd_bus_err
+@@ -664,6 +670,9 @@ static int method_set_x11_keyboard(sd_bus_message *m, void *userdata, sd_bus_err
          if (r < 0)
                  return r;
  
@@ -69,10 +69,10 @@ index c228385d0e..942ccaa038 100644
          model = empty_to_null(model);
          variant = empty_to_null(variant);
 diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
-index 66b454269d..0a8fe25d0f 100644
+index 9ca5d37b75..e41d8d73df 100644
 --- a/src/timedate/timedated.c
 +++ b/src/timedate/timedated.c
-@@ -668,6 +668,10 @@ static int method_set_timezone(sd_bus_message *m, void *userdata, sd_bus_error *
+@@ -669,6 +669,10 @@ static int method_set_timezone(sd_bus_message *m, void *userdata, sd_bus_error *
          if (r < 0)
                  return r;
  
@@ -83,7 +83,7 @@ index 66b454269d..0a8fe25d0f 100644
          if (!timezone_is_valid(z, LOG_DEBUG))
                  return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid or not installed time zone '%s'", z);
  
-@@ -747,6 +751,9 @@ static int method_set_local_rtc(sd_bus_message *m, void *userdata, sd_bus_error
+@@ -748,6 +752,9 @@ static int method_set_local_rtc(sd_bus_message *m, void *userdata, sd_bus_error
          if (r < 0)
                  return r;
  
@@ -103,6 +103,3 @@ index 66b454269d..0a8fe25d0f 100644
          r = context_update_ntp_status(c, bus, m);
          if (r < 0)
                  return r;
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0008-Fix-hwdb-paths.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0008-Fix-hwdb-paths.patch
index f938b553c9f5..69bd1cc97b27 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0008-Fix-hwdb-paths.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0008-Fix-hwdb-paths.patch
@@ -1,7 +1,7 @@
-From 3b9983969de2a86929768f6362ed41c20dd13bd3 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Nikolay Amiantov <ab@fmap.me>
 Date: Thu, 7 Jul 2016 02:47:13 +0300
-Subject: [PATCH 08/19] Fix hwdb paths
+Subject: [PATCH] Fix hwdb paths
 
 Patch by vcunat.
 ---
@@ -9,10 +9,10 @@ Patch by vcunat.
  1 file changed, 2 insertions(+), 5 deletions(-)
 
 diff --git a/src/libsystemd/sd-hwdb/hwdb-internal.h b/src/libsystemd/sd-hwdb/hwdb-internal.h
-index 5ddc2211e6..ee621eec46 100644
+index 62d27f7b89..87318e041b 100644
 --- a/src/libsystemd/sd-hwdb/hwdb-internal.h
 +++ b/src/libsystemd/sd-hwdb/hwdb-internal.h
-@@ -82,8 +82,5 @@ struct trie_value_entry2_f {
+@@ -83,8 +83,5 @@ struct trie_value_entry2_f {
  } _packed_;
  
  #define hwdb_bin_paths                          \
@@ -23,6 +23,3 @@ index 5ddc2211e6..ee621eec46 100644
 -        UDEVLIBEXECDIR "/hwdb.bin\0"
 +        "/etc/udev/hwdb.bin\0"
 +
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0009-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0009-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch
index 87cf1afc7d22..106eba2bed83 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0009-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0009-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch
@@ -1,7 +1,7 @@
-From b5966b6abb9696798618367cab33d1fed317734f Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Nikolay Amiantov <ab@fmap.me>
 Date: Tue, 11 Oct 2016 13:12:08 +0300
-Subject: [PATCH 09/19] Change /usr/share/zoneinfo to /etc/zoneinfo
+Subject: [PATCH] Change /usr/share/zoneinfo to /etc/zoneinfo
 
 NixOS uses this path.
 ---
@@ -35,10 +35,10 @@ index e486474c44..5f373d0723 100644
      <literal>Etc/UTC</literal>. The resulting link should lead to the
      corresponding binary
 diff --git a/src/basic/time-util.c b/src/basic/time-util.c
-index 5d162e8ffe..1bec83e555 100644
+index 0ad8de4b9a..b794c6c7d0 100644
 --- a/src/basic/time-util.c
 +++ b/src/basic/time-util.c
-@@ -1269,7 +1269,7 @@ static int get_timezones_from_zone1970_tab(char ***ret) {
+@@ -1281,7 +1281,7 @@ static int get_timezones_from_zone1970_tab(char ***ret) {
  
          assert(ret);
  
@@ -47,7 +47,7 @@ index 5d162e8ffe..1bec83e555 100644
          if (!f)
                  return -errno;
  
-@@ -1308,7 +1308,7 @@ static int get_timezones_from_tzdata_zi(char ***ret) {
+@@ -1320,7 +1320,7 @@ static int get_timezones_from_tzdata_zi(char ***ret) {
          _cleanup_strv_free_ char **zones = NULL;
          int r;
  
@@ -56,7 +56,7 @@ index 5d162e8ffe..1bec83e555 100644
          if (!f)
                  return -errno;
  
-@@ -1421,7 +1421,7 @@ int verify_timezone(const char *name, int log_level) {
+@@ -1433,7 +1433,7 @@ int verify_timezone(const char *name, int log_level) {
          if (p - name >= PATH_MAX)
                  return -ENAMETOOLONG;
  
@@ -65,7 +65,7 @@ index 5d162e8ffe..1bec83e555 100644
  
          fd = open(t, O_RDONLY|O_CLOEXEC);
          if (fd < 0)
-@@ -1512,7 +1512,7 @@ int get_timezone(char **ret) {
+@@ -1491,7 +1491,7 @@ int get_timezone(char **ret) {
          if (r < 0)
                  return r; /* returns EINVAL if not a symlink */
  
@@ -75,10 +75,10 @@ index 5d162e8ffe..1bec83e555 100644
                  return -EINVAL;
  
 diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
-index 2cb4f80d5d..ebeaeac52f 100644
+index 39160182ef..8dcc3307c8 100644
 --- a/src/firstboot/firstboot.c
 +++ b/src/firstboot/firstboot.c
-@@ -491,7 +491,7 @@ static int process_timezone(void) {
+@@ -494,7 +494,7 @@ static int process_timezone(void) {
          if (isempty(arg_timezone))
                  return 0;
  
@@ -88,10 +88,10 @@ index 2cb4f80d5d..ebeaeac52f 100644
          (void) mkdir_parents(etc_localtime, 0755);
          if (symlink(e, etc_localtime) < 0)
 diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
-index 438ca294db..98bd110d92 100644
+index bb149192bd..08751ed944 100644
 --- a/src/nspawn/nspawn.c
 +++ b/src/nspawn/nspawn.c
-@@ -1887,8 +1887,8 @@ int userns_mkdir(const char *root, const char *path, mode_t mode, uid_t uid, gid
+@@ -1901,8 +1901,8 @@ int userns_mkdir(const char *root, const char *path, mode_t mode, uid_t uid, gid
  static const char *timezone_from_path(const char *path) {
          return PATH_STARTSWITH_SET(
                          path,
@@ -103,10 +103,10 @@ index 438ca294db..98bd110d92 100644
  
  static bool etc_writable(void) {
 diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
-index 0a8fe25d0f..2f02b9a520 100644
+index e41d8d73df..ff1a384b3b 100644
 --- a/src/timedate/timedated.c
 +++ b/src/timedate/timedated.c
-@@ -279,7 +279,7 @@ static int context_read_data(Context *c) {
+@@ -282,7 +282,7 @@ static int context_read_data(Context *c) {
  
          r = get_timezone(&t);
          if (r == -EINVAL)
@@ -115,7 +115,7 @@ index 0a8fe25d0f..2f02b9a520 100644
          else if (r < 0)
                  log_warning_errno(r, "Failed to get target of /etc/localtime: %m");
  
-@@ -303,7 +303,7 @@ static int context_write_data_timezone(Context *c) {
+@@ -306,7 +306,7 @@ static int context_write_data_timezone(Context *c) {
  
          if (isempty(c->zone) || streq(c->zone, "UTC")) {
  
@@ -124,7 +124,7 @@ index 0a8fe25d0f..2f02b9a520 100644
  
                          if (unlink("/etc/localtime") < 0 && errno != ENOENT)
                                  return -errno;
-@@ -311,9 +311,9 @@ static int context_write_data_timezone(Context *c) {
+@@ -314,9 +314,9 @@ static int context_write_data_timezone(Context *c) {
                          return 0;
                  }
  
@@ -136,6 +136,3 @@ index 0a8fe25d0f..2f02b9a520 100644
                  if (!p)
                          return -ENOMEM;
  
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0010-localectl-use-etc-X11-xkb-for-list-x11.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0010-localectl-use-etc-X11-xkb-for-list-x11.patch
index 6e36bbdc3406..a3315a1e657a 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0010-localectl-use-etc-X11-xkb-for-list-x11.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0010-localectl-use-etc-X11-xkb-for-list-x11.patch
@@ -1,7 +1,7 @@
-From f4e9304560ad42eeb8d42be583cc55eb2e5b4bb1 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Imuli <i@imu.li>
 Date: Wed, 19 Oct 2016 08:46:47 -0400
-Subject: [PATCH 10/19] localectl: use /etc/X11/xkb for list-x11-*
+Subject: [PATCH] localectl: use /etc/X11/xkb for list-x11-*
 
 NixOS has an option to link the xkb data files to /etc/X11, but not to
 /usr/share/X11.
@@ -10,10 +10,10 @@ NixOS has an option to link the xkb data files to /etc/X11, but not to
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/locale/localectl.c b/src/locale/localectl.c
-index 548ac8eb2c..5e372f1566 100644
+index 661d54c27d..e98b578531 100644
 --- a/src/locale/localectl.c
 +++ b/src/locale/localectl.c
-@@ -280,7 +280,7 @@ static int list_x11_keymaps(int argc, char **argv, void *userdata) {
+@@ -277,7 +277,7 @@ static int list_x11_keymaps(int argc, char **argv, void *userdata) {
          } state = NONE, look_for;
          int r;
  
@@ -22,6 +22,3 @@ index 548ac8eb2c..5e372f1566 100644
          if (!f)
                  return log_error_errno(errno, "Failed to open keyboard mapping list. %m");
  
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0011-build-don-t-create-statedir-and-don-t-touch-prefixdi.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0011-build-don-t-create-statedir-and-don-t-touch-prefixdi.patch
index 5aa22d988952..75d113d00339 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0011-build-don-t-create-statedir-and-don-t-touch-prefixdi.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0011-build-don-t-create-statedir-and-don-t-touch-prefixdi.patch
@@ -1,19 +1,19 @@
-From 43a363f30b6012d600cfb62a3851c4ac7af4d1d5 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Franz Pletz <fpletz@fnordicwalking.de>
 Date: Sun, 11 Feb 2018 04:37:44 +0100
-Subject: [PATCH 11/19] build: don't create statedir and don't touch prefixdir
+Subject: [PATCH] build: don't create statedir and don't touch prefixdir
 
 ---
  meson.build | 3 ---
  1 file changed, 3 deletions(-)
 
 diff --git a/meson.build b/meson.build
-index 5bdfd9753d..5bf6afc7b7 100644
+index 9c170acc0a..818b7a3eb5 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -3539,9 +3539,6 @@ install_data('LICENSE.GPL2',
-              'docs/GVARIANT-SERIALIZATION.md',
-              install_dir : docdir)
+@@ -3928,9 +3928,6 @@ install_data('LICENSE.GPL2',
+ install_subdir('LICENSES',
+                install_dir : docdir)
  
 -meson.add_install_script('sh', '-c', mkdir_p.format(systemdstatedir))
 -meson.add_install_script('sh', '-c', 'touch $DESTDIR@0@'.format(prefixdir))
@@ -21,6 +21,3 @@ index 5bdfd9753d..5bf6afc7b7 100644
  ############################################################
  
  # Ensure that changes to the docs/ directory do not break the
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0013-add-rootprefix-to-lookup-dir-paths.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0012-add-rootprefix-to-lookup-dir-paths.patch
index 20372a5dbad5..c1659ae8a78a 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0013-add-rootprefix-to-lookup-dir-paths.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0012-add-rootprefix-to-lookup-dir-paths.patch
@@ -1,7 +1,7 @@
-From eb93778af78a127e8e20d6ed7fd9f91fd22dc7c9 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Andreas Rammhold <andreas@rammhold.de>
 Date: Thu, 9 May 2019 11:15:22 +0200
-Subject: [PATCH 13/19] add rootprefix to lookup dir paths
+Subject: [PATCH] add rootprefix to lookup dir paths
 
 systemd does not longer use the UDEVLIBEXEC directory as root for
 discovery default udev rules. By adding `$out/lib` to the lookup paths
@@ -12,7 +12,7 @@ files that I might have missed.
  1 file changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/src/basic/def.h b/src/basic/def.h
-index 2e60abb4f1..732ec51d36 100644
+index 0a1ae023a3..cc00ff6c68 100644
 --- a/src/basic/def.h
 +++ b/src/basic/def.h
 @@ -39,13 +39,15 @@
@@ -33,6 +33,3 @@ index 2e60abb4f1..732ec51d36 100644
  
  #define CONF_PATHS(n)                           \
          CONF_PATHS_USR(n)                       \
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0012-inherit-systemd-environment-when-calling-generators.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0012-inherit-systemd-environment-when-calling-generators.patch
deleted file mode 100644
index a2bdfcf8ec3f..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0012-inherit-systemd-environment-when-calling-generators.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 7ea935a5ac4f31106ce9347227d4eb59b77b02cd Mon Sep 17 00:00:00 2001
-From: Andreas Rammhold <andreas@rammhold.de>
-Date: Fri, 2 Nov 2018 21:15:42 +0100
-Subject: [PATCH 12/19] inherit systemd environment when calling generators.
-
-Systemd generators need access to the environment configured in
-stage-2-init.sh since it schedules fsck and mkfs executions based on
-being able to find an appropriate binary for the target filesystem.
-
-With this commit I am altering the systemd behaviour since upstream
-tries to gather environments with that they call
-"environment-generators" and then seems to pass that on to all the other
-executables that are being called from managers.
----
- src/core/manager.c | 13 +++++++++----
- 1 file changed, 9 insertions(+), 4 deletions(-)
-
-diff --git a/src/core/manager.c b/src/core/manager.c
-index b9b4789720..79239afe4a 100644
---- a/src/core/manager.c
-+++ b/src/core/manager.c
-@@ -4149,10 +4149,15 @@ static int manager_run_generators(Manager *m) {
-         argv[4] = NULL;
- 
-         RUN_WITH_UMASK(0022)
--                (void) execute_directories((const char* const*) paths, DEFAULT_TIMEOUT_USEC, NULL, NULL,
--                                           (char**) argv, m->transient_environment,
--                                           EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS | EXEC_DIR_SET_SYSTEMD_EXEC_PID);
--
-+                (void) execute_directories((const char* const*) paths, DEFAULT_TIMEOUT_USEC,
-+                                    // On NixOS we must propagate PATH to generators so they are
-+                                    // able to find binaries such as `fsck.${fstype}` and
-+                                    // `mkfs.${fstype}`. That is why the last argument of the
-+                                    // function (envp) is set to NULL. This propagates systemd's
-+                                    // environment (e.g. PATH) that was setup
-+                                    // before calling systemd from stage-2-init.sh.
-+                                    NULL, NULL, (char**) argv, /* NixOS: use inherited env */ NULL,
-+                                    EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS | EXEC_DIR_SET_SYSTEMD_EXEC_PID);
-         r = 0;
- 
- finish:
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0014-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0013-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch
index a22566eb4cc3..4add87267ddb 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0014-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0013-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch
@@ -1,7 +1,7 @@
-From 1d623def80a3532ac1445499c9d4673e21ae8195 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Nikolay Amiantov <ab@fmap.me>
 Date: Thu, 25 Jul 2019 20:45:55 +0300
-Subject: [PATCH 14/19] systemd-shutdown: execute scripts in
+Subject: [PATCH] systemd-shutdown: execute scripts in
  /etc/systemd/system-shutdown
 
 This is needed for NixOS to use such scripts as systemd directory is immutable.
@@ -10,18 +10,15 @@ This is needed for NixOS to use such scripts as systemd directory is immutable.
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c
-index a98cfc4d8a..b0b34edda7 100644
+index 2c3cbec02c..1b876203c6 100644
 --- a/src/shutdown/shutdown.c
 +++ b/src/shutdown/shutdown.c
-@@ -312,7 +312,7 @@ int main(int argc, char *argv[]) {
+@@ -335,7 +335,7 @@ int main(int argc, char *argv[]) {
          _cleanup_free_ char *cgroup = NULL;
-         char *arguments[3], *watchdog_device;
+         char *arguments[3];
          int cmd, r, umount_log_level = LOG_INFO;
 -        static const char* const dirs[] = {SYSTEM_SHUTDOWN_PATH, NULL};
 +        static const char* const dirs[] = {SYSTEM_SHUTDOWN_PATH, "/etc/systemd/system-shutdown", NULL};
  
          /* The log target defaults to console, but the original systemd process will pass its log target in through a
           * command line argument, which will override this default. Also, ensure we'll never log to the journal or
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0015-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0014-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch
index 1a21d1005ee0..22e2bc8e5300 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0015-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0014-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch
@@ -1,8 +1,7 @@
-From 5a96c4a98be971d84a12ae04e42bc3cb889d5191 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Nikolay Amiantov <ab@fmap.me>
 Date: Thu, 25 Jul 2019 20:46:58 +0300
-Subject: [PATCH 15/19] systemd-sleep: execute scripts in
- /etc/systemd/system-sleep
+Subject: [PATCH] systemd-sleep: execute scripts in /etc/systemd/system-sleep
 
 This is needed for NixOS to use such scripts as systemd directory is immutable.
 ---
@@ -10,10 +9,10 @@ This is needed for NixOS to use such scripts as systemd directory is immutable.
  1 file changed, 1 insertion(+)
 
 diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
-index a3aeb24633..0ed6a34d79 100644
+index 65e391d02a..28af2f8bf5 100644
 --- a/src/sleep/sleep.c
 +++ b/src/sleep/sleep.c
-@@ -182,6 +182,7 @@ static int execute(
+@@ -180,6 +180,7 @@ static int execute(
          };
          static const char* const dirs[] = {
                  SYSTEM_SLEEP_PATH,
@@ -21,6 +20,3 @@ index a3aeb24633..0ed6a34d79 100644
                  NULL
          };
  
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0017-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0015-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
index 52b74284fe26..653f3beea965 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0017-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0015-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
@@ -1,7 +1,7 @@
-From 6ddb2011b379f3232374327517af874b68c434b5 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Florian Klink <flokli@flokli.de>
 Date: Sun, 8 Mar 2020 01:05:54 +0100
-Subject: [PATCH 17/19] path-util.h: add placeholder for DEFAULT_PATH_NORMAL
+Subject: [PATCH] path-util.h: add placeholder for DEFAULT_PATH_NORMAL
 
 This will be the $PATH used to lookup ExecStart= etc. options, which
 systemd itself uses extensively.
@@ -10,7 +10,7 @@ systemd itself uses extensively.
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/src/basic/path-util.h b/src/basic/path-util.h
-index 26e7362d1f..a8f8a863ec 100644
+index 553aa4fb58..46294f4bb1 100644
 --- a/src/basic/path-util.h
 +++ b/src/basic/path-util.h
 @@ -24,11 +24,11 @@
@@ -28,6 +28,3 @@ index 26e7362d1f..a8f8a863ec 100644
  
  #if HAVE_SPLIT_USR
  #  define DEFAULT_PATH DEFAULT_PATH_SPLIT_USR
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0016-kmod-static-nodes.service-Update-ConditionFileNotEmp.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0016-kmod-static-nodes.service-Update-ConditionFileNotEmp.patch
deleted file mode 100644
index 12624cb5548f..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0016-kmod-static-nodes.service-Update-ConditionFileNotEmp.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 775a2a8940c07f4af33a2a11bfa17e0257b427cb Mon Sep 17 00:00:00 2001
-From: Florian Klink <flokli@flokli.de>
-Date: Sat, 7 Mar 2020 22:40:27 +0100
-Subject: [PATCH 16/19] kmod-static-nodes.service: Update ConditionFileNotEmpty
-
-kmod loads modules from not only /lib/modules but also from
-/run/booted-system/kernel-modules/lib/modules and
-/run/current-system/kernel-modules/lib/module
-
-Co-authored-by: Arian van Putten <arian.vanputten@gmail.com>
----
- units/kmod-static-nodes.service.in | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/units/kmod-static-nodes.service.in b/units/kmod-static-nodes.service.in
-index 777e82d16b..9a5e05a1cc 100644
---- a/units/kmod-static-nodes.service.in
-+++ b/units/kmod-static-nodes.service.in
-@@ -12,7 +12,9 @@ Description=Create List of Static Device Nodes
- DefaultDependencies=no
- Before=sysinit.target systemd-tmpfiles-setup-dev.service
- ConditionCapability=CAP_SYS_MODULE
--ConditionFileNotEmpty=/lib/modules/%v/modules.devname
-+ConditionFileNotEmpty=|/lib/modules/%v/modules.devname
-+ConditionFileNotEmpty=|/run/booted-system/kernel-modules/lib/modules/%v/modules.devname
-+ConditionFileNotEmpty=|/run/current-system/kernel-modules/lib/modules/%v/modules.devname
- 
- [Service]
- Type=oneshot
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0018-pkg-config-derive-prefix-from-prefix.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0016-pkg-config-derive-prefix-from-prefix.patch
index 58eb7f96e642..3fbfd7f10ab4 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0018-pkg-config-derive-prefix-from-prefix.patch
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0016-pkg-config-derive-prefix-from-prefix.patch
@@ -1,7 +1,7 @@
-From 50f2ada6cbfafa75b628410e8834f29581854e6f Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
 Date: Sun, 6 Dec 2020 08:34:19 +0100
-Subject: [PATCH 18/19] pkg-config: derive prefix from --prefix
+Subject: [PATCH] pkg-config: derive prefix from --prefix
 
 Point prefix to the one configured, instead of `/usr` `systemd` has limited
 support for making the pkgconfig prefix overridable, and interpolates those
@@ -16,7 +16,7 @@ Co-Authored-By: Florian Klink <flokli@flokli.de>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in
-index 162432e77f..2fc20daf03 100644
+index 5932a21b5b..20bf8e316d 100644
 --- a/src/core/systemd.pc.in
 +++ b/src/core/systemd.pc.in
 @@ -11,7 +11,7 @@
@@ -28,6 +28,3 @@ index 162432e77f..2fc20daf03 100644
  root_prefix={{ROOTPREFIX_NOSLASH}}
  rootprefix=${root_prefix}
  sysconf_dir={{SYSCONF_DIR}}
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0017-inherit-systemd-environment-when-calling-generators.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0017-inherit-systemd-environment-when-calling-generators.patch
new file mode 100644
index 000000000000..f4925437aa58
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/0017-inherit-systemd-environment-when-calling-generators.patch
@@ -0,0 +1,39 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Yuriy Taraday <yorik.sar@gmail.com>
+Date: Fri, 17 Jun 2022 12:45:10 +0000
+Subject: [PATCH] inherit systemd environment when calling generators.
+
+Systemd generators need access to the environment configured in
+stage-2-init.sh since it schedules fsck and mkfs executions based on
+being able to find an appropriate binary for the target filesystem.
+
+With this commit I am altering the systemd behaviour since upstream
+tries to gather environments with that they call
+"environment-generators" and then seems to pass that on to all the other
+executables that are being called from managers.
+---
+ src/core/manager.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/core/manager.c b/src/core/manager.c
+index 71ef7f27b4..33ded94a7c 100644
+--- a/src/core/manager.c
++++ b/src/core/manager.c
+@@ -3704,9 +3704,17 @@ static int build_generator_environment(Manager *m, char ***ret) {
+          * adjust generated units to that. Let's pass down some bits of information that are easy for us to
+          * determine (but a bit harder for generator scripts to determine), as environment variables. */
+ 
++        // On NixOS we must propagate PATH to generators so they are
++        // able to find binaries such as `fsck.${fstype}` and
++        // `mkfs.${fstype}`. That is why we ignore transient_environment that
++        // overrides the PATH variable. This propagates systemd's
++        // environment (e.g. PATH) that was setup
++        // before calling systemd from stage-2-init.sh.
++#if 0
+         nl = strv_copy(m->transient_environment);
+         if (!nl)
+                 return -ENOMEM;
++#endif
+ 
+         r = strv_env_assign(&nl, "SYSTEMD_SCOPE", MANAGER_IS_SYSTEM(m) ? "system" : "user");
+         if (r < 0)
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/0019-core-handle-lookup-paths-being-symlinks.patch b/nixpkgs/pkgs/os-specific/linux/systemd/0019-core-handle-lookup-paths-being-symlinks.patch
deleted file mode 100644
index 54e5c32aeb44..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/systemd/0019-core-handle-lookup-paths-being-symlinks.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 2ab388cf0be320879e668a6206cb15d002b55f98 Mon Sep 17 00:00:00 2001
-From: Andreas Rammhold <andreas@rammhold.de>
-Date: Wed, 18 Aug 2021 19:10:08 +0200
-Subject: [PATCH 19/19] core: handle lookup paths being symlinks
-
-With a recent change paths leaving the statically known lookup paths
-would be treated differently then those that remained within those. That
-was done (AFAIK) to consistently handle alias names. Unfortunately that
-means that on some distributions, especially those where /etc/ consists
-mostly of symlinks, would trigger that new detection for every single
-unit in /etc/systemd/system. The reason for that is that the units
-directory itself is already a symlink.
----
- src/basic/unit-file.c | 33 +++++++++++++++++++++++++++++++--
- 1 file changed, 31 insertions(+), 2 deletions(-)
-
-diff --git a/src/basic/unit-file.c b/src/basic/unit-file.c
-index 0d58b1c4fe..7314f1245f 100644
---- a/src/basic/unit-file.c
-+++ b/src/basic/unit-file.c
-@@ -254,6 +254,7 @@ int unit_file_build_name_map(
- 
-         _cleanup_hashmap_free_ Hashmap *ids = NULL, *names = NULL;
-         _cleanup_set_free_free_ Set *paths = NULL;
-+        _cleanup_strv_free_ char **expanded_search_paths = NULL;
-         uint64_t timestamp_hash;
-         char **dir;
-         int r;
-@@ -273,6 +274,34 @@ int unit_file_build_name_map(
-                         return log_oom();
-         }
- 
-+        /* Go over all our search paths, chase their symlinks and store the
-+         * result in the expanded_search_paths list.
-+         *
-+         * This is important for cases where any of the unit directories itself
-+         * are symlinks into other directories and would therefore cause all of
-+         * the unit files to be recognized as linked units.
-+         *
-+         * This is important for distributions such as NixOS where most paths
-+         * in /etc/ are symlinks to some other location on the filesystem (e.g.
-+         * into /nix/store/).
-+         */
-+        STRV_FOREACH(dir, (char**) lp->search_path) {
-+                _cleanup_free_ char *resolved_dir = NULL;
-+                r = strv_extend(&expanded_search_paths, *dir);
-+                if (r < 0)
-+                        return log_oom();
-+
-+                r = chase_symlinks(*dir, NULL, 0, &resolved_dir, NULL);
-+                if (r < 0) {
-+                        if (r != -ENOENT)
-+                                log_warning_errno(r, "Failed to resolve symlink %s, ignoring: %m", *dir);
-+                        continue;
-+                }
-+
-+                if (strv_consume(&expanded_search_paths, TAKE_PTR(resolved_dir)) < 0)
-+                        return log_oom();
-+        }
-+
-         STRV_FOREACH(dir, (char**) lp->search_path) {
-                 struct dirent *de;
-                 _cleanup_closedir_ DIR *d = NULL;
-@@ -351,11 +380,11 @@ int unit_file_build_name_map(
-                                         continue;
-                                 }
- 
--                                /* Check if the symlink goes outside of our search path.
-+                                /* Check if the symlink goes outside of our (expanded) search path.
-                                  * If yes, it's a linked unit file or mask, and we don't care about the target name.
-                                  * Let's just store the link source directly.
-                                  * If not, let's verify that it's a good symlink. */
--                                char *tail = path_startswith_strv(simplified, lp->search_path);
-+                                char *tail = path_startswith_strv(simplified, expanded_search_paths);
-                                 if (!tail) {
-                                         log_debug("%s: linked unit file: %s → %s",
-                                                   __func__, filename, simplified);
--- 
-2.33.1
-
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/default.nix b/nixpkgs/pkgs/os-specific/linux/systemd/default.nix
index 3a3a419093b7..348f0e11342e 100644
--- a/nixpkgs/pkgs/os-specific/linux/systemd/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/systemd/default.nix
@@ -15,6 +15,8 @@
 , gperf
 , getent
 , glibcLocales
+
+  # glib is only used during tests (test-bus-gvariant, test-bus-marshal)
 , glib
 , substituteAll
 , gettext
@@ -29,7 +31,6 @@
   # Optional dependencies
 , pam
 , cryptsetup
-, lvm2
 , audit
 , acl
 , lz4
@@ -61,8 +62,10 @@
 , kexec-tools
 , bashInteractive
 , libmicrohttpd
+, libfido2
+, p11-kit
 
-  # the (optional) BPF feature requires bpftool, libbpf, clang and llmv-strip to be avilable during build time.
+  # the (optional) BPF feature requires bpftool, libbpf, clang and llvm-strip to be available during build time.
   # Only libbpf should be a runtime dependency.
 , bpftools
 , libbpf
@@ -97,8 +100,8 @@
 , withTimesyncd ? true
 , withTpm2Tss ? !stdenv.hostPlatform.isMusl
 , withUserDb ? !stdenv.hostPlatform.isMusl
-, libfido2
-, p11-kit
+  # tests assume too much system access for them to be feasible for us right now
+, withTests ? false
 
   # name argument
 , pname ? "systemd"
@@ -123,7 +126,14 @@ assert withHomed -> withCryptsetup;
 assert withCryptsetup -> (cryptsetup != null);
 let
   wantCurl = withRemote || withImportd;
-  version = "249.7";
+  wantGcrypt = withResolved || withImportd;
+  version = "251.3";
+
+  # Bump this variable on every (major) version change. See below (in the meson options list) for why.
+  # command:
+  #  $ curl -s https://api.github.com/repos/systemd/systemd/releases/latest | \
+  #     jq '.created_at|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime'
+  releaseTimestamp = "1653143108";
 in
 stdenv.mkDerivation {
   inherit pname version;
@@ -134,12 +144,13 @@ stdenv.mkDerivation {
     owner = "systemd";
     repo = "systemd-stable";
     rev = "v${version}";
-    sha256 = "sha256-y33/BvvI+JyhsvuT1Cbm6J2Z72j71oXgLw6X9NwCMPE=";
+    sha256 = "sha256-vcj+k/duRID2R+wGQIyq+dVRrFYNQTsjHya6k0hmZxk=";
   };
 
-  # If these need to be regenerated, `git am path/to/00*.patch` them into a
-  # systemd worktree, rebase to the more recent systemd version, and export the
-  # patches again via `git -c format.signoff=false format-patch v${version}`.
+  # On major changes, or when otherwise required, you *must* reformat the patches,
+  # `git am path/to/00*.patch` them into a systemd worktree, rebase to the more recent
+  # systemd version, and export the patches again via
+  # `git -c format.signoff=false format-patch v${version} --no-numbered --zero-commit --no-signature`.
   # Use `find . -name "*.patch" | sort` to get an up-to-date listing of all patches
   patches = [
     ./0001-Start-device-units-for-uninitialised-encrypted-devic.patch
@@ -153,65 +164,52 @@ stdenv.mkDerivation {
     ./0009-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch
     ./0010-localectl-use-etc-X11-xkb-for-list-x11.patch
     ./0011-build-don-t-create-statedir-and-don-t-touch-prefixdi.patch
-    ./0012-inherit-systemd-environment-when-calling-generators.patch
-    ./0013-add-rootprefix-to-lookup-dir-paths.patch
-    ./0014-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch
-    ./0015-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch
-    ./0016-kmod-static-nodes.service-Update-ConditionFileNotEmp.patch
-    ./0017-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
-    ./0018-pkg-config-derive-prefix-from-prefix.patch
-
-    # In v248 or v249 we started to get in trouble due to our
-    # /etc/systemd/system being a symlink and thus being treated differently by
-    # systemd. With the below patch we mitigate that effect by special casing
-    # all our root unit dirs if they are symlinks. This does exactly what we
-    # need (AFAICT).
-    # See https://github.com/systemd/systemd/pull/20479 for upsteam discussion.
-    ./0019-core-handle-lookup-paths-being-symlinks.patch
-  ] ++ lib.optional stdenv.hostPlatform.isMusl (let
-    oe-core = fetchzip {
-      url = "https://git.openembedded.org/openembedded-core/snapshot/openembedded-core-14c6e5a4b72d0e4665279158a0740dd1dc21f72f.tar.bz2";
-      sha256 = "1jixya4czkr5p5rdcw3d6ips8zzr82dvnanvzvgjh67730scflya";
-    };
-    musl-patches = oe-core + "/meta/recipes-core/systemd/systemd";
-  in [
-    (musl-patches + "/0002-don-t-use-glibc-specific-qsort_r.patch")
-    (musl-patches + "/0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch")
-    (musl-patches + "/0004-add-fallback-parse_printf_format-implementation.patch")
-    (musl-patches + "/0005-src-basic-missing.h-check-for-missing-strndupa.patch")
-    (musl-patches + "/0006-Include-netinet-if_ether.h.patch")
-    (musl-patches + "/0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch")
-    (musl-patches + "/0008-add-missing-FTW_-macros-for-musl.patch")
-    (musl-patches + "/0009-fix-missing-of-__register_atfork-for-non-glibc-build.patch")
-    (musl-patches + "/0010-Use-uintmax_t-for-handling-rlim_t.patch")
-    (musl-patches + "/0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch")
-    (musl-patches + "/0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch")
-    (musl-patches + "/0013-Define-glibc-compatible-basename-for-non-glibc-syste.patch")
-    (musl-patches + "/0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch")
-    (musl-patches + "/0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch")
-    (musl-patches + "/0016-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch")
-    (musl-patches + "/0017-missing_type.h-add-__compar_d_fn_t-definition.patch")
-    (musl-patches + "/0018-avoid-redefinition-of-prctl_mm_map-structure.patch")
-    (musl-patches + "/0019-Handle-missing-LOCK_EX.patch")
-    (musl-patches + "/0021-test-json.c-define-M_PIl.patch")
-    (musl-patches + "/0022-do-not-disable-buffer-in-writing-files.patch")
-    (musl-patches + "/0025-Handle-__cpu_mask-usage.patch")
-    (musl-patches + "/0026-Handle-missing-gshadow.patch")
-    (musl-patches + "/0028-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch")
-
-    # Being discussed upstream: https://lists.openembedded.org/g/openembedded-core/topic/86411771#157056
-    ./musl.diff
-  ]);
+    ./0012-add-rootprefix-to-lookup-dir-paths.patch
+    ./0013-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch
+    ./0014-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch
+    ./0015-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch
+    ./0016-pkg-config-derive-prefix-from-prefix.patch
+    ./0017-inherit-systemd-environment-when-calling-generators.patch
+  ] ++ lib.optional stdenv.hostPlatform.isMusl (
+    let
+      oe-core = fetchzip {
+        url = "https://git.openembedded.org/openembedded-core/snapshot/openembedded-core-86a33f98a7c0d6f2c2b51d02ba9e01b63062cf98.tar.bz2";
+        sha256 = "081j01sw21hl405l7g9z4bavvq0q0k4g80365677m0ykhiqlx3am";
+      };
+      musl-patches = oe-core + "/meta/recipes-core/systemd/systemd";
+    in
+    [
+      (musl-patches + "/0003-missing_type.h-add-comparison_fn_t.patch")
+      (musl-patches + "/0004-add-fallback-parse_printf_format-implementation.patch")
+      (musl-patches + "/0005-src-basic-missing.h-check-for-missing-strndupa.patch")
+      (musl-patches + "/0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch")
+      (musl-patches + "/0008-add-missing-FTW_-macros-for-musl.patch")
+      (musl-patches + "/0010-Use-uintmax_t-for-handling-rlim_t.patch")
+      (musl-patches + "/0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch")
+      (musl-patches + "/0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch")
+      (musl-patches + "/0013-Define-glibc-compatible-basename-for-non-glibc-syste.patch")
+      (musl-patches + "/0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch")
+      (musl-patches + "/0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch")
+      (musl-patches + "/0018-avoid-redefinition-of-prctl_mm_map-structure.patch")
+      (musl-patches + "/0022-do-not-disable-buffer-in-writing-files.patch")
+      (musl-patches + "/0025-Handle-__cpu_mask-usage.patch")
+      (musl-patches + "/0026-Handle-missing-gshadow.patch")
+      (musl-patches + "/0028-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch")
+      (musl-patches + "/0001-pass-correct-parameters-to-getdents64.patch")
+      (musl-patches + "/0002-Add-sys-stat.h-for-S_IFDIR.patch")
+      (musl-patches + "/0001-Adjust-for-musl-headers.patch")
+    ]
+  );
 
   postPatch = ''
     substituteInPlace src/basic/path-util.h --replace "@defaultPathNormal@" "${placeholder "out"}/bin/"
     substituteInPlace src/boot/efi/meson.build \
       --replace \
-      "find_program('objcopy'" \
-      "find_program('${stdenv.cc.bintools.targetPrefix}objcopy'"
+      "run_command(cc.cmd_array(), '-print-prog-name=objcopy', check: true).stdout().strip()" \
+      "'${stdenv.cc.bintools.targetPrefix}objcopy'"
   '' + (
     let
-      # The folllowing patches references to dynamic libraries to ensure that
+      # The following patches references to dynamic libraries to ensure that
       # all the features that are implemented via dlopen(3) are available (or
       # explicitly deactivated) by pointing dlopen to the absolute store path
       # instead of relying on the linkers runtime lookup code.
@@ -267,7 +265,7 @@ stdenv.mkDerivation {
           { name = "libidn.so.12"; pkg = null; }
           { name = "libidn.so.11"; pkg = null; }
 
-          # journalctl --grep requires libpcre so lets provide it
+          # journalctl --grep requires libpcre so let's provide it
           { name = "libpcre2-8.so.0"; pkg = pcre2; }
 
           # Support for TPM2 in systemd-cryptsetup, systemd-repart and systemd-cryptenroll
@@ -276,6 +274,10 @@ stdenv.mkDerivation {
           { name = "libtss2-mu.so.0"; pkg = opt withTpm2Tss tpm2-tss; }
           { name = "libtss2-tcti-"; pkg = opt withTpm2Tss tpm2-tss; }
           { name = "libfido2.so.1"; pkg = opt withFido2 libfido2; }
+
+          # inspect-elf support
+          { name = "libelf.so.1"; pkg = opt withCoredump elfutils; }
+          { name = "libdw.so.1"; pkg = opt withCoredump elfutils; }
         ];
 
       patchDlOpen = dl:
@@ -294,7 +296,7 @@ stdenv.mkDerivation {
             # exceptional case, details:
             # https://github.com/systemd/systemd-stable/blob/v249-stable/src/shared/tpm2-util.c#L157
             if ! [[ "${library}" =~ .*libtss2-tcti-$ ]]; then
-              echo 'The shared library `${library}` does not exist but was given as subtitute for `${dl.name}`'
+              echo 'The shared library `${library}` does not exist but was given as substitute for `${dl.name}`'
               exit 1
             fi
           fi
@@ -317,11 +319,12 @@ stdenv.mkDerivation {
       exit 1
     fi
   ''
-  # Finally patch shebangs that might need patching.
-  # Should no longer be necessary with v250.
-  # https://github.com/systemd/systemd/pull/19638
+  # Finally, patch shebangs in scripts used at build time. This must not patch
+  # scripts that will end up in the output, to avoid build platform references
+  # when cross-compiling.
   + ''
-    patchShebangs .
+    shopt -s extglob
+    patchShebangs tools test src/!(rpm)
   '';
 
   outputs = [ "out" "man" "dev" ];
@@ -356,16 +359,16 @@ stdenv.mkDerivation {
     [
       acl
       audit
-      glib
       kmod
       libcap
-      libgcrypt
       libidn2
       libuuid
       linuxHeaders
       pam
     ]
 
+    ++ lib.optional wantGcrypt libgcrypt
+    ++ lib.optional withTests glib
     ++ lib.optional withApparmor libapparmor
     ++ lib.optional wantCurl (lib.getDev curl)
     ++ lib.optionals withCompression [ bzip2 lz4 xz zstd ]
@@ -389,6 +392,14 @@ stdenv.mkDerivation {
 
   mesonFlags = [
     "-Dversion-tag=${version}"
+    # We bump this variable on every (major) version change to ensure
+    # that we have known-good value for a timestamp that is in the (not so distant) past.
+    # This serves as a lower bound for valid system timestamps during startup. Systemd will
+    # reset the system timestamp if this date is +- 15 years from the system time.
+    # See the systemd v250 release notes for further details:
+    # https://github.com/systemd/systemd/blob/60e930fc3e6eb8a36fbc184773119eb8d2f30364/NEWS#L258-L266
+    "-Dtime-epoch=${releaseTimestamp}"
+
     "-Ddbuspolicydir=${placeholder "out"}/share/dbus-1/system.d"
     "-Ddbussessionservicedir=${placeholder "out"}/share/dbus-1/services"
     "-Ddbussystemservicedir=${placeholder "out"}/share/dbus-1/system-services"
@@ -400,11 +411,11 @@ stdenv.mkDerivation {
     "-Dsetfont-path=${kbd}/bin/setfont"
     "-Dtty-gid=3" # tty in NixOS has gid 3
     "-Ddebug-shell=${bashInteractive}/bin/bash"
-    "-Dglib=${lib.boolToString (glib != null)}"
+    "-Dglib=${lib.boolToString withTests}"
     # while we do not run tests we should also not build them. Removes about 600 targets
     "-Dtests=false"
     "-Danalyze=${lib.boolToString withAnalyze}"
-    "-Dgcrypt=${lib.boolToString (libgcrypt != null)}"
+    "-Dgcrypt=${lib.boolToString wantGcrypt}"
     "-Dimportd=${lib.boolToString withImportd}"
     "-Dlz4=${lib.boolToString withCompression}"
     "-Dhomed=${lib.boolToString withHomed}"
@@ -435,7 +446,11 @@ stdenv.mkDerivation {
     "-Dsmack=true"
     "-Db_pie=true"
     "-Dinstall-sysconfdir=false"
-    "-Defi-ld=${stdenv.cc.bintools.targetPrefix}ld"
+    "-Dsbat-distro=nixos"
+    "-Dsbat-distro-summary=NixOS"
+    "-Dsbat-distro-url=https://nixos.org/"
+    "-Dsbat-distro-pkgname=${pname}"
+    "-Dsbat-distro-version=${version}"
     /*
       As of now, systemd doesn't allow runtime configuration of these values. So
       the settings in /etc/login.defs have no effect on it. Many people think this
@@ -448,7 +463,6 @@ stdenv.mkDerivation {
     */
     "-Dsystem-uid-max=999"
     "-Dsystem-gid-max=999"
-    # "-Dtime-epoch=1"
 
     "-Dsysvinit-path="
     "-Dsysvrcnd-path="
@@ -487,57 +501,105 @@ stdenv.mkDerivation {
     "-Dutmp=false"
     "-Didn=false"
   ];
+  preConfigure =
+    let
+      # A list of all the runtime binaries that the systemd exectuables, tests and libraries are referencing in their source code, scripts and unit files.
+      # As soon as a dependency isn't required anymore we should remove it from the list. The `where` attribute for each of the replacement patterns must be exhaustive. If another (unhandled) case is found in the source code the build fails with an error message.
+      binaryReplacements = [
+        { search = "/usr/bin/getent"; replacement = "${getent}/bin/getent"; where = [ "src/nspawn/nspawn-setuid.c" ]; }
+
+        {
+          search = "/sbin/mkswap";
+          replacement = "${lib.getBin util-linux}/sbin/mkswap";
+          where = [
+            "man/systemd-makefs@.service.xml"
+          ];
+        }
+        { search = "/sbin/swapon"; replacement = "${lib.getBin util-linux}/sbin/swapon"; where = [ "src/core/swap.c" "src/basic/unit-def.h" ]; }
+        { search = "/sbin/swapoff"; replacement = "${lib.getBin util-linux}/sbin/swapoff"; where = [ "src/core/swap.c" ]; }
+        {
+          search = "/bin/echo";
+          replacement = "${coreutils}/bin/echo";
+          where = [
+            "man/systemd-analyze.xml"
+            "man/systemd.service.xml"
+            "src/analyze/test-verify.c"
+            "src/test/test-env-file.c"
+            "src/test/test-fileio.c"
+            "src/test/test-load-fragment.c"
+          ];
+        }
+        {
+          search = "/bin/cat";
+          replacement = "${coreutils}/bin/cat";
+          where = [ "test/create-busybox-container" "test/test-execute/exec-noexecpaths-simple.service" "src/journal/cat.c" ];
+        }
+        { search = "/sbin/modprobe"; replacement = "${lib.getBin kmod}/sbin/modprobe"; where = [ "units/modprobe@.service" ]; }
+        {
+          search = "/usr/lib/systemd/systemd-fsck";
+          replacement = "$out/lib/systemd/systemd-fsck";
+          where = [
+            "man/systemd-fsck@.service.xml"
+          ];
+        }
+      ] ++ lib.optionals withImportd [
+        {
+          search = "\"gpg\"";
+          replacement = "\\\"${gnupg}/bin/gpg\\\"";
+          where = [ "src/import/pull-common.c" ];
+        }
+        {
+          search = "\"tar\"";
+          replacement = "\\\"${gnutar}/bin/tar\\\"";
+          where = [
+            "src/import/export-tar.c"
+            "src/import/import-common.c"
+            "src/import/import-tar.c"
+          ];
+          ignore = [
+            # occurences here refer to the tar sub command
+            "src/sysupdate/sysupdate-resource.c"
+            "src/sysupdate/sysupdate-transfer.c"
+            "src/import/pull.c"
+            "src/import/export.c"
+            "src/import/import.c"
+            "src/import/importd.c"
+            # runs `tar` but also also creates a temporary directory with the string
+            "src/import/pull-tar.c"
+          ];
+        }
+      ];
+
+      # { replacement, search, where } -> List[str]
+      mkSubstitute = { replacement, search, where, ignore ? [] }:
+        map (path: "substituteInPlace ${path} --replace '${search}' \"${replacement}\"") where;
+      mkEnsureSubstituted = { replacement, search, where, ignore ? [] }:
+      let
+        ignore' = lib.concatStringsSep "|" (ignore ++ ["^test" "NEWS"]);
+      in ''
+        set +e
+        search=$(grep '${search}' -r | grep -v "${replacement}" | grep -Ev "${ignore'}")
+        set -e
+        if [[ -n "$search" ]]; then
+          echo "Not all references to '${search}' have been replaced. Found the following matches:"
+          echo "$search"
+          exit 1
+        fi
+      '';
+    in
+    ''
+      mesonFlagsArray+=(-Dntp-servers="0.nixos.pool.ntp.org 1.nixos.pool.ntp.org 2.nixos.pool.ntp.org 3.nixos.pool.ntp.org")
+      export LC_ALL="en_US.UTF-8";
 
-  preConfigure = ''
-    mesonFlagsArray+=(-Dntp-servers="0.nixos.pool.ntp.org 1.nixos.pool.ntp.org 2.nixos.pool.ntp.org 3.nixos.pool.ntp.org")
-    export LC_ALL="en_US.UTF-8";
-    # FIXME: patch this in systemd properly (and send upstream).
-    # already fixed in f00929ad622c978f8ad83590a15a765b4beecac9: (u)mount
-    for i in \
-      src/core/mount.c \
-      src/core/swap.c \
-      src/cryptsetup/cryptsetup-generator.c \
-      src/journal/cat.c \
-      src/nspawn/nspawn.c \
-      src/remount-fs/remount-fs.c \
-      src/shared/generator.c \
-      src/shutdown/shutdown.c \
-      units/emergency.service.in \
-      units/modprobe@.service \
-      units/rescue.service.in \
-      units/systemd-logind.service.in \
-      units/systemd-nspawn@.service.in; \
-    do
-      test -e $i
-      substituteInPlace $i \
-        --replace /usr/bin/getent ${getent}/bin/getent \
-        --replace /sbin/mkswap ${lib.getBin util-linux}/sbin/mkswap \
-        --replace /sbin/swapon ${lib.getBin util-linux}/sbin/swapon \
-        --replace /sbin/swapoff ${lib.getBin util-linux}/sbin/swapoff \
-        --replace /bin/echo ${coreutils}/bin/echo \
-        --replace /bin/cat ${coreutils}/bin/cat \
-        --replace /sbin/sulogin ${lib.getBin util-linux}/sbin/sulogin \
-        --replace /sbin/modprobe ${lib.getBin kmod}/sbin/modprobe \
-        --replace /usr/lib/systemd/systemd-fsck $out/lib/systemd/systemd-fsck \
-        --replace /bin/plymouth /run/current-system/sw/bin/plymouth # To avoid dependency
-    done
-
-    for dir in tools src/resolve test src/test src/shared; do
-      patchShebangs $dir
-    done
-
-    # absolute paths to gpg & tar
-    substituteInPlace src/import/pull-common.c \
-      --replace '"gpg"' '"${gnupg}/bin/gpg"'
-    for file in src/import/{{export,import,pull}-tar,import-common}.c; do
-      substituteInPlace $file \
-        --replace '"tar"' '"${gnutar}/bin/tar"'
-    done
+      ${lib.concatStringsSep "\n" (lib.flatten (map mkSubstitute binaryReplacements))}
+      ${lib.concatMapStringsSep "\n" mkEnsureSubstituted binaryReplacements}
 
+      substituteInPlace src/libsystemd/sd-journal/catalog.c \
+        --replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/
 
-    substituteInPlace src/libsystemd/sd-journal/catalog.c \
-      --replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/
-  '';
+      substituteInPlace src/import/pull-tar.c \
+        --replace 'wait_for_terminate_and_check("tar"' 'wait_for_terminate_and_check("${gnutar}/bin/tar"'
+    '';
 
   # These defines are overridden by CFLAGS and would trigger annoying
   # warning messages
@@ -545,7 +607,7 @@ stdenv.mkDerivation {
     substituteInPlace config.h \
       --replace "POLKIT_AGENT_BINARY_PATH" "_POLKIT_AGENT_BINARY_PATH" \
       --replace "SYSTEMD_BINARY_PATH" "_SYSTEMD_BINARY_PATH" \
-      --replace "SYSTEMD_CGROUP_AGENT_PATH" "_SYSTEMD_CGROUP_AGENT_PATH"
+      --replace "SYSTEMD_CGROUP_AGENTS_PATH" "_SYSTEMD_CGROUP_AGENT_PATH"
   '';
 
   NIX_CFLAGS_COMPILE = toString ([
@@ -557,8 +619,8 @@ stdenv.mkDerivation {
     # Set the release_agent on /sys/fs/cgroup/systemd to the
     # currently running systemd (/run/current-system/systemd) so
     # that we don't use an obsolete/garbage-collected release agent.
-    "-USYSTEMD_CGROUP_AGENT_PATH"
-    "-DSYSTEMD_CGROUP_AGENT_PATH=\"/run/current-system/systemd/lib/systemd/systemd-cgroups-agent\""
+    "-USYSTEMD_CGROUP_AGENTS_PATH"
+    "-DSYSTEMD_CGROUP_AGENTS_PATH=\"/run/current-system/systemd/lib/systemd/systemd-cgroups-agent\""
 
     "-USYSTEMD_BINARY_PATH"
     "-DSYSTEMD_BINARY_PATH=\"/run/current-system/systemd/lib/systemd/systemd\""
@@ -594,6 +656,18 @@ stdenv.mkDerivation {
     rm -rf $out/share/doc
   '';
 
+  # Avoid *.EFI binary stripping. At least on aarch64-linux strip
+  # removes too much from PE32+ files:
+  #   https://github.com/NixOS/nixpkgs/issues/169693
+  # The hack is to move EFI file out of lib/ before doStrip
+  # run and return it after doStrip run.
+  preFixup = lib.optionalString withEfi ''
+    mv $out/lib/systemd/boot/efi $out/dont-strip-me
+  '';
+  postFixup = lib.optionalString withEfi ''
+    mv $out/dont-strip-me $out/lib/systemd/boot/efi
+  '';
+
   passthru = {
     # The interface version prevents NixOS from switching to an
     # incompatible systemd at runtime.  (Switching across reboots is
@@ -603,7 +677,7 @@ stdenv.mkDerivation {
     # runtime; otherwise we can't and we need to reboot.
     interfaceVersion = 2;
 
-    inherit withCryptsetup;
+    inherit withCryptsetup withHostnamed withImportd withLocaled withMachined withTimedated util-linux kmod kbd;
 
     tests = {
       inherit (nixosTests) switchTest;
@@ -615,6 +689,8 @@ stdenv.mkDerivation {
     description = "A system and service manager for Linux";
     license = licenses.lgpl21Plus;
     platforms = platforms.linux;
+    # https://github.com/systemd/systemd/issues/20600#issuecomment-912338965
+    broken = stdenv.hostPlatform.isStatic;
     priority = 10;
     maintainers = with maintainers; [ flokli kloenk mic92 ];
   };
diff --git a/nixpkgs/pkgs/os-specific/linux/systemd/musl.diff b/nixpkgs/pkgs/os-specific/linux/systemd/musl.diff
deleted file mode 100644
index cab135dd8fc5..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/systemd/musl.diff
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/src/shared/mount-setup.c b/src/shared/mount-setup.c
-index ef3527e..cc1ba23 100644
---- a/src/shared/mount-setup.c
-+++ b/src/shared/mount-setup.c
-@@ -32,6 +32,7 @@
- #include "strv.h"
- #include "user-util.h"
- #include "virt.h"
-+#include "missing_type.h"
- 
- typedef enum MountMode {
-         MNT_NONE           = 0,
diff --git a/nixpkgs/pkgs/os-specific/linux/teensy-udev-rules/default.nix b/nixpkgs/pkgs/os-specific/linux/teensy-udev-rules/default.nix
new file mode 100644
index 000000000000..e3d50eee5f67
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/teensy-udev-rules/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, coreutils }:
+
+stdenv.mkDerivation {
+  pname = "teensy-udev-rules";
+  version = "2022-05-15";
+
+  # Source: https://www.pjrc.com/teensy/00-teensy.rules
+  src = ./teensy.rules;
+
+  dontUnpack = true;
+
+  runtimeDeps = [ coreutils ];
+
+  installPhase = ''
+    install -D $src $out/etc/udev/rules.d/70-teensy.rules
+    substituteInPlace $out/etc/udev/rules.d/70-teensy.rules \
+      --replace "/bin/stty" "${coreutils}/bin/stty"
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.pjrc.com/teensy/00-teensy.rules";
+    description = ''
+      udev rules that give non-root users permission to communicate with the
+      Teensy family of microcontrolers.
+
+      ModemManager (part of NetworkManager) can interfere with USB Serial
+      devices, which includes the Teensy.  See comments in the .rules file (or
+      this package's homepage) for possible workarounds.
+    '';
+    platforms = platforms.linux;
+    license = "unknown";
+    maintainers = with maintainers; [ aidalgol ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/teensy-udev-rules/teensy.rules b/nixpkgs/pkgs/os-specific/linux/teensy-udev-rules/teensy.rules
new file mode 100644
index 000000000000..0a921a507af6
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/teensy-udev-rules/teensy.rules
@@ -0,0 +1,39 @@
+# UDEV Rules for Teensy boards, http://www.pjrc.com/teensy/
+#
+# The latest version of this file may be found at:
+#   http://www.pjrc.com/teensy/00-teensy.rules
+#
+# This file must be placed at:
+#
+# /etc/udev/rules.d/00-teensy.rules    (preferred location)
+#   or
+# /lib/udev/rules.d/00-teensy.rules    (req'd on some broken systems)
+#
+# To install, type this command in a terminal:
+#   sudo cp 00-teensy.rules /etc/udev/rules.d/00-teensy.rules
+#
+# After this file is installed, physically unplug and reconnect Teensy.
+#
+ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
+ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789a]*", ENV{MTP_NO_PROBE}="1"
+KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", MODE:="0666", RUN:="/bin/stty -F /dev/%k raw -echo"
+KERNEL=="hidraw*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", MODE:="0666"
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", MODE:="0666"
+KERNEL=="hidraw*", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="013*", MODE:="0666"
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="013*", MODE:="0666"
+
+#
+# If you share your linux system with other users, or just don't like the
+# idea of write permission for everybody, you can replace MODE:="0666" with
+# OWNER:="yourusername" to create the device owned by you, or with
+# GROUP:="somegroupname" and mange access using standard unix groups.
+#
+# ModemManager tends to interfere with USB Serial devices like Teensy.
+# Problems manifest as the Arduino Serial Monitor missing some incoming
+# data, and "Unable to open /dev/ttyACM0 for reboot request" when
+# uploading.  If you experience these problems, disable or remove
+# ModemManager from your system.  If you must use a modem, perhaps
+# try disabling the "MM_FILTER_RULE_TTY_ACM_INTERFACE" ModemManager
+# rule.  Changing ModemManager's filter policy from "strict" to "default"
+# may also help.  But if you don't use a modem, completely removing
+# the troublesome ModemManager is the most effective solution.
diff --git a/nixpkgs/pkgs/os-specific/linux/tinyalsa/default.nix b/nixpkgs/pkgs/os-specific/linux/tinyalsa/default.nix
new file mode 100644
index 000000000000..45d9191eea08
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/tinyalsa/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tinyalsa";
+  version = "unstable-2022-06-05";
+
+  src = fetchFromGitHub {
+    owner = "tinyalsa";
+    repo = "tinyalsa";
+    rev = "3d70d227e7dfd1be6f8f420a5aae164a2b4126e0";
+    hash = "sha256-RHeF3VShy+LYFtJK+AEU7swIr5/rnpg2fdllnH9cFCk=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  cmakeFlags = [
+    "-DTINYALSA_USES_PLUGINS=ON"
+  ];
+
+  NIX_CFLAGS_COMPILE = toString [
+    "-Wno-error=sign-compare"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/tinyalsa/tinyalsa";
+    description = "Tiny library to interface with ALSA in the Linux kernel";
+    license = licenses.mit;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/tiptop/default.nix b/nixpkgs/pkgs/os-specific/linux/tiptop/default.nix
index bb9fa2859824..7e88e1b14b52 100644
--- a/nixpkgs/pkgs/os-specific/linux/tiptop/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/tiptop/default.nix
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     homepage = "http://tiptop.gforge.inria.fr";
     license = licenses.gpl2;
     platforms = platforms.linux;
-    maintainers = [ maintainers.vcunat ];
+    maintainers = [ ];
   };
 }
 
diff --git a/nixpkgs/pkgs/os-specific/linux/tiscamera/0001-cmake-find-aravis-fix-pkg-cfg-include-dirs.patch b/nixpkgs/pkgs/os-specific/linux/tiscamera/0001-cmake-find-aravis-fix-pkg-cfg-include-dirs.patch
new file mode 100644
index 000000000000..0e9821467850
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/tiscamera/0001-cmake-find-aravis-fix-pkg-cfg-include-dirs.patch
@@ -0,0 +1,25 @@
+From 90b540bd135de2587352719b14c385b20aa572be Mon Sep 17 00:00:00 2001
+From: Raymond Gauthier <jraygauthier@gmail.com>
+Date: Wed, 15 Jun 2022 16:09:58 -0400
+Subject: [PATCH] cmake-find-aravis: fix pkg cfg include dirs
+
+---
+ cmake/modules/FindAravis.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/modules/FindAravis.cmake b/cmake/modules/FindAravis.cmake
+index 5dab5431..811302b9 100644
+--- a/cmake/modules/FindAravis.cmake
++++ b/cmake/modules/FindAravis.cmake
+@@ -20,7 +20,7 @@ find_path(aravis_INCLUDE_DIR
+ 	arv.h
+ 	PATHS
+ 	${aravis_PKGCONF_INCLUDE_DIRS}
+-	${aravis0_6_PKGCONF_INCLUDE_DIRS}
++	${aravis0_8_PKGCONF_INCLUDE_DIRS}
+ 	/usr/local/include
+ 	# /usr/local/include/aravis-0.4
+ 	/usr/local/include/aravis-0.8
+-- 
+2.31.1
+
diff --git a/nixpkgs/pkgs/os-specific/linux/tiscamera/0001-tcamconvert-tcamsrc-add-missing-include-lib-dirs.patch b/nixpkgs/pkgs/os-specific/linux/tiscamera/0001-tcamconvert-tcamsrc-add-missing-include-lib-dirs.patch
new file mode 100644
index 000000000000..3d1e5503bcd3
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/tiscamera/0001-tcamconvert-tcamsrc-add-missing-include-lib-dirs.patch
@@ -0,0 +1,70 @@
+From 5e7146e176cb1b01b47d16a66763469dccd87f25 Mon Sep 17 00:00:00 2001
+From: Raymond Gauthier <jraygauthier@gmail.com>
+Date: Thu, 9 Jun 2022 19:45:30 -0400
+Subject: [PATCH] tcamconvert&tcamsrc: add missing include/lib dirs
+
+These were building libraries with dependencies on gstreamer-video
+and gstreamer-base but weren't adding the proper include and
+lib directories which resulted in build failure on systems
+where video and base aren't installed in the same location
+as gstreamer itself (e.g: nix, nixos).
+---
+ src/gstreamer-1.0/tcamconvert/CMakeLists.txt |  2 ++
+ src/gstreamer-1.0/tcamsrc/CMakeLists.txt     | 11 +++++++++++
+ 2 files changed, 13 insertions(+)
+
+diff --git a/src/gstreamer-1.0/tcamconvert/CMakeLists.txt b/src/gstreamer-1.0/tcamconvert/CMakeLists.txt
+index 30563c38..066cb5d7 100644
+--- a/src/gstreamer-1.0/tcamconvert/CMakeLists.txt
++++ b/src/gstreamer-1.0/tcamconvert/CMakeLists.txt
+@@ -28,6 +28,8 @@ add_library(tcamconvert SHARED
+ target_include_directories(tcamconvert
+   PRIVATE
+   ${GSTREAMER_INCLUDE_DIRS}
++  ${GSTREAMER_BASE_INCLUDE_DIRS}
++  ${GSTREAMER_VIDEO_INCLUDE_DIRS}
+   )
+ 
+ set_project_warnings(tcamconvert)
+diff --git a/src/gstreamer-1.0/tcamsrc/CMakeLists.txt b/src/gstreamer-1.0/tcamsrc/CMakeLists.txt
+index 3bc7ed97..ed5be37f 100644
+--- a/src/gstreamer-1.0/tcamsrc/CMakeLists.txt
++++ b/src/gstreamer-1.0/tcamsrc/CMakeLists.txt
+@@ -21,12 +21,15 @@ add_library(gsttcamstatistics SHARED
+ target_include_directories(gsttcamstatistics
+   PRIVATE
+   ${GSTREAMER_INCLUDE_DIRS}
++  ${GSTREAMER_BASE_INCLUDE_DIRS}
++  ${GSTREAMER_VIDEO_INCLUDE_DIRS}
+   )
+ 
+ target_link_libraries( gsttcamstatistics
+   PRIVATE
+   ${GSTREAMER_LIBRARIES}
+   ${GSTREAMER_BASE_LIBRARIES}
++  ${GSTREAMER_VIDEO_LIBRARIES}
+   )
+ 
+ 
+@@ -53,10 +56,18 @@ add_library(gsttcamsrc SHARED
+ 	tcambind.cpp
+     )
+ 
++  target_include_directories(gsttcamsrc
++    PRIVATE
++    ${GSTREAMER_INCLUDE_DIRS}
++    ${GSTREAMER_BASE_INCLUDE_DIRS}
++    ${GSTREAMER_VIDEO_INCLUDE_DIRS}
++    )
++
+   target_link_libraries( gsttcamsrc
+     PRIVATE
+ 	${GSTREAMER_LIBRARIES}
+ 	${GSTREAMER_BASE_LIBRARIES}
++    ${GSTREAMER_VIDEO_LIBRARIES}
+ 
+ 	tcamgstbase
+ 	tcam::gst-helper
+-- 
+2.31.1
+
diff --git a/nixpkgs/pkgs/os-specific/linux/tiscamera/0001-udev-rules-fix-install-location.patch b/nixpkgs/pkgs/os-specific/linux/tiscamera/0001-udev-rules-fix-install-location.patch
new file mode 100644
index 000000000000..9b373516aa9b
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/tiscamera/0001-udev-rules-fix-install-location.patch
@@ -0,0 +1,25 @@
+From fdbc0b74812b9afd663226715375b5688e5408b5 Mon Sep 17 00:00:00 2001
+From: Raymond Gauthier <jraygauthier@gmail.com>
+Date: Thu, 9 Jun 2022 20:23:02 -0400
+Subject: [PATCH] udev/rules: fix install location
+
+---
+ CMakeInstall.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeInstall.cmake b/CMakeInstall.cmake
+index 4773091f..962c9b09 100644
+--- a/CMakeInstall.cmake
++++ b/CMakeInstall.cmake
+@@ -92,7 +92,7 @@ else()
+ 
+   else()
+ 
+-    set(TCAM_INSTALL_UDEV "${CMAKE_INSTALL_PREFIX}/udev/rules.d" CACHE PATH "udev rules installation path" FORCE)
++    set(TCAM_INSTALL_UDEV "${CMAKE_INSTALL_PREFIX}/lib/udev/rules.d" CACHE PATH "udev rules installation path" FORCE)
+     set(TCAM_INSTALL_SYSTEMD "${CMAKE_INSTALL_PREFIX}/lib/systemd/system/" CACHE PATH "systemd unit installation path" FORCE)
+ 
+     set(TCAM_INSTALL_PKGCONFIG "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig" CACHE PATH "pkgconfig installation path" FORCE)
+-- 
+2.31.1
+
diff --git a/nixpkgs/pkgs/os-specific/linux/tiscamera/default.nix b/nixpkgs/pkgs/os-specific/linux/tiscamera/default.nix
index 38bc7c3eaff3..5ef0b0b0ea7f 100644
--- a/nixpkgs/pkgs/os-specific/linux/tiscamera/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/tiscamera/default.nix
@@ -3,81 +3,111 @@
 , fetchFromGitHub
 , cmake
 , pkg-config
-, pcre
-, tinyxml
+, runtimeShell
+, catch2
+, elfutils
+, libselinux
+, libsepol
+, libunwind
 , libusb1
+, libuuid
 , libzip
+, orc
+, pcre
+, zstd
 , glib
 , gobject-introspection
 , gst_all_1
-, libwebcam
-, libunwind
-, elfutils
-, orc
-, python3Packages
-, libuuid
 , wrapGAppsHook
+, withDoc ? true
+, sphinx
+, graphviz
+, withAravis ? true
+, aravis
+, meson
+, withAravisUsbVision ? withAravis
+, withGui ? true
+, qt5
 }:
 
 stdenv.mkDerivation rec {
   pname = "tiscamera";
-  version = "0.13.1";
+  version = "1.0.0";
 
   src = fetchFromGitHub {
     owner = "TheImagingSource";
     repo = pname;
     rev = "v-${pname}-${version}";
-    sha256 = "0hpy9yhc4mn6w8gvzwif703smmcys0j2jqbz2xfghqxcyb0ykplj";
+    sha256 = "0msz33wvqrji11kszdswcvljqnjflmjpk0aqzmsv6i855y8xn6cd";
   };
 
+  patches = [
+    ./0001-tcamconvert-tcamsrc-add-missing-include-lib-dirs.patch
+    ./0001-udev-rules-fix-install-location.patch
+    ./0001-cmake-find-aravis-fix-pkg-cfg-include-dirs.patch
+  ];
+
+  postPatch = ''
+    cp ${catch2}/include/catch2/catch.hpp external/catch/catch.hpp
+
+    substituteInPlace ./data/udev/80-theimagingsource-cameras.rules.in \
+      --replace "/bin/sh" "${runtimeShell}/bin/sh" \
+      --replace "typically /usr/bin/" "" \
+      --replace "typically /usr/share/theimagingsource/tiscamera/uvc-extension/" ""
+  '';
+
   nativeBuildInputs = [
     cmake
     pkg-config
-    python3Packages.wrapPython
     wrapGAppsHook
+  ] ++ lib.optionals withDoc [
+    sphinx
+    graphviz
+  ] ++ lib.optionals withAravis [
+    meson
+  ] ++ lib.optionals withGui [
+    qt5.wrapQtAppsHook
   ];
 
   buildInputs = [
-    pcre
-    tinyxml
+    elfutils
+    libselinux
+    libsepol
+    libunwind
     libusb1
+    libuuid
     libzip
+    orc
+    pcre
+    zstd
     glib
     gobject-introspection
     gst_all_1.gstreamer
     gst_all_1.gst-plugins-base
-    libwebcam
-    libunwind
-    elfutils
-    orc
-    libuuid
-    python3Packages.python
-    python3Packages.pyqt5
+    gst_all_1.gst-plugins-good
+    gst_all_1.gst-plugins-bad
+    gst_all_1.gst-plugins-ugly
+  ] ++ lib.optionals withAravis [
+    aravis
+  ] ++ lib.optionals withGui [
+    qt5.qtbase
   ];
 
-  pythonPath = with python3Packages; [ pyqt5 pygobject3 ];
-
-  propagatedBuildInputs = pythonPath;
+  hardeningDisable = [ "format" ];
 
   cmakeFlags = [
-    "-DBUILD_ARAVIS=OFF" # For GigE support. Won't need it as our camera is usb.
-    "-DBUILD_GST_1_0=ON"
-    "-DBUILD_TOOLS=ON"
-    "-DBUILD_V4L2=ON"
-    "-DBUILD_LIBUSB=ON"
-    "-DBUILD_TESTS=ON"
-    "-DTCAM_INSTALL_UDEV=${placeholder "out"}/lib/udev/rules.d"
-    "-DTCAM_INSTALL_UVCDYNCTRL=${placeholder "out"}/share/uvcdynctrl/data/199e"
-    "-DTCAM_INSTALL_GST_1_0=${placeholder "out"}/lib/gstreamer-1.0"
-    "-DTCAM_INSTALL_GIR=${placeholder "out"}/share/gir-1.0"
-    "-DTCAM_INSTALL_TYPELIB=${placeholder "out"}/lib/girepository-1.0"
-    "-DTCAM_INSTALL_SYSTEMD=${placeholder "out"}/etc/systemd/system"
-    "-DTCAM_INSTALL_PYTHON3_MODULES=${placeholder "out"}/lib/${python3Packages.python.libPrefix}/site-packages"
-    "-DGSTREAMER_1.0_INCLUDEDIR=${placeholder "out"}/include/gstreamer-1.0"
-    # There are gobject introspection commands launched as part of the build. Those have a runtime
-    # dependency on `libtcam` (which itself is built as part of this build). In order to allow
-    # that, we set the dynamic linker's path to point on the build time location of the library.
-    "-DCMAKE_SKIP_BUILD_RPATH=OFF"
+    "-DTCAM_BUILD_GST_1_0=ON"
+    "-DTCAM_BUILD_TOOLS=ON"
+    "-DTCAM_BUILD_V4L2=ON"
+    "-DTCAM_BUILD_LIBUSB=ON"
+    "-DTCAM_BUILD_TESTS=ON"
+    "-DTCAM_BUILD_ARAVIS=${if withAravis then "ON" else "OFF"}"
+    "-DTCAM_BUILD_DOCUMENTATION=${if withDoc then "ON" else "OFF"}"
+    "-DTCAM_BUILD_WITH_GUI=${if withGui then "ON" else "OFF"}"
+    "-DTCAM_DOWNLOAD_MESON=OFF"
+    "-DTCAM_INTERNAL_ARAVIS=OFF"
+    "-DTCAM_ARAVIS_USB_VISION=${if withAravis && withAravisUsbVision then "ON" else "OFF"}"
+    "-DTCAM_INSTALL_FORCE_PREFIX=ON"
   ];
 
   doCheck = true;
@@ -85,8 +115,17 @@ stdenv.mkDerivation rec {
   # gstreamer tests requires, besides gst-plugins-bad, plugins installed by this expression.
   checkPhase = "ctest --force-new-ctest-process -E gstreamer";
 
-  postFixup = ''
-    wrapPythonPrograms "$out $pythonPath"
+  # wrapGAppsHook: make sure we add ourselves to the introspection
+  # and gstreamer paths.
+  GI_TYPELIB_PATH = "${placeholder "out"}/lib/girepository-1.0";
+  GST_PLUGIN_SYSTEM_PATH_1_0 = "${placeholder "out"}/lib/gstreamer-1.0";
+
+  QT_PLUGIN_PATH = lib.optionalString withGui "${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}";
+
+  dontWrapQtApps = true;
+
+  preFixup = ''
+    gappsWrapperArgs+=("''${qtWrapperArgs[@]}")
   '';
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/os-specific/linux/trace-cmd/default.nix b/nixpkgs/pkgs/os-specific/linux/trace-cmd/default.nix
index a339c60e8dfa..0bf5a8e2adb0 100644
--- a/nixpkgs/pkgs/os-specific/linux/trace-cmd/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/trace-cmd/default.nix
@@ -1,12 +1,12 @@
-{ lib, stdenv, fetchgit, pkg-config, asciidoc, xmlto, docbook_xsl, libxslt, libtraceevent, libtracefs }:
+{ lib, stdenv, fetchgit, pkg-config, asciidoc, xmlto, docbook_xsl, docbook_xml_dtd_45, libxslt, libtraceevent, libtracefs, zstd, sourceHighlight }:
 stdenv.mkDerivation rec {
   pname = "trace-cmd";
-  version = "2.9.7";
+  version = "3.1.1";
 
   src = fetchgit {
     url    = "git://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/";
     rev    = "trace-cmd-v${version}";
-    sha256 = "sha256-04qsTlOVYh/jHVWxaGuqYj4DkUpcEYcpfUqnqhphIMg=";
+    sha256 = "sha256-zYw6DObwmroAU3ikUNo9XrwQeDlyLppe7E63WFjn44Q=";
   };
 
   # Don't build and install html documentation
@@ -15,9 +15,9 @@ stdenv.mkDerivation rec {
        Documentation{,/trace-cmd,/libtracecmd}/Makefile
   '';
 
-  nativeBuildInputs = [ asciidoc libxslt pkg-config xmlto ];
+  nativeBuildInputs = [ asciidoc libxslt pkg-config xmlto docbook_xsl docbook_xml_dtd_45 sourceHighlight ];
 
-  buildInputs = [ libtraceevent libtracefs ];
+  buildInputs = [ libtraceevent libtracefs zstd ];
 
   outputs = [ "out" "lib" "dev" "man" ];
 
@@ -27,19 +27,28 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
   makeFlags = [
-    "all" "libs" "doc"
     # The following values appear in the generated .pc file
     "prefix=${placeholder "lib"}"
-    "libdir=${placeholder "lib"}/lib"
-    "includedir=${placeholder "dev"}/include"
   ];
 
-  installTargets = [ "install_cmd" "install_libs" "install_doc" ];
+  # We do not mention targets (like "doc") explicitly in makeFlags
+  # because the Makefile would not print warnings about too old
+  # libraries (see "warning:" in the Makefile)
+  postBuild = ''
+    make libs doc -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES
+  '';
+
+  installTargets = [
+    "install_cmd"
+    "install_libs"
+    "install_doc"
+  ];
   installFlags = [
+    "LDCONFIG=false"
     "bindir=${placeholder "out"}/bin"
-    "man_dir=${placeholder "man"}/share/man"
+    "mandir=${placeholder "man"}/share/man"
     "libdir=${placeholder "lib"}/lib"
-    "pkgconfig_dir=${placeholder "lib"}/lib/pkgconfig"
+    "pkgconfig_dir=${placeholder "dev"}/lib/pkgconfig"
     "includedir=${placeholder "dev"}/include"
     "BASH_COMPLETE_DIR=${placeholder "out"}/share/bash-completion/completions"
   ];
diff --git a/nixpkgs/pkgs/os-specific/linux/trinity/default.nix b/nixpkgs/pkgs/os-specific/linux/trinity/default.nix
index 9bfe0e942eeb..09a2d8bf638d 100644
--- a/nixpkgs/pkgs/os-specific/linux/trinity/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/trinity/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "trinity";
@@ -11,6 +11,15 @@ stdenv.mkDerivation rec {
     sha256 = "0z1a7x727xacam74jccd223k303sllgwpq30lnq9b6xxy8b659bv";
   };
 
+  patches = [
+    # Pull upstream fix for -fno-common toolchains
+    (fetchpatch {
+      name = "fno-common.patch";
+      url = "https://github.com/kernelslacker/trinity/commit/e53e25cc8dd5bdb5f7d9b4247de9e9921eec81d8.patch";
+      sha256 = "0dbhyc98x11cmac6rj692zymnfqfqcbawlrkg1lhgfagzjxxwshg";
+    })
+  ];
+
   postPatch = ''
     patchShebangs configure
     patchShebangs scripts
diff --git a/nixpkgs/pkgs/os-specific/linux/tuigreet/default.nix b/nixpkgs/pkgs/os-specific/linux/tuigreet/default.nix
index 95de5b8c8d9c..8660c4a1a49c 100644
--- a/nixpkgs/pkgs/os-specific/linux/tuigreet/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/tuigreet/default.nix
@@ -5,16 +5,16 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "tuigreet";
-  version = "0.7.2";
+  version = "0.8.0";
 
   src = fetchFromGitHub {
     owner = "apognu";
     repo = pname;
     rev = version;
-    sha256 = "sha256-Mu4GGlX7ZjBaBECXRD6iJCqDMSzcj17BriJ6Nas0J70=";
+    sha256 = "sha256-8/2I6bk29/GqZ1ACuN9RgBiGAy7yt0iw2fagHfu4/BI=";
   };
 
-  cargoSha256 = "sha256-H5xqk7Yd3M8sFGHlmhAS0fhh3eM4dkvkNQGVxRSXUJs=";
+  cargoSha256 = "sha256-fOs9a0/1c8Kh4JA5up3XSQ+km/FwSYzl0w4UDL4yU4M=";
 
   meta = with lib; {
     description = "Graphical console greeter for greetd";
diff --git a/nixpkgs/pkgs/os-specific/linux/uclibc/default.nix b/nixpkgs/pkgs/os-specific/linux/uclibc-ng/default.nix
index 1d4166e4083d..f7cd34a458c3 100644
--- a/nixpkgs/pkgs/os-specific/linux/uclibc/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/uclibc-ng/default.nix
@@ -1,9 +1,14 @@
-{ lib, stdenv, buildPackages
-, fetchurl, linuxHeaders, libiconvReal
+{ lib
+, stdenv
+, buildPackages
+, fetchurl
+, linuxHeaders
+, libiconvReal
 , extraConfig ? ""
 }:
 
 let
+  isCross = (stdenv.buildPlatform != stdenv.hostPlatform);
   configParser = ''
     function parseconfig {
         set -x
@@ -36,12 +41,13 @@ let
     UCLIBC_HAS_RPC y
     DO_C99_MATH y
     UCLIBC_HAS_PROGRAM_INVOCATION_NAME y
+    UCLIBC_HAS_RESOLVER_SUPPORT y
     UCLIBC_SUSV4_LEGACY y
     UCLIBC_HAS_THREADS_NATIVE y
     KERNEL_HEADERS "${linuxHeaders}/include"
   '' + lib.optionalString (stdenv.hostPlatform.gcc.float or "" == "soft") ''
     UCLIBC_HAS_FPU n
-  '' + lib.optionalString (stdenv.isAarch32 && stdenv.buildPlatform != stdenv.hostPlatform) ''
+  '' + lib.optionalString (stdenv.isAarch32 && isCross) ''
     CONFIG_ARM_EABI y
     ARCH_WANTS_BIG_ENDIAN n
     ARCH_BIG_ENDIAN n
@@ -49,18 +55,14 @@ let
     ARCH_LITTLE_ENDIAN y
     UCLIBC_HAS_FPU n
   '';
-
-  version = "1.0.38";
 in
-
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "uclibc-ng";
-  inherit version;
+  version = "1.0.41";
 
   src = fetchurl {
-    url = "https://downloads.uclibc-ng.org/releases/${version}/uClibc-ng-${version}.tar.bz2";
-    # from "${url}.sha256";
-    sha256 = "sha256-7wexvOOfDpIsM3XcdhHxESz7GsOW+ZkiA0dfiN5rHrU=";
+    url = "https://downloads.uclibc-ng.org/releases/${version}/uClibc-ng-${version}.tar.xz";
+    sha256 = "sha256-syqSoCGNlZItaXZGTm71Hi66z7zbYFggRY2du4ph4CU=";
   };
 
   # 'ftw' needed to build acl, a coreutils dependency
@@ -78,7 +80,7 @@ stdenv.mkDerivation {
   hardeningDisable = [ "stackprotector" ];
 
   # Cross stripping hurts.
-  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
+  dontStrip = isCross;
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
 
@@ -86,7 +88,7 @@ stdenv.mkDerivation {
     "ARCH=${stdenv.hostPlatform.linuxArch}"
     "TARGET_ARCH=${stdenv.hostPlatform.linuxArch}"
     "VERBOSE=1"
-  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+  ] ++ lib.optionals (isCross) [
     "CROSS=${stdenv.cc.targetPrefix}"
   ];
 
@@ -95,24 +97,45 @@ stdenv.mkDerivation {
   enableParallelBuilding = false;
 
   installPhase = ''
+    runHook preInstall
+
     mkdir -p $out
     make $makeFlags PREFIX=$out VERBOSE=1 install
     (cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
     # libpthread.so may not exist, so I do || true
     sed -i s@/lib/@$out/lib/@g $out/lib/libc.so $out/lib/libpthread.so || true
-  '';
 
-  passthru = {
-    # Derivations may check for the existance of this attribute, to know what to link to.
-    libiconv = libiconvReal;
-  };
+    runHook postInstall
+  '';
 
   meta = with lib; {
     homepage = "https://uclibc-ng.org";
-    description = "A small implementation of the C library";
-    maintainers = with maintainers; [ rasendubi ];
-    license = licenses.lgpl2;
+    description = "Embedded C library";
+    longDescription = ''
+      uClibc-ng is a small C library for developing embedded Linux systems. It
+      is much smaller than the GNU C Library, but nearly all applications
+      supported by glibc also work perfectly with uClibc-ng.
+
+      Porting applications from glibc to uClibc-ng typically involves just
+      recompiling the source code. uClibc-ng supports shared libraries and
+      threading. It currently runs on standard Linux and MMU-less (also known as
+      uClinux) systems with support for Aarch64, Alpha, ARC, ARM, AVR32,
+      Blackfin, CRIS, C-Sky, C6X, FR-V, H8/300, HPPA, i386, IA64, KVX, LM32,
+      M68K/Coldfire, Metag, Microblaze, MIPS, MIPS64, NDS32, NIOS2, OpenRISC,
+      PowerPC, RISCV64, Sparc, Sparc64, SuperH, Tile, X86_64 and XTENSA
+      processors. Alpha, FR-V, HPPA, IA64, LM32, NIOS2, Tile and Sparc64 are
+      experimental and need more testing.
+    '';
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ rasendubi AndersonTorres ];
     platforms = platforms.linux;
-    broken = stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64;
+    badPlatforms = platforms.aarch64;
+  };
+
+  passthru = {
+    # Derivations may check for the existance of this attribute, to know what to
+    # link to.
+    libiconv = libiconvReal;
   };
+
 }
diff --git a/nixpkgs/pkgs/os-specific/linux/udisks-glue/default.nix b/nixpkgs/pkgs/os-specific/linux/udisks-glue/default.nix
deleted file mode 100644
index e51a2b1990c3..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/udisks-glue/default.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ lib, stdenv, fetchurl, pkg-config, automake, autoconf, udisks1, dbus-glib, glib, libconfuse }:
-
-stdenv.mkDerivation rec {
-  pname = "udisks-glue";
-  version = "1.3.5";
-
-  src = fetchurl {
-    url = "https://github.com/fernandotcl/udisks-glue/archive/release-${version}.tar.gz";
-    sha256 = "317d25bf249278dc8f6a5dcf18f760512427c772b9afe3cfe34e6e1baa258176";
-  };
-
-  nativeBuildInputs = [ pkg-config automake autoconf ];
-  buildInputs = [ udisks1 dbus-glib glib libconfuse ];
-
-  preConfigure = "sh autogen.sh";
-
-  meta = {
-    homepage = "https://github.com/fernandotcl/udisks-glue";
-    description = "A tool to associate udisks events to user-defined actions";
-    platforms = lib.platforms.linux;
-    maintainers = with lib.maintainers; [ pSub ];
-    license = lib.licenses.bsd2;
-    broken = true;
-    hydraPlatforms = [ ];
-  };
-}
diff --git a/nixpkgs/pkgs/os-specific/linux/udisks/1-default.nix b/nixpkgs/pkgs/os-specific/linux/udisks/1-default.nix
deleted file mode 100644
index 87da3a29d6c0..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/udisks/1-default.nix
+++ /dev/null
@@ -1,78 +0,0 @@
-{ lib
-, stdenv
-, fetchurl
-, pkg-config
-, sg3_utils
-, udev
-, glib
-, dbus
-, dbus-glib
-, polkit
-, parted
-, lvm2
-, libatasmart
-, intltool
-, libuuid
-, mdadm
-, libxslt
-, docbook_xsl
-, util-linux
-, libgudev
-}:
-
-stdenv.mkDerivation rec {
-  pname = "udisks";
-  version = "1.0.5";
-
-  src = fetchurl {
-    url = "https://hal.freedesktop.org/releases/udisks-${version}.tar.gz";
-    sha256 = "0wbg3jrv8limdgvcygf4dqin3y6d30y9pcmmk711vq571vmq5v7j";
-  };
-
-  patches = [ ./purity.patch ./no-pci-db.patch ./glibc.patch ];
-
-  preConfigure =
-    ''
-      configureFlagsArray+=(--with-systemdsystemunitdir=$out/lib/systemd/system)
-    '';
-
-  postPatch =
-    ''
-      sed -e 's,/sbin/mdadm,${mdadm}&,g' -e "s,@slashlibdir@,$out/lib,g" -i data/80-udisks.rules
-
-      substituteInPlace src/main.c --replace \
-        "/sbin:/bin:/usr/sbin:/usr/bin" \
-        "${util-linux}/bin:${mdadm}/sbin:/run/current-system/sw/bin:/run/current-system/sw/bin"
-    '';
-
-  buildInputs =
-    [
-      sg3_utils
-      udev
-      glib
-      dbus
-      dbus-glib
-      polkit
-      parted
-      libgudev
-      lvm2
-      libatasmart
-      intltool
-      libuuid
-      libxslt
-      docbook_xsl
-    ];
-
-  nativeBuildInputs = [ pkg-config ];
-
-  configureFlags = [ "--localstatedir=/var" "--enable-lvm2" ];
-
-  meta = with lib; {
-    homepage = "http://www.freedesktop.org/wiki/Software/udisks";
-    description = "A daemon and command-line utility for querying and manipulating storage devices";
-    platforms = platforms.linux;
-    license = with licenses; [ gpl2 lgpl2Plus ];
-    broken = true;
-    hydraPlatforms = [ ];
-  };
-}
diff --git a/nixpkgs/pkgs/os-specific/linux/udisks/2-default.nix b/nixpkgs/pkgs/os-specific/linux/udisks/2-default.nix
index 427e19ac9215..5aff6e969705 100644
--- a/nixpkgs/pkgs/os-specific/linux/udisks/2-default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/udisks/2-default.nix
@@ -1,8 +1,9 @@
-{ lib, stdenv, fetchFromGitHub, substituteAll, libtool, pkg-config, gettext, gnused
+{ lib, stdenv, fetchFromGitHub, substituteAll, pkg-config, gnused, autoreconfHook
 , gtk-doc, acl, systemd, glib, libatasmart, polkit, coreutils, bash, which
 , expat, libxslt, docbook_xsl, util-linux, mdadm, libgudev, libblockdev, parted
-, gobject-introspection, docbook_xml_dtd_412, docbook_xml_dtd_43, autoconf, automake
+, gobject-introspection, docbook_xml_dtd_412, docbook_xml_dtd_43
 , xfsprogs, f2fs-tools, dosfstools, e2fsprogs, btrfs-progs, exfat, nilfs-utils, ntfs3g
+, nixosTests
 }:
 
 stdenv.mkDerivation rec {
@@ -41,8 +42,11 @@ stdenv.mkDerivation rec {
     })
   ];
 
+  strictDeps = true;
+  # pkg-config had to be in both to find gtk-doc and gobject-introspection
+  depsBuildBuild = [ pkg-config ];
   nativeBuildInputs = [
-    autoconf automake pkg-config libtool gettext which gobject-introspection
+    autoreconfHook which gobject-introspection pkg-config
     gtk-doc libxslt docbook_xml_dtd_412 docbook_xml_dtd_43 docbook_xsl
   ];
 
@@ -60,6 +64,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
     (lib.enableFeature (stdenv.buildPlatform == stdenv.hostPlatform) "gtk-doc")
+    "--sysconfdir=/etc"
     "--localstatedir=/var"
     "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
     "--with-udevdir=$(out)/lib/udev"
@@ -71,10 +76,16 @@ stdenv.mkDerivation rec {
     "INTROSPECTION_TYPELIBDIR=$(out)/lib/girepository-1.0"
   ];
 
+  installFlags = [
+    "sysconfdir=${placeholder "out"}/etc"
+  ];
+
   enableParallelBuilding = true;
 
   doCheck = true;
 
+  passthru.tests.vm = nixosTests.udisks2;
+
   meta = with lib; {
     description = "A daemon, tools and libraries to access and manipulate disks, storage devices and technologies";
     homepage = "https://www.freedesktop.org/wiki/Software/udisks/";
diff --git a/nixpkgs/pkgs/os-specific/linux/udisks/glibc.patch b/nixpkgs/pkgs/os-specific/linux/udisks/glibc.patch
deleted file mode 100644
index 85ef5208049d..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/udisks/glibc.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0aa652a7b257f98f9e8e7dc7b0ddc9bc62377d09 Mon Sep 17 00:00:00 2001
-From: Alexandre Rostovtsev <tetromino@gentoo.org>
-Date: Fri, 29 May 2015 21:09:39 -0400
-Subject: [PATCH] Bug 90778 - fix build with newer glibc versions
-
-https://bugs.freedesktop.org/show_bug.cgi?id=90778
----
- src/helpers/job-drive-detach.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/helpers/job-drive-detach.c b/src/helpers/job-drive-detach.c
-index eeafcab..d122a1f 100644
---- a/src/helpers/job-drive-detach.c
-+++ b/src/helpers/job-drive-detach.c
-@@ -18,6 +18,7 @@
-  *
-  */
- 
-+#include <sys/stat.h>
- #include <stdio.h>
- #include <string.h>
- #include <errno.h>
--- 
-2.4.2
-
diff --git a/nixpkgs/pkgs/os-specific/linux/udisks/no-pci-db.patch b/nixpkgs/pkgs/os-specific/linux/udisks/no-pci-db.patch
deleted file mode 100644
index b323b515c40e..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/udisks/no-pci-db.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Systemd no longer has the pci-db program.
-
-diff -ru -x '*~' udisks-1.0.4-orig/data/80-udisks.rules udisks-1.0.4/data/80-udisks.rules
---- udisks-1.0.4-orig/data/80-udisks.rules	2011-08-25 23:31:20.000000000 +0200
-+++ udisks-1.0.4/data/80-udisks.rules	2012-12-13 13:06:52.189650854 +0100
-@@ -3,7 +3,6 @@
- 
- # import names for PCI storage controllers
- #
--SUBSYSTEM=="pci", ACTION=="add|change", ENV{ID_MODEL_FROM_DATABASE}=="", ATTR{class}=="0x01*", IMPORT{program}="pci-db %p"
- 
- # Set eSATA port type for known eSATA CardBus adapters - first we want to ensure
- # the device is on a cardbus controller (upper PCI device) - then we check
diff --git a/nixpkgs/pkgs/os-specific/linux/udisks/purity.patch b/nixpkgs/pkgs/os-specific/linux/udisks/purity.patch
deleted file mode 100644
index bf1121ddb659..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/udisks/purity.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff --git a/data/80-udisks.rules b/data/80-udisks.rules
-index 6720394..60b67ed 100644
---- a/data/80-udisks.rules
-+++ b/data/80-udisks.rules
-@@ -23,7 +23,7 @@ LABEL="ata_port_cardbus_end"
- #  this is the case we can trigger a 'change' on the sas_expander device
- #  when the bsg device appears)
- #
--SUBSYSTEM=="sas_expander", ACTION=="add|change", IMPORT{program}="udisks-probe-sas-expander /sys/%p"
-+SUBSYSTEM=="sas_expander", ACTION=="add|change", IMPORT{program}="@slashlibdir@/udev/udisks-probe-sas-expander /sys/%p"
- 
- ##############################################################################################################
- 
-@@ -54,7 +54,7 @@ ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="udisks_end"
- # import UDISKS_DM_* and UDISKS_LVM2_* properties - the long-term plan is to make the lvm2 and
- # device-mapper packages provide this information
- #
--KERNEL=="dm-*", IMPORT{program}="udisks-dm-export %M %m"
-+KERNEL=="dm-*", IMPORT{program}="@slashlibdir@/udev/udisks-dm-export %M %m"
- 
- # Make udevd synthesize a 'change' uevent when last opener of a rw-fd closes the fd - this
- # should be part of the device-mapper rules
-@@ -63,7 +63,7 @@ KERNEL=="dm-*", OPTIONS+="watch"
- ##############################################################################################################
- # Probe LVM2 Physical Volumes - this will eventually be part of the LVM2 package
- 
--ENV{ID_FS_TYPE}=="LVM2_member", TEST=="/lib/udev/udisks-lvm-pv-export", IMPORT{program}="udisks-lvm-pv-export $env{ID_FS_UUID}"
-+ENV{ID_FS_TYPE}=="LVM2_member", TEST=="@slashlibdir@/udev/udisks-lvm-pv-export", IMPORT{program}="@slashlibdir@/udev/udisks-lvm-pv-export $env{ID_FS_UUID}"
- 
- ##############################################################################################################
- 
-@@ -85,7 +85,7 @@ KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="", GOTO="probe_parttable_e
- 
- # scan for partition tables both on whole-disk and partitions
- #
--IMPORT{program}="udisks-part-id $tempnode"
-+IMPORT{program}="@slashlibdir@/udev/udisks-part-id $tempnode"
- 
- LABEL="probe_parttable_end"
- 
-@@ -109,13 +109,13 @@ LABEL="md_end"
- #
- 
- # USB ATA enclosures with a SAT layer
--KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="usb", ENV{DEVTYPE}=="disk", IMPORT{program}="udisks-probe-ata-smart $tempnode"
-+KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="usb", ENV{DEVTYPE}=="disk", IMPORT{program}="@slashlibdir@/udev/udisks-probe-ata-smart $tempnode"
- 
- # ATA disks driven by libata
--KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="ata", ENV{DEVTYPE}=="disk", IMPORT{program}="udisks-probe-ata-smart $tempnode"
-+KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="ata", ENV{DEVTYPE}=="disk", IMPORT{program}="@slashlibdir@/udev/udisks-probe-ata-smart $tempnode"
- 
- # ATA disks connected via SAS (not driven by libata)
--KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="scsi", ENV{DEVTYPE}=="disk", ENV{ID_VENDOR}=="ATA", IMPORT{program}="udisks-probe-ata-smart $tempnode"
-+KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="scsi", ENV{DEVTYPE}=="disk", ENV{ID_VENDOR}=="ATA", IMPORT{program}="@slashlibdir@/udev/udisks-probe-ata-smart $tempnode"
- 
- 
- # Example rule for tagging a device with a specific media type. Where and
diff --git a/nixpkgs/pkgs/os-specific/linux/uhk-agent/default.nix b/nixpkgs/pkgs/os-specific/linux/uhk-agent/default.nix
new file mode 100644
index 000000000000..688a743fa9c1
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/uhk-agent/default.nix
@@ -0,0 +1,39 @@
+{ appimageTools, lib, fetchurl, polkit, udev }:
+let
+  pname = "uhk-agent";
+  version = "1.5.17";
+  src = fetchurl {
+    url = "https://github.com/UltimateHackingKeyboard/agent/releases/download/v${version}/UHK.Agent-${version}-linux-x86_64.AppImage";
+    name = "${pname}-${version}.AppImage";
+    sha256 = "sha256-auOoTTRmkXVDDvcmRFzQIStNlbai8bTBLb/KUjk6EAc=";
+  };
+
+  appimageContents = appimageTools.extract {
+    name = "${pname}-${version}";
+    inherit src;
+  };
+in appimageTools.wrapType2 {
+  inherit pname version src;
+
+  extraPkgs = pkgs: with pkgs; [ polkit udev ];
+
+  extraInstallCommands = ''
+    mv $out/bin/${pname}-${version} $out/bin/${pname}
+
+    install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications
+    install -m 644 -D ${appimageContents}/resources/rules/50-uhk60.rules $out/rules/50-uhk60.rules
+    substituteInPlace $out/share/applications/${pname}.desktop \
+      --replace 'Exec=AppRun' 'Exec=${pname}'
+    cp -r ${appimageContents}/usr/share/icons $out/share
+  '';
+  # wrapType2 does not passthru pname+version
+  passthru.version = version;
+
+  meta = with lib; {
+    description = "Agent is the configuration application of the Ultimate Hacking Keyboard";
+    homepage = "https://github.com/UltimateHackingKeyboard/agent";
+    license = licenses.unfreeRedistributable;
+    maintainers = with maintainers; [ ngiger ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/uhk-udev-rules/default.nix b/nixpkgs/pkgs/os-specific/linux/uhk-udev-rules/default.nix
new file mode 100644
index 000000000000..bcb7799731f6
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/uhk-udev-rules/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, uhk-agent }:
+
+stdenv.mkDerivation {
+  pname = "uhk-udev-rules";
+  inherit (uhk-agent) version;
+
+  dontUnpack = true;
+  dontBuild = true;
+  installPhase = ''
+    runHook preInstall
+    install -D -m 644 ${uhk-agent.out}/rules/50-uhk60.rules $out/lib/udev/rules.d/50-uhk60.rules
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "udev rules for UHK keyboards from https://ultimatehackingkeyboard.com";
+    inherit (uhk-agent.meta) license;
+    maintainers = [ lib.maintainers.ngiger ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/unscd/0001-adjust-socket-paths-for-nixos.patch b/nixpkgs/pkgs/os-specific/linux/unscd/0001-adjust-socket-paths-for-nixos.patch
new file mode 100644
index 000000000000..941b5c90a624
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/unscd/0001-adjust-socket-paths-for-nixos.patch
@@ -0,0 +1,41 @@
+From 9d76d183a97cb667a1ab6d95af69d6db745215df Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <milan@petabyte.dev>
+Date: Tue, 1 Jun 2021 16:55:45 +0200
+Subject: [PATCH] adjust socket paths for nixos
+
+The original unscd would crash, because it is not allowed to create its
+legacy socket at /var/run/.nscd_socket.
+
+This socket is only required for very old glibc versions, but removing it
+is currently non-trivial, so we just move it somewhere, where it is
+allowed to be created. A patch has been submitted upstream to make this
+hack unnecessary.
+
+Also change /var/run to /run, since we shouldn't be using /var/run
+anymore.
+---
+ nscd.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/nscd.c b/nscd.c
+index a71e474..0cd7106 100644
+--- a/nscd.c
++++ b/nscd.c
+@@ -2100,10 +2100,10 @@ static void main_loop(void)
+ ** Initialization
+ */
+ 
+-#define NSCD_PIDFILE    "/var/run/nscd/nscd.pid"
+-#define NSCD_DIR        "/var/run/nscd"
+-#define NSCD_SOCKET     "/var/run/nscd/socket"
+-#define NSCD_SOCKET_OLD "/var/run/.nscd_socket"
++#define NSCD_PIDFILE    "/run/nscd/nscd.pid"
++#define NSCD_DIR        "/run/nscd"
++#define NSCD_SOCKET     "/run/nscd/socket"
++#define NSCD_SOCKET_OLD "/run/nscd/socket_legacy"
+ 
+ static smallint wrote_pidfile;
+ 
+-- 
+2.31.1
+
diff --git a/nixpkgs/pkgs/os-specific/linux/unscd/default.nix b/nixpkgs/pkgs/os-specific/linux/unscd/default.nix
new file mode 100644
index 000000000000..82b8c7076271
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/unscd/default.nix
@@ -0,0 +1,76 @@
+{ fetchurl, fetchpatch, stdenv, systemd, lib }:
+
+stdenv.mkDerivation rec {
+  pname = "unscd";
+  version = "0.54";
+
+  src = fetchurl {
+    url = "https://busybox.net/~vda/unscd/nscd-${version}.c";
+    sha256 = "0iv4iwgs3sjnqnwd7dpcw6s7i4ar9q89vgsms32clx14fdqjrqch";
+  };
+
+  unpackPhase = ''
+    runHook preUnpack
+    cp $src nscd.c
+    chmod u+w nscd.c
+    runHook postUnpack
+  '';
+
+  patches = [
+    # Patches from Debian that have not (yet) been included upstream, but are useful to us
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/u/${pname}/${version}-1/debian/patches/change_invalidate_request_info_output";
+      sha256 = "17whakazpisiq9nnw3zybaf7v3lqkww7n6jkx0igxv4z2r3mby6l";
+    })
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/u/${pname}/${version}-1/debian/patches/support_large_numbers_in_config";
+      sha256 = "0jrqb4cwclwirpqfb6cvnmiff3sm2jhxnjwxa7h0wx78sg0y3bpp";
+    })
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/u/${pname}/${version}-1/debian/patches/no_debug_on_invalidate";
+      sha256 = "0znwzb522zgikb0mm7awzpvvmy0wf5z7l3jgjlkdpgj0scxgz86w";
+    })
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/u/${pname}/${version}-1/debian/patches/notify_systemd_about_successful_startup";
+      sha256 = "1ipwmbfwm65yisy74nig9960vxpjx683l3skgxfgssfx1jb9z2mc";
+    })
+
+    # The original unscd would crash, because it is not allowed to create its
+    # legacy socket at /var/run/.nscd_socket.
+    # This socket is only required for very old glibc versions, but removing it
+    # is currently non-trivial, so we just move it somewhere, where it is
+    # allowed to be created. A patch has been submitted upstream to make this
+    # hack unnecessary.
+    # Also change /var/run to /run, since we shouldn't be using /var/run
+    # anymore.
+    # See also: http://lists.busybox.net/pipermail/busybox/2021-June/088866.html
+    ./0001-adjust-socket-paths-for-nixos.patch
+  ];
+
+  buildInputs = [ systemd ];
+
+  buildPhase = ''
+    runHook preBuild
+    gcc -Wall \
+      -Wl,--sort-section -Wl,alignment \
+      -Wl,--sort-common \
+      -fomit-frame-pointer \
+      -lsystemd \
+      -o nscd nscd.c
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm755 -t $out/bin nscd
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://busybox.net/~vda/unscd/";
+    description = "Less buggy replacement for the glibc name service cache daemon";
+    license = licenses.gpl2Only;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/upower/default.nix b/nixpkgs/pkgs/os-specific/linux/upower/default.nix
index aff9125c236d..ae24c4db6ec8 100644
--- a/nixpkgs/pkgs/os-specific/linux/upower/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/upower/default.nix
@@ -1,12 +1,16 @@
 { lib
 , stdenv
 , fetchFromGitLab
+, fetchpatch
 , pkg-config
 , rsync
 , libxslt
 , meson
 , ninja
 , python3
+, dbus
+, umockdev
+, libeatmydata
 , gtk-doc
 , docbook-xsl-nons
 , udev
@@ -18,22 +22,30 @@
 , systemd
 , useIMobileDevice ? true
 , libimobiledevice
+, withDocs ? (stdenv.buildPlatform == stdenv.hostPlatform)
 }:
 
 stdenv.mkDerivation rec {
   pname = "upower";
-  version = "0.99.17";
+  version = "1.90.0";
 
-  outputs = [ "out" "dev" "devdoc" ];
+  outputs = [ "out" "dev" ]
+    ++ lib.optionals withDocs [ "devdoc" ];
 
   src = fetchFromGitLab {
     domain = "gitlab.freedesktop.org";
     owner = "upower";
     repo = "upower";
     rev = "v${version}";
-    sha256 = "xvvqzGxgkuGcvnO12jnLURNJUoSlnMw2g/mnII+i6Bs=";
+    hash = "sha256-+C/4dDg6WTLpBgkpNyxjthSdqYdaTLC8vG6jG1LNJ7w=";
   };
 
+  strictDeps = true;
+
+  depsBuildBuild = [
+    pkg-config
+  ];
+
   nativeBuildInputs = [
     meson
     ninja
@@ -52,10 +64,22 @@ stdenv.mkDerivation rec {
     libusb1
     udev
     systemd
+    # Duplicate from checkInputs until https://github.com/NixOS/nixpkgs/issues/161570 is solved
+    umockdev
   ] ++ lib.optionals useIMobileDevice [
     libimobiledevice
   ];
 
+  checkInputs = [
+    python3.pkgs.dbus-python
+    python3.pkgs.python-dbusmock
+    python3.pkgs.pygobject3
+    dbus
+    umockdev
+    libeatmydata
+    python3.pkgs.packaging
+  ];
+
   propagatedBuildInputs = [
     glib
   ];
@@ -66,14 +90,37 @@ stdenv.mkDerivation rec {
     "-Dos_backend=linux"
     "-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
     "-Dudevrulesdir=${placeholder "out"}/lib/udev/rules.d"
+    "-Dudevhwdbdir=${placeholder "out"}/lib/udev/hwdb.d"
+    "-Dintrospection=${if (stdenv.buildPlatform == stdenv.hostPlatform) then "auto" else "disabled"}"
+    "-Dgtk-doc=${lib.boolToString withDocs}"
   ];
 
-  doCheck = false; # fails with "env: './linux/integration-test': No such file or directory"
+  doCheck = true;
 
   postPatch = ''
+    patchShebangs src/linux/integration-test.py
     patchShebangs src/linux/unittest_inspector.py
   '';
 
+  preCheck = ''
+    # Our gobject-introspection patches make the shared library paths absolute
+    # in the GIR files. When running tests, the library is not yet installed,
+    # though, so we need to replace the absolute path with a local one during build.
+    # We are using a symlink that will be overwitten during installation.
+    mkdir -p "$out/lib"
+    ln -s "$PWD/libupower-glib/libupower-glib.so" "$out/lib/libupower-glib.so.3"
+  '';
+
+  checkPhase = ''
+    runHook preCheck
+
+    # Slow fsync calls can make self-test fail:
+    # https://gitlab.freedesktop.org/upower/upower/-/issues/195
+    eatmydata meson test --print-errorlogs
+
+    runHook postCheck
+  '';
+
   postInstall = ''
     # Move stuff from DESTDIR to proper location.
     # We use rsync to merge the directories.
diff --git a/nixpkgs/pkgs/os-specific/linux/usbip/default.nix b/nixpkgs/pkgs/os-specific/linux/usbip/default.nix
index 43c22a8fd12a..cadf38b106cc 100644
--- a/nixpkgs/pkgs/os-specific/linux/usbip/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/usbip/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, kernel, udev, autoconf, automake, libtool, hwdata, kernelOlder }:
+{ lib, stdenv, fetchpatch, kernel, udev, autoconf, automake, libtool, hwdata, kernelOlder }:
 
 stdenv.mkDerivation {
   name = "usbip-${kernel.name}";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
     ./fix-snprintf-truncation.patch
     # fixes build with gcc9
     ./fix-strncpy-truncation.patch
-  ];
+  ] ++ kernel.patches;
 
   nativeBuildInputs = [ autoconf automake libtool ];
   buildInputs = [ udev ];
diff --git a/nixpkgs/pkgs/os-specific/linux/usbrelay/daemon.nix b/nixpkgs/pkgs/os-specific/linux/usbrelay/daemon.nix
new file mode 100644
index 000000000000..e5e4baae9e99
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/usbrelay/daemon.nix
@@ -0,0 +1,36 @@
+{ stdenv, usbrelay, python3 }:
+let
+  python = python3.withPackages (ps: with ps; [ usbrelay-py paho-mqtt ]);
+in
+# This is a separate derivation, not just an additional output of
+# usbrelay, because otherwise, we have a cyclic dependency between
+# usbrelay (default.nix) and the python module (python.nix).
+stdenv.mkDerivation rec {
+  pname = "usbrelayd";
+
+  inherit (usbrelay) src version;
+
+  postPatch = ''
+    substituteInPlace 'usbrelayd.service' \
+      --replace '/usr/bin/python3' "${python}/bin/python3" \
+      --replace '/usr/sbin/usbrelayd' "$out/bin/usbrelayd"
+  '';
+
+  buildInputs = [ python ];
+
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall;
+    install -m 644 -D usbrelayd $out/bin/usbrelayd
+    install -m 644 -D usbrelayd.service $out/lib/systemd/system/usbrelayd.service
+    install -m 644 -D 50-usbrelay.rules $out/lib/udev/rules.d/50-usbrelay.rules
+    install -m 644 -D usbrelayd.conf $out/etc/usbrelayd.conf # include this as an example
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "USB Relay MQTT service";
+    inherit (usbrelay.meta) homepage license maintainers platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/usbrelay/default.nix b/nixpkgs/pkgs/os-specific/linux/usbrelay/default.nix
new file mode 100644
index 000000000000..25388d3b2308
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/usbrelay/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, fetchFromGitHub, hidapi, installShellFiles }:
+stdenv.mkDerivation rec {
+  pname = "usbrelay";
+  version = "1.0";
+
+  src = fetchFromGitHub {
+    owner = "darrylb123";
+    repo = "usbrelay";
+    rev = version;
+    sha256 = "sha256-5zgpN4a+r0tmw0ISTJM+d9mo+L/qwUvpWPSsykuG0cg=";
+  };
+
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
+  buildInputs = [
+    hidapi
+  ];
+
+  makeFlags = [
+    "DIR_VERSION=${version}"
+    "PREFIX=${placeholder "out"}"
+  ];
+
+  postInstall = ''
+    installManPage usbrelay.1
+  '';
+
+  meta = with lib; {
+    description = "Tool to control USB HID relays";
+    homepage = "https://github.com/darrylb123/usbrelay";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ wentasah ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/usbrelay/python.nix b/nixpkgs/pkgs/os-specific/linux/usbrelay/python.nix
new file mode 100644
index 000000000000..02d5ac284eda
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/usbrelay/python.nix
@@ -0,0 +1,12 @@
+{ buildPythonPackage, usbrelay }:
+
+buildPythonPackage rec {
+  pname = "usbrelay_py";
+  inherit (usbrelay) version src;
+
+  buildInputs = [ usbrelay ];
+
+  pythonImportsCheck = [ "usbrelay_py" ];
+
+  inherit (usbrelay) meta;
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/usbrelay/test.nix b/nixpkgs/pkgs/os-specific/linux/usbrelay/test.nix
new file mode 100644
index 000000000000..dc5847558a69
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/usbrelay/test.nix
@@ -0,0 +1,63 @@
+# NixOS test for usbrelayd
+#
+# It is not stored in nixos/tests directory, because it requires the
+# USB relay connected to the host computer and as such, it cannot be
+# run automatically.
+#
+# Run this test as:
+#
+#     nix-build test.nix -A driverInteractive && ./result/bin/nixos-test-driver --no-interactive
+#
+# The interactive driver is required because the default
+# (non-interactive) driver uses qemu without support for passing USB
+# devices to the guest (see
+# https://discourse.nixos.org/t/hardware-dependent-nixos-tests/18564
+# for discussion of other alternatives).
+
+import ../../../../nixos/tests/make-test-python.nix ({ pkgs, ... }: {
+  name = "usbrelayd";
+
+  nodes.machine = {
+    virtualisation.qemu.options = [
+      "-device qemu-xhci"
+      "-device usb-host,vendorid=0x16c0,productid=0x05df"
+    ];
+    services.usbrelayd.enable = true;
+    systemd.services.usbrelayd = {
+      after = [ "mosquitto.service" ];
+    };
+    services.mosquitto = {
+      enable = true;
+      listeners = [{
+        acl = [ "pattern readwrite #" ];
+        omitPasswordAuth = true;
+        settings.allow_anonymous = true;
+      }];
+    };
+    environment.systemPackages = [
+      pkgs.usbrelay
+      pkgs.mosquitto
+    ];
+    documentation.nixos.enable = false; # building nixos manual takes long time
+  };
+
+  testScript = ''
+    if os.waitstatus_to_exitcode(os.system("lsusb -d 16c0:05df")) != 0:
+        print("No USB relay detected, skipping test")
+        import sys
+        sys.exit(2)
+    machine.start()
+    # usbrelayd is started by udev when an relay is detected
+    machine.wait_for_unit("usbrelayd.service")
+
+    stdout = machine.succeed("usbrelay")
+    relay_id = stdout.split(sep="_")[0]
+    assert relay_id != ""
+    import time
+    time.sleep(1)
+    machine.succeed(f"mosquitto_pub -h localhost -t cmnd/{relay_id}/1 -m ON")
+    time.sleep(1)
+    machine.succeed(f"mosquitto_pub -h localhost -t cmnd/{relay_id}/1 -m OFF")
+    print("Did you see the relay switching on and off?")
+  '';
+})
diff --git a/nixpkgs/pkgs/os-specific/linux/usbtop/default.nix b/nixpkgs/pkgs/os-specific/linux/usbtop/default.nix
index 6948d51e5dc7..fb3d32df09a0 100644
--- a/nixpkgs/pkgs/os-specific/linux/usbtop/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/usbtop/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     homepage = "https://github.com/aguinet/usbtop";
     description = "A top utility that shows an estimated instantaneous bandwidth on USB buses and devices";
-    maintainers = with maintainers; [ etu ];
+    maintainers = with maintainers; [ ];
     license = licenses.bsd3;
     platforms = platforms.linux;
   };
diff --git a/nixpkgs/pkgs/os-specific/linux/util-linux/default.nix b/nixpkgs/pkgs/os-specific/linux/util-linux/default.nix
index bedd2417e7ea..cb323e623bed 100644
--- a/nixpkgs/pkgs/os-specific/linux/util-linux/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/util-linux/default.nix
@@ -1,15 +1,24 @@
-{ lib, stdenv, fetchurl, pkg-config, zlib, shadow, libcap_ng
-, ncurses ? null, pam, systemd ? null
+{ lib, stdenv, fetchurl, pkg-config, zlib, shadow
+, capabilitiesSupport ? true
+, libcap_ng
+, ncursesSupport ? true
+, ncurses
+, pamSupport ? true
+, pam
+, systemdSupport ? stdenv.isLinux && !stdenv.hostPlatform.isStatic
+, systemd
 , nlsSupport ? true
+, translateManpages ? true
+, po4a
 }:
 
 stdenv.mkDerivation rec {
-  pname = "util-linux";
-  version = "2.37.4";
+  pname = "util-linux" + lib.optionalString (!nlsSupport && !ncursesSupport && !systemdSupport) "-minimal";
+  version = "2.38";
 
   src = fetchurl {
-    url = "mirror://kernel/linux/utils/util-linux/v${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "sha256-Y05pFq2RM2bDU2tkaOeER2lUm5mnsr+AMU3nirVlW4M=";
+    url = "mirror://kernel/linux/utils/util-linux/v${lib.versions.majorMinor version}/util-linux-${version}.tar.xz";
+    hash = "sha256-bREcvk1VszbbLx++/7xluJkIcEwBE2Nx0yqpvsNz62Q=";
   };
 
   patches = [
@@ -40,10 +49,11 @@ stdenv.mkDerivation rec {
     "--disable-makeinstall-setuid" "--disable-makeinstall-chown"
     "--disable-su" # provided by shadow
     (lib.enableFeature nlsSupport "nls")
-    (lib.withFeature (ncurses != null) "ncursesw")
-    (lib.withFeature (systemd != null) "systemd")
-    (lib.withFeatureAs (systemd != null)
+    (lib.withFeature ncursesSupport "ncursesw")
+    (lib.withFeature systemdSupport "systemd")
+    (lib.withFeatureAs systemdSupport
        "systemdsystemunitdir" "${placeholder "bin"}/lib/systemd/system/")
+    (lib.enableFeature translateManpages "poman")
     "SYSCONFSTATICDIR=${placeholder "lib"}/lib"
   ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
        "scanf_cv_type_modifier=ms"
@@ -55,10 +65,14 @@ stdenv.mkDerivation rec {
     "usrsbin_execdir=${placeholder "bin"}/sbin"
   ];
 
-  nativeBuildInputs = [ pkg-config ];
-  buildInputs =
-    [ zlib pam libcap_ng ]
-    ++ lib.filter (p: p != null) [ ncurses systemd ];
+  nativeBuildInputs = [ pkg-config ]
+    ++ lib.optionals translateManpages [ po4a ];
+
+  buildInputs = [ zlib ]
+    ++ lib.optionals pamSupport [ pam ]
+    ++ lib.optionals capabilitiesSupport [ libcap_ng ]
+    ++ lib.optionals ncursesSupport [ ncurses ]
+    ++ lib.optionals systemdSupport [ systemd ];
 
   doCheck = false; # "For development purpose only. Don't execute on production system!"
 
diff --git a/nixpkgs/pkgs/os-specific/linux/v4l-utils/default.nix b/nixpkgs/pkgs/os-specific/linux/v4l-utils/default.nix
index 3fdd9e791bd5..f8d0c9be0d90 100644
--- a/nixpkgs/pkgs/os-specific/linux/v4l-utils/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/v4l-utils/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchurl, pkg-config, perl
-, libjpeg, udev
+, argp-standalone, libjpeg, udev
 , withUtils ? true
 , withGUI ? true, alsa-lib, libX11, qtbase, libGLU, wrapQtAppsHook
 }:
@@ -35,7 +35,9 @@ in stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config perl ] ++ lib.optional withQt wrapQtAppsHook;
 
-  buildInputs = [ udev ] ++ lib.optionals withQt [ alsa-lib libX11 qtbase libGLU ];
+  buildInputs = [ udev ]
+    ++ lib.optional (!stdenv.hostPlatform.isGnu) argp-standalone
+    ++ lib.optionals withQt [ alsa-lib libX11 qtbase libGLU ];
 
   propagatedBuildInputs = [ libjpeg ];
 
diff --git a/nixpkgs/pkgs/os-specific/linux/vdo/default.nix b/nixpkgs/pkgs/os-specific/linux/vdo/default.nix
new file mode 100644
index 000000000000..d9033e65876b
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/vdo/default.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv
+, fetchFromGitHub
+, installShellFiles
+, libuuid
+, lvm2_dmeventd  # <libdevmapper-event.h>
+, zlib
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "vdo";
+  version = "8.2.0.2";  # kvdo uses this!
+
+  src = fetchFromGitHub {
+    owner = "dm-vdo";
+    repo = pname;
+    rev = version;
+    hash = "sha256-IP/nL4jQ+rIWuUxXUiBtlIKTMZCNelvxgTfTcaB1it0=";
+  };
+
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
+  buildInputs = [
+    libuuid
+    lvm2_dmeventd
+    zlib
+    python3.pkgs.wrapPython
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    pyyaml
+  ];
+
+  pythonPath = propagatedBuildInputs;
+
+  makeFlags = [
+    "DESTDIR=${placeholder "out"}"
+    "INSTALLOWNER="
+    # all of these paths are relative to DESTDIR and have defaults that don't work for us
+    "bindir=/bin"
+    "defaultdocdir=/share/doc"
+    "mandir=/share/man"
+    "python3_sitelib=${python3.sitePackages}"
+  ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    installShellCompletion --bash $out/bash_completion.d/*
+    rm -r $out/bash_completion.d
+
+    wrapPythonPrograms
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/dm-vdo/vdo";
+    description = "A set of userspace tools for managing pools of deduplicated and/or compressed block storage";
+    platforms = platforms.linux;
+    license = with licenses; [ gpl2Plus ];
+    maintainers = with maintainers; [ ajs124 ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/vendor-reset/default.nix b/nixpkgs/pkgs/os-specific/linux/vendor-reset/default.nix
index e1395bd33c07..f4430f3224ae 100644
--- a/nixpkgs/pkgs/os-specific/linux/vendor-reset/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/vendor-reset/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, kernel, lib }:
+{ stdenv, fetchFromGitHub, fetchpatch, kernel, lib }:
 
 stdenv.mkDerivation rec {
   pname = "vendor-reset";
@@ -11,6 +11,15 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-xa7P7+mRk4FVgi+YYCcsFLfyNqPmXvy3xhGoTDVqPxw=";
   };
 
+  patches = [
+    # Fix build with Linux 5.18.
+    # https://github.com/gnif/vendor-reset/pull/58
+    (fetchpatch {
+      url = "https://github.com/gnif/vendor-reset/commit/5bbffcd6fee5348e8808bdbfcb5b21d455b02f55.patch";
+      sha256 = "sha256-L1QxVpcZAVYiaMFCBfL2EJgeMyOR8sDa1UqF1QB3bns=";
+    })
+  ];
+
   nativeBuildInputs = kernel.moduleBuildDependencies;
 
   hardeningDisable = [ "pic" ];
@@ -24,11 +33,13 @@ stdenv.mkDerivation rec {
     install -D vendor-reset.ko -t "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/misc/"
   '';
 
+  enableParallelBuilding = true;
+
   meta = with lib; {
     description = "Linux kernel vendor specific hardware reset module";
     homepage = "https://github.com/gnif/vendor-reset";
     license = licenses.gpl2Only;
-    maintainers = with maintainers; [ wedens ];
+    maintainers = with maintainers; [ ];
     platforms = [ "x86_64-linux" ];
     broken = kernel.kernelOlder "4.19";
   };
diff --git a/nixpkgs/pkgs/os-specific/linux/vmm_clock/default.nix b/nixpkgs/pkgs/os-specific/linux/vmm_clock/default.nix
index a9cc266f6c53..b630ed4749fa 100644
--- a/nixpkgs/pkgs/os-specific/linux/vmm_clock/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/vmm_clock/default.nix
@@ -26,6 +26,7 @@ stdenv.mkDerivation rec {
   ];
 
   meta = with lib; {
+    broken = kernel.kernelOlder "4.19";
     description =
       "Experimental implementation of a kvmclock-derived clocksource for Linux guests under OpenBSD's hypervisor";
     homepage = "https://github.com/voutilad/vmm_clock";
diff --git a/nixpkgs/pkgs/os-specific/linux/vmware/default.nix b/nixpkgs/pkgs/os-specific/linux/vmware/default.nix
new file mode 100644
index 000000000000..ecc43bf3f3a9
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/vmware/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchFromGitHub, kernel, kmod, gnugrep, vmware-workstation }:
+
+stdenv.mkDerivation rec {
+  pname = "vmware-modules";
+  version = "${vmware-workstation.version}-${kernel.version}";
+
+  src = fetchFromGitHub {
+    owner = "mkubecek";
+    repo = "vmware-host-modules";
+    rev = "w${vmware-workstation.version}-k5.18";
+    sha256 = "sha256-sAeCjaSrBXGP5szfCY5CpMrGwzCw4aM67EN+YfA3AWA=";
+  };
+
+  hardeningDisable = [ "pic" ];
+
+  nativeBuildInputs = kernel.moduleBuildDependencies;
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace '/lib/modules/$(VM_UNAME)/misc' "$out/lib/modules/${kernel.modDirVersion}/misc" \
+      --replace '$(shell uname -r)' "${kernel.modDirVersion}" \
+      --replace /sbin/modinfo "${kmod}/bin/modinfo" \
+      --replace 'test -z "$(DESTDIR)"' "0"
+
+    for module in "vmmon-only" "vmnet-only"; do
+      substituteInPlace "./$module/Makefile" \
+        --replace '/lib/modules/' "${kernel.dev}/lib/modules/" \
+        --replace '$(shell uname -r)' "${kernel.modDirVersion}" \
+        --replace /bin/grep "${gnugrep}/bin/grep"
+    done
+  '';
+
+  preInstall = ''
+    mkdir -p "$out/lib/modules/${kernel.modDirVersion}/misc"
+  '';
+
+  meta = with lib; {
+    description = "Kernel modules needed for VMware hypervisor";
+    homepage = "https://github.com/mkubecek/vmware-host-modules";
+    license = licenses.gpl2Only;
+    platforms = [ "x86_64-linux" ];
+    broken = (kernel.kernelOlder "5.5" && kernel.isHardened) || kernel.kernelAtLeast "5.19";
+    maintainers = with maintainers; [ deinferno ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/waydroid/default.nix b/nixpkgs/pkgs/os-specific/linux/waydroid/default.nix
index 1390077a60d1..0a0a4019e983 100644
--- a/nixpkgs/pkgs/os-specific/linux/waydroid/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/waydroid/default.nix
@@ -16,13 +16,13 @@
 
 python3Packages.buildPythonApplication rec {
   pname = "waydroid";
-  version = "1.2.0";
+  version = "1.2.1";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = version;
-    sha256 = "03d87sh443kn0j2mpih1g909khkx3wgb04h605f9jhd0znskkbmw";
+    sha256 = "sha256-Sf1rl8GCSTuneuYroGqsm9Aq2rBurpyswOrfCq2mWOs=";
   };
 
   propagatedBuildInputs = with python3Packages; [
diff --git a/nixpkgs/pkgs/os-specific/linux/wireguard/default.nix b/nixpkgs/pkgs/os-specific/linux/wireguard/default.nix
index 32389d27369c..a47fb30c1b39 100644
--- a/nixpkgs/pkgs/os-specific/linux/wireguard/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/wireguard/default.nix
@@ -1,17 +1,15 @@
 { lib, stdenv, fetchzip, kernel, perl, wireguard-tools, bc }:
 
-# module requires Linux >= 3.10 https://www.wireguard.io/install/#kernel-requirements
-assert lib.versionAtLeast kernel.version "3.10";
 # wireguard upstreamed since 5.6 https://lists.zx2c4.com/pipermail/wireguard/2019-December/004704.html
 assert lib.versionOlder kernel.version "5.6";
 
 stdenv.mkDerivation rec {
   pname = "wireguard";
-  version = "1.0.20210606";
+  version = "1.0.20211208";
 
   src = fetchzip {
     url = "https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${version}.tar.xz";
-    sha256 = "sha256-ha7x6+41oPRRhuRwEb1ojRWLF1dlEMoJtqXrzRKQ408=";
+    sha256 = "sha256-MHC4ojhRD8IGwTUE8oEew8IVof9hQCC7CPgVQIBfBRQ=";
   };
 
   hardeningDisable = [ "pic" ];
diff --git a/nixpkgs/pkgs/os-specific/linux/wpa_supplicant/default.nix b/nixpkgs/pkgs/os-specific/linux/wpa_supplicant/default.nix
index 925ec71d3fa1..2d954d83ecf3 100644
--- a/nixpkgs/pkgs/os-specific/linux/wpa_supplicant/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/wpa_supplicant/default.nix
@@ -1,6 +1,6 @@
 { lib, stdenv, fetchurl, openssl, pkg-config, libnl
 , nixosTests, wpa_supplicant_gui
-, withDbus ? true, dbus
+, dbusSupport ? true, dbus
 , withReadline ? true, readline
 , withPcsclite ? true, pcsclite
 , readOnlyModeSSIDs ? false
@@ -44,6 +44,7 @@ stdenv.mkDerivation rec {
     CONFIG_EAP_PWD=y
     CONFIG_EAP_SAKE=y
     CONFIG_ELOOP=eloop
+    CONFIG_EXT_PASSWORD_FILE=y
     CONFIG_HS20=y
     CONFIG_HT_OVERRIDES=y
     CONFIG_IEEE80211AC=y
@@ -68,7 +69,7 @@ stdenv.mkDerivation rec {
     CONFIG_EAP_AKA=y
     CONFIG_EAP_AKA_PRIME=y
     CONFIG_PCSC=y
-  '' + optionalString withDbus ''
+  '' + optionalString dbusSupport ''
     CONFIG_CTRL_IFACE_DBUS=y
     CONFIG_CTRL_IFACE_DBUS_NEW=y
     CONFIG_CTRL_IFACE_DBUS_INTRO=y
@@ -93,7 +94,7 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [ openssl libnl ]
-    ++ optional withDbus dbus
+    ++ optional dbusSupport dbus
     ++ optional withReadline readline
     ++ optional withPcsclite pcsclite;
 
diff --git a/nixpkgs/pkgs/os-specific/linux/xf86-input-wacom/default.nix b/nixpkgs/pkgs/os-specific/linux/xf86-input-wacom/default.nix
index 80762aa784eb..af1dc126bfdc 100644
--- a/nixpkgs/pkgs/os-specific/linux/xf86-input-wacom/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/xf86-input-wacom/default.nix
@@ -19,13 +19,13 @@
 
 stdenv.mkDerivation rec {
   pname = "xf86-input-wacom";
-  version = "1.0.0";
+  version = "1.1.0";
 
   src = fetchFromGitHub {
     owner = "linuxwacom";
     repo = pname;
     rev = "${pname}-${version}";
-    sha256 = "sha256-WitvT1y9KpXJriMr6Z9CrmAQdKPBZ5g9fP2nIgzJzAc=";
+    sha256 = "sha256-AYjO7B0Z6G1JqpLdvm9LS+ujz7iUp8UwZ9X1WQ/dGk0=";
   };
 
   nativeBuildInputs = [ autoreconfHook pkg-config ];
diff --git a/nixpkgs/pkgs/os-specific/linux/xmm7360-pci/default.nix b/nixpkgs/pkgs/os-specific/linux/xmm7360-pci/default.nix
deleted file mode 100644
index 435ff94afb76..000000000000
--- a/nixpkgs/pkgs/os-specific/linux/xmm7360-pci/default.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, kernel, perl, bc, breakpointHook }:
-
-stdenv.mkDerivation rec {
-  pname = "xmm7360-pci";
-  version = "unstable-2021-07-19";
-
-  src = fetchFromGitHub {
-    owner = "xmm7360";
-    repo = "xmm7360-pci";
-    rev = "7086b80bb609180b1b89fb478751e5e8414ab64f";
-    sha256 = "1wdb0phqg9rj9g9ycqdya0m7lx24kzjlh25yw0ifp898ddxrrr0c";
-  };
-
-  makeFlags = kernel.makeFlags ++ [
-    "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
-    "INSTALL_MOD_PATH=${placeholder "out"}"
-  ];
-
-  nativeBuildInputs = kernel.moduleBuildDependencies;
-  installFlags = [ "DEPMOD=true" ];
-
-  meta = with lib; {
-    homepage = "https://github.com/xmm7360/xmm7360-pci";
-    description = "PCI driver for Fibocom L850-GL modem based on Intel XMM7360 modem";
-    downloadPage = "https://github.com/xmm7360/xmm7360-pci";
-    license = licenses.isc;
-    maintainers = with maintainers; [ flokli hexa ];
-    platforms = platforms.linux;
-    broken = kernel.kernelOlder "4.10" || kernel.kernelAtLeast "5.14";
-  };
-}
diff --git a/nixpkgs/pkgs/os-specific/linux/xone/default.nix b/nixpkgs/pkgs/os-specific/linux/xone/default.nix
index f04ccc569dff..71bafb7abd9b 100644
--- a/nixpkgs/pkgs/os-specific/linux/xone/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/xone/default.nix
@@ -1,14 +1,14 @@
 { stdenv, lib, fetchFromGitHub, kernel, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "xone-${version}-${kernel.version}";
-  version = "0.2";
+  pname = "xone";
+  version = "0.3";
 
   src = fetchFromGitHub {
     owner = "medusalix";
-    repo = "xone";
-    rev = "v${version}";
-    sha256 = "sha256-m4305Xl5w4nyAVqubjwWsiyPDVtfGykjlSW2eKEytVk=";
+    repo = pname;
+    rev = "refs/tags/v${version}";
+    sha256 = "sha256-h+j4xCV9R6hp9trsv1NByh9m0UBafOz42ZuYUjclILE=";
   };
 
   setSourceRoot = ''
diff --git a/nixpkgs/pkgs/os-specific/linux/xp-pen-drivers/deco-01-v2/default.nix b/nixpkgs/pkgs/os-specific/linux/xp-pen-drivers/deco-01-v2/default.nix
new file mode 100644
index 000000000000..32804afa9ff2
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/xp-pen-drivers/deco-01-v2/default.nix
@@ -0,0 +1,81 @@
+{ lib
+, stdenv
+, fetchzip
+, libusb1
+, glibc
+, libGL
+, xorg
+, qtx11extras
+, wrapQtAppsHook
+, autoPatchelfHook
+, libX11
+, libXtst
+, libXi
+, libXrandr
+, libXinerama
+}:
+
+let
+  dataDir = "var/lib/xppend1v2";
+in
+stdenv.mkDerivation rec {
+  pname = "xp-pen-deco-01-v2-driver";
+  version = "3.2.3.220323-1";
+
+  src = fetchzip {
+    url = "https://www.xp-pen.com/download/file/id/1936/pid/440/ext/gz.html#.tar.gz";
+    name = "xp-pen-deco-01-v2-driver-${version}.tar.gz";
+    sha256 = "sha256-n/yutkRsjcIRRhB4q1yqEmaa03/1SO8RigJi/ZkfLbk=";
+  };
+
+  nativeBuildInputs = [
+    wrapQtAppsHook
+    autoPatchelfHook
+  ];
+
+  dontBuild = true;
+
+  dontWrapQtApps = true; # this is done manually
+
+  buildInputs = [
+    libusb1
+    libX11
+    libXtst
+    libXi
+    libXrandr
+    libXinerama
+    glibc
+    libGL
+    stdenv.cc.cc.lib
+    qtx11extras
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/{opt,bin}
+    cp -r App/usr/lib/pentablet/{pentablet,resource.rcc,conf} $out/opt
+    chmod +x $out/opt/pentablet
+    cp -r App/lib $out/lib
+    sed -i 's#usr/lib/pentablet#${dataDir}#g' $out/opt/pentablet
+
+    runHook postInstall
+  '';
+
+  postFixup = ''
+    makeWrapper $out/opt/pentablet $out/bin/xp-pen-deco-01-v2-driver \
+      "''${qtWrapperArgs[@]}" \
+      --run 'if [ "$EUID" -ne 0 ]; then echo "Please run as root."; exit 1; fi' \
+      --run 'if [ ! -d /${dataDir} ]; then mkdir -p /${dataDir}; cp -r '$out'/opt/conf /${dataDir}; chmod u+w -R /${dataDir}; fi'
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.xp-pen.com/product/461.html";
+    description = "Drivers for the XP-PEN Deco 01 v2 drawing tablet";
+    platforms = [ "x86_64-linux" ];
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    maintainers = with maintainers; [ virchau13 ];
+    license = licenses.unfree;
+  };
+}
+
diff --git a/nixpkgs/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix b/nixpkgs/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix
new file mode 100644
index 000000000000..ad983662109a
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, mkDerivation, fetchzip, autoPatchelfHook, libusb1, libX11, libXtst, qtbase, libglvnd }:
+
+mkDerivation rec {
+  pname = "xp-pen-g430-driver";
+  version = "1.2.13.1";
+
+  src = fetchzip {
+    url = "https://download01.xp-pen.com/file/2020/04/Linux_Pentablet_V${version}.tar.gz(20200428).zip";
+    sha256 = "1r423hcpi26v82pzl59br1zw5vablikclqsy6mcqi0v5p84hfrdd";
+  } + /Linux_Pentablet_V1.2.13.1.tar.gz;
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+  ];
+
+  buildInputs = [
+    libusb1
+    libX11
+    libXtst
+    qtbase
+    libglvnd
+    stdenv.cc.cc.lib
+  ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp Pentablet_Driver $out/bin/pentablet-driver
+    cp config.xml $out/bin/config.xml
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.xp-pen.com/download-46.html";
+    description = "Driver for XP-PEN Pentablet drawing tablets";
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    license = licenses.unfree;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ ivar ];
+  };
+}
diff --git a/nixpkgs/pkgs/os-specific/linux/xpadneo/default.nix b/nixpkgs/pkgs/os-specific/linux/xpadneo/default.nix
index c5aa09a88608..623b881cd0f2 100644
--- a/nixpkgs/pkgs/os-specific/linux/xpadneo/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/xpadneo/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "xpadneo";
-  version = "0.9.1";
+  version = "0.9.4";
 
   src = fetchFromGitHub {
     owner = "atar-axis";
     repo = pname;
-    rev = "v${version}";
-    hash = "sha256-VUcS4OzvPj0o627ZWIOBqEAQJ4JuMCMjgaZoMkL/IHc=";
+    rev = "refs/tags/v${version}";
+    sha256 = "sha256-4zd+x9uYl0lJgePM9LEgLYFqvcw6VPF/CbR1XiYSwGE=";
   };
 
   setSourceRoot = ''
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     description = "Advanced Linux driver for Xbox One wireless controllers";
     homepage = "https://atar-axis.github.io/xpadneo";
-    license = licenses.gpl3Plus;
+    license = licenses.gpl3Only;
     maintainers = with maintainers; [ kira-bruneau ];
     platforms = platforms.linux;
   };
diff --git a/nixpkgs/pkgs/os-specific/linux/zenpower/default.nix b/nixpkgs/pkgs/os-specific/linux/zenpower/default.nix
index f3f6e420a2a2..1ba01a1c88fb 100644
--- a/nixpkgs/pkgs/os-specific/linux/zenpower/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/zenpower/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "zenpower";
-  version = "0.1.13";
+  version = "unstable-2022-04-13";
 
   src = fetchFromGitHub {
     owner = "Ta180m";
     repo = "zenpower3";
-    rev = "v${version}";
-    sha256 = "sha256-2QScHDwOKN3Psui0M2s2p6D97jjbfe3Us5Nkn2srKC0=";
+    rev = "c36a86c64b802e9b90b5166caee6a8e8eddaeb56";
+    sha256 = "1i9ap7xgab421f3c68mcmad25xs4h8pfz0g0f9yzg7hxpmb0npxi";
   };
 
   hardeningDisable = [ "pic" ];
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     description = "Linux kernel driver for reading temperature, voltage(SVI2), current(SVI2) and power(SVI2) for AMD Zen family CPUs.";
     homepage = "https://github.com/Ta180m/zenpower3";
-    license = licenses.gpl2;
+    license = licenses.gpl2Plus;
     maintainers = with maintainers; [ alexbakker artturin ];
     platforms = [ "x86_64-linux" ];
     broken = versionOlder kernel.version "4.14";
diff --git a/nixpkgs/pkgs/os-specific/linux/zfs/default.nix b/nixpkgs/pkgs/os-specific/linux/zfs/default.nix
index 6747d511694b..5d55d1db6574 100644
--- a/nixpkgs/pkgs/os-specific/linux/zfs/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/zfs/default.nix
@@ -16,7 +16,7 @@
 , enablePython ? true
 
 # for determining the latest compatible linuxPackages
-, linuxPackages_5_17 ? pkgs.linuxKernel.packages.linux_5_17
+, linuxPackages_5_18 ? pkgs.linuxKernel.packages.linux_5_18
 }:
 
 let
@@ -203,7 +203,7 @@ let
         changelog = "https://github.com/openzfs/zfs/releases/tag/zfs-${version}";
         license = lib.licenses.cddl;
         platforms = lib.platforms.linux;
-        maintainers = with lib.maintainers; [ hmenke jcumming jonringer wizeman fpletz globin ];
+        maintainers = with lib.maintainers; [ hmenke jcumming jonringer wizeman globin ];
         mainProgram = "zfs";
         # If your Linux kernel version is not yet supported by zfs, try zfsUnstable.
         # On NixOS set the option boot.zfs.enableUnstable.
@@ -216,28 +216,28 @@ in {
   # to be adapted
   zfsStable = common {
     # check the release notes for compatible kernels
-    kernelCompatible = kernel.kernelAtLeast "3.10" && kernel.kernelOlder "5.18";
-    latestCompatibleLinuxPackages = linuxPackages_5_17;
+    kernelCompatible = kernel.kernelOlder "5.19";
+    latestCompatibleLinuxPackages = linuxPackages_5_18;
 
     # this package should point to the latest release.
-    version = "2.1.4";
+    version = "2.1.5";
 
-    sha256 = "sha256-pHz1N2j+d9p1xleEBwwrmK9mN5gEyM69Suy0dsrkZT4=";
+    sha256 = "sha256-a9rmuPO8R8UfxdHvwjfFuYRGn97a1MPmLZRvr3l0swE=";
   };
 
   zfsUnstable = common {
     # check the release notes for compatible kernels
-    kernelCompatible = kernel.kernelAtLeast "3.10" && kernel.kernelOlder "5.18";
-    latestCompatibleLinuxPackages = linuxPackages_5_17;
+    kernelCompatible = kernel.kernelOlder "5.19";
+    latestCompatibleLinuxPackages = linuxPackages_5_18;
 
     # this package should point to a version / git revision compatible with the latest kernel release
     # IMPORTANT: Always use a tagged release candidate or commits from the
     # zfs-<version>-staging branch, because this is tested by the OpenZFS
     # maintainers.
-    version = "2.1.4";
+    version = "2.1.5";
     # rev = "0000000000000000000000000000000000000000";
 
-    sha256 = "sha256-pHz1N2j+d9p1xleEBwwrmK9mN5gEyM69Suy0dsrkZT4=";
+    sha256 = "sha256-a9rmuPO8R8UfxdHvwjfFuYRGn97a1MPmLZRvr3l0swE=";
 
     isUnstable = true;
   };
diff --git a/nixpkgs/pkgs/os-specific/solo5/default.nix b/nixpkgs/pkgs/os-specific/solo5/default.nix
index d51219e69ae9..c50cea7b3850 100644
--- a/nixpkgs/pkgs/os-specific/solo5/default.nix
+++ b/nixpkgs/pkgs/os-specific/solo5/default.nix
@@ -2,7 +2,7 @@
 , pkg-config, qemu, syslinux, util-linux }:
 
 let
-  version = "0.6.9";
+  version = "0.7.3";
   # list of all theoretically available targets
   targets = [
     "genode"
@@ -21,14 +21,16 @@ in stdenv.mkDerivation {
 
   src = fetchurl {
     url = "https://github.com/Solo5/solo5/releases/download/v${version}/solo5-v${version}.tar.gz";
-    sha256 = "03lvk9mab3yxrmi73wrvvhykqcydjrsda0wj6aasnjm5lx9jycpr";
+    sha256 = "sha256-8LftT22XzmmWxgYez+BAHDX4HOyl5DrwrpuO2+bqqcY=";
   };
 
+  patches = [ ./fix_paths.patch ./test_sleep.patch ];
+
   hardeningEnable = [ "pie" ];
 
   configurePhase = ''
     runHook preConfigure
-    sh configure.sh
+    sh configure.sh --prefix=/
     runHook postConfigure
   '';
 
@@ -38,15 +40,7 @@ in stdenv.mkDerivation {
     runHook preInstall
     export DESTDIR=$out
     export PREFIX=$out
-    make install-tools
-
-    # get CONFIG_* vars from Makeconf which also parse in sh
-    grep '^CONFIG_' Makeconf > nix_tmp_targetconf
-    source nix_tmp_targetconf
-    # install opam / pkg-config files for all enabled targets
-    ${lib.concatMapStrings (bind: ''
-      [ -n "$CONFIG_${lib.toUpper bind}" ] && make install-opam-${bind}
-    '') targets}
+    make install
 
     substituteInPlace $out/bin/solo5-virtio-mkimage \
       --replace "/usr/lib/syslinux" "${syslinux}/share/syslinux" \
diff --git a/nixpkgs/pkgs/os-specific/solo5/fix_paths.patch b/nixpkgs/pkgs/os-specific/solo5/fix_paths.patch
new file mode 100644
index 000000000000..8895de311dae
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/solo5/fix_paths.patch
@@ -0,0 +1,29 @@
+diff --git a/toolchain/cc.in b/toolchain/cc.in
+index 337562a..0ec9315 100644
+--- a/toolchain/cc.in
++++ b/toolchain/cc.in
+@@ -30,9 +30,9 @@
+ # symbols.
+ 
+ prog="$(basename $0)"
+-I="$(dirname $0)/../include"
++I="$(realpath $0 | xargs dirname)/../include"
+ [ ! -d "${I}" ] && echo "$prog: Could not determine include path" 1>&2 && exit 1
+-L="$(dirname $0)/../lib/@@CONFIG_TARGET_TRIPLE@@"
++L="$(realpath $0 | xargs dirname)/../lib/@@CONFIG_TARGET_TRIPLE@@"
+ [ ! -d "${L}" ] && echo "$prog: Could not determine library path" 1>&2 && exit 1
+ # we can't really tell if 'cc' is called with no input, but work around the
+ # most obvious cases and stop them from "succeeding" and producing an "a.out"
+diff --git a/toolchain/ld.in b/toolchain/ld.in
+index 01dffa8..13dca2c 100644
+--- a/toolchain/ld.in
++++ b/toolchain/ld.in
+@@ -28,7 +28,7 @@
+ # linking a unikernel. No default for ABI is provided, as it is expected that a
+ # caller directly using 'ld' knows what they are doing.
+ 
+-L="$(dirname $0)/../lib/@@CONFIG_TARGET_TRIPLE@@"
++L="$(realpath $0 | xargs dirname)/../lib/@@CONFIG_TARGET_TRIPLE@@"
+ [ ! -d "${L}" ] && echo "$0: Could not determine library path" 1>&2 && exit 1
+ # ld accepts -z solo5-abi=ABI, but does not provide a default ABI
+ # this is intentional
diff --git a/nixpkgs/pkgs/os-specific/solo5/test_sleep.patch b/nixpkgs/pkgs/os-specific/solo5/test_sleep.patch
new file mode 100644
index 000000000000..f86a83d09dec
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/solo5/test_sleep.patch
@@ -0,0 +1,22 @@
+diff --git a/tests/test_time/test_time.c b/tests/test_time/test_time.c
+index 931500b..cde64ad 100644
+--- a/tests/test_time/test_time.c
++++ b/tests/test_time/test_time.c
+@@ -110,7 +110,8 @@ int solo5_app_main(const struct solo5_start_info *si __attribute__((unused)))
+         /*
+          * Verify that we did not sleep less than requested (see above).
+          */
+-        if (delta < NSEC_PER_SEC) {
++        const solo5_time_t slack = 100000000ULL;
++        if (delta < NSEC_PER_SEC - slack) {
+             printf("[%d] ERROR: slept too little (expected at least %llu ns)\n",
+                     iters, (unsigned long long)NSEC_PER_SEC);
+             failed = true;
+@@ -120,7 +121,6 @@ int solo5_app_main(const struct solo5_start_info *si __attribute__((unused)))
+          * Verify that we did not sleep more than requested, within reason
+          * (scheduling delays, general inaccuracy of the current timing code).
+          */
+-        const solo5_time_t slack = 100000000ULL;
+         if (delta > (NSEC_PER_SEC + slack)) {
+             printf("[%d] ERROR: slept too much (expected at most %llu ns)\n",
+                     iters, (unsigned long long)slack);
diff --git a/nixpkgs/pkgs/os-specific/windows/default.nix b/nixpkgs/pkgs/os-specific/windows/default.nix
index 15e3d7f89ab6..c34f97a17db2 100644
--- a/nixpkgs/pkgs/os-specific/windows/default.nix
+++ b/nixpkgs/pkgs/os-specific/windows/default.nix
@@ -37,6 +37,8 @@ lib.makeScope newScope (self: with self; {
     stdenv = crossThreadsStdenv;
   };
 
+  npiperelay = callPackage ./npiperelay { };
+
   pthreads = callPackage ./pthread-w32 { };
 
   wxMSW = callPackage ./wxMSW-2.8 { };
diff --git a/nixpkgs/pkgs/os-specific/windows/mingw-w64/default.nix b/nixpkgs/pkgs/os-specific/windows/mingw-w64/default.nix
index 38293e65f70f..569b149868ff 100644
--- a/nixpkgs/pkgs/os-specific/windows/mingw-w64/default.nix
+++ b/nixpkgs/pkgs/os-specific/windows/mingw-w64/default.nix
@@ -21,7 +21,6 @@ in stdenv.mkDerivation {
   enableParallelBuilding = true;
 
   buildInputs = [ windows.mingw_w64_headers ];
-  dontStrip = true;
   hardeningDisable = [ "stackprotector" "fortify" ];
 
   meta = {
diff --git a/nixpkgs/pkgs/os-specific/windows/npiperelay/default.nix b/nixpkgs/pkgs/os-specific/windows/npiperelay/default.nix
new file mode 100644
index 000000000000..edc83a27e551
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/windows/npiperelay/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "npiperelay";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "jstarks";
+    repo = "npiperelay";
+    rev = "v${version}";
+    sha256 = "sha256-cg4aZmpTysc8m1euxIO2XPv8OMnBk1DwhFcuIFHF/1o=";
+  };
+
+  vendorSha256 = null;
+
+  meta = {
+    description = "Access Windows named pipes from WSL";
+    homepage = "https://github.com/jstarks/npiperelay";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.shlevy ];
+    platforms = lib.platforms.windows;
+  };
+}