NixOS Config for Matt Camp
Welcome to AI Campground, your gateway to my personalized Nix ecosystem. This repository serves as a comprehensive collection of both my NixOS and generic Nix configurations, as I transition from traditional dotfiles. The migration is a work in progress, but the goal is a cohesive, well-documented Nix setup. Throughout this evolution, I'm committed to providing detailed READMEs to share my journey, insights, and solutions to challenges encountered.
Before diving in, ensure that you have Nix installed on your system. If not, you can download and install it from the official Nix website.
git clone https://gitlab.com/usmcamp0811/dotfiles.git
nix build gitlab:usmcamp0811/dotfiles#isoConfigurations.base-iso
dd if=./result/iso/nixos.iso of=/dev/usb_drive status=progress
Here's an overview of what my Nix configuration offers:
-
Campground Nvim: I configured my Neovim config using NixVim and export it as a package.
-
Home Manager: Manage your dotfiles, home environment, and user-specific configurations with Home Manager.
-
Hashicorp Vault: Leveraging insights from Jake Hamilton's dotfiles, I've seamlessly integrated Vault Agent into my Nix configuration. This provides an exemplary secret management experience, eliminating the need to store sensitive information in git repositories or other insecure locations.
-
Automated Deploy: Ability to automatically deploy all systems through Gitlab CICD or with
deploy --host <hostname> .#<hostname>
. -
Git Pre-Commit Hooks: Seamless integration of git hooks with Nix. To enable the hooks just activate the default shell.
nix develop
-
System Observability & Monitoring: Integrate Prometheus, Grafana, and Loki to achieve comprehensive monitoring of all systems, including Systemd services.
-
Terraform Modules: Various modules for deploying infrastructure in the cloud with Terraform.
Leveraging the SnowfallOrg lib architecture, my Nix setup offers a streamlined and well-organized way to handle your Nix ecosystem. Here’s the breakdown:
-
Custom Library: Located in the
lib/
folder, an optional custom library features a Nix function that utilizesinputs
,snowfall-inputs
, andlib
to return an attribute set that merges withlib
. -
Hierarchical Directory Setup: The
lib/
andpackages/
directories support a flexible, nestable folder structure. Each folder houses a Nix function designed to return an attribute set that blends seamlessly intolib
, facilitating a modular configuration. -
Package Layering: Within the
packages/
folder, you have the option to define a collection of exportable packages. These packages are initialized usingcallPackage
and should contain functions that accept an attribute set of packages and the essentiallib
to yield a derivation. -
Configuration Modules: The
modules/
folder allows you to set up NixOS modules tailored for different platforms likenixos
,darwin
, andhome
, making system configuration management more modular. -
Personalized Overlays: Use the
overlays/
directory for any custom overlays you may have. Each overlay function should accept three arguments: an attribute set based on your flake's inputs and achannels
attribute that lists all accessible channels, the finalizedpkgs
, and their predecessors. This feature enhances package set customization. -
System-Centric Configurations: The
systems/
folder helps you organize your system setups by architecture and format, enabling configurations for multiple platforms likex86_64-linux
oraarch64-darwin
. -
Home Environment Configs: Similarly, the
homes/
folder arranges configurations by architecture, which is particularly handy for managing home environments via Nix.
This methodology fosters a user-friendly approach to Nix configuration, balancing both flexibility and modularity for better manageability.
Inspiration and code snippets have been sourced from various corners of the internet. I'll endeavor to document these contributions whenever memory and circumstances permit.