about summary refs log tree commit diff
path: root/modules/virtualisation
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2012-12-16 13:31:44 -0500
committerShea Levy <shea@shealevy.com>2012-12-16 13:31:44 -0500
commitae4c8e3e0b6218c1cadd7ee360cd92ec613646b9 (patch)
tree67bef40ed7f58515174348eb8e10f2f52bdb4bd8 /modules/virtualisation
parentac9002ce1845d14dfaa8af0fdb25c9958729b2b2 (diff)
downloadnixlib-ae4c8e3e0b6218c1cadd7ee360cd92ec613646b9.tar
nixlib-ae4c8e3e0b6218c1cadd7ee360cd92ec613646b9.tar.gz
nixlib-ae4c8e3e0b6218c1cadd7ee360cd92ec613646b9.tar.bz2
nixlib-ae4c8e3e0b6218c1cadd7ee360cd92ec613646b9.tar.lz
nixlib-ae4c8e3e0b6218c1cadd7ee360cd92ec613646b9.tar.xz
nixlib-ae4c8e3e0b6218c1cadd7ee360cd92ec613646b9.tar.zst
nixlib-ae4c8e3e0b6218c1cadd7ee360cd92ec613646b9.zip
nova-image.nix: Replace the commented-out aufs mount with a commented-out unionfs-fuse mount
Diffstat (limited to 'modules/virtualisation')
-rw-r--r--modules/virtualisation/nova-image.nix17
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/virtualisation/nova-image.nix b/modules/virtualisation/nova-image.nix
index 2aa78aeaddab..0ce5d218cdb4 100644
--- a/modules/virtualisation/nova-image.nix
+++ b/modules/virtualisation/nova-image.nix
@@ -72,10 +72,6 @@ with pkgs.lib;
 
   boot.kernelParams = [ "console=ttyS0" ];
 
-  boot.initrd.kernelModules = [ "aufs" ];
-
-  boot.extraModulePackages = [ config.boot.kernelPackages.aufs ];
-
   boot.loader.grub.version = 2;
   boot.loader.grub.device = "/dev/vda";
   boot.loader.grub.timeout = 0;
@@ -83,8 +79,8 @@ with pkgs.lib;
   # Put /tmp and /var on /ephemeral0, which has a lot more space.
   # Unfortunately we can't do this with the `fileSystems' option
   # because it has no support for creating the source of a bind
-  # mount.  Also, "move" /nix to /ephemeral0 by layering an AUFS
-  # on top of it so we have a lot more space for Nix operations.
+  # mount.  Also, "move" /nix to /ephemeral0 by layering a unionfs-fuse
+  # mount on top of it so we have a lot more space for Nix operations.
   /*
   boot.initrd.postMountCommands =
     ''
@@ -96,9 +92,16 @@ with pkgs.lib;
       mkdir -m 755 -p $targetRoot/var
       mount --bind $targetRoot/ephemeral0/var $targetRoot/var
 
+      mkdir -p /unionfs-chroot/ro-nix
+      mount --rbind $targetRoot/nix /unionfs-chroot/ro-nix
+
+      mkdir -p /unionfs-chroot/rw-nix
       mkdir -m 755 -p $targetRoot/ephemeral0/nix
-      mount -t aufs -o dirs=$targetRoot/ephemeral0/nix=rw:$targetRoot/nix=rr none $targetRoot/nix
+      mount --rbind $targetRoot/ephemeral0/nix /unionfs-chroot/rw-nix
+      unionfs -o allow_other,cow,nonempty,chroot=/unionfs-chroot /rw-nix=RW:/ro-nix=RO $targetRoot/nix
     '';
+
+    boot.initrd.supportedFilesystems = [ "unionfs-fuse" ];
     */
 
   # Since Nova allows VNC access to instances, it's nice to start to