Last active
January 17, 2022 15:21
-
-
Save stammw/d0ce886c88779fa921fd142ea962dd67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/focal64" | |
config.vm.disk :disk, size: "100GB", primary: true | |
config.vm.synced_folder "empty", "/vagrant", type: "rsync", rsync__exclude: [ ".git/", "h3/target", "quinn-interop/target" ] | |
config.vm.synced_folder "dotfiles", "/home/jcbegue/.config/nixpkgs", type: "rsync", rsync__exclude: [ ".git/", "h3/target", "quinn-interop/target" ] | |
config.vm.provider "virtualbox" do |vb| | |
# Display the VirtualBox GUI when booting the machine | |
vb.gui = true | |
# Customize the amount of memory on the VM: | |
vb.memory = "2048" | |
end | |
config.vm.provision "shell", inline: <<-SHELL | |
USR=jcbegue | |
SUDO="sudo -iu ${USR}" | |
apt-get update | |
apt-get install -y \ | |
git \ | |
bluez \ | |
vim \ | |
curl \ | |
wget | |
#ubuntu-desktop | |
echo -e "toto\ntoto\n\n\n\n\n\nY" | (adduser --quiet ${USR}) | |
usermod -aG users,audio,video,sudo,adm ${USR} | |
sudo chown -R ${USR}:${USR} /home/${USR}/ | |
echo "${USR} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | |
curl -L https://nixos.org/nix/install -o /tmp/install_nix.sh | |
${SUDO} sh /tmp/install_nix.sh --daemon | |
${SUDO} nix-channel --add https://nixos.org/channels/nixos-21.11 nixpkgs | |
${SUDO} nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz home-manager | |
${SUDO} nix-channel --update | |
echo 'export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH' >> /home/${USR}/.profile | |
${SUDO} nix-shell '<home-manager>' -A install | |
${SUDO} ln -sf /home/${USR}/.config/nixpkgs/home-ubuntu.nix /home/${USR}/.config/nixpkgs/home.nix | |
${SUDO} home-manager switch -b backup | |
chown ${USR}: /home/${USR}/.profile | |
# maybe need to rm /nix/store/${HASH}-home-manager-path/share/zsh/site-functions/_nix | |
sudo usermod --shell /home/${USR}/.nix-profile/bin/zsh ${USR} | |
${SUDO} git clone --depth 1 https://github.com/hlissner/doom-emacs /home/${USR}/.emacs.d | |
yes | ${SUDO} /home/${USR}/.emacs.d/bin/doom install | |
rustup | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment