KISS NixOS configuration based on Flakes & flake-parts (supports macOS too)
Find a file
2023-02-12 14:09:25 -05:00
.vscode vscode: not using makefile anymore 2022-12-18 10:03:57 -05:00
home darwin: set ssh auth sock for 1p 2023-01-31 11:32:19 -05:00
nix-darwin consolidate hci modules 2023-01-05 10:36:37 +05:30
nixos fix warnings 2023-02-12 14:08:39 -05:00
secrets users/config.nix 2022-12-27 15:23:16 -05:00
systems pce: include nixpkgs-fmt 2023-02-12 14:09:25 -05:00
users pinch, no more 2023-02-12 14:06:00 -05:00
.envrc flake'ify shell.nix 2022-05-08 10:25:46 -04:00
.gitattributes git: make flake.lock as auto-generated 2022-05-08 10:17:29 -04:00
.gitignore add direnv 2022-04-28 14:47:41 -04:00
flake.lock update vscode-server input 2023-02-12 14:08:46 -05:00
flake.nix pinch, no more 2023-02-12 14:06:00 -05:00
lib.nix Fix darwin activation 2023-01-05 10:23:18 +05:30
README.md readme: revamp 2023-01-04 20:08:08 -05:00

This repository contains the Nix / NixOS configuration for all of my systems.

Setup

To use this repository as base configuration for your new machine running:

NixOS Linux

macOS

  • Install Nix (must be multi-user)
  • Install nix-darwin
    • This will create a ~/.nixpkgs/darwin-configuration.nix, but we do not need that.
  • Clone this repo anywhere
  • Edit users/config.nix to contain your users
  • Run nix develop -c , activate.1 That's it. Re-open your terminal.

Architecture

Start from flake.nix (see Flakes). flake-parts is used as the module system.

Directory layout

  • home: home-manager config (shared between Linux and macOS)
  • nixos: nixos modules for Linux
  • nix-darwin: nix-darwin modules for macOS
  • users: user information
  • secrets: agenix secrets (encrypted using ssh keys)
  • systems: top-level configuration.nix('ish) for various systems

Tips

  • Run , in nix develop shell (tip: direnv is better) to see available scripts.
  • To update NixOS (and other inputs) run nix flake update
    • You may also update a subset of inputs, e.g.
      nix flake lock --update-input nixpkgs --update-input darwin --update-input home-manager
      # Also, in the dev shell: , update-primary
      
  • To free up disk space,
    sudo nix-env -p /nix/var/nix/profiles/system --delete-generations +2
    sudo nixos-rebuild boot
    
  • To autoformat the project tree using nixpkgs-fmt, run nix fmt.

  1. You might have to rm -rf /etc/nix/nix.conf, so our flake.nix can do its thing. ↩︎