Skip to content

Zfs

services.zfs.autoReplication.enable

Whether to enable ZFS snapshot replication. Type: boolean

Default

false

Example

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/zfs-replication.nix

services.zfs.autoReplication.followDelete

Remove remote snapshots that don't have a local correspondent. Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/zfs-replication.nix

services.zfs.autoReplication.host

Remote host where snapshots should be sent. lz4 is expected to be installed on this host. Type: string

Example

"example.com"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/zfs-replication.nix

services.zfs.autoReplication.identityFilePath

Path to SSH key used to login to host. Type: path

Example

"/home/username/.ssh/id_rsa"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/zfs-replication.nix

services.zfs.autoReplication.localFilesystem

Local ZFS filesystem from which snapshots should be sent. Defaults to the attribute name. Type: string

Example

"pool/file/path"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/zfs-replication.nix

services.zfs.autoReplication.recursive

Recursively discover snapshots to send. Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/zfs-replication.nix

services.zfs.autoReplication.remoteFilesystem

Remote ZFS filesystem where snapshots should be sent. Type: string

Example

"pool/file/path"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/zfs-replication.nix

services.zfs.autoReplication.username

Username used by SSH to login to remote host. Type: string

Example

"username"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/backup/zfs-replication.nix

services.zfs.autoScrub.enable

Whether to enable periodic scrubbing of ZFS pools. Type: boolean

Default

false

Example

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.autoScrub.interval

Systemd calendar expression when to scrub ZFS pools. See {manpage}systemd.time(7).

Type: string

Default

"monthly"

Example

"quarterly"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.autoScrub.pools

List of ZFS pools to periodically scrub. If empty, all pools will be scrubbed.

Type: list of string

Default

[ ]

Example

["tank"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.autoScrub.randomizedDelaySec

Add a randomized delay before each ZFS autoscrub. The delay will be chosen between zero and this value. This value must be a time span in the format specified bysystemd.time(7)

Type: string

Default

"6h"

Example

"12h"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.autoSnapshot.daily

Number of daily auto-snapshots that you wish to keep.

Type: signed integer

Default

7

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.autoSnapshot.enable

Enable the (OpenSolaris-compatible) ZFS auto-snapshotting service. Note that you must set the com.sun:auto-snapshot property to true on all datasets which you wish to auto-snapshot.

You can override a child dataset to use, or not use auto-snapshotting by setting its flag with the given interval: zfs set com.sun:auto-snapshot:weekly=false DATASET

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.autoSnapshot.flags

Flags to pass to the zfs-auto-snapshot command.

Run zfs-auto-snapshot (without any arguments) to see available flags.

If it's not too inconvenient for snapshots to have timestamps in UTC, it is suggested that you append --utc to the list of default options (see example).

Otherwise, snapshot names can cause name conflicts or apparent time reversals due to daylight savings, timezone or other date/time changes.

Type: string

Default

"-k -p"

Example

"-k -p --utc"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.autoSnapshot.frequent

Number of frequent (15-minute) auto-snapshots that you wish to keep.

Type: signed integer

Default

4

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.autoSnapshot.hourly

Number of hourly auto-snapshots that you wish to keep.

Type: signed integer

Default

24

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.autoSnapshot.monthly

Number of monthly auto-snapshots that you wish to keep.

Type: signed integer

Default

12

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.autoSnapshot.weekly

Number of weekly auto-snapshots that you wish to keep.

Type: signed integer

Default

4

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.expandOnBoot

After importing, expand each device in the specified pools.

Set the value to the plain string "all" to expand all pools on boot:

services.zfs.expandOnBoot = "all";

or set the value to a list of pools to expand the disks of specific pools:

services.zfs.expandOnBoot = [ "tank" "dozer" ];

Type: one of "disabled", "all" or list of string

Default

"disabled"

Example

["tank""dozer"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.trim.enable

Whether to enable periodic TRIM on all ZFS pools. Type: boolean

Default

true

Example

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.trim.interval

How often we run trim. For most desktop and server systems a sufficient trimming frequency is once a week.

The format is described in {manpage}systemd.time(7).

Type: string

Default

"weekly"

Example

"daily"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.trim.randomizedDelaySec

Add a randomized delay before each ZFS trim. The delay will be chosen between zero and this value. This value must be a time span in the format specified bysystemd.time(7)

Type: string

Default

"6h"

Example

"12h"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.zed.enableMail

Whether to enable ZED's ability to send emails.

Type: boolean

Default

config.services.mail.sendmailSetuidWrapper != null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix

services.zfs.zed.settings

ZFS Event Daemon /etc/zfs/zed.d/zed.rc content

See {manpage}zed(8) for details on ZED and the scripts in /etc/zfs/zed.d to find the possible variables

Type: attribute set of (string or signed integer or boolean or list of string)

Example

`#!nix { ZED_DEBUG_LOG = "/tmp/zed.debug.log";

ZED_EMAIL_ADDR = [ "root" ]; ZED_EMAIL_PROG = "mail"; ZED_EMAIL_OPTS = "-s '@SUBJECT@' @ADDRESS@";

ZED_NOTIFY_INTERVAL_SECS = 3600; ZED_NOTIFY_VERBOSE = false;

ZED_USE_ENCLOSURE_LEDS = true; ZED_SCRUB_AFTER_RESILVER = false; } `

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix