Skip to main content

Install via Nix

Install git-cliff using Nix for reproducible, declarative package management.

Quick Start

Temporarily use git-cliff:
nix-shell -p git-cliff
This opens a shell with git-cliff available.

Installation Methods

Traditional Nix Commands

1

Using nix-shell (Recommended)

Temporarily add git-cliff to your environment:
nix-shell -p git-cliff
This creates an isolated environment with git-cliff available.To use it:
git-cliff --version
2

Using nix-env

Install git-cliff permanently:
nix-env -iA nixpkgs.git-cliff
Using nix-env permanently modifies a local profile. Consider using nix-shell or NixOS configuration instead for better reproducibility.
3

Verify installation

git-cliff --version

New Nix CLI (Experimental)

The new Nix CLI requires enabling experimental features. Add to ~/.config/nix/nix.conf:
experimental-features = nix-command flakes
Run git-cliff directly without installing:
nix run nixpkgs#git-cliff
With arguments:
nix run nixpkgs#git-cliff -- --help
nix run nixpkgs#git-cliff -- -o CHANGELOG.md

NixOS Configuration

Add git-cliff to your system configuration:
Add to /etc/nixos/configuration.nix:
{ config, pkgs, ... }:

{
  environment.systemPackages = with pkgs; [
    git-cliff
    # other packages...
  ];
}
Rebuild your system:
sudo nixos-rebuild switch

Development Shell

Create a development environment with git-cliff:
Create shell.nix in your project:
{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  buildInputs = with pkgs; [
    git-cliff
    git
  ];
  
  shellHook = ''
    echo "git-cliff $(git-cliff --version)"
    echo "Development environment ready!"
  '';
}
Enter the shell:
nix-shell

Channel Management

Using Stable Channel

git-cliff is available in the stable channel:
nix-shell -p git-cliff

Using Unstable Channel

For the latest features, use the unstable channel:
1

Add unstable channel

nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update nixpkgs
2

Install from unstable

nix-env -iA nixpkgs.git-cliff

Managing Installation

# Using nix-env
nix-env -q | grep git-cliff

# Using nix profile (new CLI)
nix profile list | grep git-cliff

Troubleshooting

Ensure your Nix profile is in your PATH:
echo $PATH | grep nix
Add to your shell configuration (~/.bashrc, ~/.zshrc, etc.):
export PATH="$HOME/.nix-profile/bin:$PATH"
Or source the Nix profile:
. ~/.nix-profile/etc/profile.d/nix.sh
To use the new Nix CLI commands, enable experimental features:Permanently:Create/edit ~/.config/nix/nix.conf:
experimental-features = nix-command flakes
Temporarily:
nix --experimental-features 'nix-command flakes' run nixpkgs#git-cliff
Update your channels:
nix-channel --update
Or search for the package:
nix search nixpkgs git-cliff
Try the unstable channel if not found in stable.
Nix should not require sudo for most operations. If you get permission errors:
  1. Ensure Nix is properly installed:
    nix --version
    
  2. Check Nix daemon is running (multi-user install):
    sudo systemctl status nix-daemon
    
  3. Reinstall Nix if needed:
    sh <(curl -L https://nixos.org/nix/install) --daemon
    
If you’re getting an older version:
  1. Update channels:
    nix-channel --update
    
  2. Reinstall:
    nix-env -e git-cliff
    nix-env -iA nixpkgs.git-cliff
    
  3. Or use unstable channel:
    nix-channel --add https://nixos.org/channels/nixpkgs-unstable
    nix-channel --update
    nix-env -iA nixpkgs.git-cliff
    

Why Use Nix?

Reproducibility

Nix ensures exact reproducibility. The same configuration always produces the same result.

Declarative

Define your environment declaratively. Share configurations across machines.

Rollbacks

Easily rollback to previous configurations if something breaks.

Isolation

Packages are isolated. No conflicts between versions or dependencies.

Next Steps

Configuration

Configure git-cliff for your project

Nix Flakes

Learn about Nix Flakes

Build docs developers (and LLMs) love