<commit_before>{pkgs, config, ...}:

###### interface
let
  inherit (pkgs.lib) mkOption mkIf;

  options = {
    services = {
      bitlbee = {

        enable = mkOption {
          default = false;
          description = ''
            Whether to run the BitlBee IRC to other chat network gateway.
            Running it allows you to access the MSN, Jabber, Yahoo! and ICQ chat
            networks via an IRC client.
          '';
        };

        interface = mkOption {
          default = "127.0.0.1";
          description = ''
            The interface the BitlBee deamon will be listening to.  If `127.0.0.1',
            only clients on the local host can connect to it; if `0.0.0.0', clients
            can access it from any network interface.
          '';
        };

        portNumber = mkOption {
          default = 6667;
          description = ''
            Number of the port BitlBee will be listening to.
          '';
        };

      };
    };
  };
in

###### implementation

let
  bitlbeeUid = config.ids.uids.bitlbee;
  inherit (config.services.bitlbee) portNumber interface;
in

mkIf config.services.bitlbee.enable {

  require = options;

  users = {
    extraUsers = [
      { name = "bitlbee";
        uid = bitlbeeUid;
        description = "BitlBee user";
        home = "/var/empty";
      }
    ];
    
    extraGroups = [
      { name = "bitlbee";
        gid = config.ids.gids.bitlbee;
      }
    ];
  };

  services.extraJobs = [{
    name = "bitlbee";

    job = ''
      description "BitlBee IRC to other chat networks gateway"

      start on network-interfaces/started
      stop on network-interfaces/stop

      start script
          if ! test -d /var/lib/bitlbee
          then
              mkdir -p /var/lib/bitlbee
          fi
      end script

      respawn ${pkgs.bitlbee}/sbin/bitlbee -F -p ${toString portNumber} \
              -i ${interface} -u bitlbee
    '';
  }];

  environment.systemPackages = [ pkgs.bitlbee ];
}
<commit_msg>Bitlbee: Change ownership of `/var/lib/bitlbee'.<commit_after>{pkgs, config, ...}:

###### interface
let
  inherit (pkgs.lib) mkOption mkIf;

  options = {
    services = {
      bitlbee = {

        enable = mkOption {
          default = false;
          description = ''
            Whether to run the BitlBee IRC to other chat network gateway.
            Running it allows you to access the MSN, Jabber, Yahoo! and ICQ chat
            networks via an IRC client.
          '';
        };

        interface = mkOption {
          default = "127.0.0.1";
          description = ''
            The interface the BitlBee deamon will be listening to.  If `127.0.0.1',
            only clients on the local host can connect to it; if `0.0.0.0', clients
            can access it from any network interface.
          '';
        };

        portNumber = mkOption {
          default = 6667;
          description = ''
            Number of the port BitlBee will be listening to.
          '';
        };

      };
    };
  };
in

###### implementation

let
  bitlbeeUid = config.ids.uids.bitlbee;
  inherit (config.services.bitlbee) portNumber interface;
in

mkIf config.services.bitlbee.enable {

  require = options;

  users = {
    extraUsers = [
      { name = "bitlbee";
        uid = bitlbeeUid;
        description = "BitlBee user";
        home = "/var/empty";
      }
    ];
    
    extraGroups = [
      { name = "bitlbee";
        gid = config.ids.gids.bitlbee;
      }
    ];
  };

  services.extraJobs = [{
    name = "bitlbee";

    job = ''
      description "BitlBee IRC to other chat networks gateway"

      start on network-interfaces/started
      stop on network-interfaces/stop

      start script
          if ! test -d /var/lib/bitlbee
          then
              mkdir -p /var/lib/bitlbee
              chown bitlbee:bitlbee /var/lib/bitlbee
          fi
      end script

      respawn ${pkgs.bitlbee}/sbin/bitlbee -F -p ${toString portNumber} \
              -i ${interface} -u bitlbee
    '';
  }];

  environment.systemPackages = [ pkgs.bitlbee ];
}

{'fraction_non_alphanumeric': 0.10765080922020598, 'fraction_numerical': 0.00980872976949485, 'mean_word_length': 1.650422352176738, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4612347', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1237, 'n_words': 343}