mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-10 15:35:30 +00:00
Started work to resolve infrec error
This commit is contained in:
parent
c9f1bdf167
commit
230d216cb3
1 changed files with 13 additions and 9 deletions
|
|
@ -5,7 +5,15 @@
|
||||||
}: let
|
}: let
|
||||||
defaultPdfViewerName = "okular";
|
defaultPdfViewerName = "okular";
|
||||||
|
|
||||||
inherit (builtins) filter isAttrs hasAttr attrNames length elemAt;
|
inherit
|
||||||
|
(builtins)
|
||||||
|
filter
|
||||||
|
isAttrs
|
||||||
|
hasAttr
|
||||||
|
attrNames
|
||||||
|
length
|
||||||
|
elemAt
|
||||||
|
;
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.types) str package listOf;
|
inherit (lib.types) str package listOf;
|
||||||
|
|
@ -24,13 +32,9 @@
|
||||||
pdfViewerNamesList ? (
|
pdfViewerNamesList ? (
|
||||||
filter (
|
filter (
|
||||||
x: let
|
x: let
|
||||||
y = viewerCfg.${x};
|
y = viewerCfg."${x}";
|
||||||
in (
|
in (
|
||||||
isAttrs y
|
isAttrs y && hasAttr "enable" y && hasAttr "package" y && hasAttr "executable" y && hasAttr "args" y
|
||||||
&& hasAttr "enable" y
|
|
||||||
&& hasAttr "package" y
|
|
||||||
&& hasAttr "executable" y
|
|
||||||
&& hasAttr "args" y
|
|
||||||
)
|
)
|
||||||
) (attrNames viewerCfg)
|
) (attrNames viewerCfg)
|
||||||
),
|
),
|
||||||
|
|
@ -40,7 +44,7 @@
|
||||||
currentPdfViewerName = elemAt pdfViewerNamesList index;
|
currentPdfViewerName = elemAt pdfViewerNamesList index;
|
||||||
|
|
||||||
# Get the current pdf viewer object
|
# Get the current pdf viewer object
|
||||||
currentPdfViewer = viewerCfg.${currentPdfViewerName};
|
currentPdfViewer = viewerCfg."${currentPdfViewerName}";
|
||||||
|
|
||||||
# Get the index that will be used for the next iteration
|
# Get the index that will be used for the next iteration
|
||||||
nextIndex = index + 1;
|
nextIndex = index + 1;
|
||||||
|
|
@ -77,7 +81,7 @@
|
||||||
};
|
};
|
||||||
in (getEnabledPdfViewersInfo {});
|
in (getEnabledPdfViewersInfo {});
|
||||||
|
|
||||||
enabledPdfViewerCfg = viewerCfg.${enabledPdfViewersInfo.enabledViewerName};
|
enabledPdfViewerCfg = viewerCfg."${enabledPdfViewersInfo.enabledViewerName}";
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./custom.nix
|
./custom.nix
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue