Compare commits

...

2 commits

Author SHA1 Message Date
ee4e468012 nijika: change hardware graphics drivers 2025-05-04 20:38:04 +10:00
06c0f2f55a bocchi: add hardware configuration 2025-05-04 20:36:05 +10:00
4 changed files with 60 additions and 93 deletions

View file

@ -2,8 +2,7 @@
{
imports = [
./disko.nix
# ./hardware-configuration.nix
./hardware-configuration.nix
];
networking.hostName = "bocchi";

View file

@ -1,78 +0,0 @@
{ ... }:
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # Override existing partition
# Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted
subvolumes = {
# Subvolume name is different from mountpoint
"/root" = {
mountpoint = "/";
};
# Subvolume name is the same as the mountpoint
"/home" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/home";
};
"/nix" = {
mountOptions = [
"compress=zstd"
"noatime"
];
mountpoint = "/nix";
};
"/media" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/media";
};
"/media/shows" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/shows"; };
"/media/movies" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/movies"; };
"/media/music" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/music"; };
"/media/books" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/books"; };
"/media/repositories" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/repositories"; };
"/media/torrents" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/torrents"; };
# Subvolume for the swapfile
"/swap" = {
mountpoint = "/.swapvol";
swap = {
swapfile.size = "20M";
swapfile2.size = "20M";
swapfile2.path = "rel-path";
};
};
};
};
};
};
};
};
};
};
}

View file

@ -0,0 +1,39 @@
# 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")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" "wl" ];
boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/ff0cbf64-8bff-46a3-9bb2-8e314fcfda94";
fsType = "btrfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/795C-AFC7";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s20u1.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0f0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -9,19 +9,26 @@
networking.hostName = "nijika";
hardware.graphics.enable = true;
environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD";
hardware.graphics.extraPackages = with pkgs; [
intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD
libva-vdpau-driver # Previously vaapiVdpau
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
# OpenCL support for intel CPUs before 12th gen
# see: https://github.com/NixOS/nixpkgs/issues/356535
# intel-compute-runtime-legacy1
vpl-gpu-rt # QSV on 11th gen or newer
intel-media-sdk # QSV up to 11th gen
intel-ocl # OpenCL support
];
# enable vaapi on OS-level
nixpkgs.config.packageOverrides = pkgs: {
intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
};
environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD"; # Same here
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD
libva-vdpau-driver # Previously vaapiVdpau
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
# OpenCL support for intel CPUs before 12th gen
# see: https://github.com/NixOS/nixpkgs/issues/356535
intel-compute-runtime-legacy1
vpl-gpu-rt # QSV on 11th gen or newer
intel-media-sdk # QSV up to 11th gen
intel-ocl # OpenCL support
];
};
services.logind.lidSwitchExternalPower = "ignore";
}