nixpkgs/pkgs/by-name/co/compsize/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

45 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, fetchurl, btrfs-progs }:
let
# https://github.com/kilobyte/compsize/issues/52
btrfs-progs' = btrfs-progs.overrideAttrs (old: rec {
pname = "btrfs-progs";
version = "6.10";
src = fetchurl {
url = "mirror://kernel/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${version}.tar.xz";
hash = "sha256-M4KoTj/P4f/eoHphqz9OhmZdOPo18fNFSNXfhnQj4N8=";
};
});
in
stdenv.mkDerivation rec {
pname = "compsize";
version = "1.5";
src = fetchFromGitHub {
owner = "kilobyte";
repo = pname;
rev = "v${version}";
sha256 = "sha256-OX41ChtHX36lVRL7O2gH21Dfw6GPPEClD+yafR/PFm8=";
};
buildInputs = [ btrfs-progs' ];
installFlags = [
"PREFIX=${placeholder "out"}"
];
preInstall = ''
mkdir -p $out/share/man/man8
'';
meta = with lib; {
description = "btrfs: Find compression type/ratio on a file or set of files";
mainProgram = "compsize";
homepage = "https://github.com/kilobyte/compsize";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ CrazedProgrammer ];
platforms = platforms.linux;
};
}