git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #4400 from matejc/seeksservice

seeks: update and write nixos module

commitb9c2fe5fd8d1ebad8aead54616e80358058b39cb authorMateusz Kowalczyk <mk440@bath.ac.uk> dateMon 13 Oct 2014, 21:37 (12 years ago) parent391c277561d3b3
5 files changed+108−14
nixos/modules/misc/ids.nix+2 nixos/modules/module-list.nix+1 nixos/modules/services/networking/seeks.nix+75 pkgs/tools/networking/p2p/seeks/default.nix+29−11 pkgs/top-level/all-packages.nix+1−3
nixos/modules/misc/ids.nix+2
@@ -155,6 +155,7 @@
155155 consul = 145;
156156 mailpile = 146;
157157 redmine = 147;
158+ seeks = 148;
158159
159160 prosody = 148;
160161
@@ -279,6 +280,7 @@
279280 uhub = 142;
280281 mailpile = 146;
281282 redmine = 147;
283+ seeks = 148;
282284
283285 prosody = 148;
284286
nixos/modules/module-list.nix+1
@@ -259,6 +259,7 @@
259259 ./services/networking/rpcbind.nix
260260 ./services/networking/sabnzbd.nix
261261 ./services/networking/searx.nix
262+ ./services/networking/seeks.nix
262263 ./services/networking/spiped.nix
263264 ./services/networking/ssh/lshd.nix
264265 ./services/networking/ssh/sshd.nix
nixos/modules/services/networking/seeks.nixnew file+75
@@ -0,0 +1,75 @@
1+{ config, lib, pkgs, ... }:
2+
3+with lib;
4+
5+let
6+
7+ cfg = config.services.seeks;
8+
9+ confDir = cfg.confDir;
10+
11+ seeks = pkgs.seeks.override { seeks_confDir = confDir; };
12+
13+in
14+
15+{
16+
17+ ###### interface
18+
19+ options = {
20+
21+ services.seeks = {
22+
23+ enable = mkOption {
24+ default = false;
25+ type = types.bool;
26+ description = "
27+ Whether to enable the Seeks server.
28+ ";
29+ };
30+
31+ confDir = mkOption {
32+ default = "";
33+ type = types.str;
34+ description = "
35+ The Seeks server configuration. If it is not specified,
36+ a default configuration is used (${seeks}/etc/seeks).
37+ ";
38+ };
39+
40+ };
41+
42+ };
43+
44+
45+ ###### implementation
46+
47+ config = mkIf config.services.seeks.enable {
48+
49+ users.extraUsers.seeks =
50+ { uid = config.ids.uids.seeks;
51+ description = "Seeks user";
52+ createHome = true;
53+ home = "/var/lib/seeks";
54+ };
55+
56+ users.extraGroups.seeks =
57+ { gid = config.ids.gids.seeks;
58+ };
59+
60+ systemd.services.seeks =
61+ {
62+ description = "Seeks server, the p2p search engine.";
63+ after = [ "network.target" ];
64+ wantedBy = [ "multi-user.target" ];
65+ serviceConfig = {
66+ User = "seeks";
67+ ExecStart = "${seeks}/bin/seeks";
68+ };
69+ };
70+
71+ environment.systemPackages = [ seeks ];
72+
73+ };
74+
75+}
pkgs/tools/networking/p2p/seeks/default.nix+29−11
@@ -1,28 +1,44 @@
1−{ fetchurl, stdenv, zlib, docbook2x, pcre, curl, libxml2, libevent, perl
2−, pkgconfig, protobuf, tokyocabinet, tokyotyrant, opencv
1+{ fetchgit, stdenv, zlib, docbook2x, pcre, curl, libxml2, libevent, perl
2+, pkgconfig, protobuf, tokyocabinet, tokyotyrant, opencv, autoconf, automake
3+, libtool, seeks_confDir ? ""
34}:
45
5−let version = "0.4.1"; in
66stdenv.mkDerivation {
7− name = "seeks-${version}";
7+ name = "seeks-0.4.1";
88
9− src = fetchurl {
10− url = "mirror://sourceforge/seeks/hippy/seeks-${version}.tar.gz";
11− sha256 = "1ppbbjw1zffxxhyvy64xwsff9xlw9wigqb7qwq5iw5mhbblz545q";
9+ src = fetchgit {
10+ url = "git://github.com/beniz/seeks.git";
11+ rev = "1168b3a2f3111c3fca31dd961135194c3e8df5fd";
12+ sha256 = "159k9fk1ry8cybrq38jxm1qyxks9hlkfz624hzwxlzah6xb2j8a4";
1213 };
1314
1415 buildInputs =
1516 [ zlib docbook2x pcre curl libxml2 libevent perl pkgconfig
16− protobuf tokyocabinet tokyotyrant opencv
17+ protobuf tokyocabinet tokyotyrant opencv autoconf automake libtool
1718 ];
1819
1920 configureFlags =
2021 [ # Enable the built-in web server providing a web search interface.
21− # See <http://www.seeks-project.info/wiki/index.php/Seeks_On_Web>.
2222 "--enable-httpserv-plugin=yes"
2323 "--with-libevent=${libevent}"
2424 ];
2525
26+ preConfigure = ''
27+ ./autogen.sh
28+ '';
29+
30+ postInstall = stdenv.lib.optionalString (seeks_confDir != "") ''
31+ ln -svf ${seeks_confDir}/config $out/etc/seeks/config
32+ ln -svf ${seeks_confDir}/cf-config $out/etc/seeks/cf-config
33+ ln -svf ${seeks_confDir}/httpserv-config $out/etc/seeks/httpserv-config
34+ ln -svf ${seeks_confDir}/img-websearch-config $out/etc/seeks/img-websearch-config
35+ ln -svf ${seeks_confDir}/lsh-config $out/etc/seeks/lsh-config
36+ ln -svf ${seeks_confDir}/query-capture-config $out/etc/seeks/query-capture-config
37+ ln -svf ${seeks_confDir}/udb-service-config $out/etc/seeks/udb-service-config
38+ ln -svf ${seeks_confDir}/uri-capture-config $out/etc/seeks/uri-capture-config
39+ ln -svf ${seeks_confDir}/websearch-config $out/etc/seeks/websearch-config
40+ '';
41+
2642 # FIXME: Test suite needs <https://code.google.com/p/googletest/>.
2743 doCheck = false;
2844
@@ -44,8 +60,10 @@ stdenv.mkDerivation {
4460
4561 homepage = http://www.seeks-project.info/;
4662
47− maintainers = [ stdenv.lib.maintainers.ludo ];
63+ maintainers = [
64+ stdenv.lib.maintainers.ludo
65+ stdenv.lib.maintainers.matejc
66+ ];
4867 platforms = stdenv.lib.platforms.gnu; # arbitrary choice
49− hydraPlatforms = [];
5068 };
5169}
pkgs/top-level/all-packages.nix+1−3
@@ -10195,9 +10195,7 @@ let
1019510195
1019610196 seafile-client = callPackage ../applications/networking/seafile-client { };
1019710197
10198− seeks = callPackage ../tools/networking/p2p/seeks {
10199− opencv = opencv_2_1;
10200− };
10198+ seeks = callPackage ../tools/networking/p2p/seeks { };
1020110199
1020210200 seg3d = callPackage ../applications/graphics/seg3d {
1020310201 wxGTK = wxGTK28.override { unicode = false; };