Merge branch 'master' into staging

This commit is contained in:
Franz Pletz
2017-07-28 16:08:30 +02:00
117 changed files with 3980 additions and 1944 deletions

View File

@@ -49,7 +49,7 @@ stdenv.mkDerivation {
meta = with stdenv.lib; {
description = "A module for powering off hybrid GPUs";
platforms = platforms.linux;
homepage = https://github.com/Bumblebee-Project/bbswitch;
homepage = "https://github.com/Bumblebee-Project/bbswitch";
maintainers = with maintainers; [ abbradar ];
};
}

View File

@@ -1,21 +1,18 @@
{ stdenv, lib, fetchFromGitHub, kernel }:
# Upstream build for kernel > 4.10 is currently broken
# Reference: https://github.com/dorimanx/exfat-nofuse/issues/103
assert lib.versionOlder kernel.version "4.10";
# Upstream build for kernel 4.1 is broken, 3.12 and below seems to be working
assert lib.versionAtLeast kernel.version "4.2" || lib.versionOlder kernel.version "4.0";
stdenv.mkDerivation rec {
name = "exfat-nofuse-${version}-${kernel.version}";
version = "2017-01-03";
version = "2017-06-19";
src = fetchFromGitHub {
owner = "dorimanx";
repo = "exfat-nofuse";
rev = "8d291f5";
sha256 = "0lg1mykglayswli2aliw8chsbr4g629v9chki5975avh43jn47w9";
rev = "de4c760bc9a05ead83bc3ec6eec6cf1fb106f523";
sha256 = "0v979d8sbcb70lakm4jal2ck3gspkdgq9108k127f7ph08vf8djm";
};
hardeningDisable = [ "pic" ];

View File

@@ -3,11 +3,11 @@ let
s = # Generated upstream information
rec {
baseName="firejail";
version="0.9.44.10";
version="0.9.48";
name="${baseName}-${version}";
hash="19wln3h54wcscqgcmkm8sprdh7vrn5k91rr0hagv055y1i52c7mj";
url="https://netix.dl.sourceforge.net/project/firejail/firejail/firejail-0.9.44.10.tar.xz";
sha256="19wln3h54wcscqgcmkm8sprdh7vrn5k91rr0hagv055y1i52c7mj";
hash="02a74nx8p2gbpd6ffnr52p02pxxllw3yy5fy4083a77r3wia8zb3";
url="https://vorboss.dl.sourceforge.net/project/firejail/firejail/firejail-0.9.48.tar.xz";
sha256="02a74nx8p2gbpd6ffnr52p02pxxllw3yy5fy4083a77r3wia8zb3";
};
buildInputs = [
which
@@ -21,6 +21,13 @@ stdenv.mkDerivation {
name = "${s.name}.tar.bz2";
};
prePatch = ''
# Allow whitelisting ~/.nix-profile
substituteInPlace etc/firejail.config --replace \
'# follow-symlink-as-user yes' \
'follow-symlink-as-user no'
'';
preConfigure = ''
sed -e 's@/bin/bash@${stdenv.shell}@g' -i $( grep -lr /bin/bash .)
sed -e "s@/bin/cp@$(which cp)@g" -i $( grep -lr /bin/cp .)

View File

@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
name = "keyutils-${version}";
version = "1.5.9";
version = "1.5.10";
src = fetchurl {
url = "http://people.redhat.com/dhowells/keyutils/${name}.tar.bz2";
sha256 = "1bl3w03ygxhc0hz69klfdlwqn33jvzxl1zfl2jmnb2v85iawb8jd";
sha256 = "1dmgjcf7mnwc6h72xkvpaqpzxw8vmlnsmzz0s27pg0giwzm3sp0i";
};
outputs = [ "out" "lib" "dev" ];

View File

@@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
name = "mcelog-${version}";
version = "148";
version = "153";
src = fetchFromGitHub {
sha256 = "04mzscvr38r2q9da9wmv3cxb99vrkxks1mzgvwsxk753xan3p42c";
rev = "v${version}";
repo = "mcelog";
owner = "andikleen";
owner = "andikleen";
repo = "mcelog";
rev = "v${version}";
sha256 = "1wz55dzqdiam511d6p1958al6vzlhrhs73s7gly0mzm6kpji0gxa";
};
postPatch = ''
@@ -28,6 +28,12 @@ stdenv.mkDerivation rec {
installFlags = [ "DESTDIR=$(out)" "prefix=" "DOCDIR=/share/doc" ];
postInstall = ''
mkdir -p $out/lib/systemd/system
substitute mcelog.service $out/lib/systemd/system/mcelog.service \
--replace /usr/sbin $out/bin
'';
meta = with stdenv.lib; {
description = "Log x86 machine checks: memory, IO, and CPU hardware errors";
longDescription = ''

View File

@@ -6,67 +6,57 @@
}:
with stdenv.lib;
let
buildKernel = any (n: n == configFile) [ "kernel" "all" ];
buildUser = any (n: n == configFile) [ "user" "all" ];
common = { version, sha256 } @ args : stdenv.mkDerivation rec {
name = "spl-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
src = fetchFromGitHub {
owner = "zfsonlinux";
repo = "spl";
rev = "spl-${version}";
inherit sha256;
};
patches = [ ./const.patch ./install_prefix.patch ];
nativeBuildInputs = [ autoreconfHook ];
hardeningDisable = [ "pic" ];
preConfigure = ''
substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid
substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
'';
configureFlags = [
"--with-config=${configFile}"
] ++ optionals buildKernel [
"--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
"--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
enableParallelBuilding = true;
meta = {
description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
longDescription = ''
This kernel module is a porting layer for ZFS to work inside the linux
kernel.
'';
homepage = http://zfsonlinux.org/;
platforms = platforms.linux;
license = licenses.gpl2Plus;
maintainers = with maintainers; [ jcumming wizeman wkennington fpletz ];
};
};
in
assert any (n: n == configFile) [ "kernel" "user" "all" ];
assert buildKernel -> kernel != null;
{
splStable = common {
version = "0.6.5.11";
sha256 = "192val8035pj2rryi3fwb134avzirhv5ifaj5021vh8bbjx75pd5";
};
splUnstable = common {
version = "0.7.0-rc5";
sha256 = "17y25g02c9swi3n90lhjvazcnsr69nh50dz3b8g1c08zlz9n2akp";
};
}
stdenv.mkDerivation rec {
name = "spl-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
version = "0.7.0";
src = fetchFromGitHub {
owner = "zfsonlinux";
repo = "spl";
rev = "spl-${version}";
sha256 = "05qqwhxc9nj94y28c97iwfz8gkjwicrhnkj425yb47gqa8rafazk";
};
patches = [ ./const.patch ./install_prefix.patch ];
nativeBuildInputs = [ autoreconfHook ];
hardeningDisable = [ "pic" ];
preConfigure = ''
substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid
substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
'';
configureFlags = [
"--with-config=${configFile}"
] ++ optionals buildKernel [
"--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
"--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
enableParallelBuilding = true;
meta = {
description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
longDescription = ''
This kernel module is a porting layer for ZFS to work inside the linux
kernel.
'';
homepage = http://zfsonlinux.org/;
platforms = platforms.linux;
license = licenses.gpl2Plus;
maintainers = with maintainers; [ jcumming wizeman wkennington fpletz globin ];
};
}

View File

@@ -3,23 +3,15 @@
with stdenv.lib;
stdenv.mkDerivation rec {
name = "sysdig-${version}";
version = "0.16.0";
version = "0.17.0";
src = fetchFromGitHub {
owner = "draios";
repo = "sysdig";
rev = version;
sha256 = "1h3f9nkc5fkvks6va0maq377m9qxnsf4q3f2dc14rdzfvnzidy06";
sha256 = "0xw4in2yb3ynpc8jwl95j92kbyr7fzda3mab8nyxcyld7gshrlvd";
};
patches = [
(fetchpatch {
# Sysdig fails to run on linux kernels with unified cgroups enabled
url = https://github.com/draios/sysdig/files/909689/0001-Fix-for-linux-kernels-with-cgroup-v2-API-enabled.patch.txt;
sha256 = "10nmisifa500hzpa3899rs837bcal72pnqidxmrnr1js187z8j84";
})
];
buildInputs = [
cmake zlib luajit ncurses perl jsoncpp libb64 openssl curl jq gcc
];

View File

@@ -13,149 +13,105 @@ let
buildKernel = any (n: n == configFile) [ "kernel" "all" ];
buildUser = any (n: n == configFile) [ "user" "all" ];
common = { version, sha256, extraPatches, spl, incompatibleKernelVersion ? null } @ args:
if buildKernel &&
(incompatibleKernelVersion != null) &&
versionAtLeast kernel.version incompatibleKernelVersion then
throw "Linux v${kernel.version} is not yet supported by zfsonlinux v${version}. Try zfsUnstable or set the NixOS option boot.zfs.enableUnstable."
else stdenv.mkDerivation rec {
name = "zfs-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
in stdenv.mkDerivation rec {
name = "zfs-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
version = "0.7.0";
src = fetchFromGitHub {
owner = "zfsonlinux";
repo = "zfs";
rev = "zfs-${version}";
inherit sha256;
};
src = fetchFromGitHub {
owner = "zfsonlinux";
repo = "zfs";
rev = "zfs-${version}";
sha256 = "16z0fl282rsmvgk608ii7n410swivkrisp112n2fhhjc1fs0zall";
};
patches = extraPatches;
patches = [
(fetchpatch {
url = "https://github.com/Mic92/zfs/compare/zfs-0.7.0-rc3...nixos-zfs-0.7.0-rc3.patch";
sha256 = "1vlw98v8xvi8qapzl1jwm69qmfslwnbg3ry1lmacndaxnyckkvhh";
})
];
buildInputs = [ autoreconfHook nukeReferences ]
++ optionals buildKernel [ spl ]
++ optionals buildUser [ zlib libuuid python attr ];
buildInputs = [ autoreconfHook nukeReferences ]
++ optionals buildKernel [ spl ]
++ optionals buildUser [ zlib libuuid python attr ];
# for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
NIX_CFLAGS_LINK = "-lgcc_s";
# for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
NIX_CFLAGS_LINK = "-lgcc_s";
hardeningDisable = [ "pic" ];
hardeningDisable = [ "pic" ];
preConfigure = ''
substituteInPlace ./module/zfs/zfs_ctldir.c --replace "umount -t zfs" "${utillinux}/bin/umount -t zfs"
substituteInPlace ./module/zfs/zfs_ctldir.c --replace "mount -t zfs" "${utillinux}/bin/mount -t zfs"
substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount" "${utillinux}/bin/umount"
substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/mount" "${utillinux}/bin/mount"
substituteInPlace ./cmd/ztest/ztest.c --replace "/usr/sbin/ztest" "$out/sbin/ztest"
substituteInPlace ./cmd/ztest/ztest.c --replace "/usr/sbin/zdb" "$out/sbin/zdb"
substituteInPlace ./config/user-systemd.m4 --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d"
substituteInPlace ./config/zfs-build.m4 --replace "\$sysconfdir/init.d" "$out/etc/init.d"
substituteInPlace ./etc/zfs/Makefile.am --replace "\$(sysconfdir)" "$out/etc"
substituteInPlace ./cmd/zed/Makefile.am --replace "\$(sysconfdir)" "$out/etc"
substituteInPlace ./module/Makefile.in --replace "/bin/cp" "cp"
substituteInPlace ./etc/systemd/system/zfs-share.service.in \
--replace "@bindir@/rm " "${coreutils}/bin/rm "
preConfigure = ''
substituteInPlace ./module/zfs/zfs_ctldir.c --replace "umount -t zfs" "${utillinux}/bin/umount -t zfs"
substituteInPlace ./module/zfs/zfs_ctldir.c --replace "mount -t zfs" "${utillinux}/bin/mount -t zfs"
substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount" "${utillinux}/bin/umount"
substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/mount" "${utillinux}/bin/mount"
substituteInPlace ./udev/rules.d/* --replace "/lib/udev/vdev_id" "$out/lib/udev/vdev_id"
substituteInPlace ./cmd/ztest/ztest.c --replace "/usr/sbin/ztest" "$out/sbin/ztest"
substituteInPlace ./cmd/ztest/ztest.c --replace "/usr/sbin/zdb" "$out/sbin/zdb"
substituteInPlace ./config/user-systemd.m4 --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d"
substituteInPlace ./config/zfs-build.m4 --replace "\$sysconfdir/init.d" "$out/etc/init.d"
substituteInPlace ./etc/zfs/Makefile.am --replace "\$(sysconfdir)" "$out/etc"
substituteInPlace ./cmd/zed/Makefile.am --replace "\$(sysconfdir)" "$out/etc"
substituteInPlace ./module/Makefile.in --replace "/bin/cp" "cp"
substituteInPlace ./etc/systemd/system/zfs-share.service.in \
--replace "@bindir@/rm " "${coreutils}/bin/rm "
./autogen.sh
'';
for f in ./udev/rules.d/*
do
substituteInPlace "$f" --replace "/lib/udev/vdev_id" "$out/lib/udev/vdev_id"
done
configureFlags = [
"--with-config=${configFile}"
] ++ optionals buildUser [
"--with-dracutdir=$(out)/lib/dracut"
"--with-udevdir=$(out)/lib/udev"
"--with-systemdunitdir=$(out)/etc/systemd/system"
"--with-systemdpresetdir=$(out)/etc/systemd/system-preset"
"--with-mounthelperdir=$(out)/bin"
"--sysconfdir=/etc"
"--localstatedir=/var"
"--enable-systemd"
] ++ optionals buildKernel [
"--with-spl=${spl}/libexec/spl"
"--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
"--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
./autogen.sh
'';
enableParallelBuilding = true;
configureFlags = [
"--with-config=${configFile}"
] ++ optionals buildUser [
"--with-dracutdir=$(out)/lib/dracut"
"--with-udevdir=$(out)/lib/udev"
"--with-systemdunitdir=$(out)/etc/systemd/system"
"--with-systemdpresetdir=$(out)/etc/systemd/system-preset"
"--with-mounthelperdir=$(out)/bin"
"--sysconfdir=/etc"
"--localstatedir=/var"
"--enable-systemd"
] ++ optionals buildKernel [
"--with-spl=${spl}/libexec/spl"
"--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
"--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
installFlags = [
"sysconfdir=\${out}/etc"
"DEFAULT_INITCONF_DIR=\${out}/default"
];
enableParallelBuilding = true;
postInstall = ''
# Prevent kernel modules from depending on the Linux -dev output.
nuke-refs $(find $out -name "*.ko")
'' + optionalString buildUser ''
# Remove provided services as they are buggy
rm $out/etc/systemd/system/zfs-import-*.service
installFlags = [
"sysconfdir=\${out}/etc"
"DEFAULT_INITCONF_DIR=\${out}/default"
];
sed -i '/zfs-import-scan.service/d' $out/etc/systemd/system/*
postInstall = ''
# Prevent kernel modules from depending on the Linux -dev output.
nuke-refs $(find $out -name "*.ko")
'' + optionalString buildUser ''
# Remove provided services as they are buggy
rm $out/etc/systemd/system/zfs-import-*.service
for i in $out/etc/systemd/system/*; do
substituteInPlace $i --replace "zfs-import-cache.service" "zfs-import.target"
done
sed -i '/zfs-import-scan.service/d' $out/etc/systemd/system/*
# Fix pkgconfig.
ln -s ../share/pkgconfig $out/lib/pkgconfig
for i in $out/etc/systemd/system/*; do
substituteInPlace $i --replace "zfs-import-cache.service" "zfs-import.target"
done
# Remove tests because they add a runtime dependency on gcc
rm -rf $out/share/zfs/zfs-tests
'';
# Fix pkgconfig.
ln -s ../share/pkgconfig $out/lib/pkgconfig
# Remove tests because they add a runtime dependency on gcc
rm -rf $out/share/zfs/zfs-tests
'';
meta = {
description = "ZFS Filesystem Linux Kernel module";
longDescription = ''
ZFS is a filesystem that combines a logical volume manager with a
Copy-On-Write filesystem with data integrity detection and repair,
snapshotting, cloning, block devices, deduplication, and more.
'';
homepage = http://zfsonlinux.org/;
license = licenses.cddl;
platforms = platforms.linux;
maintainers = with maintainers; [ jcumming wizeman wkennington fpletz ];
};
};
in
assert any (n: n == configFile) [ "kernel" "user" "all" ];
assert buildKernel -> kernel != null && spl != null;
{
# also check if kernel version constraints in
# ./nixos/modules/tasks/filesystems/zfs.nix needs
# to be adapted
zfsStable = common {
# comment/uncomment if breaking kernel versions are known
incompatibleKernelVersion = "4.12";
version = "0.6.5.11";
# this package should point to the latest release.
sha256 = "1wqz43cjr21m3f52ahcikl2798pbzj5sfy16zqxwiqpv7iy09kr3";
extraPatches = [
(fetchpatch {
url = "https://github.com/Mic92/zfs/compare/zfs-0.6.5.8...nixos-zfs-0.6.5.8.patch";
sha256 = "14kqqphzg02m9a7qncdhff8958cfzdrvsid3vsrm9k75lqv1w08z";
})
];
inherit spl;
};
zfsUnstable = common {
# comment/uncomment if breaking kernel versions are known
incompatibleKernelVersion = null;
version = "0.7.0-rc5";
# this package should point to a version / git revision compatible with the latest kernel release
sha256 = "1k0fl6lbi5winri58v26k7gngd560hbj0247rnwcbc6j01ixsr5n";
extraPatches = [
(fetchpatch {
url = "https://github.com/Mic92/zfs/compare/zfs-0.7.0-rc3...nixos-zfs-0.7.0-rc3.patch";
sha256 = "1vlw98v8xvi8qapzl1jwm69qmfslwnbg3ry1lmacndaxnyckkvhh";
})
];
spl = splUnstable;
};
}
meta = {
description = "ZFS Filesystem Linux Kernel module";
longDescription = ''
ZFS is a filesystem that combines a logical volume manager with a
Copy-On-Write filesystem with data integrity detection and repair,
snapshotting, cloning, block devices, deduplication, and more.
'';
homepage = http://zfsonlinux.org/;
license = licenses.cddl;
platforms = platforms.linux;
maintainers = with maintainers; [ jcumming wizeman wkennington fpletz globin ];
};
}