nixos-config/machines/hyper/configuration.nix

64 lines
1.3 KiB
Nix

# SPDX-FileCopyrightText: 2020-2024 Simon Bruder <simon@sbruder.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
{ lib, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
./network.nix
../../modules
];
networking.hostName = "hyper";
system.stateVersion = "23.11";
virtualisation.libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
ovmf.enable = true;
};
};
environment.systemPackages = with pkgs; [
virtiofsd
];
fileSystems = {
"/data/shared" = {
device = "/dev/hyper-vg/shared";
fsType = "btrfs";
options = [ "discard=async" "noatime" "compress=zstd" ];
};
};
#environment.etc."libvirt/hooks/qemu".source = pkgs.writeShellScript "libvirt-qemu-hook" ''
# set -euo pipefail
# object="$1"
# operation="$2"
# sub_operation="$3"
# extra_arg="$4"
# intel_arc_reset_hack_guests=(
# "virtdows"
# )
# case "$operation" in
# start)
# if [ "$sub_operation" = "begin" ]; then
# for guest in "''${intel_arc_reset_hack_guests[@]}"; do
# if [ "$guest" = "$object" ]; then
# echo "Applied intel arc reset hack for guest $guest"
# echo > /sys/bus/pci/devices/0000:08:00.0/reset_method
# fi
# done
# fi
# ;;
# esac
#'';
}