git.iko.soy/typeable/nixpkgs
on master help sign in
seeks: nixos module
commit561d3b38601dfe12b859ed6de402bd01d4196d3b authorMatej Cotman <cotman.matej@gmail.com> dateMon 6 Oct 2014, 21:25 (12 years ago) parent76a7b0b
3 files changed+78
nixos/modules/misc/ids.nix+2 nixos/modules/module-list.nix+1 nixos/modules/services/networking/seeks.nix+75
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+}