Step-by-step installation guide for Nix and dotfiles setup including nix.conf configuration, channel updates, home-manager, and nix-darwin
This guide covers installation for both macOS (using nix-darwin) and NixOS.
macOS Installation:
NixOS Installation:
cd ~
mkdir -p git_repos/github.com/barleytea
cd git_repos/github.com/barleytea
git clone https://github.com/barleytea/dotfiles.git
mkdir -p "$HOME/.config/nix"
echo 'experimental-features = nix-command flakes' > "$HOME/.config/nix/nix.conf"
echo 'use-xdg-base-directories = true' >> "$HOME/.config/nix/nix.conf"
echo 'warn-dirty = false' >> "$HOME/.config/nix/nix.conf"
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm
source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
sudo vi /etc/nix/nix.conf
extra-trusted-users = miyoshi_s
use-xdg-base-directories = true
Determinate Systems ㎠Nix 㯠modern launchd ã§įŽĄįããããããkickstart ãäŊŋãīŧunload/load ã¯é寞åŋīŧã
sudo launchctl kickstart -k system/systems.determinate.nix-daemon
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update
cd ~/git_repos/github.com/barleytea/dotfiles/darwin
nix flake update
nix run nixpkgs#home-manager -- switch --flake .#home --impure
zsh
cd ~/git_repos/github.com/barleytea/dotfiles
make nix-darwin-apply
For NixOS systems, the installation process is different as NixOS manages the entire system configuration.
cd ~
mkdir -p git_repos/github.com/barleytea
cd git_repos/github.com/barleytea
git clone https://github.com/barleytea/dotfiles.git
mkdir -p "$HOME/.config/nix"
echo 'experimental-features = nix-command flakes' > "$HOME/.config/nix/nix.conf"
echo 'use-xdg-base-directories = true' >> "$HOME/.config/nix/nix.conf"
echo 'warn-dirty = false' >> "$HOME/.config/nix/nix.conf"
cd ~/git_repos/github.com/barleytea/dotfiles/nixos
sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix
Edit nixos/configuration.nix and nixos/flake.nix to match your system.
cd ~/git_repos/github.com/barleytea/dotfiles
sudo nixos-rebuild switch --flake ./nixos#desktop
This command applies both system and home-manager configurations.
sudo reboot