mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 21:09:00 +02:00
Add support for tarsnap options -H and -L
A new option `explicitSymlinks` will set `-H` when creating an archive. This option makes tarsnap follow any symlinks specified explicitly on the commandline, but not any found inside the file tree. A new option `followSymlinks` will set `-L` when creating an archive. This option makes tarsnap follow any symlinks found anywhere in the file tree instead of storing them as-is.
This commit is contained in:
parent
adaa9d9348
commit
d462595600
|
@ -238,6 +238,20 @@ in
|
|||
Whether to produce verbose logging output.
|
||||
'';
|
||||
};
|
||||
explicitSymlinks = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to follow symlinks specified as archives.
|
||||
'';
|
||||
};
|
||||
followSymlinks = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to follow all symlinks in archive trees.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
));
|
||||
|
@ -304,6 +318,8 @@ in
|
|||
let run = ''tarsnap --configfile "/etc/tarsnap/${name}.conf" \
|
||||
-c -f "${name}-$(date +"%Y%m%d%H%M%S")" \
|
||||
${optionalString cfg.verbose "-v"} \
|
||||
${optionalString cfg.explicitSymlinks "-H"} \
|
||||
${optionalString cfg.followSymlinks "-L"} \
|
||||
${concatStringsSep " " cfg.directories}'';
|
||||
in if (cfg.cachedir != null) then ''
|
||||
mkdir -p ${cfg.cachedir}
|
||||
|
|
Loading…
Reference in a new issue