diff options
author | Mateusz Kowalczyk <mk440@bath.ac.uk> | 2014-10-13 21:37:11 +0100 |
---|---|---|
committer | Mateusz Kowalczyk <mk440@bath.ac.uk> | 2014-10-13 21:37:11 +0100 |
commit | b9c2fe5fd8d1ebad8aead54616e80358058b39cb (patch) | |
tree | 49645b3e58d475425b56273993e11d86d862a45f /nixos | |
parent | 391c2778d4ad9cc5167387d788041c1b53be97f6 (diff) | |
parent | 561d3b38601dfe12b859ed6de402bd01d4196d3b (diff) |
Merge pull request #4400 from matejc/seeksservice
seeks: update and write nixos module
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/misc/ids.nix | 2 | ||||
-rwxr-xr-x | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/networking/seeks.nix | 75 |
3 files changed, 78 insertions, 0 deletions
diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index dc5d1b7a6d23..d28624c4326f 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -155,6 +155,7 @@ consul = 145; mailpile = 146; redmine = 147; + seeks = 148; prosody = 148; @@ -279,6 +280,7 @@ uhub = 142; mailpile = 146; redmine = 147; + seeks = 148; prosody = 148; diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 35706f874ce0..17d3140b087f 100755 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -259,6 +259,7 @@ ./services/networking/rpcbind.nix ./services/networking/sabnzbd.nix ./services/networking/searx.nix + ./services/networking/seeks.nix ./services/networking/spiped.nix ./services/networking/ssh/lshd.nix ./services/networking/ssh/sshd.nix diff --git a/nixos/modules/services/networking/seeks.nix b/nixos/modules/services/networking/seeks.nix new file mode 100644 index 000000000000..155ecbb98ef3 --- /dev/null +++ b/nixos/modules/services/networking/seeks.nix @@ -0,0 +1,75 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.services.seeks; + + confDir = cfg.confDir; + + seeks = pkgs.seeks.override { seeks_confDir = confDir; }; + +in + +{ + + ###### interface + + options = { + + services.seeks = { + + enable = mkOption { + default = false; + type = types.bool; + description = " + Whether to enable the Seeks server. + "; + }; + + confDir = mkOption { + default = ""; + type = types.str; + description = " + The Seeks server configuration. If it is not specified, + a default configuration is used (${seeks}/etc/seeks). + "; + }; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.seeks.enable { + + users.extraUsers.seeks = + { uid = config.ids.uids.seeks; + description = "Seeks user"; + createHome = true; + home = "/var/lib/seeks"; + }; + + users.extraGroups.seeks = + { gid = config.ids.gids.seeks; + }; + + systemd.services.seeks = + { + description = "Seeks server, the p2p search engine."; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + User = "seeks"; + ExecStart = "${seeks}/bin/seeks"; + }; + }; + + environment.systemPackages = [ seeks ]; + + }; + +} |