Skip to content

Latest commit

Β 

History

History
143 lines (110 loc) Β· 3.56 KB

File metadata and controls

143 lines (110 loc) Β· 3.56 KB
NixOS Logo

My NixOS Configuration

My personal NixOS setup, fully declarative and leveraging the power of Nix for custom packages and configurations.

NixOS


πŸ”§ The Wrapper Pattern

All my packages use symlinkJoin + wrapProgram to inject configuration using only nix (no home-manager!):

# pkgs/ghostty/default.nix
pkgs.symlinkJoin {
  name = "ghostty-wrapped";
  paths = [ pkgs.ghostty ];
  nativeBuildInputs = [ pkgs.makeWrapper ];
  postBuild = ''
    wrapProgram $out/bin/ghostty \
      --add-flags "--config-file=${./config}"
  '';
}

🩹 Mergiraf Patch System

Applying multiple community patches to dwl usually causes conflicts. apply-patches.nix solves this:

# pkgs/dwl/default.nix
dwlSrc = applyPatches {
  src = pkgs.fetchgit { url = "https://codeberg.org/dwl/dwl.git"; /* ... */ };
  patches = [
    (pkgs.fetchurl { url = "...movestack.patch"; })
    (pkgs.fetchurl { url = "...bar.patch"; })
  ];
};

How it works:

  • Uses mergiraf for intelligent 3-way merging
  • Falls back to fixup patches when needed
  • Result: clean patch stacking that "just works"

πŸ“ Neovim with nixCats

A nixCats config running Neovim nightly:

# pkgs/nvim/default.nix (highlights)
lspsAndRuntimeDeps = {
  general = [
    lua-language-server
    nil  # Nix LSP
    stylua
    ripgrep fd
    customPkgs.tidal-language-server  # Haskell Music LSP packaged by me :)
  ];
};

startupPlugins = {
  general = [
    blink-cmp oil-nvim
    flash-nvim harpoon2
    nvim-treesitter.withAllGrammars
    # ... 40+ more
  ];
};

settings = {
  neovim-unwrapped = neovim-nightly-overlay.packages.${system}.neovim;
};

πŸš€ Quick Start

# Load my NixOS configuration
sudo nixos-rebuild switch --flake github:gavbog/nix#<hostname> # Options: mac, x86

# Try individual packages
nix run github:gavbog/nix#nvim
nix run github:gavbog/nix#ghostty
nix build github:gavbog/nix#dwl

πŸ’» Systems

Hostname Description
mac Apple Silicon Desktop (Asahi)
x86 Intel/Amd Desktop

Each system has its own configuration defined under systems/:

systems/
β”œβ”€β”€ mac/                 # Apple Silicon Desktop setup
β”œβ”€β”€ x86/                 # x86 Desktop setup
└── ...

πŸ“ Structure

.
β”œβ”€β”€ flake.nix
β”œβ”€β”€ pkgs/
β”‚   β”œβ”€β”€ dwl/           # Patched Wayland compositor
β”‚   β”œβ”€β”€ nvim/          # nixCats Neovim config
β”‚   β”œβ”€β”€ ghostty/       # Terminal wrapper
β”‚   β”œβ”€β”€ zsh/           # Shell with Starship + Zinit
β”‚   β”œβ”€β”€ librewolf/     # Browser
β”‚   └── ...
β”œβ”€β”€ lib/
β”‚   └── apply-patches.nix  # Mergiraf patch utility
β”œβ”€β”€ modules/           # NixOS modules (audio, bluetooth, etc.)
└── systems/           # Host-specific configurations

Built with ❄️ Nix