Set up your environment
This guide will help you set up a working development environment on your work machine.
Machine
Below you will find all the required steps in order to configure the most basic machine setup.
-
Install VSCode or Cursor, Time Doctor and Google Chrome via the Kernel Self Service application.
-
Open Cloudflare WARP and connect to the
aws
virtual network. -
Install basic tools:
Terminal window NIXPKGS_ALLOW_UNFREE=1 nix profile add --impure \nixpkgs#direnv \nixpkgs#git \nixpkgs#nil \nixpkgs#nix-direnv \nixpkgs#nixfmt \nixpkgs#nodejs_22 \nixpkgs#saml2aws \nixpkgs#sops \nixpkgs#terraform \nixpkgs#uv -
Terminal window nix profile add github:fluidattacks/makes/24.12 -
Add your SSH key to your GitLab account.
-
Configure Git to sign commits using SSH.
-
Write an email to help@fluidattacks.com requesting developer access to the Universe Repository.
Environment
This section will guide you through setting up a terminal with AWS credentials and a code editor in an automated way every time you enter your local checkout of the Universe repository.
After this section you will have:
- A terminal with AWS credentials for the specific product you are developing.
- An editor with:
- The source code of the Universe repository.
- Recommended development extensions.
- Automatic code formatters on save.
- Auto completion and go to definition.
- OS libraries required.
Terminal
We’ll configure the terminal first. Once the terminal is configured, all of the applications you open from it will inherit the development environment and credentials.
At this point you should have Nix and Makes already installed in your system, so we won’t go into those details.
For maximum compatibility,
we suggest you use ZSH
(macOS default shell)
as the command interpreter of your terminal.
Please follow these steps:
-
Make sure you have the following tools installed in your system:
- Determinate Nix
- Makes
- Git
- Direnv
- VSCode
- If you are missing any of the previous tools, refer back to the machine configuration
-
Clone the Universe repository using SSH:
Terminal window git clone git@gitlab.com:fluidattacks/universe.git -
cd
to the root of the repository and configure your Git username and email:Terminal window git config user.name "Your Name"git config user.email "username@fluidattacks.com" -
Configure
direnv
by adding the following lines to your~/.zshrc
shell configuration file:Terminal window # Configure direnvexport DIRENV_WARN_TIMEOUT=1hsource <(direnv hook zsh)After making these changes, apply them with:
Terminal window source ~/.zshrc -
cd
to universe and run the following commands:Terminal window cd universedirenv allowThis will start the login process on your terminal.
-
For components that already use flakes, you need to cd into the component and run
direnv allow
to enter the development environment.Terminal window cd skimsdirenv allow
Editor
We highly recommend you use Visual Studio Code because most of the team uses it, and it works very well for our purpose.
- You can open the universe directory,
either using the
File > Open Folder
option in the menu or from a terminal, still within the universe repository withcode .
. - Go to the extensions tab
(Ctrl+Shift+X)
, type@recommended
, and install the recommended extensions for the workspace.
Your first commit
You have almost finished the onboarding.
Your next goal is making your first commit reach production.
-
Read the Contributing section carefully.
-
Create a new issue following the onboarding template and assign it to you.
-
Create your local branch.
-
Add your name, username and email to the .mailmap file.
-
Make sure your commit message follows the expected syntax.
-
Check if the commit message is valid using Makes:
Terminal window m . /common/test/commitlint -
Push your commit to the repository.
-
Once the Merge Request is approved and merged, and every other item in the issue is done, you can go ahead and close the issue.
Troubleshooting
Here you will find typical errors and how to solve them.
Can not push to the remote repository
Make sure you:
- Have the correct permissions to push to the repository.
- Have correctly set up your SSH key.
- Are using an updated version of Git (>2.40.0).