Skip to content

marmos91/dotfiles

Repository files navigation

marmos91 dotfiles

Cross-platform dotfiles for macOS and Linux (Ubuntu/GNOME), powered by Nix, Home Manager, and Stow.

result

Highlights

Installation

Clone the repository:

git clone https://github.com/marmos91/dotfiles.git ~/.dotfiles
cd ~/.dotfiles

Run the install script:

chmod +x install.sh && ./install.sh

Options

Flag Description
--shell <shell> Set default shell (zsh or bash). Default: zsh
--shell-only Only change the default shell, skip full installation
--hostname <name> Set hostname (macOS only). Default: amaterasu
--no-stow Skip stowing dotfiles
--skip-nix Skip Nix installation (use existing Nix)
--no-1password Skip 1Password installation (Linux only)
--help Show help message

Examples:

./install.sh                          # Full install with defaults
./install.sh --shell bash             # Install with bash as default shell
./install.sh --hostname myhost        # Install with custom hostname (macOS)
./install.sh --shell-only             # Only set zsh as default (skip install)
./install.sh --no-stow --skip-nix     # Only apply Nix configuration
./install.sh --no-1password           # Skip 1Password installation on Linux

What it does

  1. Install Stow (via Homebrew on macOS, apt/dnf/pacman on Linux)
  2. Install Nix using the Determinate Systems installer
  3. Install 1Password via official apt repository (Linux only, for SSH agent)
  4. Symlink dotfiles to your home directory via Stow
  5. Apply the appropriate Nix configuration:
    • macOS: nix-darwin + home-manager
    • Linux: standalone home-manager
  6. Set the default shell (Linux only)

1Password SSH Agent Setup

This configuration uses 1Password for SSH key management and Git commit signing. After installation:

  1. Open 1Password and sign in to your account
  2. Enable SSH Agent: Go to Settings → Developer and enable:
    • "Use the SSH agent"
    • "Integrate with 1Password CLI"
  3. Add your SSH key to 1Password (if not already there)
  4. Authorize the key for Git signing when prompted

The git configuration automatically uses 1Password's op-ssh-sign for commit signing:

  • macOS: /Applications/1Password.app/Contents/MacOS/op-ssh-sign
  • Linux: /opt/1Password/op-ssh-sign

To verify it's working:

# Test SSH agent
ssh-add -l

# Test commit signing
echo "test" | git commit --allow-empty -m "Test signed commit"
git log --show-signature -1

Note: On macOS, install 1Password from the Mac App Store or official download.

Post-install

Restart your terminal or log out/in for all changes to take effect.

Uninstallation

To completely remove the dotfiles and Nix:

chmod +x uninstall.sh && ./uninstall.sh

Options

Flag Description
--dotfiles-only Only unstow dotfiles, keep Nix and packages
--keep-nix Keep Nix installed, remove dotfiles and config
--keep-stow Keep stow installed
--keep-1password Keep 1Password installed (Linux only)
-y, --yes Skip confirmation prompt
--help Show help message

Examples:

./uninstall.sh                    # Full uninstall (interactive)
./uninstall.sh -y                 # Full uninstall (no confirmation)
./uninstall.sh --dotfiles-only    # Only remove dotfile symlinks
./uninstall.sh --keep-nix         # Remove dotfiles but keep Nix
./uninstall.sh --keep-1password   # Keep 1Password installed on Linux

What it removes

  1. Dotfile symlinks (unstow)
  2. Stow (unless --keep-stow)
  3. 1Password app and CLI (Linux, unless --keep-1password)
  4. Home-manager/nix-darwin configuration
  5. Nix and all packages (unless --keep-nix)
  6. Nix cache files

Warning: Full uninstall is destructive and will remove all Nix-installed packages.

Usage

After installation, use the rebuild command to apply configuration changes:

rebuild

This automatically detects your platform and runs the appropriate command:

  • macOS: darwin-rebuild switch --flake ~/.config/nix-darwin
  • Linux: home-manager switch --flake ~/.config/nix-darwin

Structure

~/.dotfiles/
├── .config/
│   ├── nix-darwin/          # Nix configuration
│   │   ├── flake.nix        # Main flake (inputs & outputs)
│   │   ├── system/          # macOS system config (nix-darwin)
│   │   └── home/            # User config (home-manager)
│   │       ├── catppuccin.nix      # Global theme config
│   │       ├── programs/
│   │       │   ├── desktop/        # GNOME settings (Linux)
│   │       │   ├── terminal/       # ghostty, kitty, tmux, starship
│   │       │   ├── shell/          # zsh, fish
│   │       │   ├── git/            # git, lazygit, delta
│   │       │   └── utilities/      # bat, fzf, btop, k9s, etc.
│   │       └── development/        # Language toolchains
│   └── nvim/                # Neovim configuration
├── install.sh               # Installation script
├── uninstall.sh             # Uninstallation script
└── README.md

Platform-specific features

macOS

  • Homebrew casks for GUI applications
  • System preferences (Dock, Finder, keyboard)
  • AeroSpace window manager

Linux (Ubuntu/GNOME)

  • GNOME settings via dconf (keyboard repeat, trackpad, dark mode)
  • Dash-to-Dock extension with auto-hide
  • GNOME Terminal with Catppuccin theme
  • Window buttons on left (macOS-style)

Customization

Key files to customize:

Purpose File
Theme (flavor/accent) home/catppuccin.nix
Shell aliases home/programs/shell/zsh.nix
Git config home/programs/git/config.nix
Neovim plugins .config/nvim/lua/plugins/
Terminal settings home/programs/terminal/
GNOME settings home/programs/desktop/gnome.nix
Secrets management home/secrets/ (README)

License

MIT LICENSE

About

marmos91 personal dotfiles repository

Topics

Resources

License

Stars

Watchers

Forks