mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Update nix setup
Need to remove solr, because it has been dropped in nixos 23.11
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
let
|
||||
full-text-search = {
|
||||
enabled = true;
|
||||
solr.url = "http://localhost:${toString config.services.solr.port}/solr/docspell";
|
||||
backend = "postgresql";
|
||||
postgresql = {
|
||||
pg-config = {
|
||||
"german" = "my-germam";
|
||||
@ -24,7 +24,6 @@ in
|
||||
|
||||
services.docspell-joex = {
|
||||
enable = true;
|
||||
waitForTarget = "solr-init.target";
|
||||
bind.address = "0.0.0.0";
|
||||
base-url = "http://localhost:7878";
|
||||
jvmArgs = [ "-J-Xmx1536M" ];
|
||||
|
@ -2,6 +2,5 @@
|
||||
{
|
||||
imports = [
|
||||
./configuration-test.nix
|
||||
./solr.nix
|
||||
];
|
||||
}
|
||||
|
@ -1,41 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
# This module sets up solr with one core. It is a bit tedious…. If you
|
||||
# know a better solution, please let me know.
|
||||
{
|
||||
nixpkgs.config = {
|
||||
permittedInsecurePackages = [
|
||||
"solr-8.6.3"
|
||||
];
|
||||
};
|
||||
|
||||
services.solr = {
|
||||
enable = true;
|
||||
};
|
||||
# This is needed to run solr script as user solr
|
||||
users.users.solr.useDefaultShell = true;
|
||||
|
||||
systemd.services.solr-init =
|
||||
let
|
||||
solrPort = toString config.services.solr.port;
|
||||
initSolr = ''
|
||||
if [ ! -f ${config.services.solr.stateDir}/docspell_core ]; then
|
||||
while ! echo "" | ${pkgs.inetutils}/bin/telnet localhost ${solrPort}
|
||||
do
|
||||
echo "Waiting for SOLR become ready..."
|
||||
sleep 1.5
|
||||
done
|
||||
${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh solr -c "${pkgs.solr}/bin/solr create_core -c docspell -p ${solrPort}";
|
||||
touch ${config.services.solr.stateDir}/docspell_core
|
||||
fi
|
||||
'';
|
||||
in
|
||||
{
|
||||
script = initSolr;
|
||||
after = [ "solr.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "solr.target" ];
|
||||
description = "Create a core at solr";
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user