feat: improve GPU support for modules

This commit is contained in:
2026-01-25 16:19:09 +01:00
parent b4a57a8f64
commit 21e85fc77b
6 changed files with 29 additions and 9 deletions

View File

@@ -1,10 +1,20 @@
{pkgs, ...}: {
{
pkgs,
config,
...
}: let
inherit (config.home) gpuType;
in {
programs.btop = {
enable = true;
package = pkgs.btop.override {
rocmSupport = true;
cudaSupport = true;
};
package =
if gpuType != null
then
pkgs.btop.override {
rocmSupport = gpuType == "amd";
cudaSupport = gpuType == "nvidia";
}
else pkgs.btop;
settings = {
color_theme = "${pkgs.btop}/share/btop/themes/nord.theme";
cpu_bottom = false;

View File

@@ -1,3 +1,3 @@
{pkgs, ...}:
pkgs.writeShellScriptBin "mp42webm" ''
${pkgs.ffmpeg}/bin/ffmpeg -i "$1" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "$1".webm''
${pkgs.ffmpeg}/bin/ffmpeg -i "$1" -c:v libvpx -crf 10 -b:v 1M -c:a -hwaccel=auto libvorbis "$1".webm''

View File

@@ -17,7 +17,14 @@ in {
./shell
];
options.home.fullDesktop = mkEnableOption "Enable most modules";
options.home = {
fullDesktop = mkEnableOption "Enable most modules";
gpuType = mkOption {
type = types.nullOr (types.enum ["nvidia" "amd" "intel"]);
default = null;
example = "amd";
};
};
config.home = {
cli.fullDesktop = mkDefault cfg.fullDesktop;
desktop.fullDesktop = mkDefault cfg.fullDesktop;

View File

@@ -59,7 +59,9 @@ in {
};
tray.compact = true;
};
services.gpuType = "amd";
services = mkIf (config.home.gpuType != null) {
inherit (config.home) gpuType;
};
session.commands = {
logout = ["uwsm" "stop"];
shutdown = ["systemctl" "poweroff"];

View File

@@ -15,7 +15,7 @@ in {
force-seekable = true; # force streams to be seekable
slang = "jpn,jp,eng,en,fra,fr";
alang = "eng,en,fra,fr";
gpu-api = "vulkan";
gpu-api = "auto";
osc = true;
profile = "gpu-hq";
# geometry = "50%x50%";

View File

@@ -1,6 +1,7 @@
{config, ...}: {
imports = [../home.nix];
home = {
gpuType = "amd";
cli.nh.flake = "${config.home.homeDirectory}/.dotfiles";
dev.ai = {
enable = true;