Dotfiles managed with Nix flakes, Home Manager, and nix-darwin for macOS.
Legacy stow setup still available for Linux/non-Nix environments.
# Clone and rebuild
git clone https://github.com/usrrname/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
sudo darwin-rebuild switch --flake .#mac-jenc# Clone the repo
git clone https://github.com/usrrname/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
# Copy hardware configuration from existing install
sudo cp /etc/nixos/hardware-configuration.nix hosts/nixos-box/
# Rebuild
sudo nixos-rebuild switch --flake .#nixos-box# Install Nix (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# Clone and apply
git clone https://github.com/usrrname/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
home-manager switch --flake .#fedora-mini# Check if Nix is already installed
which nix && nix --version
# If Nix is not installed:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# Source Nix profile (if home-manager command not found)
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
# Install home-manager (if not available)
nix profile add home-manager
# Clone and apply
git clone https://github.com/usrrname/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
home-manager switch --flake .#pi-nascd ~/.dotfiles
git pull
# macOS
sudo darwin-rebuild switch --flake .#mac-jenc
# NixOS
sudo nixos-rebuild switch --flake .#nixos-box
# Fedora/Ubuntu/Debian
home-manager switch --flake .#fedora-mini├── flake.nix # Nix flake entry point
├── hosts/
│ ├── mac-jenc/ # macOS system config (nix-darwin)
│ ├── nixos-box/ # NixOS system config
│ ├── fedora-mini/ # Fedora/Ubuntu/Debian (standalone HM)
│ └── pi-nas/ # Raspberry Pi 4B NAS (standalone HM)
├── home/ # Shared Home Manager config (packages, programs)
├── modules/ # Nix modules (bash, claude, direnv, gh, nvim, opencode, tmux)
├── common/ # Stow packages (agents)
└── macos/ # macOS-specific stow packages (act)
- System packages: git, curl, wget, ripgrep, fzf, neovim, go, nodejs, pnpm, yarn, bun, etc.
- Homebrew casks (macOS only): wezterm, obsidian, 1password, orbstack, slack, spotify, firefox, brave-browser, tailscale, gpg-suite
- Programs: git, ssh, bash, zsh, direnv, gh, tmux, starship, vim, nvim (LazyVim), opencode, claude
- Configs: SSH config, Wezterm, nvim/LazyVim, bash aliases, shell aliases, environment variables, Claude Code settings/skills/hooks
agents(common) - Cloudflare reference docs and skills
To stow:
./stow-dotfiles.shverdaccio,husky,zed,mc(Midnight Commander),iterm2
Edit home/default.nix or modules/:
# Example: add a program
programs.someapp = {
enable = true;
# ... settings
};
# Example: link a config file
xdg.configFile."someapp/config.toml".source = ./someapp/config.toml;Then rebuild:
sudo darwin-rebuild switch --flake .#mac-jenc# 1. Create the directory structure
mkdir -p common/someapp/.config/someapp
# 2. Copy your config
cp -r ~/.config/someapp/* common/someapp/.config/someapp/
# 3. Remove the original
rm -rf ~/.config/someapp
# 4. Add to COMMON array in stow-dotfiles.sh
# 5. Run stow
./stow-dotfiles.shEdit hosts/mac-jenc/default.nix:
homebrew = {
brews = [
"some-formula"
];
casks = [
"some-app"
];
};Then rebuild.
Check what's installed:
nix profile list
brew listVerify configs:
ssh -G hostname # Check SSH config
nvim --version # Check neovimRollback:
# List generations
darwin-rebuild --list-generations
# Rollback to previous
sudo darwin-rebuild switch --rollbackDry run:
nix build .#darwinConfigurations.mac-jenc.system --dry-runBuild plugins
nvim --headless -c "Lazy sync" -c "qa"Force clean and reinstall LazyVim plugins
nvim --headless -c "lua require('lazy').clean()" -c "lua require('lazy').sync()" -c "qa"Refresh and sync plugins (interactive)
:Lazy clean
:Lazy sync| Keymap | Description |
|---|---|
<leader>oo |
Toggle terminal |
<leader>oa |
Ask about file/selection |
<leader>oc |
Execute action |
<leader>os |
Send selection (visual) |
<leader>oe |
Explain code |
<leader>or |
Review code |
go / goo |
Add range/line |
<S-Up/Down> |
Scroll |
Security: Background agents read-only; bash requires confirmation; sessions excluded from git
op://<vault-name>/<item-name>/[section-name/]<field-name>Usage: op read <reference> [flags]
Examples:
Print the secret saved in the field 'password', on the item 'db', in the vault 'app-prod':
op read op://app-prod/db/password
Use a secret reference with a query parameter to retrieve a one-time
password:
op read "op://app-prod/db/one-time password?attribute=otp"
Use a secret reference with a query parameter to get an SSH key's private key in the OpenSSH format:
op read "op://app-prod/ssh key/private key?ssh-format=openssh"
Save the SSH key found on the item 'ssh' in the 'server' vault
as a new file 'key.pem' on your computer:
op read --out-file ./key.pem op://app-prod/server/ssh/key.pem
Use 'op read' in a command with secret references in place of plaintext secrets:
docker login -u $(op read op://prod/docker/username) -p $(op read op://prod/docker/password)