Files
nixos-thinkpad/configuration.nix
T
2026-04-19 17:12:27 +02:00

158 lines
4.7 KiB
Nix
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./networks
./desktop
./virtualisation
];
# Use the GNU GRUB bootloader.
boot.loader = {
grub = {
enable = true;
device = "nodev";
efiSupport = true;
};
efi.canTouchEfiVariables = true;
};
# Catppuccin for GRUB
catppuccin.grub = {
enable = true;
flavor = "mocha";
};
# Catppuccin for tty
catppuccin.tty = {
enable = true;
flavor = "mocha";
};
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
# Enable NixOS flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Set your time zone.
time.timeZone = "Europe/Warsaw";
# Define a user account. Don't forget to set a password with passwd.
users.users.cln = {
isNormalUser = true;
description = "cln";
password = "123"; # Change
extraGroups = [ "wheel" "video" "render" "input" "libvirtd" ];
shell = pkgs.zsh;
home = "/home/cln";
};
# Shell for user
programs.zsh.enable = true;
programs.bash.enable = true; # In case something breaks
swapDevices = [{ # Create a swap file
device = "/.swapfile";
size = 8*1024;
}];
# Intel GPU Drivers
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
# Required for modern Intel GPUs (Xe iGPU and ARC)
intel-media-driver # VA-API (iHD) userspace
vpl-gpu-rt # oneVPL (QSV) runtime
# Optional (compute / tooling):
intel-compute-runtime # OpenCL (NEO) + Level Zero for Arc/Xe
# NOTE: 'intel-ocl' also exists as a legacy package; not recommended for Arc/Xe.
# libvdpau-va-gl # Only if you must run VDPAU-only apps
];
};
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "iHD"; # Prefer the modern iHD backend
# VDPAU_DRIVER = "va_gl"; # Only if using libvdpau-va-gl
};
# May help if FFmpeg/VAAPI/QSV init fails (esp. on Arc with i915):
hardware.enableRedistributableFirmware = true;
boot.kernelParams = [ "i915.enable_guc=3" ];
# X related settings
services.xserver = {
enable = false;
xkb.layout = "pl";
videoDrivers = [ "modesetting" ];
};
# Enable pipewire
security.rtkit.enable = true;
services.pipewire.wireplumber.enable = true;
services.pipewire = {
enable = true; # if not already enabled
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
# Bluetooth support
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
# Shows battery charge of connected devices on supported
# Bluetooth adapters. Defaults to 'false'.
Experimental = true;
# When enabled other devices can connect faster to us, however
# the tradeoff is increased power consumption. Defaults to
# 'false'.
FastConnectable = true;
};
Policy = {
# Enable all controllers when they are found. This includes
# adapters present on start as well as adapters that are plugged
# in later on. Defaults to 'true'.
AutoEnable = true;
};
};
};
# List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options).
environment.systemPackages = with pkgs; [
cryptsetup
xfsprogs
vim
];
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "26.05"; # Did you read the comment?
}