SKILL.md
Installation
This guide covers installation for both macOS (using nix-darwin) and NixOS.
macOS Installation:
- [1. Create dotfiles directory](#1-craete-a-directory-that-matches-the-ghq-root)
- [2. Set up local nix.conf](#2-set-up-local-nixconf)
- [3. Install nix](#3-install-nix)
- [4. Set up global nix.conf](#4-set-up-global-nixconf)
- [5. Update nix channel](#5-update-nix-channel)
- [6. Apply home-manager config](#6-apply-home-manager-config)
- [7. Launch zsh](#7-launch-zsh)
- [8. Apply darwin config](#8-apply-darwin-config)
NixOS Installation:
- [NixOS Setup](#nixos-setup)
1. Craete a directory that matches the ghq root.
cd ~
mkdir -p git_repos/github.com/barleytea
cd git_repos/github.com/barleytea
git clone https://github.com/barleytea/dotfiles.git
2. Set up local nix.conf
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"
3. Install nix
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
4. Set up global nix.conf
- edit /etc/nix/nix.conf
sudo vi /etc/nix/nix.conf
- add the following to the file
extra-trusted-users = miyoshi_s
use-xdg-base-directories = true
- restart nix-daemon
Determinate Systems の Nix は modern launchd で管理されるため、kickstart を使う(unload/load は非対応)。
sudo launchctl kickstart -k system/systems.determinate.nix-daemon
5. Update nix channel
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update
6. Apply home-manager config
cd ~/git_repos/github.com/barleytea/dotfiles/darwin
nix flake update
nix run nixpkgs#home-manager -- switch --flake .#home --impure
7. Launch zsh
zsh
8. Apply darwin config
cd ~/git_repos/github.com/barleytea/dotfiles
make nix-darwin-apply
NixOS Setup
For NixOS systems, the installation process is different as NixOS manages the entire system configuration.
1. Create dotfiles directory
cd ~
mkdir -p git_repos/github.com/barleytea
cd git_repos/github.com/barleytea
git clone https://github.com/barleytea/dotfiles.git
2. Set up local nix.conf
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"
3. Copy hardware configuration
cd ~/git_repos/github.com/barleytea/dotfiles/nixos
sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix
4. Update system configuration
Edit nixos/configuration.nix and nixos/flake.nix to match your system.
5. Build and apply NixOS configuration
cd ~/git_repos/github.com/barleytea/dotfiles
sudo nixos-rebuild switch --flake ./nixos#desktop
This command applies both system and home-manager configurations.
6. Reboot
sudo reboot