mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-09 19:03:36 +02:00
feat: new host - idols-akane, hardens VFAT /boot mounts (#245)
* feat: new host - idols-akane * fix: missing efi files * fix: efi partition - permission issue
This commit is contained in:
@@ -1,41 +1,17 @@
|
||||
{
|
||||
modulesPath,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
##############################################################################
|
||||
#
|
||||
# Template for KubeVirt's VM, mainly based on:
|
||||
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/kubevirt.nix
|
||||
#
|
||||
# We write our hardware-configuration.nix, so that we can do some customization more easily.
|
||||
#
|
||||
# the url above is used by `nixos-generator` to generate the KubeVirt's qcow2 image file.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
imports = [
|
||||
"${toString modulesPath}/profiles/qemu-guest.nix"
|
||||
./qemu-guest.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
# disable backups in the VM
|
||||
services.btrbk.instances = lib.mkForce { };
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
autoResize = true;
|
||||
};
|
||||
|
||||
boot.growPartition = true;
|
||||
boot.kernelParams = [ "console=ttyS0" ];
|
||||
boot.loader.grub.device = "/dev/vda";
|
||||
|
||||
services.qemuGuest.enable = true; # qemu-guest-agent
|
||||
services.openssh.enable = true;
|
||||
# we configure the host via nixos itself, so we don't need the cloud-init
|
||||
services.cloud-init.enable = lib.mkForce false;
|
||||
systemd.services."serial-getty@ttyS0".enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
35
modules/nixos/server/qemu-guest.nix
Normal file
35
modules/nixos/server/qemu-guest.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
modulesPath,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
##############################################################################
|
||||
#
|
||||
# Template for KubeVirt's VM, mainly based on:
|
||||
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/kubevirt.nix
|
||||
#
|
||||
# We write our hardware-configuration.nix, so that we can do some customization more easily.
|
||||
#
|
||||
# the url above is used by `nixos-generator` to generate the KubeVirt's qcow2 image file.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
imports = [
|
||||
"${toString modulesPath}/profiles/qemu-guest.nix"
|
||||
];
|
||||
|
||||
config = {
|
||||
# disable backups in the VM
|
||||
services.btrbk.instances = lib.mkForce { };
|
||||
|
||||
boot.growPartition = true;
|
||||
boot.kernelParams = [ "console=ttyS0" ];
|
||||
boot.loader.grub.device = "/dev/vda";
|
||||
|
||||
services.qemuGuest.enable = true; # qemu-guest-agent
|
||||
services.openssh.enable = true;
|
||||
# we configure the host via nixos itself, so we don't need the cloud-init
|
||||
services.cloud-init.enable = lib.mkForce false;
|
||||
systemd.services."serial-getty@ttyS0".enable = true;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user