Install Nix (learn more about this installer)
curl --proto '=https' --tlsv1.2 -sSf \
-L https://install.determinate.systems/nix \
| sh -s -- install
and run nix develop
to launch development environment.
- Create reusable configuration profiles in
profiles
directory
-
Add new host to
nixosConfiguration
andapps
outputs inflake.nix
file -
Create host declaration in
hosts/<hostname>
directory (usehosts/server1
as example) -
Test configuration
nix flake check --no-build
- Test server in VM
nix run .#<hostname>
-
Add new test to
checks
output inflake.nix
file -
Create test script in
tests/<test-name>.nix
file -
Run test
nix flake check`
- Launch interactive environment
nix repl ./repl.nix --argstr hostname <hostname>"
- Print configuration value
:p config.<option>
For example, print a list of enabled ssh ports
:p config.services.openssh.ports
or print full admin user configuration
:p config.users.users.admin
If needed, port forwarding can be configured in
profiles/development.nix file. This file must be
included in host declaration file hosts/<hostname>/default.nix
(see: hosts/server1/default.nix for example).
-
Create identities (users and/or systems able to use secrets) and secrets in secrets/secrets.nix file
-
Create a encrypted file for each secret
nix develop
agenix -e <SECRET-NAME>.age
- Use secret in NixOS module (see: profiles/secrets.nix for example)
For more information check out Agenix tutorial.
- TODO - nixos-anywhere
-
Merge flake inputs update PR created by
flake-update
workflow -
Update
deploy
tag usingutils/release.sh
script -
Wait for system update is performed automatically at 1am (see profiles/auto-upgrade.nix)
- Get system version (run on server)
nixos-version --json