Documentation

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.

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

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

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+"  ];

}

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"

Create a new repository on Github and push your flake to the repository.

git branch -M main
git remote add origin [email protected]:$YOUR_USERNAME/hello-flakery.git
git push -u origin main
Replace $YOUR_USERNAME with your Github username.

Deploy your flake on Flakery

Create your Template

To deploy your flake on Flakery, you will need to create a new deployment. You can do this by visiting the Templates page, selecting the Create New Template button and adding your flake to the input field. The url should look something like this: github:$YOUR_USERNAME/hello-flakery#default.

Replace $YOUR_USERNAME with your Github username.