sudo apt install curl git
git clone https://github.com/rkalnins/nix-config.git
curl -L https://nixos.org/nix/install | sh
. /home/rmk/.nix-profile/etc/profile.d/nix.sh
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update
# simply export for now, take care later to avoid polluting current configs
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
nix-shell '<home-manager>' -A install
# add experimental features to ~/.config/nix/nix.conf
mkdir ~/.config/nix && touch ~/.config/nix/nix.conf
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
rm -rf ~/.config/nixpkgs
ln -s ~/nix-config ~/.config/nixpkgs
home-manager switch
Make sure using 64-bit kernel. Using 32-bit was causing all kinds of rebuilds and issues.
Then, if there's a conflict,
sudo rm /nix/store/<hash>-nix-2.5.1/share/zsh/site-functions/_nix
sudo rm /nix/store/<hash>-home-manager-path/share/zsh/site-functions/_nix
# run switch again
home-manager switch
Might have to add export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
to somewhere
From UChicago instructions:
- Create new network using VirtualBox > Tools
- Add host-only network adapter to VM (Settings > Network), set name to new network created in step 1
- Setup VM:
sudo apt update
sudo apt install openssh-server
# check with `nmcli con show` for correct connection first
nmcli con mod "Wired connection 2" ipv4.method "manual" ipv4.addresses "192.168.56.101/24"
sudo apt update
sudo apt install openssh-server
sudo apt shutdown -h now
Add entry to port forwarding list for VM (Settings > Network > NAT adapter > Advanced > Port forwarding)
Host: 127.0.0.1
Host port: xxxx
VM port: 22
- Package these instructins into some kind of deploy script
Thanks to Jeff Hutchison (jhh) for reference with nvim configuration.