summary refs log tree commit diff
path: root/nixos/lib/make-disk-image.nix
diff options
context:
space:
mode:
authorTravis Athougies <iammisc@gmail.com>2019-01-23 15:47:55 -0800
committerDanylo Hlynskyi <abcz2.uprola@gmail.com>2019-01-24 01:47:55 +0200
commita66ef3aa3d6cbc900528f5163b3115576546ef56 (patch)
tree8a4b6a1f571c71084c4012acc51010b13486a64d /nixos/lib/make-disk-image.nix
parenta96ff6181871ed4629eebf1aae21cfdcca891c15 (diff)
downloadnixpkgs-a66ef3aa3d6cbc900528f5163b3115576546ef56.tar
nixpkgs-a66ef3aa3d6cbc900528f5163b3115576546ef56.tar.gz
nixpkgs-a66ef3aa3d6cbc900528f5163b3115576546ef56.tar.bz2
nixpkgs-a66ef3aa3d6cbc900528f5163b3115576546ef56.tar.lz
nixpkgs-a66ef3aa3d6cbc900528f5163b3115576546ef56.tar.xz
nixpkgs-a66ef3aa3d6cbc900528f5163b3115576546ef56.tar.zst
nixpkgs-a66ef3aa3d6cbc900528f5163b3115576546ef56.zip
Add options to build disk image function (#50239)
* add options to build disk image function

* Revert suffix changes
Diffstat (limited to 'nixos/lib/make-disk-image.nix')
-rw-r--r--nixos/lib/make-disk-image.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix
index 6fec322f909..5e86ea479d5 100644
--- a/nixos/lib/make-disk-image.nix
+++ b/nixos/lib/make-disk-image.nix
@@ -27,6 +27,9 @@
 , # The root file system type.
   fsType ? "ext4"
 
+, # Filesystem label
+  label ? "nixos"
+
 , # The initial NixOS configuration file to be copied to
   # /etc/nixos/configuration.nix.
   configFile ? null
@@ -134,9 +137,9 @@ let format' = format; in let
       # Get start & length of the root partition in sectors to $START and $SECTORS.
       eval $(partx $diskImage -o START,SECTORS --nr ${rootPartition} --pairs)
 
-      mkfs.${fsType} -F -L nixos $diskImage -E offset=$(sectorsToBytes $START) $(sectorsToKilobytes $SECTORS)K
+      mkfs.${fsType} -F -L ${label} $diskImage -E offset=$(sectorsToBytes $START) $(sectorsToKilobytes $SECTORS)K
     '' else ''
-      mkfs.${fsType} -F -L nixos $diskImage
+      mkfs.${fsType} -F -L ${label} $diskImage
     ''}
 
     root="$PWD/root"