Improve Proxmox backup image generation

This commit is contained in:
yuri 2023-08-04 01:38:49 +02:00
parent 5c0f7dd6b8
commit 09abf3bee9
6 changed files with 37 additions and 9 deletions

View file

@ -58,11 +58,12 @@
[Unit]
Description=print-public-ssh-host-key.service
Before=getty@tty1.service
After=sshd.service
[Service]
Type=oneshot
ExecStart=/run/current-system/sw/bin/bash -c "/run/current-system/sw/bin/echo ----- ED25519 PUBLIC SSH HOST KEY -----\
&& /run/current-system/sw/bin/cut -d ' ' -f 1-2 /etc/ssh/ssh_host_ed25519_key.pub"
ExecStart=/run/current-system/sw/bin/bash -c "/run/current-system/sw/bin/echo -e \"----- ED25519 PUBLIC SSH HOST KEY -----\
\n$(/run/current-system/sw/bin/cut -d ' ' -f 1-2 /etc/ssh/ssh_host_ed25519_key.pub)\""
RemainAfterExit=no
StandardOutput=tty
'';

View file

@ -10,5 +10,26 @@
firewall.enable = true;
};
proxmox = {
qemuConf = {
ostype = "l26";
cores = 2;
memory = 1024;
bios = "seabios";
# Option not available in 23.05
# diskSize = "8096";
virtio0 = "local-zfs:base-disk-0,discard=on";
boot = "order=virtio0";
net0 = "tag=999,virtio=00:00:00:00:00:00,bridge=vmbr0,firewall=1";
agent = true;
};
qemuExtraConf = {
cpu = "cputype=host,flags=+aes";
onboot = 1;
machine = "q35";
template = 1;
};
};
system.stateVersion = "23.05";
}

View file

@ -1,5 +1,9 @@
{ ... }:
{
imports = [
./hardware-configuration.nix
];
# Enable console output on TTY1 and serial console
boot.kernelParams = [
"console=tty1"

View file

@ -1,11 +1,14 @@
{ config, lib, modulesPath, ... }:
{
# hardware-configuration.nix copied and adapted from the default configuration generated by nixos-generators
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot = {
initrd = {
# To use the VirtIO SCSI disks, add the "virtio_scsi" kernel module to availableKernelModules
availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "virtio_blk" ];
kernelModules = [ ];
};