diff --git a/templates/default/Vagrantfile b/templates/default/Vagrantfile new file mode 100644 index 0000000..da41397 --- /dev/null +++ b/templates/default/Vagrantfile @@ -0,0 +1,32 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.box = "nixos" + + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false + + # config.vm.network "forwarded_port", guest: 80, host: 80 + # config.vm.network "forwarded_port", guest: 443, host: 443 + config.vm.network "private_network", ip: "192.168.56.44", auto_config: false + # config.vm.network "public_network" + + config.vm.provider "virtualbox" do |vb| + # Display the VirtualBox GUI when booting the machine + vb.gui = false + + # Customize the amount of memory on the VM: + # vb.memory = 4 * 1024 + + # vb.cpus = 2; + end + + config.vm.provision "shell", inline: <<-SHELL + # nix develop 'nixpkgs#git' --command "sudo nixos-rebuild switch --flake /vagrant" + nix-shell -p git --command "sudo nixos-rebuild switch --flake /vagrant" + SHELL + end + \ No newline at end of file diff --git a/templates/default/flake.nix b/templates/default/flake.nix new file mode 100644 index 0000000..3033cf9 --- /dev/null +++ b/templates/default/flake.nix @@ -0,0 +1,25 @@ +{ + description = "A very basic flake"; + + inputs = { + sbrow.url = "github:sbrow/nix"; + }; + + outputs = { self, nixpkgs, sbrow }: { + nixosModules.default = { config, ... }: { + config = { + /* Your config here */ + }; + }; + + # A Vagrant box for testing + nixosConfigurations.vagrant = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + (nixpkgs + "/nixos/modules/virtualisation/virtualbox-image.nix") + sbrow.nixosModules.vagrant + self.nixosModules.default + ]; + }; + }; +}