Coder Social home page Coder Social logo

concrexit-nix's Introduction

Concrexit nix initial setup

nix-shell setup.nix

Set your AWS client credentials:

export AWS_ACCESS_KEY=...
export AWS_SECRET_KEY=...

Now you can start the instance (feel free to copy the whole text):

# This is the production subnet
export subnet_id=subnet-072547905992bb9a1

# Create instance with the NixOS AMI
instance_info=$(ec2-run-instances ami-02c34db5766cc7013 --region eu-west-1 -k concrexit --subnet $subnet_id --instance-type t2.micro --block-device-mapping '/dev/xvda=:20' --group sg-05b2701b8e277cb69)

# We need the instance ID for the next two commands
instance_id=$(echo "$instance_info" | grep "INSTANCE" | cut -f 2)

# Grep the public key from the instance description
public_ip=$(ec2-describe-instances --region eu-west-1 $instance_id | grep "NICASSOCIATION" | cut -f 2)

# Set the name
ec2-create-tags --region eu-west-1 $instance_id -t Name=concrexit-staging

echo "You can now login with"
echo "ssh -i concrexit.pem root@$public_ip"

You need to wait a bit before logging in to allow the SSH server to start up.

Build the machine configuration:

# Get the Nix hash of the machine config
nix_hash=$(nix-build -A machine)

NIX_SSHOPTS="-i concrexit.pem" nix-copy-closure --to root@$public_ip $nix_hash
ssh -i concrexit.pem root@$public_ip -- $nix_hash/bin/switch-to-configuration switch

concrexit-nix's People

Contributors

pingiun avatar dependabot[bot] avatar github-actions[bot] avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.