feat: amd stuff

This commit is contained in:
2024-04-03 22:09:56 +02:00
parent bd1d0cfab6
commit e44948405a
9 changed files with 52 additions and 58 deletions

View File

@@ -30,13 +30,9 @@
allowUnfree = true; allowUnfree = true;
allowUnsupportedSystem = true; allowUnsupportedSystem = true;
experimental-features = "nix-command flakes"; experimental-features = "nix-command flakes";
substituters = [ substituters = [ "https://hyprland.cachix.org" ];
"https://hyprland.cachix.org"
"https://cuda-maintainers.cachix.org"
];
trusted-public-keys = [ trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
]; ];
}; };
overlays = [ overlays = [

View File

@@ -31,7 +31,7 @@
locale.preset.theaninova.enable = true; locale.preset.theaninova.enable = true;
hardware = { hardware = {
nvidia.preset.proprietary.enable = true; amdgpu.preset.default.enable = true;
audio.preset.pipewire.enable = true; audio.preset.pipewire.enable = true;
cc1.enable = true; cc1.enable = true;
fv43u.enable = true; fv43u.enable = true;

View File

@@ -1,11 +1,13 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { { config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];

View File

@@ -90,7 +90,6 @@
brightness = 0.8; brightness = 0.8;
}; };
}; };
opengl.nvidia_anti_flicker = true;
animations = { animations = {
enabled = "yes"; enabled = "yes";
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
@@ -236,15 +235,6 @@
platformTheme = "qtct"; platformTheme = "qtct";
}; };
programs.fish.loginShellInit =
# fish
''
Hyprland && echo "goodbye" && exit 0 \
|| echo "$status couldn't launch Hyprland" && tty | grep tty1 \
&& echo "refusing to autologin without Hyprland on tty1" && exit 0 \
|| echo "not on tty1, letting in"
'';
home = { home = {
pointerCursor = { pointerCursor = {
gtk.enable = true; gtk.enable = true;

View File

@@ -42,7 +42,7 @@
pinta pinta
kdePackages.kdenlive kdePackages.kdenlive
# friture TODO: broken # friture TODO: broken
blender blender-hip
openscad-unstable openscad-unstable
# development # development

View File

@@ -9,28 +9,16 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
boot = { boot = {
loader = { loader.timeout = 0;
timeout = 0;
systemd-boot.consoleMode = "max";
};
plymouth = { plymouth.enable = true;
enable = true;
theme = "text";
};
kernelParams = [ kernelParams = [
# Redirect all kernel messages to a console off screen
"fbcon=vc:2-6"
"console=tty1"
"splash"
"quiet" "quiet"
"rd.udev.log_level=3" "rd.udev.log_level=3"
"rd.systemd.show_status=false" "rd.systemd.show_status=false"
"udev.log_priority=3" "udev.log_priority=3"
"boot.shell_on_fail"
"vt.global_cursor_default=0" # no cursor blinking "vt.global_cursor_default=0" # no cursor blinking
]; ];
consoleLogLevel = 0; consoleLogLevel = 0;

View File

@@ -12,6 +12,7 @@
./hardware/gbmonctl.nix ./hardware/gbmonctl.nix
./hardware/nvidia-proprietary.nix ./hardware/nvidia-proprietary.nix
./hardware/nvidia-nouveau.nix ./hardware/nvidia-nouveau.nix
./hardware/amdgpu.nix
./hardware/cc1.nix ./hardware/cc1.nix
./hardware/fv43u.nix ./hardware/fv43u.nix
./hardware/virtual-camera.nix ./hardware/virtual-camera.nix

View File

@@ -17,9 +17,16 @@ in {
}; };
services = { services = {
getty.autologinUser = "${username}"; greetd = {
getty.extraArgs = [ "--noclear" "--noissue" "--nonewline" ]; enable = true;
getty.loginOptions = "-p -f -- \\u"; # preserve environment settings = rec {
initial_session = {
command = "${pkgs.hyprland}/bin/Hyprland &> /dev/null";
user = username;
};
default_session = initial_session;
};
};
dbus.enable = true; dbus.enable = true;
@@ -39,27 +46,5 @@ in {
}; };
environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.NIXOS_OZONE_WL = "1";
/* systemd.services = {
plymouth-quit-hyprland = mkIf config.boot.quiet.enable {
description = "Pause plymouth animation";
conflicts = [ "plymouth-quit.service" ];
after = [
"plymouth-quit.service"
"rc-local.service"
"plymouth-start.service"
"systemd-user-sessions.service"
];
serviceConfig = {
Type = "oneshot";
ExecStartPre = "${pkgs.plymouth}/bin/plymouth deactivate";
ExecStartPost = [
"${pkgs.coreutils}/bin/sleep 30"
"${pkgs.plymouth}/bin/plymouth quit --retain-splash"
];
};
};
};
*/
}; };
} }

View File

@@ -0,0 +1,32 @@
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.hardware.amdgpu.preset.default;
in {
options.hardware.amdgpu.preset.default = {
enable =
mkEnableOption "Enable ADM GPU driver support with some sane defaults";
};
config = mkIf cfg.enable {
hardware.opengl = {
enable = true;
driSupport = true;
extraPackages = with pkgs; [ rocmPackages.clr.icd ];
};
boot = {
# https://docs.kernel.org/gpu/amdgpu/module-parameters.html
kernelParams = [ "amdgpu.seamless=1" "amdgpu.freesync_video=1" ];
initrd.kernelModules = [ "amdgpu" ];
};
environment.systemPackages = with pkgs; [
amdgpu_top
glxinfo
libva-utils
vulkan-tools
];
};
}