mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
doc/udevCheckHook: init
This commit is contained in:
parent
3b17ba75ab
commit
d3a197a33d
3 changed files with 40 additions and 0 deletions
|
@ -35,6 +35,7 @@ python.section.md
|
||||||
scons.section.md
|
scons.section.md
|
||||||
tauri.section.md
|
tauri.section.md
|
||||||
tetex-tex-live.section.md
|
tetex-tex-live.section.md
|
||||||
|
udevCheckHook.section.md
|
||||||
unzip.section.md
|
unzip.section.md
|
||||||
validatePkgConfig.section.md
|
validatePkgConfig.section.md
|
||||||
versionCheckHook.section.md
|
versionCheckHook.section.md
|
||||||
|
|
36
doc/hooks/udevCheckHook.section.md
Normal file
36
doc/hooks/udevCheckHook.section.md
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# udevCheckHook {#udevcheckhook}
|
||||||
|
|
||||||
|
The `udevCheckHook` derivation adds `udevCheckPhase` to the [`preInstallCheckHooks`](#ssec-installCheck-phase),
|
||||||
|
which finds all udev rules in all outputs and verifies them using `udevadm verify --resolve-names=never --no-style`.
|
||||||
|
It should be used in any package that has udev rules outputs to ensure the rules are and stay valid.
|
||||||
|
|
||||||
|
The hook runs in `installCheckPhase`, requiring `doInstallCheck` is enabled for the hook to take effect:
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
udevCheckHook,
|
||||||
|
# ...
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
# ...
|
||||||
|
|
||||||
|
nativeInstallCheckInputs = [
|
||||||
|
udevCheckHook
|
||||||
|
];
|
||||||
|
doInstallCheck = true;
|
||||||
|
|
||||||
|
# ...
|
||||||
|
})
|
||||||
|
```
|
||||||
|
Note that for [`buildPythonPackage`](#buildpythonpackage-function) and [`buildPythonApplication`](#buildpythonapplication-function), `doInstallCheck` is enabled by default.
|
||||||
|
|
||||||
|
All outputs are scanned for their `/{etc,lib}/udev/rules.d` paths.
|
||||||
|
If no rule output is found, the hook is basically a no-op.
|
||||||
|
|
||||||
|
The `udevCheckHook` adds a dependency on `systemdMinimal`.
|
||||||
|
It is internally guarded behind `hostPlatform` supporting udev and `buildPlatform` being able to execute `udevadm`.
|
||||||
|
The hook does not need explicit platform checks in the places where it is used.
|
||||||
|
|
||||||
|
The hook can be disabled using `dontUdevCheck`, which is necessary if you want to run some different task in `installCheckPhase` on a package with broken udev rule outputs.
|
|
@ -2429,6 +2429,9 @@
|
||||||
"tetex-tex-live": [
|
"tetex-tex-live": [
|
||||||
"index.html#tetex-tex-live"
|
"index.html#tetex-tex-live"
|
||||||
],
|
],
|
||||||
|
"udevcheckhook": [
|
||||||
|
"index.html#udevcheckhook"
|
||||||
|
],
|
||||||
"unzip": [
|
"unzip": [
|
||||||
"index.html#unzip"
|
"index.html#unzip"
|
||||||
],
|
],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue