nixpkgs/pkgs/by-name/rw/rwedid/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

48 lines
1.3 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitea
, pkg-config
, xz
}:
rustPlatform.buildRustPackage rec {
pname = "rwedid";
version = "0.3.2";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "ral";
repo = "rwedid";
rev = version;
hash = "sha256-lbZD/QLCgkD5OQZdn6oCjry9edMcJ+q9qGF7IbY36U4=";
};
cargoHash = "sha256-eY12p8pyUjSaoP4QKfVFwKQGdvFNG7GMAbFkFa8i05I=";
nativeBuildInputs = [
pkg-config
];
buildInputs = [
xz
];
postInstall = ''
mkdir -p $out/etc/udev/rules.d
echo 'SUBSYSTEM=="i2c-dev",KERNEL=="i2c-[0-9]*", ATTRS{class}=="0x030000", TAG+="uaccess"' > $out/etc/udev/rules.d/60-rwedid.rules
'';
meta = with lib; {
description = "Read and write EDID data over an I2C bus";
longDescription = ''
To install udev rules, you also have to add `services.udev.packages = [ pkgs.rwedid ]` into your configuration.
Additionally you will also have to create the i2c group, on NixOS this can be done using `users.groups.i2c = {};`.
And you will have to load i2c-dev kernel module, for that add `boot.initrd.availableKernelModules = [ i2c-dev ] to your config.
'';
homepage = "https://codeberg.org/ral/rwedid";
license = licenses.mit;
platforms = platforms.linux;
maintainers = [ ];
};
}