Merge pull request #179425 from McSinyx/phylactery
phylactery: init at 0.1.1
This commit is contained in:
commit
a8c2879f43
|
@ -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
|
||||
|
|
51
nixos/modules/services/web-apps/phylactery.nix
Normal file
51
nixos/modules/services/web-apps/phylactery.nix
Normal 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 ];
|
||||
}
|
|
@ -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 {};
|
||||
|
|
20
nixos/tests/web-apps/phylactery.nix
Normal file
20
nixos/tests/web-apps/phylactery.nix
Normal 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 ];
|
||||
})
|
27
pkgs/servers/web-apps/phylactery/default.nix
Normal file
27
pkgs/servers/web-apps/phylactery/default.nix
Normal 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;
|
||||
};
|
||||
}
|
|
@ -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; };
|
||||
|
|
Loading…
Reference in New Issue
Block a user