mirror of
https://github.com/elitak/nixos-infect.git
synced 2024-12-22 16:18: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> ];
|
imports = [ <nixpkgs/nixos/modules/profiles/qemu-guest.nix> ];
|
||||||
boot.loader.grub.device = "/dev/$disk";
|
boot.loader.grub.device = "$grubdev";
|
||||||
fileSystems."/" = { device = "/dev/${disk}1"; fsType = "ext4"; };
|
fileSystems."/" = { device = "$rootfsdev"; fsType = "ext4"; };
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -147,8 +147,12 @@ removeSwap() {
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareEnv() {
|
prepareEnv() {
|
||||||
# $disk is used in makeConf()
|
# $grubdev is used in makeConf()
|
||||||
for disk in vda sda; do [[ -e /dev/$disk ]] && break; done
|
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
|
# DigitalOcean doesn't seem to set USER while running user data
|
||||||
export USER="root"
|
export USER="root"
|
||||||
|
|
Loading…
Reference in a new issue