nixops-aws icon indicating copy to clipboard operation
nixops-aws copied to clipboard

Allow mounting /nix/store on separate ebs volume

Open lo1tuma opened this issue 8 years ago • 2 comments

Currently it seems not possible to mount /nix/store to a separate ebs volume. I would expect that given the following configuration the store should be located on /dev/xvdj. Instead it is mounted on the root device. So the store does get its own mount point but on the device of the root partition. Is this intentional? Is it possible to have the store on a separate volume at all?

let
  region = "us-west-1";
  zone = "us-west-1b";
in
  {
    resources.ec2KeyPairs.xxxxx = { inherit region; };

    resources.ebsVolumes.nixStore = {
      tags.Name = "nix-store";
      inherit region zone;
      size = 250;
      volumeType = "gp2";
    };

    jenkinsMaster =
      { config, resources, ... }:
      {
        deployment.targetEnv = "ec2";
        deployment.ec2.ebsInitialRootDiskSize = 250;
        deployment.ec2.region = region;
        deployment.ec2.instanceType = "c4.xlarge";
        deployment.ec2.keyPair = resources.ec2KeyPairs.xxxx;
        deployment.ec2.subnetId = "xxxx";

        fileSystems."/nix/store" = {
          autoFormat = true;
          fsType = "ext4";
          device = "/dev/xvdj";
          ec2.disk = resources.ebsVolumes.nixStore;
        };
      };
  }

lo1tuma avatar Aug 05 '16 12:08 lo1tuma

16:26:09 ikwildrpepper | domenkozar: no, that's very hard to do

domenkozar avatar Nov 29 '16 15:11 domenkozar

Is this a problem for having a separate /nix/store partition in general? Are things any easier if it's the whole /nix partition that is separate?

(Where can I learn about how /nix/store is mounted?)

therealpxc avatar Nov 28 '17 03:11 therealpxc