Printing: Difference between revisions
imported>Tobias.bora No edit summary |
imported>Tobias.bora No edit summary |
||
| Line 46: | Line 46: | ||
You can also declaratively add the PPD as a new driver by creating a simple derivation. You just need to create a derivation that puts the PPD file in <code>$out/share/cups/model/yourfile.ppd</code> (you can also put it in a subfolder like <code>$out/share/cups/model/HP/yourfile.ppd</code> to limit conflicts between ppd having the same name). Note that the name of the file does not change the way cups will list it as the model/manufacturer is written inside the (text) ppd. | You can also declaratively add the PPD as a new driver by creating a simple derivation. You just need to create a derivation that puts the PPD file in <code>$out/share/cups/model/yourfile.ppd</code> (you can also put it in a subfolder like <code>$out/share/cups/model/HP/yourfile.ppd</code> to limit conflicts between ppd having the same name). Note that the name of the file does not change the way cups will list it as the model/manufacturer is written inside the (text) ppd. | ||
As in the imperative method, first check that your file does not contain any reference to binaries outside the store like <code>/bin/</code> or <code>/usr/</code>. If it does not contain any reference then you should be able to simply do this: | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
| Line 59: | Line 59: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
If your ppd contains links to external binaries, you can instead | If your ppd contains links to external binaries, you can instead patch the file using for instance <code>substituteInPlace</code>. For that, create a file, say, <code>myPrinter.nix</code> containing something like: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ stdenv }: | { stdenv }: | ||