sd-image: Add option to control sd image expansion on boot.
This is supeer useful to allow the normal sd-image code to be used by someone who wants to setup multiple partitions with a sd-image. Currently I'm manually copying the sd-image file and modifying it instead.
This commit is contained in:
parent
bd64a6221f
commit
bef4bda8dd
1 changed files with 8 additions and 1 deletions
|
@ -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 = {
|
||||
|
@ -215,7 +222,7 @@ in
|
|||
'';
|
||||
}) {};
|
||||
|
||||
boot.postBootCommands = ''
|
||||
boot.postBootCommands = lib.mkIf config.sdImage.expandOnBoot ''
|
||||
# On the first boot do some maintenance tasks
|
||||
if [ -f /nix-path-registration ]; then
|
||||
set -euo pipefail
|
||||
|
|
Loading…
Reference in a new issue