1 # NixOS module for Freenet daemon
2 { config, lib, pkgs, ... }:
5 cfg = config.services.freenet;
6 varDir = "/var/lib/freenet";
18 enable = lib.mkOption {
19 type = lib.types.bool;
21 description = "Enable the Freenet daemon";
27 description = "Set the nice level for the Freenet daemon";
36 config = lib.mkIf cfg.enable {
38 systemd.services.freenet = {
39 description = "Freenet daemon";
40 after = [ "network.target" ];
41 wantedBy = [ "multi-user.target" ];
42 serviceConfig.ExecStart = "${pkgs.freenet}/bin/freenet";
43 serviceConfig.User = "freenet";
44 serviceConfig.UMask = "0007";
45 serviceConfig.WorkingDirectory = varDir;
46 serviceConfig.Nice = cfg.nice;
49 users.users.freenet = {
51 description = "Freenet daemon user";
54 uid = config.ids.uids.freenet;
57 users.groups.freenet.gid = config.ids.gids.freenet;