mirror of
https://github.com/mvaldes14/dotfiles-nix.git
synced 2026-09-25 02:30:51 +00:00
No description
- Nix 93.3%
- CSS 6.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| config | ||
| mac | ||
| modules | ||
| nixos | ||
| wsl | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
Nix Configuration
Unified flake-based Nix configuration for macOS (home-manager only), NixOS, and WSL.
Structure
mac/- macOS home-manager configurationnixos/- NixOS system configurationwsl/- WSL NixOS configurationmodules/- Shared configuration modules (git, zsh, tmux, shell, nvim)flake.nix- Root flake managing all systems
Installation
macOS (Home Manager)
-
Clone the repo:
git clone <repo-url> ~/git/dotfiles-nix cd ~/git/dotfiles-nix -
Install home-manager if not already installed:
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager nix-channel --update nix-shell '<home-manager>' -A install -
Apply configuration:
home-manager switch --flake .#"mvaldes@mac"
NixOS
-
Clone the repo:
git clone <repo-url> ~/git/dotfiles-nix -
Create symlink to
/etc/nixos:sudo ln -s ~/git/dotfiles-nix /etc/nixos -
Test the configuration:
sudo nixos-rebuild test --flake /etc/nixos#nixos -
If successful, apply permanently:
sudo nixos-rebuild switch --flake /etc/nixos#nixos
WSL
-
Clone the repo:
git clone <repo-url> ~/git/dotfiles-nix -
Create symlink to
/etc/nixos:sudo ln -s ~/git/dotfiles-nix /etc/nixos -
Test the configuration:
sudo nixos-rebuild test --flake /etc/nixos#wsl -
If successful, apply permanently:
sudo nixos-rebuild switch --flake /etc/nixos#wsl
Usage
macOS
# Update configuration
cd ~/git/dotfiles-nix
home-manager switch --flake ".#mvaldes@mac" --impure
# Update flake inputs
nix flake update
# Check what will change
home-manager build --flake ".#mvaldes@mac"
NixOS
# Update configuration
sudo nixos-rebuild switch --flake /etc/nixos#nixos
# Update flake inputs
cd /etc/nixos && sudo nix flake update
# Test configuration without applying
sudo nixos-rebuild test --flake /etc/nixos#nixos
WSL
# Update configuration
sudo nixos-rebuild switch --flake /etc/nixos#wsl
# Update flake inputs
cd /etc/nixos && sudo nix flake update
# Test configuration without applying
sudo nixos-rebuild test --flake /etc/nixos#wsl
Notes
- Username: Default username is
mvaldes- update in each system's configuration file if needed - macOS External Dependencies: The Mac config references dotfiles at
~/git/dotfiles/. To build without--impure, you'll need to either:- Move those files into this repo under a
dotfiles/directory - Use
--impureflag:home-manager switch --flake .#"mvaldes@mac" --impure
- Move those files into this repo under a
- Shared Modules: All systems share common configuration modules for git, zsh, tmux, and shell programs