NixOS / nixops-aws

GNU Lesser General Public License v3.0
53 stars 37 forks source link

How do you use the s3 remote backend? #157

Open blobcode opened 2 years ago

blobcode commented 2 years ago

I've tried using the s3 remote backend below

network.storage.s3 = {
      profile = "root";
      region = "us-east-1";
      bucket = "main-nixops-state";
      key = "personal.nixops";
      kms_keyid = "166c5cbe-b827-4105-bdf4-a2db9b52efb4";
    };

however when deploying on nixopsUnstable, I get

The network requires the 's3' state provider, but no plugin provides it.

I've found no documentation on how to fix this.

My question is how does one exactly install the s3 plugin? And does anyone have an example config I could reference?

teto commented 2 years ago

I am kind of in the same boat as you so it's just a guess but probably you should use nixops.packages."${system}".nixops-aws # nixops with plugins from nixops.url = "github:lukebfox/nixops-plugged"; to have nixops and its aws plugin.

roberth commented 2 years ago

nixpkgs also has a nixopsUnstable that includes most plugins. If something is missing from there, you can ping me for a review and merge.

teto commented 2 years ago

looks like it is now called nixops_unstable on unstable

blobcode commented 2 years ago

@roberth

It still appears as missing even with nixops_unstable on nixpkgs-unstable

roberth commented 2 years ago

Then this seems to be an issue with the aws plugin.

lunik1 commented 2 years ago

I'm having the same issue using a flake-based deployment.

lunik1 commented 2 years ago

Initial cursory investigation: NixopsAWSPlugin does not override storage_backends in nixops_aws/plugin.py, and so no s3 plugin is found when nixops assembles its list of storage backends here. The "fix" is to set storage_backends to return a dict containing the s3 bucket storage backend.

…however—and this may be my lack of sleep / familiarity with the codebase talking—I cannot find an implementation of a StorageBackend in this repo.