mirror of
https://github.com/elitak/nixos-infect.git
synced 2024-12-22 08:08:29 +03:00
add LVM support (#44)
This commit is contained in:
parent
0c2eef5dbb
commit
d8512ed9d3
1 changed files with 8 additions and 4 deletions
12
nixos-infect
12
nixos-infect
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue