services.bukkit-server.enable

If enabled, start a Minecraft Server. The server data will be loaded from and saved to

.

type

boolean

default

{
  services.bukkit-server.enable = false;
}

services.bukkit-server.package

Version of minecraft-server to run.

type

package

example

{
  services.bukkit-server.package = {
    _type = "literalExpression";
    text = "pkgs.minecraft-server_1_12_2";
  };
}

default

{
  services.bukkit-server.package = "pkgs.minecraft-server";
}

services.bukkit-server.additionalSettingsFiles

Additional settings files for bukkit servers, like paper.yml

type

attribute set of YAML value

example

{
  services.bukkit-server.additionalSettingsFiles = {
    _type = "literalExpression";
    text = ''
      {
        "paper.yml" = {
          settings.unsupported-settings = {
            allow-permanent-block-break-exploits = true;
          };
        };
      }
      
    '';
  };
}

default

{
  services.bukkit-server.additionalSettingsFiles = {};
}

services.bukkit-server.dataDir

Directory to store Minecraft database and other state/data files.

type

path

default

{
  services.bukkit-server.dataDir = "/var/lib/minecraft";
}

services.bukkit-server.declarative

Whether to use a declarative Minecraft server configuration. Only if set to true, the options

and will be applied.

type

boolean

default

{
  services.bukkit-server.declarative = false;
}

services.bukkit-server.eula

Whether you agree to

Mojangs EULA. This option must be set to true to run Minecraft server.

type

boolean

default

{
  services.bukkit-server.eula = false;
}

services.bukkit-server.jvmOpts

JVM options for the Minecraft server.

type

strings concatenated with " "

example

{
  services.bukkit-server.jvmOpts = "-Xmx2048M -Xms4092M -XX:+UseG1GC -XX:+CMSIncrementalPacing -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10";
}

default

{
  services.bukkit-server.jvmOpts = "-Xmx2048M -Xms2048M";
}

services.bukkit-server.openFirewall

Whether to open ports in the firewall for the server.

type

boolean

default

{
  services.bukkit-server.openFirewall = false;
}

services.bukkit-server.serverProperties

Minecraft server properties for the server.properties file. Only has an effect when is set to true. See

for documentation on these values.

type

attribute set of boolean or signed integer or string

example

{
  services.bukkit-server.serverProperties = {
    _type = "literalExpression";
    text = ''
      {
        server-port = 43000;
        difficulty = 3;
        gamemode = 1;
        max-players = 5;
        motd = "NixOS Minecraft server!";
        white-list = true;
        enable-rcon = true;
        "rcon.password" = "hunter2";
      }
      
    '';
  };
}

default

{
  services.bukkit-server.serverProperties = {};
}

services.bukkit-server.whitelist

Whitelisted players, only has an effect when

is true and the whitelist is enabled via by setting white-list to true. This is a mapping from Minecraft usernames to UUIDs. You can use to get a Minecraft UUID for a username.

type

attribute set of Minecraft UUID

example

{
  services.bukkit-server.whitelist = {
    _type = "literalExpression";
    text = ''
      {
        username1 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
        username2 = "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy";
      };
      
    '';
  };
}

default

{
  services.bukkit-server.whitelist = {};
}

services.restic.backups

Periodic backups to create with Restic.

type

attribute set of submodule

example

{
  services.restic.backups = {
    localbackup = {
      initialize = true;
      passwordFile = "/etc/nixos/secrets/restic-password";
      paths = [
        "/home"
      ];
      repository = "/mnt/backup-hdd";
    };
    remotebackup = {
      extraOptions = [
        "sftp.command='ssh backup@host -i /etc/nixos/secrets/backup-private-key -s sftp'"
      ];
      passwordFile = "/etc/nixos/secrets/restic-password";
      paths = [
        "/home"
      ];
      repository = "sftp:backup@host:/backups/home";
      timerConfig = {
        OnCalendar = "00:05";
        RandomizedDelaySec = "5h";
      };
    };
  };
}

default

{
  services.restic.backups = {};
}

services.restic.backups.<name>.dynamicFilesFrom

A script that produces a list of files to back up. The results of this command are given to the '--files-from' option.

type

null or string

example

{
  services.restic.backups.<name>.dynamicFilesFrom = "find /home/matt/git -type d -name .git";
}

default

{
  services.restic.backups.<name>.dynamicFilesFrom = null;
}

services.restic.backups.<name>.extraBackupArgs

Extra arguments passed to restic backup.

type

list of string

example

{
  services.restic.backups.<name>.extraBackupArgs = [
    "--exclude-file=/etc/nixos/restic-ignore"
  ];
}

default

{
  services.restic.backups.<name>.extraBackupArgs = [];
}

services.restic.backups.<name>.extraOptions

Extra extended options to be passed to the restic --option flag.

type

list of string

example

{
  services.restic.backups.<name>.extraOptions = [
    "sftp.command='ssh backup@192.168.1.100 -i /home/user/.ssh/id_rsa -s sftp'"
  ];
}

default

{
  services.restic.backups.<name>.extraOptions = [];
}

services.restic.backups.<name>.initialize

Create the repository if it doesn't exist.

type

boolean

default

{
  services.restic.backups.<name>.initialize = false;
}

services.restic.backups.<name>.passwordFile

Read the repository password from a file.

type

string

example

{
  services.restic.backups.<name>.passwordFile = "/etc/nixos/restic-password";
}

services.restic.backups.<name>.paths

Which paths to backup. If null or an empty array, no backup command will be run. This can be used to create a prune-only job.

type

null or list of string

example

{
  services.restic.backups.<name>.paths = [
    "/var/lib/postgresql"
    "/home/user/backup"
  ];
}

default

{
  services.restic.backups.<name>.paths = null;
}

services.restic.backups.<name>.postStart

A script that runs before after a backup is executed.

type

null or string

example

{
  services.restic.backups.<name>.postStart = "program-that-saves-alot continue";
}

default

{
  services.restic.backups.<name>.postStart = null;
}

services.restic.backups.<name>.preStart

A script that runs before a backup is executed.

type

null or string

example

{
  services.restic.backups.<name>.preStart = "program-that-saves-alot pause";
}

default

{
  services.restic.backups.<name>.preStart = null;
}

services.restic.backups.<name>.pruneOpts

A list of options (--keep-* et al.) for 'restic forget --prune', to automatically prune old snapshots. The 'forget' command is run after the 'backup' command, so keep that in mind when constructing the --keep-* options.

type

list of string

example

{
  services.restic.backups.<name>.pruneOpts = [
    "--keep-daily 7"
    "--keep-weekly 5"
    "--keep-monthly 12"
    "--keep-yearly 75"
  ];
}

default

{
  services.restic.backups.<name>.pruneOpts = [];
}

services.restic.backups.<name>.rcloneConfig

Configuration for the rclone remote being used for backup. See the remote's specific options under rclone's docs at

. When specifying option names, use the "config" name specified in the docs. For example, to set --b2-hard-delete for a B2 remote, use hard_delete = true in the attribute set. Warning: Secrets set in here will be world-readable in the Nix store! Consider using the rcloneConfigFile option instead to specify secret values separately. Note that options set here will override those set in the config file.

type

null or attribute set of string or boolean

example

{
  services.restic.backups.<name>.rcloneConfig = {
    account = "xxx";
    hard_delete = true;
    key = "xxx";
    type = "b2";
  };
}

default

{
  services.restic.backups.<name>.rcloneConfig = null;
}

services.restic.backups.<name>.rcloneConfigFile

Path to the file containing rclone configuration. This file must contain configuration for the remote specified in this backup set and also must be readable by root. Options set in rcloneConfig will override those set in this file.

type

null or path

default

{
  services.restic.backups.<name>.rcloneConfigFile = null;
}

services.restic.backups.<name>.rcloneOptions

Options to pass to rclone to control its behavior. See for available options. When specifying option names, strip the leading --. To set a flag such as --drive-use-trash, which does not take a value, set the value to the Boolean true.

type

null or attribute set of string or boolean

example

{
  services.restic.backups.<name>.rcloneOptions = {
    bwlimit = "10M";
    drive-use-trash = "true";
  };
}

default

{
  services.restic.backups.<name>.rcloneOptions = null;
}

services.restic.backups.<name>.repository

repository to backup to.

type

string

example

{
  services.restic.backups.<name>.repository = "sftp:backup@192.168.1.100:/backups/‹name›";
}

services.restic.backups.<name>.s3CredentialsFile

file containing the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for an S3-hosted repository, in the format of an EnvironmentFile as described by systemd.exec(5)

type

null or string

default

{
  services.restic.backups.<name>.s3CredentialsFile = null;
}

services.restic.backups.<name>.timerConfig

When to run the backup. See man systemd.timer for details.

type

attribute set of systemd option

example

{
  services.restic.backups.<name>.timerConfig = {
    OnCalendar = "00:05";
    RandomizedDelaySec = "5h";
  };
}

default

{
  services.restic.backups.<name>.timerConfig = {
    OnCalendar = "daily";
  };
}

services.restic.backups.<name>.user

As which user the backup should run.

type

string

example

{
  services.restic.backups.<name>.user = "postgresql";
}

default

{
  services.restic.backups.<name>.user = "root";
}