Skip to content

Instantly share code, notes, and snippets.

@djacu
Created November 12, 2022 07:31
Show Gist options
  • Select an option

  • Save djacu/9cd2f6982146c197e6e0cacdbeb3aee4 to your computer and use it in GitHub Desktop.

Select an option

Save djacu/9cd2f6982146c197e6e0cacdbeb3aee4 to your computer and use it in GitHub Desktop.
testing bootloader option in nixos virtualisation
{
description = "testing bootloader option in nixos virtualisation";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixos-generators.url = "github:nix-community/nixos-generators";
inputs.nixos-generators.inputs.nixpkgs.follows = "nixpkgs";
outputs = {
self,
nixpkgs,
flake-utils,
nixos-generators,
}:
flake-utils.lib.eachSystem [flake-utils.lib.system.x86_64-linux] (
system: let
pkgs = import nixpkgs {
inherit system;
};
test-vm = nixos-generators.nixosGenerate {
inherit system;
format = "vm";
modules =
[
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
({...}: {
config.virtualisation.graphics = false;
config.virtualisation.useBootLoader = true;
})
];
};
in {
packages = {
inherit test-vm;
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment