# Quick Start

Flakery creates templates and deployments for your nixos flakes. You can use flakery to create deployments of a nixos flake, seeded with a file system. These files are encrypted at rest and can be decrypted on demand.

# Prerequisites

In order to use flakery, you will need to have the following installed:

# Create your project directory and initialize a flake

To create a new flake, you can use the nix flake init command. This will create a new directory with a flake.nix file and a hello.nix file.

mkdir hello-flakery
cd hello-flakery
nix flake init -t github:getflakery/flakes#default
1
2
3

# Add your ssh public key to the flake

If you don't already have an ssh key, you can generate one with the following command:

ssh-keygen 
1

this will generate a new ssh key in your ~/.ssh directory. You can then add this key to your flake by editing the hello.nix file


























 
 




{ config, pkgs, ... }:

{

  # Set your time zone.
  time.timeZone = "America/Los_Angeles";


  system.stateVersion = "23.05"; 
  nix.settings.experimental-features = [ "nix-command" "flakes" ];


  users.users.alice = {
    isNormalUser = true;
    extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
    packages = with pkgs; [ ];
  };
  services.openssh = {
    enable = true;
    # require public key authentication for better security
    settings.PasswordAuthentication = false;
    settings.KbdInteractiveAuthentication = false;
    #settings.PermitRootLogin = "yes";
  };
  users.users."alice".openssh.authorizedKeys.keys = [
    # replace with your ssh key 
    "ssh-ed25519 NOTAREALKEYBUTTHISISWHEREYOURSSHOULDBEdslkfjsoi3cjnefoODIUFNI0JDNCKL+" 
  ];

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

# Create a git repository and push your flake

Initialize a git repository and create an initial commit.

git init
git add .
git commit -m "initial commit"
1
2
3

Create a new repository on Github (opens new window) and push your flake to the repository.

git branch -M main
git remote add origin git@github.com:$YOUR_USERNAME/hello-flakery.git
git push -u origin main
1
2
3

TIP

Replace $YOUR_USERNAME with your Github username.

# Deploy your flake on Flakery

# Create your deployment template

To deploy your flake on Flakery, you will need to create a new deployment. You can do this by visiting the Flakery website (opens new window) and adding your flake to the input field. the url should look something like this: github:$YOUR_USERNAME/hello-flakery#default.

TIP

Replace $YOUR_USERNAME with your Github username.

Alt text

# Create your deployment

Once you have added your flake, it will appear in the list of available flakes. You can click on the flake to view its details.

Alt text

Once you have added your flake, you can click the "Create Deployment" button. This will create a new deployment of your flake.

Alt text

after creating your deployment, you can view the details of your deployment.

Alt text

Alt text

Alt text

After a few minutes, your deployment will be ready. You can then ssh into your deployment using the following command:

ssh alice@$YOUR_DEPLOYMENT_IP
1

TIP

Replace $YOUR_DEPLOYMENT_IP with the IP address of your deployment.

you should get a terminal session from which you can interact with your deployment.

[alice@ip-10-0-0-210:~]$ 
1