2021-02-10 00:37:24 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, kernel
|
2022-12-05 15:04:14 +01:00
|
|
|
, nixosTests
|
2021-02-10 00:37:24 +01:00
|
|
|
}:
|
|
|
|
|
2023-01-31 14:17:35 +01:00
|
|
|
let
|
2023-04-03 13:48:09 +02:00
|
|
|
tag = "0.3.1";
|
2023-01-31 14:17:35 +01:00
|
|
|
in
|
2021-02-10 00:37:24 +01:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "apfs";
|
2023-01-31 14:17:35 +01:00
|
|
|
version = "${tag}-${kernel.version}";
|
2021-02-10 00:37:24 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linux-apfs";
|
|
|
|
repo = "linux-apfs-rw";
|
2023-01-31 14:17:35 +01:00
|
|
|
rev = "v${tag}";
|
2023-04-03 13:48:09 +02:00
|
|
|
sha256 = "sha256-KYPZsCAEqJl0VjV/TmJWi20Y7yApIJH0YMwQIL80Ep4=";
|
2021-02-10 00:37:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2022-02-10 02:35:56 +01:00
|
|
|
makeFlags = kernel.makeFlags ++ [
|
2021-02-10 00:37:24 +01:00
|
|
|
"KERNELRELEASE=${kernel.modDirVersion}"
|
|
|
|
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
"INSTALL_MOD_PATH=$(out)"
|
|
|
|
];
|
|
|
|
|
2022-12-05 15:04:14 +01:00
|
|
|
passthru.tests.test = nixosTests.apfs;
|
|
|
|
|
2021-02-10 00:37:24 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "APFS module for linux";
|
2023-01-31 14:17:35 +01:00
|
|
|
longDescription = ''
|
|
|
|
The Apple File System (APFS) is the copy-on-write filesystem currently
|
|
|
|
used on all Apple devices. This module provides a degree of experimental
|
|
|
|
support on Linux.
|
|
|
|
If you make use of the write support, expect data corruption.
|
|
|
|
Read-only support is somewhat more complete, with sealed volumes,
|
|
|
|
snapshots, and all the missing compression algorithms recently added.
|
|
|
|
Encryption is still not in the works though.
|
|
|
|
'';
|
2021-02-10 00:37:24 +01:00
|
|
|
homepage = "https://github.com/linux-apfs/linux-apfs-rw";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
platforms = platforms.linux;
|
2022-08-26 14:44:31 +02:00
|
|
|
broken = kernel.kernelOlder "4.9";
|
2021-02-10 00:37:24 +01:00
|
|
|
maintainers = with maintainers; [ Luflosi ];
|
|
|
|
};
|
|
|
|
}
|