Skip to content

DylanRJohnston/nixos

Repository files navigation

CI

Configuration files for NixOS and Home Manager. Feel free to browse and see what works for you. Reading through other people's configurations was very helpful for me as I was learning Nix.

Bootstrapping

To bootstrap a Darwin system configuration.

  1. Install Nix

    sh <(curl -L https://nixos.org/nix/install)
    
  2. Install Homebrew

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
  3. Install Nix Darwin

    nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
    ./result/bin/darwin-installer
  4. Clone Repository

    rm -rf ~/.nixpkgs
    git clone [email protected]:DylanRJohnston/nixos.git ~/.nixpkgs
  5. Configure System

    darwin-rebuild switch --flake ~/.nixpkgs

Project Structure

flake.nix contains System Configurations and Templates.

System Configurations

flake.nix contains a number of system configurations as well as a number of helper methods for constructing Darwin (mkDarwin) and NixOS (mkNixOS) system configurations which are specialisations of the generic mkSystem function.

NixOS or Nix-Darwin modules are provided with a number of extra parameters.

  • lockfile - The contents of the flake.lock, currently used to pin the /etc/nix/registry.conf to the same version as the lockfile. Ensuring all invocations of nix shell nixpkgs#foobar use the same nixpkgs as the system configuration.
  • hardware - The nixos/nixos-hardware flake contents. Contains hardware specific modules to support things like the Raspberry PI.
  • common - Contains NixOS modules that are shared between NixOS system configurations.

Home Manager modules are provided similarly with an extra common argument that contains shared home-manager modules.

NixOS, Nix Darwin, and Home Manager all have a common.base module that contains a sensible collection of modules. Most of the system configurations contain just these base modules with use cases specific overrides. For example, for AU-L-0226 the NixOS Configuration contains just the base configuration with an additional Homebrew Cask for LastPass. The Home Manager module is similarly just the base configuration with overrides for the git config.

Templates

About

nixos confgiurations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published