In this repository, you find my
common Nix libraries, common Nix packages, and common NixOS modules
and my public NixOS system configurations.
The top-level flake.nix
is the entry point to all of them. The common
components itself are standalone and can be used by anyone in out-of-tree projects.
You can include this project and use the common components without using the
NixOS configurations at all! To do so, please look at
/common/README.md
.
The whole repository is based on the referenced version of nixpkgs in
flake.nix
. Thus, the versions of Nix and NixOS required by all Nix files are
tied to that. Usually, this repository always follows the latest stable NixOS
release.
Either clone this repository and consume the local flake or run
$ nixos-rebuild <build|switch> --flake git+https://github.com/phip1611/nixos-configs#<hostname>
Depending on the difference between your current system and the applied NixOS configuration, you might have to reboot so that all the goodness is fully applied, such as environment variables, fresher Linux kernel, etc.
In this repository, I test two aspects (in CI):
- The unit tests of
libutil
report success - The NixOS configurations evaluate successfully
The common module is transitively tested via the NixOS configurations that are build.
The unit tests do not follow any particular testing strategy or framework, as there is no common Nix unit-testing framework yet (to my knowledge). In the testing infrastructure of my repository, a successful test is just a derivation that builds successfully.
Just type $ nix flake check
. This runs unit tests (checks
attribute) and
checks that the NixOS system configurations
evaluate
to valid derivations. (Please note that some errors might only be caught when
the NixOS configurations are actually build.)
You can run $ ./build-all-configs.sh
to build all NixOS configs locally.
However, most of the time, $ nix flake check
should be sufficient.
To run a specific check, run:
$ nix build .\#checks.x86_64-linux.<name>
or for a NixOS configuration, run
$ nixos-rebuild build --flake .#<system name>
The top-level Nix flake exports the following attributes (following the Nix flake conventions):
checks
: various unit testsdevShells
- everything needed to build and format this repository
- all custom pkgs from
common/nix/packages
- additional util packages for this repository
nixosConfigurations
: the configurations for my NixOS systemsnixosModules
: my common NixOS moduleoverlays
: overlays for my common Nix packages and utility librariespackages
:- all custom packages from
common/nix/packages
- additional util packages for this repository
- all custom packages from
The following non-standard attributes are exported as well:
lib
:libutil
library