Skip to content
yk4toPublic

About

My dotfiles with Nix and Home Manager

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

1,424 Commits

Folders and files

Repository files navigation

dotfiles

NixOS Unstable macOS Golden Gate CI

Hosts

See ./hosts for details.

Usage

Rebuilds and garbage collection are done with nh. The flake path comes from NH_FLAKE, and the host is detected from the hostname.

nh darwin switch           # macOS
nh os switch               # NixOS
nh clean all --keep 5      # garbage collect (also runs weekly)

Run nh as your own user, not with sudo. nh builds as you and calls sudo only for activation.

Private inputs

Some flake inputs are private GitHub repositories, so Nix needs a GitHub token to fetch them. After the first switch, agenix places it at /run/agenix/nix-github-token and nix.conf includes it.

On a new machine, the token is not there yet, so pass one from the GitHub CLI for the first switch. nh is unavailable then too, so use the plain commands. darwin-rebuild evaluates the flake as root, so build it as your user first:

nix run nixpkgs#gh -- auth login
export NIX_CONFIG="access-tokens = github.com=$(nix run nixpkgs#gh -- auth token)"

# macOS
nix build .#darwinConfigurations.<host>.system
sudo darwin-rebuild switch --flake .#<host>

# NixOS (`--sudo` only elevates activation)
nixos-rebuild switch --sudo --flake .#<host>

The nix-github-token secret holds one line, access-tokens = github.com=<token>, with a fine-grained token that can read the private repositories. CI reads the same kind of token from the NIX_GITHUB_TOKEN repository secret.

Stacks

Base (shared on macOS and Linux)

Managed by Nix and Home Manager
Shell Zsh
Shell Prompt Pure
Terminal Emulator Ghostty
Editor VSCode, Neovim
Coding Agent Claude Code, Codex
Font JetBrains Mono, UDEV Gothic 🇯🇵
Color Scheme Catppuccin Mocha
Nix Formatter Alejandra
Nix CLI Helper nh, nix-search-tv + television
Secret Management ragenix
System Monitor bottom
Git-related Tools koji, Lazygit, delta, ghq
Modern CLI Tools zoxide, eza, bat, Atuin
Other CLI Tools direnv, hyperfine, ...
VPN Tailscale

Neovim

Managed by Nixvim
UI Snacks.nvim, lualine.nvim
Completion blink.cmp + copilot.lua
Formatter conform.nvim with alejandra, biome, prettier, ...

macOS

Managed by nix-darwin
GUI Apps Manager nix-homebrew, Homebrew Cask, mas
Container System OrbStack (Docker replacement)

Linux

NixOS
WM + Shell Niri + Noctalia
Input Method Fcitx5 + Hazkey
Self-Hosted Services FreshRSS, Memos, Karakeep, homepage
Private Network Cloudflare Tunnel
Secure Boot Lanzaboote

References

Inspired by

About

My dotfiles with Nix and Home Manager

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages