diff --git a/flake.nix b/flake.nix index 43314ff..dd2b2cb 100644 --- a/flake.nix +++ b/flake.nix @@ -30,13 +30,9 @@ allowUnfree = true; allowUnsupportedSystem = true; experimental-features = "nix-command flakes"; - substituters = [ - "https://hyprland.cachix.org" - "https://cuda-maintainers.cachix.org" - ]; + substituters = [ "https://hyprland.cachix.org" ]; trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" ]; }; overlays = [ diff --git a/hosts/MONSTER/default.nix b/hosts/MONSTER/default.nix index f3c70bb..e18d6d2 100644 --- a/hosts/MONSTER/default.nix +++ b/hosts/MONSTER/default.nix @@ -31,7 +31,7 @@ locale.preset.theaninova.enable = true; hardware = { - nvidia.preset.proprietary.enable = true; + amdgpu.preset.default.enable = true; audio.preset.pipewire.enable = true; cc1.enable = true; fv43u.enable = true; diff --git a/hosts/MONSTER/hardware-configuration.nix b/hosts/MONSTER/hardware-configuration.nix index b4e61e6..8b7db83 100644 --- a/hosts/MONSTER/hardware-configuration.nix +++ b/hosts/MONSTER/hardware-configuration.nix @@ -1,11 +1,13 @@ # 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, ... }: { +{ config, lib, pkgs, modulesPath, ... }: + +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; 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.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; diff --git a/modules/home-manager/desktops/hyprland/default.nix b/modules/home-manager/desktops/hyprland/default.nix index fcc979c..65fec8c 100644 --- a/modules/home-manager/desktops/hyprland/default.nix +++ b/modules/home-manager/desktops/hyprland/default.nix @@ -90,7 +90,6 @@ brightness = 0.8; }; }; - opengl.nvidia_anti_flicker = true; animations = { enabled = "yes"; bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; @@ -236,15 +235,6 @@ 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 = { pointerCursor = { gtk.enable = true; diff --git a/modules/home-manager/packages/default.nix b/modules/home-manager/packages/default.nix index 6760b93..001d2fd 100644 --- a/modules/home-manager/packages/default.nix +++ b/modules/home-manager/packages/default.nix @@ -42,7 +42,7 @@ pinta kdePackages.kdenlive # friture TODO: broken - blender + blender-hip openscad-unstable # development diff --git a/modules/nixos/boot/quiet.nix b/modules/nixos/boot/quiet.nix index 25a200a..05fe370 100644 --- a/modules/nixos/boot/quiet.nix +++ b/modules/nixos/boot/quiet.nix @@ -9,28 +9,16 @@ in { config = mkIf cfg.enable { boot = { - loader = { - timeout = 0; - systemd-boot.consoleMode = "max"; - }; + loader.timeout = 0; - plymouth = { - enable = true; - theme = "text"; - }; + plymouth.enable = true; kernelParams = [ - # Redirect all kernel messages to a console off screen - "fbcon=vc:2-6" - "console=tty1" - - "splash" "quiet" "rd.udev.log_level=3" "rd.systemd.show_status=false" "udev.log_priority=3" - "boot.shell_on_fail" "vt.global_cursor_default=0" # no cursor blinking ]; consoleLogLevel = 0; diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index effad97..8cf1920 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -12,6 +12,7 @@ ./hardware/gbmonctl.nix ./hardware/nvidia-proprietary.nix ./hardware/nvidia-nouveau.nix + ./hardware/amdgpu.nix ./hardware/cc1.nix ./hardware/fv43u.nix ./hardware/virtual-camera.nix diff --git a/modules/nixos/desktops/hyprland.nix b/modules/nixos/desktops/hyprland.nix index 93313fb..c22419f 100644 --- a/modules/nixos/desktops/hyprland.nix +++ b/modules/nixos/desktops/hyprland.nix @@ -17,9 +17,16 @@ in { }; services = { - getty.autologinUser = "${username}"; - getty.extraArgs = [ "--noclear" "--noissue" "--nonewline" ]; - getty.loginOptions = "-p -f -- \\u"; # preserve environment + greetd = { + enable = true; + settings = rec { + initial_session = { + command = "${pkgs.hyprland}/bin/Hyprland &> /dev/null"; + user = username; + }; + default_session = initial_session; + }; + }; dbus.enable = true; @@ -39,27 +46,5 @@ in { }; 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" - ]; - }; - }; - }; - */ }; } diff --git a/modules/nixos/hardware/amdgpu.nix b/modules/nixos/hardware/amdgpu.nix new file mode 100644 index 0000000..f8a5029 --- /dev/null +++ b/modules/nixos/hardware/amdgpu.nix @@ -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 + ]; + }; +}