mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-30 22:57:55 +00:00
home-manager/services/openrefine: init
This commit is contained in:
parent
966de82dc1
commit
d3c00006ea
@ -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
|
||||||
];
|
];
|
||||||
|
52
modules/home-manager/services/openrefine.nix
Normal file
52
modules/home-manager/services/openrefine.nix
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -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
|
||||||
]);
|
]);
|
||||||
|
14
tests/modules/home-manager/services/openrefine/basic.nix
Normal file
14
tests/modules/home-manager/services/openrefine/basic.nix
Normal 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
|
||||||
|
'';
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
openrefine-basic = ./basic.nix;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user