Demonstrate some examples of Nix in docker
.
βΉοΈ NOTE: Use playground to test if you'd prefer not to install Nix.
A list of things still to try and investigate TODO.md
NOTE: This repo has switched to conventional commits. It requires pre-commit
and commitizen
to help with controlling this.
# install pre-commmit (prerequisite for commitizen)
brew install pre-commit
brew install commitizen
# conventional commits extension
code --install-extension vivaxy.vscode-conventional-commits
# install hooks
pre-commit install --hook-type commit-msg --hook-type pre-push
- README
- Conventional Commits
- Contents
- Nix
- Glossary
- π Install Nix
- Index and Locate files
- 00 - Nix playground
- 01 - Simple Nix
- 02 - Single Package Docker Image
- 03 - Multi Package Docker Image
- 04 - Installing Software
- 05 - Installing Environments
- 06 - Build Nix docker image in docker
- 07 - Build Nix
nodejs
image in docker - 08 - Build
ffmpeg
issue - 09 - Build
distroless
images - 10 - Nixpacks
- 11 - Flakes
- 12 - Bundle
- 14 - Distroless Flakes
- 15 - Determinate System Installer
- 16 - Nodejs Builds
- 17 - custom package
- 20 - script dependencies
- 22 - shells
- π Resources
Nix is a powerful and flexible package manager for Unix-based systems, such as Linux and macOS. It was created to address some of the limitations and problems associated with traditional package managers like apt, yum, and pacman. Nix provides a reliable and reproducible way of managing software packages and their dependencies.
Some key features of Nix include:
-
Declarative package management: Users can describe the desired software environment in a declarative language called Nix expressions. This allows for easy sharing, reproducibility, and version control of software environments.
-
Isolation of package dependencies: Nix stores packages in isolation from each other, which prevents dependency conflicts and simplifies the process of upgrading, rolling back, or removing packages.
-
Atomic upgrades and rollbacks: Nix supports atomic operations, meaning that upgrading or rolling back a package does not affect the rest of the system. If an upgrade fails or a package causes issues, you can easily revert to the previous version without any consequences.
-
Multi-user support: Nix allows multiple users on a single system to have their own software environments without interfering with one another. This is particularly useful in shared or managed environments like research labs, universities, or workplaces.
-
Source and binary packages: Nix can build packages from source code or use precompiled binaries. This allows for greater flexibility and choice in how software is installed and managed.
-
NixOS: Nix is also the basis for NixOS, a Linux distribution built entirely around the Nix package manager. NixOS takes the principles of Nix and applies them to the entire operating system, resulting in a highly customizable, reproducible, and maintainable system.
Overall, Nix is a powerful package management solution that aims to make managing software on Unix-based systems more reliable, flexible, and reproducible.
The is a glossary file here with a few terms used from Nix.
- Install-Nix guide
- Install vscode extension
code --install-extension bbenoist.Nix
Check the installation:
# check the daemon is running
systemctl status nix-daemon
systemctl start nix-daemon
# show help
nix-env --help
# a quick test of nix-shell
nix-shell -p nix-info --run "nix-info -m"
nix-env -iA nixpkgs.nix-index
nix-shell -p nix-index
# NOTE: THis seems to fail inside a container.
nix-index
# Try to find ldd inside packages
nix-locate ldd
The NixPkgs index.
Playground based on building nix in Docker (doesn't require local Nix install)
Steps README.md
Demonstrates how to build a python app in Nix
Steps README.md
Demonstrates how to build a single package docker image in Nix
Steps README.md
Demonstrates how to build a multi package docker image in Nix
Steps README.md
Demonstrates how to install software using nix package manager
Steps README.md
Demonstrate how to define environments.
Steps README.md
Building a Nix image inside a container
Steps README.md
Building a Nix nodejs image.
Steps README.md
Demonstrate creating an ffmpeg
image with Nix.
Steps README.md
Demonstrate using nix
package to install into a distroless/scratch image.
Steps README.md
Demonstrate how to use NixPacks to build containers.
Steps README.md
Demonstrate how to use nix flakes
.
Steps README.md
Demonstrate how to use nix bundles
.
Steps README.md
Demonstrate how to use flakes to control versions of software used to build images.
Steps README.md
Demonstrate how to use the Determinate Systems Installer.
Steps README.md
Demonstrate the difference with the default nodejs, distrolesss and nix.
Steps README.md
Demonstrate how to build a custom package.
Steps README.md
Demonstrate how to write scripts that pack their dependencies.
Steps README.md
Demonstrate how to write scripts that pack their dependencies.
Steps README.md
- Search more than 80 000 packages here
- Nixhub - Search over 400,000 granular versions of nix packages here
- Minimal Docker Images
- Nix-by-example
- Nix Flakes: an Introduction here
- Building a Nix Package here
- How to Learn Nix here
- How to Learn Nix, Part 1: What's all this about? here
- awesome-nix here
- Nix Book here
- What Is Nix here
- Nix.dev here