rdma-core: 54.0 -> 55.0 (#364655)
[NixPkgs.git] / nixos / modules / services / networking / i2p.nix
blob09d14a759b24fe29cce823d3da00e79be1d5dae2
2   config,
3   lib,
4   pkgs,
5   ...
6 }:
7 let
8   cfg = config.services.i2p;
9   homeDir = "/var/lib/i2p";
12   ###### interface
13   options.services.i2p.enable = lib.mkEnableOption "I2P router";
15   ###### implementation
16   config = lib.mkIf cfg.enable {
17     users.users.i2p = {
18       group = "i2p";
19       description = "i2p User";
20       home = homeDir;
21       createHome = true;
22       uid = config.ids.uids.i2p;
23     };
24     users.groups.i2p.gid = config.ids.gids.i2p;
25     systemd.services.i2p = {
26       description = "I2P router with administration interface for hidden services";
27       after = [ "network.target" ];
28       wantedBy = [ "multi-user.target" ];
29       serviceConfig = {
30         User = "i2p";
31         WorkingDirectory = homeDir;
32         Restart = "on-abort";
33         ExecStart = "${pkgs.i2p}/bin/i2prouter";
34       };
35     };
36   };