From 110f451b13f7b0ba20360247dd871941d2c7ebc0 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 21 Apr 2025 21:43:04 +0800 Subject: [PATCH] add apollo gpu config --- profiles/apollo/default.nix | 1 + profiles/apollo/hardware.nix | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 profiles/apollo/hardware.nix diff --git a/profiles/apollo/default.nix b/profiles/apollo/default.nix index 0a9421c..756de83 100644 --- a/profiles/apollo/default.nix +++ b/profiles/apollo/default.nix @@ -17,6 +17,7 @@ in # Import your generated (nixos-generate-config) hardware configuration ./hardware-configuration.nix + ./hardware.nix ./networking.nix "${self}/modules/nixos/core" "${self}/modules/nixos/user.nix" diff --git a/profiles/apollo/hardware.nix b/profiles/apollo/hardware.nix new file mode 100644 index 0000000..16fd6d4 --- /dev/null +++ b/profiles/apollo/hardware.nix @@ -0,0 +1,32 @@ +# 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, username, ... }: + +{ + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [ + vaapiIntel + intel-media-driver + ]; + }; + + fileSystems."/home/${username}/tmp" = + { + device = "none"; + fsType = "tmpfs"; + options = [ "uid=1000" "gid=100" "defaults" "size=16G" "mode=755" ]; + }; + + fileSystems."/tmp" = + { + device = "tmpfs"; + fsType = "tmpfs"; + }; + + swapDevices = [{ + device = "/var/swapfile"; + size = 16 * 1024; + }]; +}