No results
4
Contributing
Forgejo Actions edited this page 2026-08-10 15:52:21 +00:00
🤝 Contributing
Adding a vendor or driver series
A step-by-step walkthrough is in docs/adding-a-printer.md. In short:
- Create
vendors/<vendor>/<series>/default.nixthat fetches the driver archive withpkgs.fetchzip(real SRI hash, nofakeHash) and callslib.mkIntunePackagefrom the repo root. - Add
vendors/<vendor>/<series>/scripts/Install.ps1andUninstall.ps1. - Register the package in
flake.nix'svendorPackagesset. nix build .#<vendor>-<series>and confirm the output.intunewin.
Keep vendor default.nix files minimal — fetch, unpack, call
lib/mkIntunePackage.nix. Anything reusable
belongs in lib/ or nix/, not duplicated per vendor — PowerShell helpers
that every Install.ps1 needs (e.g. Import-DriverPublisherTrust in
lib/common-scripts/) go there too;
mkIntunePackage.nix merges them into every package's build tree
automatically.
Design constraints to preserve
- One package per driver series, not per printer. Printer identity (name, IP, model) is supplied at deploy time via Intune install-command arguments — never bake a specific printer into a package.
- No secrets or driver binaries committed. Drivers are fetched at build time and pinned by hash only.
- Idempotent scripts.
Install.ps1/Uninstall.ps1must be safe to re-run: create resources only if absent, reconcile if present but different, and never fail because something already exists. - Reproducible builds.
mkintunewinmust produce byte-identical output for identical inputs and--seed. If you touchtools/mkintunewin.py, don't introduce non-determinism (wall-clock timestamps, unsorted directory iteration, unseeded randomness).
Style
- Nix: format with
nixpkgs-fmt(available innix develop, wired up asnix fmt). - PowerShell: short comment-based help header (synopsis, parameters, one example); inline comments only where the why isn't obvious from the code.
- Python: standard library +
pycryptodomeonly, no other runtime dependencies — this keepsnix/intunewin-packer.nixsimple to wrap.
Before opening a PR
nix flake check
nix build .#all
nix fmt
If you changed tools/mkintunewin.py, see
docs/architecture.md
— format changes should be validated against a real Intune upload where
possible.