1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 kernel,
6 kernelModuleMakeFlags,
7 nixosTests,
8}:
9
10let
11 tag = "0.3.13";
12in
13stdenv.mkDerivation {
14 pname = "apfs";
15 version = "${tag}-${kernel.version}";
16
17 src = fetchFromGitHub {
18 owner = "linux-apfs";
19 repo = "linux-apfs-rw";
20 rev = "v${tag}";
21 hash = "sha256-PXTyPOZhBeFGXu71Jj46hlrgVemgmYrjHqkTFjTDoTc=";
22 };
23
24 hardeningDisable = [ "pic" ];
25 nativeBuildInputs = kernel.moduleBuildDependencies;
26
27 makeFlags = kernelModuleMakeFlags ++ [
28 "KERNELRELEASE=${kernel.modDirVersion}"
29 "KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
30 "INSTALL_MOD_PATH=$(out)"
31 ];
32
33 passthru.tests.apfs = nixosTests.apfs;
34
35 meta = with lib; {
36 description = "APFS module for linux";
37 longDescription = ''
38 The Apple File System (APFS) is the copy-on-write filesystem currently
39 used on all Apple devices. This module provides a degree of experimental
40 support on Linux.
41 If you make use of the write support, expect data corruption.
42 Read-only support is somewhat more complete, with sealed volumes,
43 snapshots, and all the missing compression algorithms recently added.
44 Encryption is still not in the works though.
45 '';
46 homepage = "https://github.com/linux-apfs/linux-apfs-rw";
47 license = licenses.gpl2Only;
48 platforms = platforms.linux;
49 maintainers = with maintainers; [ Luflosi ];
50 };
51}