home-manager/services/openrefine: init

This commit is contained in:
Gabriel Arazas 2024-12-28 14:50:21 +08:00
parent 966de82dc1
commit d3c00006ea
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
5 changed files with 71 additions and 0 deletions

View File

@ -14,6 +14,7 @@
./services/gonic.nix ./services/gonic.nix
./services/ludusavi.nix ./services/ludusavi.nix
./services/matcha.nix ./services/matcha.nix
./services/openrefine.nix
./services/plover.nix ./services/plover.nix
./services/yt-dlp.nix ./services/yt-dlp.nix
]; ];

View File

@ -0,0 +1,52 @@
{ config, lib, pkgs, ... }:
let
cfg = config.services.openrefine;
settingsFormat = pkgs.formats.ini { };
in
{
options.services.openrefine = {
enable = lib.mkEnableOption "OpenRefine server";
package = lib.mkPackageOption pkgs "openrefine" { };
settings = lib.mkOption {
type = settingsFormat.type;
default = { };
example = lib.literalExpression ''
'';
};
extraFlags = lib.mkOption {
type = with lib.types; listOf str;
default = [ ];
example = lib.literalExpression ''
[
"--port" "29345"
]
'';
};
};
config = lib.mkIf cfg.enable {
systemd.user.services.openrefine = {
Unit = {
Description = "OpenRefine server";
Documentation = [ "https://openrefine.org/docs" ];
After = [
"network-online.target"
"default.target"
];
};
Service = {
ExecStart = ''
${lib.getExe' cfg.package "refine"} ${lib.concatStringsSep " " cfg.extraFlags}
'';
Restart = "on-failure";
};
};
};
}

View File

@ -66,6 +66,7 @@ import nmt {
./services/gonic ./services/gonic
./services/ludusavi ./services/ludusavi
./services/matcha ./services/matcha
./services/openrefine
./services/plover ./services/plover
./services/yt-dlp ./services/yt-dlp
]); ]);

View File

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
{
services.openrefine = {
enable = true;
package = pkgs.openrefine;
};
test.stubs.openrefine = { };
nmt.script = ''
assertFileExists home-files/.config/systemd/user/openrefine.service
'';
}

View File

@ -0,0 +1,3 @@
{
openrefine-basic = ./basic.nix;
}