diff options
author | Mario Rodas <marsam@users.noreply.github.com> | 2019-10-12 09:01:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-12 09:01:58 -0500 |
commit | af4351ab85ed74b2ff3da29e5bbd71b9e8a0f3be (patch) | |
tree | 7e449e630140944f1981077527fe79477b61a1e2 | |
parent | 57f698434a850fa03cbe86bab51262f2138bc627 (diff) | |
parent | 367cd2c7f8c7801f94ad4750f3f3389526643fcc (diff) | |
download | nixpkgs-af4351ab85ed74b2ff3da29e5bbd71b9e8a0f3be.tar nixpkgs-af4351ab85ed74b2ff3da29e5bbd71b9e8a0f3be.tar.gz nixpkgs-af4351ab85ed74b2ff3da29e5bbd71b9e8a0f3be.tar.bz2 nixpkgs-af4351ab85ed74b2ff3da29e5bbd71b9e8a0f3be.tar.lz nixpkgs-af4351ab85ed74b2ff3da29e5bbd71b9e8a0f3be.tar.xz nixpkgs-af4351ab85ed74b2ff3da29e5bbd71b9e8a0f3be.tar.zst nixpkgs-af4351ab85ed74b2ff3da29e5bbd71b9e8a0f3be.zip |
Merge pull request #69255 from minijackson/init-shiori
Init shiori
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/web-apps/shiori.nix | 50 | ||||
-rw-r--r-- | nixos/tests/shiori.nix | 17 | ||||
-rw-r--r-- | pkgs/servers/web-apps/shiori/default.nix | 22 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
5 files changed, 92 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 6829a4e2578..4d177ae9699 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -806,6 +806,7 @@ ./services/web-apps/restya-board.nix ./services/web-apps/tt-rss.nix ./services/web-apps/selfoss.nix + ./services/web-apps/shiori.nix ./services/web-apps/virtlyst.nix ./services/web-apps/wordpress.nix ./services/web-apps/youtrack.nix diff --git a/nixos/modules/services/web-apps/shiori.nix b/nixos/modules/services/web-apps/shiori.nix new file mode 100644 index 00000000000..1817a203935 --- /dev/null +++ b/nixos/modules/services/web-apps/shiori.nix @@ -0,0 +1,50 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.services.shiori; +in { + options = { + services.shiori = { + enable = mkEnableOption "Shiori simple bookmarks manager"; + + package = mkOption { + type = types.package; + default = pkgs.shiori; + defaultText = "pkgs.shiori"; + description = "The Shiori package to use."; + }; + + address = mkOption { + type = types.str; + default = ""; + description = '' + The IP address on which Shiori will listen. + If empty, listens on all interfaces. + ''; + }; + + port = mkOption { + type = types.port; + default = 8080; + description = "The port of the Shiori web application"; + }; + }; + }; + + config = mkIf cfg.enable { + systemd.services.shiori = with cfg; { + description = "Shiori simple bookmarks manager"; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + ExecStart = "${package}/bin/shiori serve --address '${address}' --port '${toString port}'"; + DynamicUser = true; + Environment = "SHIORI_DIR=/var/lib/shiori"; + StateDirectory = "shiori"; + }; + }; + }; + + meta.maintainers = with maintainers; [ minijackson ]; +} diff --git a/nixos/tests/shiori.nix b/nixos/tests/shiori.nix new file mode 100644 index 00000000000..0022a7220fe --- /dev/null +++ b/nixos/tests/shiori.nix @@ -0,0 +1,17 @@ +import ./make-test.nix ({ lib, ...}: + +{ + name = "shiori"; + meta.maintainers = with lib.maintainers; [ minijackson ]; + + machine = + { ... }: + { services.shiori.enable = true; }; + + testScript = '' + $machine->waitForUnit('shiori.service'); + $machine->waitForOpenPort('8080'); + $machine->succeed("curl --fail http://localhost:8080/"); + $machine->succeed("curl --fail --location http://localhost:8080/ | grep -qi shiori"); + ''; +}) diff --git a/pkgs/servers/web-apps/shiori/default.nix b/pkgs/servers/web-apps/shiori/default.nix new file mode 100644 index 00000000000..5cf54ff14ba --- /dev/null +++ b/pkgs/servers/web-apps/shiori/default.nix @@ -0,0 +1,22 @@ +{ stdenv, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "shiori"; + version = "1.5.0"; + + modSha256 = "142raxqh6mipw0dyhzgc8ha6vn74wdin25qrl1nkd68mpcvsbblg"; + + src = fetchFromGitHub { + owner = "go-shiori"; + repo = pname; + rev = "v${version}"; + sha256 = "13and7gh2882khqppwz3wwq44p7az4bfdfjvlnqcpqyi8xa28pmq"; + }; + + meta = with stdenv.lib; { + description = "Simple bookmark manager built with Go"; + homepage = "https://github.com/go-shiori/shiori"; + license = licenses.mit; + maintainers = with maintainers; [ minijackson ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 14596a6dd5f..404bb89c1c9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15390,6 +15390,8 @@ in shaarli-material = callPackage ../servers/web-apps/shaarli/material-theme.nix { }; + shiori = callPackage ../servers/web-apps/shiori { }; + matomo = callPackage ../servers/web-apps/matomo { }; axis2 = callPackage ../servers/http/tomcat/axis2 { }; |