mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
repart: Enable discard option (#397906)
This commit is contained in:
commit
bf2bc08b37
1 changed files with 14 additions and 0 deletions
|
@ -72,6 +72,19 @@ in
|
|||
example = "require";
|
||||
default = "refuse";
|
||||
};
|
||||
|
||||
discard = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Controls whether to issue the BLKDISCARD I/O control command on the
|
||||
space taken up by any added partitions or on the space in between them.
|
||||
Usually, it's a good idea to issue this request since it tells the underlying
|
||||
hardware that the covered blocks shall be considered empty, improving performance.
|
||||
|
||||
See {manpage}`systemd-repart(8)` for details.
|
||||
'';
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.repart = {
|
||||
|
@ -163,6 +176,7 @@ in
|
|||
--definitions=/etc/repart.d \
|
||||
--dry-run=no \
|
||||
--empty=${initrdCfg.empty} \
|
||||
--discard=${lib.boolToString initrdCfg.discard} \
|
||||
${lib.optionalString (initrdCfg.device != null) initrdCfg.device}
|
||||
''
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue