diff options
author | Profpatsch <mail@profpatsch.de> | 2018-05-23 17:47:55 +0200 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2018-05-23 17:47:55 +0200 |
commit | 2110a42c2c0ad5fee44c69b7ce2fc0a3024221c2 (patch) | |
tree | addca1dd4c53d45b4a7575b5d8d4f0901e83cdcb | |
parent | a720b4e04f9aa548ac6738379470b7fdb0bc3722 (diff) |
machines/mikiya: wait, until mapper device is unlocked
-rw-r--r-- | machines/profpatsch/mikiya.nix | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/machines/profpatsch/mikiya.nix b/machines/profpatsch/mikiya.nix index 1d1d6c10..8432c8f1 100644 --- a/machines/profpatsch/mikiya.nix +++ b/machines/profpatsch/mikiya.nix @@ -15,6 +15,7 @@ let name = "mikiya-root"; device = "/dev/disk/by-uuid/56910867-ed83-438a-b67c-c057e662c89e"; }; + rootDevice = "/dev/mapper/mikiya-root"; raidDevices = lib.imap (mkDevice "raid") [ "f0069e04-d058-40b3-8f13-92f11c4c2546" @@ -36,6 +37,10 @@ in { enable = true; ssh.enable = true; ssh.authorizedKeys = myLib.authKeys; + # we wait until the root device is unlocked (by ssh) + postCommands = '' + while [ ! -e ${rootDevice} ]; do sleep 1; done + ''; }; availableKernelModules = [ "ahci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" @@ -48,7 +53,7 @@ in { }; fileSystems."/" = { - device = "/dev/mapper/mikiya-root"; + device = rootDevice; fsType = "ext4"; options = [ "ssd" ]; }; @@ -57,6 +62,7 @@ in { fsType = "ext3"; }; + networking.useDHCP = true; nix.maxJobs = 4; |