git.iko.soy/typeable/nixpkgs
on master help sign in
Add options to build disk image function (#50239)

* add options to build disk image function * Revert suffix changes

commita66ef3aa3d6cbc900528f5163b3115576546ef56 authorTravis Athougies <iammisc@gmail.com> dateWed 23 Jan 2019, 15:47 (8 years ago) parenta96ff61
1 file changed+5−2
nixos/lib/make-disk-image.nix+5−2
nixos/lib/make-disk-image.nix+5−2
@@ -27,6 +27,9 @@
2727, # The root file system type.
2828 fsType ? "ext4"
2929
30+, # Filesystem label
31+ label ? "nixos"
32+
3033, # The initial NixOS configuration file to be copied to
3134 # /etc/nixos/configuration.nix.
3235 configFile ? null
@@ -134,9 +137,9 @@ let format' = format; in let
134137 # Get start & length of the root partition in sectors to $START and $SECTORS.
135138 eval $(partx $diskImage -o START,SECTORS --nr ${rootPartition} --pairs)
136139
137− mkfs.${fsType} -F -L nixos $diskImage -E offset=$(sectorsToBytes $START) $(sectorsToKilobytes $SECTORS)K
140+ mkfs.${fsType} -F -L ${label} $diskImage -E offset=$(sectorsToBytes $START) $(sectorsToKilobytes $SECTORS)K
138141 '' else ''
139− mkfs.${fsType} -F -L nixos $diskImage
142+ mkfs.${fsType} -F -L ${label} $diskImage
140143 ''}
141144
142145 root="$PWD/root"