{
  acl,
  bash,
  coreutils,
  dpkg,
  fetchurl,
  findutils,
  hostname,
  iproute2,
  jq,
  lib,
  nfs-utils,
  python3Packages,
  samba,
  stdenv,
  systemd,
}:

stdenv.mkDerivation {
  pname = "cockpit-file-sharing";
  version = "4.5.6-1";

  src = fetchurl {
    url = "https://github.com/45Drives/cockpit-file-sharing/releases/download/v4.5.6-1/cockpit-file-sharing_4.5.6-1jammy_all.deb";
    hash = "sha256-ViTdhiCmqwuBvAfzT8hr2kqZqyWkV9OZ9FEPD10ajF8=";
  };

  nativeBuildInputs = [ dpkg ];

  unpackPhase = "dpkg-deb -x $src source";

  installPhase = ''
    runHook preInstall
    mkdir -p $out/share/cockpit
    cp -r source/usr/share/cockpit/file-sharing $out/share/cockpit/
    runHook postInstall
  '';

  passthru.cockpitPath = [
    acl
    bash
    coreutils
    findutils
    hostname
    iproute2
    jq
    nfs-utils
    python3Packages.botocore
    samba
    systemd
  ];

  meta = {
    description = "Cockpit plugin to manage Samba and NFS file sharing (45Drives)";
    homepage = "https://github.com/45Drives/cockpit-file-sharing";
    license = lib.licenses.gpl3Plus;
    platforms = lib.platforms.linux;
    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
  };
}
