Jump to content

Calibre: Difference between revisions

From NixOS Wiki
m Fix formatting a bit
Improve formatting, add top level usage heading, remove generic page description
Line 1: Line 1:
[https://calibre-ebook.com/ Calibre] is program to view, edit, convert and print ebooks.  
[https://calibre-ebook.com/ Calibre] is program to view, edit, convert and print ebooks.


This page is intended to explain how to run <code>calibre</code> in nixos.
== Usage ==
=== Connecting USB devices ===


== Connecting USB devices ==
To connect devices via USB, you might have to add the following to your NixOS configuration:


To connect devices via USB, you might have to add the following to your <code>configuration.nix</code> file:
<syntaxhighlight lang="nix">
services.udisks2.enable = true;
</syntaxhighlight>


<syntaxHighlight lang=nix>
=== <code>.cbr</code> files ===
services.udisks2.enable = true;
</syntaxHighlight>


== .cbr and .cbz files ==
If you want to open <code>.cbr</code> files, you need to add the following lines to your NixOS configuration:


If you want to open .cbr and .cbz files, you need to add the following lines to your <code>configuration.nix</code> file:
<syntaxhighlight lang="nix">
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
environment.systemPackages = with pkgs; [       
environment.systemPackages = with pkgs; [       
   (calibre.override {
   (calibre.override {
Line 20: Line 20:
   })
   })
];
];
</nowiki>}}
</syntaxhighlight>
 
{{note|<code>calibre</code> requires several unfree packages to open .cbr files. If you are using <code>allowUnfreePredicate</code> you will need to ensure that your configurations permit all of them.


{{note|<code>calibre</code> requires several unfree packages to open .cbr and .cbz files. If you are using <code>allowUnfreePredicate</code> you will need to ensure that your configurations permit all of them.
<syntaxhighlight lang="nix">
<syntaxHighlight lang=nix>
{
{
   nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
   nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
Line 30: Line 31:
   ];
   ];
}
}
</syntaxHighlight>
</syntaxhighlight>
}}
}}
[[Category: Applications]]
[[Category: Applications]]

Revision as of 05:35, 5 September 2025

Calibre is program to view, edit, convert and print ebooks.

Usage

Connecting USB devices

To connect devices via USB, you might have to add the following to your NixOS configuration:

services.udisks2.enable = true;

.cbr files

If you want to open .cbr files, you need to add the following lines to your NixOS configuration:

environment.systemPackages = with pkgs; [      
  (calibre.override {
    unrarSupport = true;
  })
];
Note: calibre requires several unfree packages to open .cbr files. If you are using allowUnfreePredicate you will need to ensure that your configurations permit all of them.
{
  nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    "calibre"
    "unrar"
  ];
}