virgil/vfio
This commit is contained in:
parent
a4e5b89f0e
commit
f58d2f9232
5 changed files with 94 additions and 72 deletions
|
|
@ -1,11 +1,15 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod"];
|
||||
|
|
@ -13,13 +17,13 @@
|
|||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/48340a1a-5055-4d72-b83b-db57a3a7e230";
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/48340a1a-5055-4d72-b83b-db57a3a7e230";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/5292-3A27";
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/5292-3A27";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0022" "dmask=0022"];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, self, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
config,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
# ./disko.nix
|
||||
./hardware-configuration.nix
|
||||
./vfio.nix
|
||||
];
|
||||
|
||||
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
|
@ -28,7 +29,12 @@
|
|||
listen_addresses = ["127.0.0.1:53" "[::1]:53"];
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
qemuOvmf = true;
|
||||
};
|
||||
};
|
||||
services.zapret = {
|
||||
enable = true;
|
||||
params = [
|
||||
|
|
@ -137,5 +143,4 @@
|
|||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
services.displayManager.ly.enable = true;
|
||||
system.stateVersion = "25.05"; # Did you read the comment?
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk"];
|
||||
|
|
@ -13,13 +17,13 @@
|
|||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-partlabel/disk-nixos-root";
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-partlabel/disk-nixos-root";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-partlabel/disk-nixos-ESP";
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-partlabel/disk-nixos-ESP";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0022" "dmask=0022"];
|
||||
};
|
||||
|
|
|
|||
10
hosts/virgil/vfio.nix
Normal file
10
hosts/virgil/vfio.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
boot.kernelparams = ["amd_iommu=on"];
|
||||
boot.blacklistedKernelModules = ["nvidia" "nouveau"];
|
||||
boot.kernelModules = ["vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio"];
|
||||
boot.extraModprobeConfig = "options vfio-pci ids=10de:2705,10de:22bb";
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue