Merge pull request #91955 from c00w/expand

sd-image: Add option to control sd image expansion on boot.
This commit is contained in:
Sandro 2021-05-01 14:52:07 +02:00 committed by GitHub
commit ac72d9acfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,6 +126,13 @@ in
''; '';
}; };
expandOnBoot = mkOption {
type = types.bool;
default = true;
description = ''
Whether to configure the sd image to expand it's partition on boot.
'';
};
}; };
config = { config = {
@ -215,7 +222,7 @@ in
''; '';
}) {}; }) {};
boot.postBootCommands = '' boot.postBootCommands = lib.mkIf config.sdImage.expandOnBoot ''
# On the first boot do some maintenance tasks # On the first boot do some maintenance tasks
if [ -f /nix-path-registration ]; then if [ -f /nix-path-registration ]; then
set -euo pipefail set -euo pipefail