add LVM support (#44)

This commit is contained in:
DavHau 2020-02-14 08:04:27 +07:00 committed by GitHub
parent 0c2eef5dbb
commit d8512ed9d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,8 +36,8 @@ EOF
{ ... }:
{
imports = [ <nixpkgs/nixos/modules/profiles/qemu-guest.nix> ];
boot.loader.grub.device = "/dev/$disk";
fileSystems."/" = { device = "/dev/${disk}1"; fsType = "ext4"; };
boot.loader.grub.device = "$grubdev";
fileSystems."/" = { device = "$rootfsdev"; fsType = "ext4"; };
}
EOF
@ -147,8 +147,12 @@ removeSwap() {
}
prepareEnv() {
# $disk is used in makeConf()
for disk in vda sda; do [[ -e /dev/$disk ]] && break; done
# $grubdev is used in makeConf()
for grubdev in /dev/vda /dev/sda; do [[ -e $grubdev ]] && break; done
# Retrieve root fs block device
# (get root mount) (get partition or logical volume)
rootfsdev=$(mount | grep "on / type" | awk '{print $1;}')
# DigitalOcean doesn't seem to set USER while running user data
export USER="root"