Merge pull request #179425 from McSinyx/phylactery

phylactery: init at 0.1.1
This commit is contained in:
ckie 2022-06-30 18:29:19 +03:00 committed by GitHub
commit a8c2879f43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 102 additions and 0 deletions

View File

@ -1082,6 +1082,7 @@
./services/web-apps/nexus.nix
./services/web-apps/nifi.nix
./services/web-apps/node-red.nix
./services/web-apps/phylactery.nix
./services/web-apps/pict-rs.nix
./services/web-apps/peertube.nix
./services/web-apps/plantuml-server.nix

View File

@ -0,0 +1,51 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.phylactery;
in {
options.services.phylactery = {
enable = mkEnableOption "Whether to enable Phylactery server";
host = mkOption {
type = types.str;
default = "localhost";
description = "Listen host for Phylactery";
};
port = mkOption {
type = types.port;
description = "Listen port for Phylactery";
};
library = mkOption {
type = types.path;
description = "Path to CBZ library";
};
package = mkOption {
type = types.package;
default = pkgs.phylactery;
defaultText = literalExpression "pkgs.phylactery";
description = "The Phylactery package to use";
};
};
config = mkIf cfg.enable {
systemd.services.phylactery = {
environment = {
PHYLACTERY_ADDRESS = "${cfg.host}:${toString cfg.port}";
PHYLACTERY_LIBRARY = "${cfg.library}";
};
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ConditionPathExists = cfg.library;
DynamicUser = true;
ExecStart = "${cfg.package}/bin/phylactery";
};
};
};
meta.maintainers = with maintainers; [ McSinyx ];
}

View File

@ -426,6 +426,7 @@ in {
php = handleTest ./php {};
php80 = handleTest ./php { php = pkgs.php80; };
php81 = handleTest ./php { php = pkgs.php81; };
phylactery = handleTest ./web-apps/phylactery.nix {};
pict-rs = handleTest ./pict-rs.nix {};
pinnwand = handleTest ./pinnwand.nix {};
plasma5 = handleTest ./plasma5.nix {};

View File

@ -0,0 +1,20 @@
import ../make-test-python.nix ({ pkgs, lib, ... }: {
name = "phylactery";
nodes.machine = { ... }: {
services.phylactery = rec {
enable = true;
port = 8080;
library = "/tmp";
};
};
testScript = ''
start_all()
machine.wait_for_unit('phylactery')
machine.wait_for_open_port(8080)
machine.wait_until_succeeds('curl localhost:8080')
'';
meta.maintainers = with lib.maintainers; [ McSinyx ];
})

View File

@ -0,0 +1,27 @@
{ lib, buildGoPackage, fetchFromSourcehut, nixosTests }:
buildGoPackage rec {
pname = "phylactery";
version = "0.1.1";
goPackagePath = "git.sr.ht/~cnx/phylactery";
src = fetchFromSourcehut {
owner = "~cnx";
repo = pname;
rev = version;
sha256 = "sha256-HcpdPQ1WOMFNdfsZb//GvUVBCbmS3jARbcXjchlv2oE=";
};
# Upstream repo doesn't provide any test.
doCheck = false;
passthru.tests.phylactery = nixosTests.phylactery;
meta = with lib; {
description = "Old school comic web server";
homepage = "https://git.sr.ht/~cnx/phylactery";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ McSinyx ];
platforms = platforms.all;
};
}

View File

@ -29313,6 +29313,8 @@ with pkgs;
phrase-cli = callPackage ../tools/misc/phrase-cli { };
phylactery = callPackage ../servers/web-apps/phylactery { };
pianobar = callPackage ../applications/audio/pianobar { };
pianobooster = qt5.callPackage ../applications/audio/pianobooster { stdenv = gcc10StdenvCompat; };