mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-10 15:35:30 +00:00
Added more pdf viewer options
This commit is contained in:
parent
95a0125ce0
commit
821cefec27
5 changed files with 189 additions and 0 deletions
42
modules/plugins/languages/tex/pdfViewer/viewers/custom.nix
Normal file
42
modules/plugins/languages/tex/pdfViewer/viewers/custom.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
} @ moduleInheritencePackage: let
|
||||
# The name of the pdf viewer
|
||||
name = "custom";
|
||||
|
||||
# The viewer template
|
||||
template = import ./viewerTemplate.nix;
|
||||
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) package str listOf;
|
||||
in (
|
||||
template {
|
||||
inherit name moduleInheritencePackage;
|
||||
|
||||
options = {
|
||||
enable = mkEnableOption "enable using a custom pdf viewer.";
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
example = pkgs.okular;
|
||||
description = "custom viewer package";
|
||||
};
|
||||
|
||||
executable = mkOption {
|
||||
type = str;
|
||||
example = "okular";
|
||||
description = "The executable name to call the viewer.";
|
||||
};
|
||||
|
||||
args = mkOption {
|
||||
type = listOf str;
|
||||
example = ["--unique" "file:%p#src:%l%f"];
|
||||
description = "Arguments to pass to the viewer.";
|
||||
};
|
||||
};
|
||||
|
||||
argsFunction = viewerCfg: (viewerCfg.args);
|
||||
}
|
||||
)
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./custom.nix
|
||||
./okular.nix
|
||||
./sioyek.nix
|
||||
./qpdfview.nix
|
||||
./zathura.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
42
modules/plugins/languages/tex/pdfViewer/viewers/qpdfview.nix
Normal file
42
modules/plugins/languages/tex/pdfViewer/viewers/qpdfview.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
} @ moduleInheritencePackage: let
|
||||
# The name of the pdf viewer
|
||||
name = "qpdfview";
|
||||
|
||||
# The viewer template
|
||||
template = import ./viewerTemplate.nix;
|
||||
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) package str listOf;
|
||||
in (
|
||||
template {
|
||||
inherit name moduleInheritencePackage;
|
||||
|
||||
options = {
|
||||
enable = mkEnableOption "enable qpdfview as the pdf file previewer.";
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = pkgs.qpdfview;
|
||||
description = "qpdfview package";
|
||||
};
|
||||
|
||||
executable = mkOption {
|
||||
type = str;
|
||||
default = "qpdfview";
|
||||
description = "The executable name to call the viewer.";
|
||||
};
|
||||
|
||||
args = mkOption {
|
||||
type = listOf str;
|
||||
default = ["--unique" "%p#src:%f:%l:1"];
|
||||
description = "Arguments to pass to the viewer.";
|
||||
};
|
||||
};
|
||||
|
||||
argsFunction = viewerCfg: (viewerCfg.args);
|
||||
}
|
||||
)
|
||||
59
modules/plugins/languages/tex/pdfViewer/viewers/sioyek.nix
Normal file
59
modules/plugins/languages/tex/pdfViewer/viewers/sioyek.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
} @ moduleInheritencePackage: let
|
||||
# The name of the pdf viewer
|
||||
name = "sioyek";
|
||||
|
||||
# The viewer template
|
||||
template = import ./viewerTemplate.nix;
|
||||
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) package str listOf;
|
||||
in (
|
||||
template {
|
||||
inherit name moduleInheritencePackage;
|
||||
|
||||
options = {
|
||||
enable = mkEnableOption "enable sioyek as the pdf file previewer.";
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = pkgs.sioyek;
|
||||
description = "sioyek package";
|
||||
};
|
||||
|
||||
executable = mkOption {
|
||||
type = str;
|
||||
default = "sioyek";
|
||||
description = "The executable name to call the viewer.";
|
||||
};
|
||||
|
||||
args = mkOption {
|
||||
type = listOf str;
|
||||
default = [
|
||||
"--reuse-window"
|
||||
"--execute-command"
|
||||
"toggle_synctex"
|
||||
"--inverse-search"
|
||||
"texlab inverse-search -i \"%%1\" -l %%2"
|
||||
"--forward-search-file"
|
||||
"%f"
|
||||
"--forward-search-line"
|
||||
"%l"
|
||||
"%p"
|
||||
];
|
||||
description = ''
|
||||
Arguments to pass to the viewer.
|
||||
|
||||
By default, this is the only viewer that supports the inverse search feature by
|
||||
command line arguments and doesn't explicitly require extra tinkering else where
|
||||
in your config.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
argsFunction = viewerCfg: (viewerCfg.args);
|
||||
}
|
||||
)
|
||||
42
modules/plugins/languages/tex/pdfViewer/viewers/zathura.nix
Normal file
42
modules/plugins/languages/tex/pdfViewer/viewers/zathura.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
} @ moduleInheritencePackage: let
|
||||
# The name of the pdf viewer
|
||||
name = "zathura";
|
||||
|
||||
# The viewer template
|
||||
template = import ./viewerTemplate.nix;
|
||||
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) package str listOf;
|
||||
in (
|
||||
template {
|
||||
inherit name moduleInheritencePackage;
|
||||
|
||||
options = {
|
||||
enable = mkEnableOption "enable zathura as the pdf file previewer.";
|
||||
|
||||
package = mkOption {
|
||||
type = package;
|
||||
default = pkgs.zathura;
|
||||
description = "zathura package";
|
||||
};
|
||||
|
||||
executable = mkOption {
|
||||
type = str;
|
||||
default = "zathura";
|
||||
description = "The executable name to call the viewer.";
|
||||
};
|
||||
|
||||
args = mkOption {
|
||||
type = listOf str;
|
||||
default = ["--synctex-forward" "%l:1:%f" "%p"];
|
||||
description = "Arguments to pass to the viewer.";
|
||||
};
|
||||
};
|
||||
|
||||
argsFunction = viewerCfg: (viewerCfg.args);
|
||||
}
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue