KISS NixOS configuration based on Flakes & flake-parts (supports macOS too)
Find a file
2024-09-18 20:42:07 -04:00
.github/workflows ci: Use omnix 2024-08-21 12:30:46 -04:00
.vscode Add ci to remotely build on two CI machines 2024-07-15 17:15:24 -04:00
home nix-direnv: keep package option until this PR 2024-08-27 16:10:36 -04:00
nix-darwin Add github-nix-ci based runners (#60) 2024-06-21 23:39:22 -04:00
nixos Don't use unstable Nix 2024-09-03 22:08:45 -04:00
packages ci: disable intel mac 2024-09-03 15:25:34 -04:00
secrets Update my token 2024-08-21 12:41:39 -04:00
systems darwin: remap caps lock 2024-09-18 11:10:13 -04:00
users me: keep one ssh key 2024-06-02 10:26:47 -04:00
.envrc flake'ify shell.nix 2022-05-08 10:25:46 -04:00
.gitattributes chore: Redundant entry 2024-06-21 19:46:58 -04:00
.gitignore add direnv 2022-04-28 14:47:41 -04:00
flake.lock Update flake-parts 2024-09-12 11:07:18 -04:00
flake.nix nix: Add shell name 2024-09-11 21:39:48 -04:00
justfile Update nixos-flake 2024-06-26 17:25:20 -04:00
README.md readme: test commit 2024-09-18 20:42:07 -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 wish 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

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:juspay/omnix ci build
  • For secrets management, I use ragenix.

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. ↩︎