Skip to content

Instantly share code, notes, and snippets.

@asconix
Created May 30, 2018 08:03
Show Gist options
  • Save asconix/5a489570e24b3d92e97cf40e46b918e2 to your computer and use it in GitHub Desktop.
Save asconix/5a489570e24b3d92e97cf40e46b918e2 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
which vagrant >/dev/null
which git >/dev/null
echo ">>> Cloning/pulling nixpkgs Git repository ..."
git clone https://github.com/nixos/nixpkgs nixpkgs || (cd nixpkgs; git pull -f; cd ..)
echo ">>> Creating and configuring VM according to Vagrantfile ..."
vagrant up || true
echo ">>> Inserting custom installer scripts into nixpgs ..."
cd nixpkgs/nixos/modules/installer/cd-dvd
cp ../../../../../custom/installation-cd-minimal.nix .
cp ../../../../../custom/boot.nix .
cp ../../../../../custom/base.nix .
cp ../../../../../custom/i18n.nix .
cp ../../../../../custom/users.nix .
cp ../../../../../custom/networking.nix .
cp ../../../../../custom/packages.nix .
cp ../../../../../custom/services.nix .
cp ../../../../../custom/desktop.nix .
cp ../../../../../custom/emacs.nix .
cp ../../../../../custom/audio.nix .
cp ../../../../../custom/virtualization.nix .
cp ../../../../../custom/dotfiles.nix .
cp -r ../../../../../custom/hosts .
ln -sf hosts/notebooks/shodan.nix host.nix
cp -r ../../../../../custom/secrets .
cp -r ../../../../../custom/dotfiles .
cd -
echo ">>> TODO ..."
vagrant ssh -c 'cd /vagrant/nixpkgs/nixos; nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd-dvd/installation-cd-minimal.nix default.nix && cp -f result/iso/*.iso /vagrant/ && sync'
vagrant halt
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment