Skip to content

dlubawy/nix-configs

Repository files navigation

Cache 📝 Format 🔎 Update ⬆️

nix-configs

My personal Nix configurations for managing multiple systems using NixOS and nix-darwin. This repository provides declarative configuration for workstations, servers, and network infrastructure.

Overview

This configuration manages:

  • NixOS systems: Router (Banana Pi), NAS server (GMKtec G9), WSL
  • macOS systems: Development workstation (MacBook Pro M1)
  • User environments: Dotfiles and applications via Home Manager
  • Network services: Nextcloud, Jellyfin, Grafana, Prometheus, Loki
  • Network infrastructure: Router with VLANs, firewall, and monitoring

Getting Started

To use these configurations:

  1. Review the documentation for your target system in the Hosts or Homes section
  2. Define your users in ./users following the nix-configs module schema
  3. Update vars in flake.nix with your admin user email
  4. Configure secrets using agenix for passwords and sensitive data
  5. Build and deploy using the commands specific to your host or home

Each host and home configuration has detailed installation instructions in its README.

Notes

These configurations make use of personal preferences. I have forked some tools and made personal edits which may make this unstable:

  • nix-darwin: I added additional user configuration management and fixed some multi-user issues in the system. This was done in a heavy-handed manner and so will likely not be supported upstream. This may change as upstream improves on these issues.
  • agenix: Wanted to add armor output support for better git visibility. Also needed to fix ageBin for Darwin configuration.

Hosts

  • Banana Pi BPI-R3: bpi - Router and network infrastructure
  • GMKtec G9: lil-nas - NAS server with Nextcloud, Jellyfin, and monitoring
  • MacBook Pro M1: laplace - macOS development workstation
  • WSL: syringa - Windows Subsystem for Linux

Hosts import reusable system configuration modules based on the type of system being configured:

All hosts import the Home Manager module (./modules/home-manager). This module brings in reusable configurations to be applied for each defined user in a host.

Homes

Standalone home-manager configurations for systems not managed by NixOS or nix-darwin:

  • Steam Deck: companioncube - Portable gaming device
  • Android AVF: debian - Android Virtualization Framework Linux terminal

Each home configuration has its own README with installation and usage instructions.

Modules

Reusable NixOS and nix-darwin modules provide the building blocks for host configurations:

  • darwin: macOS system configuration via nix-darwin
  • home-manager: User-level dotfiles and application configuration
  • nix-configs: Common user definition schema
  • nixos: NixOS system configuration
  • nixvim: Neovim IDE configuration
  • topology: Network topology visualization

Each module has its own README with detailed documentation on its purpose and usage.

Users

Users are defined in the ./users directory using the schema from the nix-configs module. The default configuration imports all users, but hosts can selectively import individual users as needed.

The admin user is specified in vars within flake.nix. You should modify this user if copying this repository.

Password Management

Default passwords for users are set differently by platform:

  • Darwin: Defaults to the user's configuration name
  • NixOS: Set via initialHashedPassword or hashedPasswordFile

If mutableUsers is enabled in the host configuration, passwords may be changed from their initial values.

NixOS Shadow Files

The users.shadow.enable option moves password management into individually managed $HOME/.shadow files using the nixos-passwd script from the nixos-password package. When a /persist mount is enabled, shadow files are created in /persist/$HOME/.shadow for each managed user.

Templates

Development environment templates are available for quick project setup. Initialize a new project with:

nix flake init --template github:dlubawy/nix-configs/main#[template]

Available templates: deno, go, latex, nix, python, rust, tofu, and empty.

About

My personal Nix configurations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors