mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-03-26 09:05:06 +00:00
Update nix setup
Need to remove solr, because it has been dropped in nixos 23.11
This commit is contained in:
parent
50dadad48e
commit
96c825e93a
@ -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";
|
||||
};
|
||||
|
||||
}
|
8
nix/flake.lock
generated
8
nix/flake.lock
generated
@ -2,16 +2,16 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1673704454,
|
||||
"narHash": "sha256-5Wdj1MgdOgn3+dMFIBtg+IAYZApjF8JzwLWDPieg0C4=",
|
||||
"lastModified": 1706373441,
|
||||
"narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a83ed85c14fcf242653df6f4b0974b7e1c73c6c6",
|
||||
"rev": "56911ef3403a9318b7621ce745f5452fb9ef6867",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-22.11",
|
||||
"ref": "nixos-23.11",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
description = "Docspell flake";
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-22.11";
|
||||
nixpkgs.url = "nixpkgs/nixos-23.11";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
@ -11,19 +11,19 @@
|
||||
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
||||
# Version config
|
||||
cfg = {
|
||||
v0_40_0 = rec {
|
||||
version = "0.40.0";
|
||||
v0_41_0 = rec {
|
||||
version = "0.41.0";
|
||||
server = {
|
||||
url = "https://github.com/eikek/docspell/releases/download/v${version}/docspell-restserver-${version}.zip";
|
||||
sha256 = "sha256-lTvLZ9MBezEhELr2LhrTtm2fRWxdLWEjAhOqxRmBwwg=";
|
||||
sha256 = "sha256-JFftIzI94UNLLh96I++qFsBZhOkquPIPhNhtS2Ov8wI=";
|
||||
};
|
||||
joex = {
|
||||
url = "https://github.com/eikek/docspell/releases/download/v${version}/docspell-joex-${version}.zip";
|
||||
sha256 = "sha256-lVDRl7CrRmojL7ZIPIlR6VzHoplEB/ew7aID3urYspU=";
|
||||
sha256 = "sha256-flKWjEsMd2/XT3Bu6EjFgf3lCojvLbKFDEXemP1K+/8=";
|
||||
};
|
||||
};
|
||||
};
|
||||
current_version = cfg.v0_40_0;
|
||||
current_version = cfg.v0_41_0;
|
||||
inherit (current_version) version;
|
||||
in
|
||||
rec
|
||||
@ -76,7 +76,7 @@
|
||||
default = (import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.default ];
|
||||
}).docspell-server;
|
||||
}).docspell-joex;
|
||||
});
|
||||
|
||||
checks = forAllSystems
|
||||
|
Loading…
x
Reference in New Issue
Block a user