1
0
Fork 0

GPU: fix Intel drivers; Nix: disable distributed builds now that NOS supports remote builds

This commit is contained in:
Aires 2024-10-05 13:03:44 -04:00
parent 24ba087895
commit 5f334a59d6
6 changed files with 11 additions and 61 deletions

View file

@ -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]

View file

@ -88,7 +88,4 @@ in
services.syncthing.enable = true;
};
};
# Build remotely
nix.distributedBuilds = true;
}

View file

@ -38,6 +38,4 @@ in
};
users.aires.enable = true;
};
nix.distributedBuilds = true;
}

View file

@ -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
];
};
};

View file

@ -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

View file

@ -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;
};