Instll steam and the zfs_clone_send / zfs_clone_recv scripts.
This commit is contained in:
@@ -5,6 +5,20 @@
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
zfs_clone_send =
|
||||
(pkgs.writeScriptBin "zfs_clone_send" (builtins.readFile ./files/zfs_clone_send.bash)).overrideAttrs
|
||||
(old: {
|
||||
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||
|
||||
});
|
||||
zfs_clone_recv =
|
||||
(pkgs.writeScriptBin "zfs_clone_recv" (builtins.readFile ./files/zfs_clone_recv.bash)).overrideAttrs
|
||||
(old: {
|
||||
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||
|
||||
});
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
@@ -18,4 +32,8 @@
|
||||
trim.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
zfs_clone_send
|
||||
zfs_clone_recv
|
||||
];
|
||||
}
|
||||
|
||||
13
nix/configuration/roles/zfs/files/zfs_clone_recv.bash
Normal file
13
nix/configuration/roles/zfs/files/zfs_clone_recv.bash
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# A zfs-send alias that creates a perfect clone with good defaults.
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# -s if the stream is interrupted, save the partial stream. The stream can then be resumed by doing a zfs send -t token where token is the receive_resume_token prop on the dataset we received into.
|
||||
# -u Do not mount the filesystem we are receiving. We can always mount afterwards but this avoids issues with streams with mountpoints to places like /
|
||||
# Can optionally add -F to destroy the dataset in the recv location.
|
||||
exec zfs recv -s -u "${@}"
|
||||
|
||||
# To delete an interrupted recv, run `zfs receive -A dataset`
|
||||
8
nix/configuration/roles/zfs/files/zfs_clone_send.bash
Normal file
8
nix/configuration/roles/zfs/files/zfs_clone_send.bash
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# A zfs-send alias that creates a perfect clone with good defaults.
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
exec zfs send --compressed --replicate --large-block --embed --verbose --raw "${@}"
|
||||
Reference in New Issue
Block a user