kish10 / nix-server-tools

Server tools generated by Nix.
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

nix-server-tools

Server tools generated by Nix.

Usefull tips.

Working with Docker.

Docker Contexts.

Should create a Nix derivation to hold all the files for the Docker context that the local COPY command in the Dockerfile would reference.

Note:

Working with Nix Flakes

Checking correctness of the flake.nix file & corresponding code (& build inputs), without building.

nix flake check

Updating the build inputs

To get the latest versions of the build inputs can run nix flake update before nix build .#.

Using builtins.getEnv with Nix flake.

To read environment variables from the shell context where nix build .#<proxy> is called:

Using local git repo as build inputs (usefull for quick prototyping during development).

For the build input url can use: git+file://<absolute path to the local git repo>.

Also see:

Working with secrets.

Nix automatically copies files into the nix-store. So recommend that secrets files should be encrypted anytime building with Nix such as nix build .# or nix develop .#, and the secret files should decrypted only when ecessary such as when running docker compose up.