From 5f334a59d60109622ad0dcab103443b5c39a8de8 Mon Sep 17 00:00:00 2001 From: Andre Date: Sat, 5 Oct 2024 13:03:44 -0400 Subject: [PATCH] GPU: fix Intel drivers; Nix: disable distributed builds now that NOS supports remote builds --- README.md | 15 +-------------- hosts/Khanda/default.nix | 3 --- hosts/Pihole/default.nix | 2 -- modules/system/gpu/intel.nix | 31 +++++++++---------------------- modules/system/nix.nix | 19 ------------------- modules/users/root/default.nix | 2 +- 6 files changed, 11 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 40cb6c1..2c39a78 100644 --- a/README.md +++ b/README.md @@ -68,20 +68,7 @@ Nix can create builds for or on remote systems, and transfer them via SSH. ##### Generating a build on a remote system -You can run a build on a remote server, then pull it down to the local system. This is called a `distributedBuild`. - -> [!NOTE] -> For distributed builds, the root user on the local system needs SSH access to the build target. This is done automatically. - -To enable root builds on a host, add this to its config: - -```nix -nix.distributedBuilds = true; -``` - -For hosts where `nix.distributedBuilds` is true, this repo automatically gives the local root user SSH access to an unprivileged user on the build systems. This is configured in `modules/secrets.nix`, but the build systems are defined in [`modules/system/nix.nix`](https://code.8bitbuddhism.com/aires/nix-configuration/src/commit/433821ef0c46f08855a041c3aa97143a954564f5/modules/system/nix.nix#L57). - -If you want to ensure a build happens on a remote system, you can use: +You can run a build on a remote server by using `--build-host`: ```sh nixos-rebuild build --flake . --build-host [remote hostname] diff --git a/hosts/Khanda/default.nix b/hosts/Khanda/default.nix index ffada57..a6e0c3c 100644 --- a/hosts/Khanda/default.nix +++ b/hosts/Khanda/default.nix @@ -88,7 +88,4 @@ in services.syncthing.enable = true; }; }; - - # Build remotely - nix.distributedBuilds = true; } diff --git a/hosts/Pihole/default.nix b/hosts/Pihole/default.nix index 93d7438..73ea477 100644 --- a/hosts/Pihole/default.nix +++ b/hosts/Pihole/default.nix @@ -38,6 +38,4 @@ in }; users.aires.enable = true; }; - - nix.distributedBuilds = true; } diff --git a/modules/system/gpu/intel.nix b/modules/system/gpu/intel.nix index 8499a3d..48b5f2c 100644 --- a/modules/system/gpu/intel.nix +++ b/modules/system/gpu/intel.nix @@ -1,4 +1,6 @@ # Enables Intel GPU support. +# https://wiki.nixos.org/wiki/Intel_Graphics +# https://nixos.org/manual/nixos/stable/#sec-x11--graphics-cards-intel { pkgs, config, @@ -14,32 +16,17 @@ in }; config = lib.mkIf cfg.enable { - # Configuration options from NixOS-Hardware: https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/intel/default.nix - boot.initrd.kernelModules = [ "i915" ]; + services.xserver.videoDrivers = [ "intel" ]; - environment.variables.VDPAU_DRIVER = "va_gl"; - - hardware.opengl = { - extraPackages = with pkgs; [ - ( - if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then - vaapiIntel - else - intel-vaapi-driver - ) - libvdpau-va-gl - intel-media-driver + hardware.graphics = { + enable = true; + extraPackages = [ + pkgs.intel-media-driver + pkgs.unstable.vpl-gpu-rt ]; - extraPackages32 = with pkgs.driversi686Linux; [ - ( - if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then - vaapiIntel - else - intel-vaapi-driver - ) - libvdpau-va-gl intel-media-driver + pkgs.unstable.vpl-gpu-rt ]; }; }; diff --git a/modules/system/nix.nix b/modules/system/nix.nix index ed23dd1..b57913e 100644 --- a/modules/system/nix.nix +++ b/modules/system/nix.nix @@ -70,25 +70,6 @@ in registry.nixpkgs.flake = inputs.nixpkgs; nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; - # Configure remote build machines - # To enable a system to use remote build machines, add `nix.distributedBuilds = true;` to its config - buildMachines = [ - { - hostName = "hevana"; - systems = [ - "x86_64-linux" - "aarch64-linux" - ]; - protocol = "ssh-ng"; - supportedFeatures = [ - "nixos-test" - "kvm" - "benchmark" - "big-parallel" - ]; - } - ]; - # When using a builder, use its package store extraOptions = '' builders-use-substitutes = true diff --git a/modules/users/root/default.nix b/modules/users/root/default.nix index 68602c3..0f521d7 100644 --- a/modules/users/root/default.nix +++ b/modules/users/root/default.nix @@ -4,7 +4,7 @@ home-manager.users.root = { home.stateVersion = "24.05"; programs = { - ssh = lib.mkIf config.nix.distributedBuilds { + ssh = { enable = true; matchBlocks = config.secrets.users.root.sshConfig; };