KISS NixOS configuration based on Flakes & flake-parts (supports macOS too)
Find a file
Sridhar Ratnakumar c6efa50e65 Use newer version of just
until it is upgraded in nixpkgs, like:

https://github.com/NixOS/nixpkgs/pull/311583
2024-05-26 15:32:14 -04:00
.github/workflows ci: --show-trace 2024-04-02 02:50:57 -04:00
.vscode add nixd 2024-05-26 15:31:35 -04:00
clusters/github-runner gr: ephemeral 2024-05-26 11:19:14 -04:00
home Remove last references to emacs 2024-05-26 14:43:46 -04:00
nix-darwin Clean up old runner 2024-03-26 17:05:26 -04:00
nixos add hedgedoc 2024-05-19 10:12:11 -04:00
packages Use newer version of just 2024-05-26 15:32:14 -04:00
systems add hedgedoc 2024-05-19 10:12:11 -04:00
users Rm redundant args 2023-07-15 11:49:19 -04:00
.envrc flake'ify shell.nix 2022-05-08 10:25:46 -04:00
.gitattributes Add jenkins (#34) 2023-03-20 14:32:03 -04:00
.gitignore add direnv 2022-04-28 14:47:41 -04:00
flake.lock nix: Update inputs 2024-05-24 17:35:38 -04:00
flake.nix Use newer version of just 2024-05-26 15:32:14 -04:00
justfile Use newer version of just 2024-05-26 15:32:14 -04:00
README.md Revert "chore(readme): add zulip banner" 2024-05-22 14:07:49 -04:00

AGPL project chat Harmeless Code of Conduct

This repository contains the Nix / NixOS configuration for all of my systems. See nixos-flake if you want to create your own configuration from scratch.

Setup

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

NixOS Linux

Tip

For a general tutorial, see https://nixos.asia/en/nixos-install-flake

macOS

  • Install Nix
  • Clone this repo anywhere
  • Edit flake.nix to use your system hostname as a key of the darwinConfigurations set
  • Edit users/config.nix to contain your users
  • Run nix run.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
  • systems: top-level configuration.nix('ish) for various systems
  • clusters: Features that span more than 1 system

Tips

  • 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
      # Or, `nix run .#update`
      
  • 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.
  • To build all flake outputs (locally or in CI), run nix --accept-flake-config run github:srid/nixci
  • For secrets management, I use colmena along with 1Password.

Discussion

If you wish to discuss about this config, join the Zulip.


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