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
+8 -1
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