From 25532dd2c71cc6ebe71c35c9da9aab2cf336818e Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Wed, 27 Mar 2024 21:36:40 +0000 Subject: [PATCH] Add more common parts --- common.nix | 23 ++++++++++++++++++++- hardware/intel-uhd.nix | 18 +++++++++++++++++ machines/talos/configuration.nix | 34 +------------------------------- 3 files changed, 41 insertions(+), 34 deletions(-) create mode 100644 hardware/intel-uhd.nix diff --git a/common.nix b/common.nix index 9b080ba..99b0b1f 100644 --- a/common.nix +++ b/common.nix @@ -2,7 +2,7 @@ { imports = [ - users.nix + ./users.nix ]; # Set your time zone. @@ -14,4 +14,25 @@ font = "Lat2-Terminus16"; useXkbConfig = true; # use xkb.options in tty. }; + + programs = { + zsh.enable = true; + }; + + environment.systemPackages = with pkgs; [ + git + gnupg + lsof + gnumake + python3 + ]; + + services = { + openssh = { + enable = true; + settings = { + PermitRootLogin = "yes"; + }; + }; + }; } \ No newline at end of file diff --git a/hardware/intel-uhd.nix b/hardware/intel-uhd.nix new file mode 100644 index 0000000..1d1eefb --- /dev/null +++ b/hardware/intel-uhd.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + # Accel graphics + nixpkgs.config.packageOverrides = pkgs: { + intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; + }; + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver # LIBVA_DRIVER_NAME=iHD + intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) + vaapiVdpau + libvdpau-va-gl + ]; + }; + environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; # Force intel-media-driver +} \ No newline at end of file diff --git a/machines/talos/configuration.nix b/machines/talos/configuration.nix index 6e38a37..13adb1b 100644 --- a/machines/talos/configuration.nix +++ b/machines/talos/configuration.nix @@ -1,7 +1,3 @@ -# 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, ... }: { @@ -9,6 +5,7 @@ [ # Include the results of the hardware scan. ./hardware-configuration.nix ../../common.nix + ../../hardware/intel-uhd.nix ]; system.copySystemConfiguration = true; @@ -53,47 +50,18 @@ # Enable sensors hardware.sensor.iio.enable = true; - # Accel graphics - nixpkgs.config.packageOverrides = pkgs: { - intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; - }; - hardware.opengl = { - enable = true; - extraPackages = with pkgs; [ - intel-media-driver # LIBVA_DRIVER_NAME=iHD - intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) - vaapiVdpau - libvdpau-va-gl - ]; - }; - environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; # Force intel-media-driver - - # Define a user account. Don't forget to set a password with ‘passwd’. - # List packages installed in system profile environment.systemPackages = with pkgs; [ - git - gnupg - lsof - gnumake firefox - python3 ]; programs = { - zsh.enable = true; flashrom.enable = true; gnome-terminal.enable = true; }; # Enable the OpenSSH daemon. services = { - openssh = { - enable = true; - settings = { - PermitRootLogin = "yes"; - }; - }; locate.enable = true; upower.enable = true; thermald.enable = true;