# NIX_PATH=nixpkgs=channel:nixos-19.03:nixos-config=$PWD/digitalocean2.nix nix-build '<nixpkgs/nixos>' -A config.system.build.diskImage

{ config, pkgs, lib, ... }: {
  imports = [
    <nixpkgs/nixos/modules/profiles/minimal.nix>
    <nixpkgs/nixos/modules/profiles/headless.nix>
    <nixpkgs/nixos/modules/profiles/qemu-guest.nix>
  ];

  fileSystems."/" = {
    device = "/dev/disk/by-label/nixos";
    fsType = "ext4";
    autoResize = true;
  };

  boot.loader.grub.device = "/dev/sda";
  boot.growPartition = true;

  system.build.diskImage = import <nixpkgs/nixos/lib/make-disk-image.nix> {
    inherit pkgs lib config;

    diskSize = 1000;

    configFile = ./digitalocean2.nix;
  };

  hardware = {
    enableRedistributableFirmware = lib.mkForce false;
    opengl.driSupport = lib.mkForce false;
  };
}