Initial commit. Add configuration for NixOS Proxmox image
This commit is contained in:
commit
4193e65a04
14 changed files with 321 additions and 0 deletions
30
config/proxmox-vm/boot.nix
Normal file
30
config/proxmox-vm/boot.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
# A Proxmox VM BIOS boot configuration.
|
||||
# Sources for this configuration:
|
||||
# - a generated NixOS 23.05 configuration
|
||||
# - https://github.com/NixOS/nixpkgs/blob/069de7d3deafab651fd627c8f6d7e4c7b33087a2/nixos/modules/virtualisation/proxmox-image.nix#L241
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
boot = {
|
||||
initrd.availableKernelModules = [ "uas" "virtio_blk" "virtio_pci" ];
|
||||
initrd.kernelModules = [ ];
|
||||
# Not specified here:
|
||||
# - boot.kernelModules
|
||||
# - boot.extraModulePackages
|
||||
# Please specify as needed.
|
||||
|
||||
# Grow the root partition on boot.
|
||||
growPartition = true;
|
||||
|
||||
kernelParams = [ "console=ttyS0" ];
|
||||
|
||||
loader.grub = {
|
||||
enable = true;
|
||||
# TODO: Can we use "/dev/disk/by-label/nixos" here?
|
||||
device = "/dev/vda";
|
||||
};
|
||||
|
||||
loader.timeout = 0;
|
||||
};
|
||||
}
|
9
config/proxmox-vm/default.nix
Normal file
9
config/proxmox-vm/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./qemu-guest-agent.nix
|
||||
./storage.nix
|
||||
];
|
||||
}
|
9
config/proxmox-vm/qemu-guest-agent.nix
Normal file
9
config/proxmox-vm/qemu-guest-agent.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
# A Proxmox VM qemu-guest-agent configuration.
|
||||
# Sources for this configuration:
|
||||
# - https://github.com/NixOS/nixpkgs/blob/069de7d3deafab651fd627c8f6d7e4c7b33087a2/nixos/modules/virtualisation/proxmox-image.nix#L270
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.qemuGuest.enable = true;
|
||||
}
|
18
config/proxmox-vm/storage.nix
Normal file
18
config/proxmox-vm/storage.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
# A Proxmox VM storage configuration.
|
||||
# Sources for this configuration:
|
||||
# - a generated NixOS 23.05 configuration
|
||||
# - https://github.com/NixOS/nixpkgs/blob/069de7d3deafab651fd627c8f6d7e4c7b33087a2/nixos/modules/virtualisation/proxmox-image.nix#L260
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
autoResize = true;
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# Not specified here:
|
||||
# - swapDevices
|
||||
# If needed, manually specify it elsewhere.
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue