nixos-riscv/builders/make-nvme.nix

31 lines
837 B
Nix
Raw Normal View History

2023-06-24 14:56:10 +02:00
{ config, lib, pkgs, modulesPath, ... }:
with lib;
{
system.build.nvmeImage = import "${modulesPath}/../lib/make-disk-image.nix" {
inherit config lib pkgs;
diskSize = 8*1024; # megabytes
# TODO: zstd
format = "raw"; # one of qcow2, qcow2-compressed, vdi, vpc, raw.
installBootLoader = true;
partitionTableType = "efi";
configFile = pkgs.writeText "configuration.nix" ''
{
imports = [ <./machine-config.nix> ];
}
'';
};
boot.growPartition = true;
boot.initrd.kernelModules = [ "nvme" ];
/** /
boot.loader.grub.efiSupport = true;
boot.loader.grub.efiInstallAsRemovable = true;
boot.loader.grub.device = "nodev";
/**/
fileSystems."/boot" = { device = "/dev/nvme0n1p1"; fsType = "vfat"; };
fileSystems."/" = { device = "/dev/nvme0n1p2"; fsType = "ext4"; };
}