Versioning $HOME
. Contains nix configs, dotfiles, scripts.
Config for NixOS only.
- Do the whole NixOS install thing, and in another machine put together a basic config in the
flake.nix
- Clone this repo in the home folder:
git clone https://github.com/f-f/home.git ~
- Copy out all the content:
cd home && find . -maxdepth 1 -exec mv {} .. \;
- Fetch everything:
cd ~ && git submodule update --init --recursive --remote
- Integrate into the config for this hostname the autogenerated
hardware-configuration.nix
andconfiguration.nix
files, thennixos-switch
At this point is should be possible to ssh from another machine, so the rest can be done remotely:
- Add the fzf module:
mkdir -p .zprezto/contrib && cd $_ git clone https://github.com/gpanders/fzf-prezto.git fzf cd fzf git submodule update --init
- Make a new ssh key for github:
ssh-keygen -t ed25519 -C "$USER+github@$(hostname)" -f github
, add it as deploy key here - Replace this repo remote from http to git:
git remote set-url origin [email protected]:f-f/home.git
It's a little more involved to bootstrap Nix on macOS, but it can be done. After cloning the stuff:
# In case of M1
softwareupdate --install-rosetta
# Install brew and nix
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
curl -L https://nixos.org/nix/install | sh
# Set hostname
export NEW_HOSTNAME=foo
sudo scutil --set HostName $NEW_HOSTNAME
sudo scutil --set LocalHostName $NEW_HOSTNAME
sudo scutil --set ComputerName $NEW_HOSTNAME
# At this point, edit nixos-config/flake.nix to add the new machine
# Then:
nixos-switch
# Note: it will complain at first that the nix command requires experimental features, so that will require executing the script by hand adding the right flags, but after that it's all fine
Useful reads: