1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-04 19:45:54 +00:00
nixpkgs/nixos/modules/services/networking/seeks.nix

76 lines
1.3 KiB
Nix
Raw Normal View History

2014-10-06 20:25:10 +01:00
{ 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,
2015-09-24 10:42:32 +01:00
a default configuration is used.
2014-10-06 20:25:10 +01:00
";
};
};
};
###### implementation
config = mkIf config.services.seeks.enable {
users.users.seeks =
2014-10-06 20:25:10 +01:00
{ uid = config.ids.uids.seeks;
description = "Seeks user";
createHome = true;
home = "/var/lib/seeks";
};
users.groups.seeks =
2014-10-06 20:25:10 +01:00
{ 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 ];
};
}