recoll: add module
This commit is contained in:
parent
b13946438f
commit
0e2f7876d2
10 changed files with 330 additions and 0 deletions
16
tests/modules/services/recoll/basic-configuration.conf
Normal file
16
tests/modules/services/recoll/basic-configuration.conf
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
nocjk = 0
|
||||
|
||||
skippedNames+ = node_modules
|
||||
|
||||
topdirs = ~/Downloads ~/Documents ~/library
|
||||
|
||||
underscoresasletter = 1
|
||||
|
||||
[~/library/projects]
|
||||
skippedNames+ = .editorconfig .gitignore result flake.lock go.sum
|
||||
|
||||
[~/library/projects/software]
|
||||
skippedNames+ = target result
|
||||
|
||||
[~/what-is-this-project]
|
||||
skippedNames+ = whoa-there
|
||||
35
tests/modules/services/recoll/basic-configuration.nix
Normal file
35
tests/modules/services/recoll/basic-configuration.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.recoll = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
configDir = "${config.xdg.configHome}/recoll";
|
||||
settings = {
|
||||
topdirs = [ "~/Downloads" "~/Documents" "~/library" ];
|
||||
"skippedNames+" = [ "node_modules" ];
|
||||
underscoresasletter = true;
|
||||
nocjk = false;
|
||||
|
||||
"~/library/projects" = {
|
||||
"skippedNames+" =
|
||||
[ ".editorconfig" ".gitignore" "result" "flake.lock" "go.sum" ];
|
||||
};
|
||||
|
||||
"~/library/projects/software" = {
|
||||
"skippedNames+" = [ "target" "result" ];
|
||||
};
|
||||
|
||||
"~/what-is-this-project" = { "skippedNames+" = [ "whoa-there" ]; };
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/systemd/user/recollindex.service
|
||||
assertFileExists home-files/.config/systemd/user/recollindex.timer
|
||||
|
||||
assertFileExists home-files/.config/recoll/recoll.conf
|
||||
assertFileContent home-files/.config/recoll/recoll.conf \
|
||||
${./basic-configuration.conf}
|
||||
'';
|
||||
}
|
||||
25
tests/modules/services/recoll/config-format-order.conf
Normal file
25
tests/modules/services/recoll/config-format-order.conf
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
b = 10
|
||||
|
||||
d = 0
|
||||
|
||||
e = This should be the second to the last non-attrset value in the config.
|
||||
|
||||
g = This is coming from a list
|
||||
|
||||
[a]
|
||||
foo = bar
|
||||
|
||||
[c]
|
||||
a = This should appear as the second section.
|
||||
aa = 1
|
||||
b = 53
|
||||
|
||||
[f]
|
||||
a = This should be second to the last for the attribute names with an attrset.
|
||||
b = 3193
|
||||
c = 0
|
||||
d = Hello there
|
||||
|
||||
[foo]
|
||||
bar = This should be the last attribute with an attrset.
|
||||
baz = 42
|
||||
45
tests/modules/services/recoll/config-format-order.nix
Normal file
45
tests/modules/services/recoll/config-format-order.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# This is a test primarily concerned with the order of the configuration. The
|
||||
# configuration is dynamically generated in alphabetical order of the top-level
|
||||
# attribute names. Because of this, it is possible to override top-level
|
||||
# attributes that are supposed to be configured in the top-level configuration.
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.recoll = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
settings = {
|
||||
a = { foo = "bar"; };
|
||||
b = 10;
|
||||
c = {
|
||||
a = "This should appear as the second section.";
|
||||
b = 53;
|
||||
aa = true;
|
||||
};
|
||||
d = false;
|
||||
e =
|
||||
"This should be the second to the last non-attrset value in the config.";
|
||||
f = {
|
||||
a =
|
||||
"This should be second to the last for the attribute names with an attrset.";
|
||||
b = 3193;
|
||||
c = false;
|
||||
d = [ "Hello" "there" ];
|
||||
};
|
||||
foo = {
|
||||
bar = "This should be the last attribute with an attrset.";
|
||||
baz = 42;
|
||||
};
|
||||
g = [ "This" "is" "coming" "from" "a" "list" ];
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/systemd/user/recollindex.service
|
||||
assertFileExists home-files/.config/systemd/user/recollindex.timer
|
||||
|
||||
assertFileExists home-files/.recoll/recoll.conf
|
||||
assertFileContent home-files/.recoll/recoll.conf \
|
||||
${./config-format-order.conf}
|
||||
'';
|
||||
}
|
||||
4
tests/modules/services/recoll/default.nix
Normal file
4
tests/modules/services/recoll/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
recoll-basic-configuration = ./basic-configuration.nix;
|
||||
recoll-config-format-order = ./config-format-order.nix;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue