python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / nixos / modules / services / networking / i2p.nix
blobc5c7a955cbd4f26612b068cb9d2c089a203cda36
1 { config, lib, pkgs, ... }:
3 with lib;
5 let
6   cfg = config.services.i2p;
7   homeDir = "/var/lib/i2p";
8 in {
9   ###### interface
10   options.services.i2p.enable = mkEnableOption (lib.mdDoc "I2P router");
12   ###### implementation
13   config = mkIf cfg.enable {
14     users.users.i2p = {
15       group = "i2p";
16       description = "i2p User";
17       home = homeDir;
18       createHome = true;
19       uid = config.ids.uids.i2p;
20     };
21     users.groups.i2p.gid = config.ids.gids.i2p;
22     systemd.services.i2p = {
23       description = "I2P router with administration interface for hidden services";
24       after = [ "network.target" ];
25       wantedBy = [ "multi-user.target" ];
26       serviceConfig = {
27         User = "i2p";
28         WorkingDirectory = homeDir;
29         Restart = "on-abort";
30         ExecStart = "${pkgs.i2p}/bin/i2prouter-plain";
31       };
32     };
33   };