Merge pull request #179425 from McSinyx/phylactery

phylactery: init at 0.1.1

ckie a8c2879f be443e9a

Changed files
+102
nixos
modules
services
web-apps
tests
pkgs
servers
web-apps
phylactery
top-level
+1
nixos/modules/module-list.nix
···
./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
+51
nixos/modules/services/web-apps/phylactery.nix
···
+
{ 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 ];
+
}
+1
nixos/tests/all-tests.nix
···
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 {};
+20
nixos/tests/web-apps/phylactery.nix
···
+
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 ];
+
})
+27
pkgs/servers/web-apps/phylactery/default.nix
···
+
{ 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;
+
};
+
}
+2
pkgs/top-level/all-packages.nix
···
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; };