Personal NixOS, nix-darwin, Ansible, chezmoi, and Bluefin setup
Important
This is my personal setup
git clone https://github.com/FlameFlag/nix-dotfiles.git ~/nix-dotfiles
cd ~/nix-dotfilessudo nixos-generate-config --show-hardware-config > hosts/linux/hardware-configuration.nix
sudo nixos-rebuild switch --flake .#lenovo-legion
nix run .#immutable-activate -- --backend auto --flake "$PWD" --reset-containers
chezmoi init --source "$PWD/dotfiles"
chezmoi apply --refresh-externals=always --forcenix run nix-darwin -- switch --flake .#FlameFlags-Mac-mini
sudo darwin-rebuild switch --flake .#FlameFlags-Mac-mini
ansible-playbook ansible/playbooks/userland.yml
chezmoi init --source "$PWD/dotfiles"
chezmoi apply --refresh-externals=always --force./ansible/bootstrap.sh
env CGO_ENABLED=0 go run ./cmd/immutable-activate --backend auto --flake "$PWD" --reset-containers
chezmoi init --source "$PWD/dotfiles"
chezmoi apply --refresh-externals=always --forceHost bits:
ansible-playbook ansible/playbooks/host.ymlSpectrum is the Bluefin host path: bootc image first, userland after reboot.
Published image:
https://github.com/FlameFlag/nix-dotfiles/pkgs/container/nix-dotfiles-bluefin
sudo bootc switch ghcr.io/flameflag/nix-dotfiles-bluefin:latest
systemctl rebootAfter reboot:
git clone https://github.com/FlameFlag/nix-dotfiles.git ~/nix-dotfiles
cd ~/nix-dotfiles
env CGO_ENABLED=0 go run ./cmd/immutable-activate --backend auto --flake "$PWD" --reset-containers
chezmoi init --source "$PWD/dotfiles"
chezmoi apply --refresh-externals=always --force
ansible-playbook ansible/playbooks/host.ymlLocal image instead of GHCR:
sudo podman build --pull=newer --tag localhost/nix-dotfiles-bluefin:local --file spectrum/Containerfile .
sudo bootc switch --transport containers-storage localhost/nix-dotfiles-bluefin:local
systemctl rebootAfter changing spectrum/ or anything copied by spectrum/Containerfile, rebuild the same local tag and upgrade into it:
sudo podman build --pull=newer --tag localhost/nix-dotfiles-bluefin:local --file spectrum/Containerfile .
sudo bootc upgrade
systemctl rebootUse bootc switch when changing to a different image reference, such as first moving from stock Bluefin to Spectrum or moving from the local image to GHCR. Use bootc upgrade after rebuilding or republishing the image reference that the machine already tracks.
UBlue automatic updates do not run Ansible. Use update for userland, and run ansible-playbook ansible/playbooks/host.yml for host bits.
update
rebuild
check
czanix fmt
nix flake check
ansible-playbook --syntax-check ansible/playbooks/bootstrap.yml
ansible-playbook --syntax-check ansible/playbooks/userland.yml
ansible-playbook --syntax-check ansible/playbooks/host.yml
ansible-playbook --syntax-check ansible/playbooks/site.yml
ansible-lint ansible
yamllint .
docker compose build
docker compose run --rm alpine
docker compose run --rm fedora-44
docker compose --profile nix-profile build nix-profile
docker compose --profile nix-profile run --rm nix-profile