From 9838a041fb101639f66cb334669029d9395c3d58 Mon Sep 17 00:00:00 2001 From: Callum Leslie Date: Thu, 5 Sep 2024 20:43:07 +0100 Subject: [PATCH] linuxPackages.nullfs: init at 0.17 --- pkgs/os-specific/linux/nullfs/default.nix | 47 +++++++++++++++++++++++ pkgs/top-level/linux-kernels.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/os-specific/linux/nullfs/default.nix diff --git a/pkgs/os-specific/linux/nullfs/default.nix b/pkgs/os-specific/linux/nullfs/default.nix new file mode 100644 index 000000000000..62a71829b2e1 --- /dev/null +++ b/pkgs/os-specific/linux/nullfs/default.nix @@ -0,0 +1,47 @@ +{ + stdenv, + lib, + fetchFromGitHub, + kernel, +}: +stdenv.mkDerivation rec { + pname = "nullfs"; + version = "0.17"; + + src = fetchFromGitHub { + owner = "abbbi"; + repo = "nullfsvfs"; + rev = "v${version}"; + sha256 = "sha256-Hkplhem4Gb1xsYQtRSWub0m15Fiil3qJAO183ygP+WI="; + }; + + hardeningDisable = [ "pic" ]; + + enableParallelBuilding = true; + + nativeBuildInputs = kernel.moduleBuildDependencies; + + makeFlags = kernel.makeFlags ++ [ + "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ]; + + prePatch = '' + substituteInPlace "Makefile" \ + --replace-fail "/lib/modules/\$(shell uname -r)/build" "\$(KSRC)" + ''; + + installPhase = '' + runHook preInstall + mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/fs/nullfs/" + install -p -m 644 nullfs.ko $out/lib/modules/${kernel.modDirVersion}/kernel/fs/nullfs/ + runHook postInstall + ''; + + meta = with lib; { + description = "A virtual black hole file system that behaves like /dev/null"; + homepage = "https://github.com/abbbi/nullfsvfs"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ callumio ]; + }; +} diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index d5bd0f19bac2..3c69f5f5ece8 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -605,6 +605,8 @@ in { drbd = callPackage ../os-specific/linux/drbd/driver.nix { }; + nullfs = callPackage ../os-specific/linux/nullfs { }; + } // lib.optionalAttrs config.allowAliases { ati_drivers_x11 = throw "ati drivers are no longer supported by any kernel >=4.1"; # added 2021-05-18; hid-nintendo = throw "hid-nintendo was added in mainline kernel version 5.16"; # Added 2023-07-30