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