forked from mirrors_public/oddlama_nix-config
feat: back to xorg for gaming 😞
This commit is contained in:
parent
bbcf39a3ae
commit
05b626f912
7 changed files with 226 additions and 27 deletions
|
@ -2,7 +2,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nixos-hardware.nixosModules.common-cpu-amd
|
inputs.nixos-hardware.nixosModules.common-cpu-amd
|
||||||
inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
|
inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
|
||||||
inputs.nixos-hardware.nixosModules.common-gpu-nvidia-nonprime
|
|
||||||
inputs.nixos-hardware.nixosModules.common-pc
|
inputs.nixos-hardware.nixosModules.common-pc
|
||||||
inputs.nixos-hardware.nixosModules.common-pc-hdd
|
inputs.nixos-hardware.nixosModules.common-pc-hdd
|
||||||
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
||||||
|
|
|
@ -12,6 +12,7 @@ in {
|
||||||
imports = [
|
imports = [
|
||||||
./fonts.nix
|
./fonts.nix
|
||||||
./wayland.nix
|
./wayland.nix
|
||||||
|
./xserver.nix
|
||||||
./steam.nix
|
./steam.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
25
modules/optional/graphical/xserver.nix
Normal file
25
modules/optional/graphical/xserver.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
|
dpi = 96;
|
||||||
|
displayManager.startx.enable = true;
|
||||||
|
desktopManager.xterm.enable = false;
|
||||||
|
autoRepeatDelay = 235;
|
||||||
|
autoRepeatInterval = 60;
|
||||||
|
videoDrivers = ["modesetting"];
|
||||||
|
libinput = {
|
||||||
|
enable = true;
|
||||||
|
mouse.accelProfile = "flat";
|
||||||
|
mouse.accelSpeed = "0";
|
||||||
|
# touchpad = {
|
||||||
|
# accelProfile = "flat";
|
||||||
|
# accelSpeed = "0.5";
|
||||||
|
# naturalScrolling = true;
|
||||||
|
# disableWhileTyping = true;
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
layout = "de";
|
||||||
|
xkbVariant = "nodeadkeys";
|
||||||
|
};
|
||||||
|
services.autorandr.enable = true;
|
||||||
|
}
|
|
@ -1,12 +1,17 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
boot.blacklistedKernelModules = ["nouveau"];
|
boot.blacklistedKernelModules = ["nouveau"];
|
||||||
|
services.xserver.videoDrivers = lib.mkForce ["nvidia"];
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
nvidia = {
|
nvidia = {
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
nvidiaPersistenced = true;
|
nvidiaPersistenced = true;
|
||||||
nvidiaSettings = true;
|
nvidiaSettings = true;
|
||||||
open = false;
|
open = true;
|
||||||
powerManagement.enable = true;
|
powerManagement.enable = true;
|
||||||
};
|
};
|
||||||
opengl = {
|
opengl = {
|
||||||
|
@ -14,6 +19,7 @@
|
||||||
driSupport = true;
|
driSupport = true;
|
||||||
driSupport32Bit = true;
|
driSupport32Bit = true;
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
|
vaapiVdpau
|
||||||
nvidia-vaapi-driver
|
nvidia-vaapi-driver
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,7 +10,10 @@
|
||||||
./firefox.nix
|
./firefox.nix
|
||||||
./kitty.nix
|
./kitty.nix
|
||||||
./signal.nix
|
./signal.nix
|
||||||
./sway.nix
|
# XXX: disabled for the time being because gaming under nvidia+wayland has too many bugs
|
||||||
|
# XXX: retest this in the future. Problems were flickering under gles, black screens and refresh issues under vulkan, black wine windows.
|
||||||
|
# ./sway.nix
|
||||||
|
./i3.nix
|
||||||
]
|
]
|
||||||
++ lib.optionals nixosConfig.graphical.gaming.enable [
|
++ lib.optionals nixosConfig.graphical.gaming.enable [
|
||||||
./games/bottles.nix
|
./games/bottles.nix
|
||||||
|
@ -19,12 +22,15 @@
|
||||||
home = {
|
home = {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
appimage-run
|
appimage-run
|
||||||
yt-dlp
|
|
||||||
thunderbird
|
|
||||||
chromium
|
chromium
|
||||||
zathura
|
|
||||||
feh
|
feh
|
||||||
|
pinentry # For yubikey
|
||||||
sirula
|
sirula
|
||||||
|
thunderbird
|
||||||
|
xdg-utils
|
||||||
|
xdragon
|
||||||
|
yt-dlp
|
||||||
|
zathura
|
||||||
];
|
];
|
||||||
|
|
||||||
# TODO emoji in firefox are wrong
|
# TODO emoji in firefox are wrong
|
||||||
|
@ -49,6 +55,23 @@
|
||||||
persistence."/persist".directories = [
|
persistence."/persist".directories = [
|
||||||
"projects"
|
"projects"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
pointerCursor = {
|
||||||
|
gtk.enable = true;
|
||||||
|
name = "Adwaita-dark";
|
||||||
|
package = pkgs.gnome.adwaita-icon-theme;
|
||||||
|
# TODO XXX: not working
|
||||||
|
size = 24;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Needed to fix cursors in firefox under wayland, see https://github.com/NixOS/nixpkgs/issues/207339#issuecomment-1374497558
|
||||||
|
gtk = {
|
||||||
|
enable = true;
|
||||||
|
theme = {
|
||||||
|
package = pkgs.gnome.gnome-themes-extra;
|
||||||
|
name = "Adwaita-dark";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.mimeApps.enable = true;
|
xdg.mimeApps.enable = true;
|
||||||
|
|
165
users/myuser/graphical/i3.nix
Normal file
165
users/myuser/graphical/i3.nix
Normal file
|
@ -0,0 +1,165 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit
|
||||||
|
(lib)
|
||||||
|
mapAttrs'
|
||||||
|
nameValuePair
|
||||||
|
;
|
||||||
|
|
||||||
|
bindWithModifier = mapAttrs' (k: nameValuePair (cfg.modifier + "+" + k));
|
||||||
|
cfg = config.xsession.windowManager.i3.config;
|
||||||
|
in {
|
||||||
|
xsession.windowManager.i3 = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
modifier = "Mod4";
|
||||||
|
terminal = "kitty";
|
||||||
|
|
||||||
|
# Excuse me, le füque
|
||||||
|
focus.followMouse = false;
|
||||||
|
focus.mouseWarping = false;
|
||||||
|
|
||||||
|
# TODO menu = "rofi -show run";
|
||||||
|
|
||||||
|
keybindings =
|
||||||
|
{
|
||||||
|
"XF86AudioRaiseVolume" = "exec --no-startup-id wpctl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||||
|
"XF86AudioLowerVolume" = "exec --no-startup-id wpctl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||||
|
"XF86AudioMute" = "exec --no-startup-id wpctl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||||
|
"XF86AudioMicMute" = "exec --no-startup-id wpctl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||||
|
|
||||||
|
#"Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
|
||||||
|
#"${mod}+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot save area";
|
||||||
|
}
|
||||||
|
# // optionalAttrs useBacklight {
|
||||||
|
# "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5";
|
||||||
|
# "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5";
|
||||||
|
# }
|
||||||
|
// {
|
||||||
|
"Menu" = "exec ${cfg.menu}";
|
||||||
|
}
|
||||||
|
# General mappings that start with $modifier+...
|
||||||
|
// bindWithModifier {
|
||||||
|
"t" = "exec ${cfg.terminal}";
|
||||||
|
"asciicircum" = "exec ${cfg.menu}";
|
||||||
|
"b" = "exec firefox";
|
||||||
|
|
||||||
|
"Shift+r" = "reload";
|
||||||
|
"q" = "kill";
|
||||||
|
|
||||||
|
"Left" = "focus left";
|
||||||
|
"Right" = "focus right";
|
||||||
|
"Up" = "focus up";
|
||||||
|
"Down" = "focus down";
|
||||||
|
|
||||||
|
"Shift+Left" = "move left";
|
||||||
|
"Shift+Right" = "move right";
|
||||||
|
"Shift+Up" = "move up";
|
||||||
|
"Shift+Down" = "move down";
|
||||||
|
|
||||||
|
"s" = "splith";
|
||||||
|
"v" = "splitv";
|
||||||
|
"f" = "floating toggle";
|
||||||
|
"Return" = "fullscreen toggle";
|
||||||
|
"Space" = "focus mode_toggle";
|
||||||
|
# "a" = "focus parent";
|
||||||
|
# "s" = "layout stacking";
|
||||||
|
# "w" = "layout tabbed";
|
||||||
|
# "e" = "layout toggle split";
|
||||||
|
|
||||||
|
"Shift+Ctrl+q" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
||||||
|
"r" = "mode resize";
|
||||||
|
|
||||||
|
"1" = "workspace number 1";
|
||||||
|
"2" = "workspace number 2";
|
||||||
|
"3" = "workspace number 3";
|
||||||
|
"4" = "workspace number 4";
|
||||||
|
"5" = "workspace number 5";
|
||||||
|
"6" = "workspace number 6";
|
||||||
|
"7" = "workspace number 7";
|
||||||
|
"8" = "workspace number 8";
|
||||||
|
"9" = "workspace number 9";
|
||||||
|
"Comma" = "workspace prev";
|
||||||
|
"Period" = "workspace next";
|
||||||
|
|
||||||
|
"Shift+1" = "move container to workspace number 1";
|
||||||
|
"Shift+2" = "move container to workspace number 2";
|
||||||
|
"Shift+3" = "move container to workspace number 3";
|
||||||
|
"Shift+4" = "move container to workspace number 4";
|
||||||
|
"Shift+5" = "move container to workspace number 5";
|
||||||
|
"Shift+6" = "move container to workspace number 6";
|
||||||
|
"Shift+7" = "move container to workspace number 7";
|
||||||
|
"Shift+8" = "move container to workspace number 8";
|
||||||
|
"Shift+9" = "move container to workspace number 9";
|
||||||
|
"Shift+Comma" = "move container to workspace prev";
|
||||||
|
"Shift+Period" = "move container to workspace next";
|
||||||
|
};
|
||||||
|
|
||||||
|
window.titlebar = false;
|
||||||
|
|
||||||
|
#assigns = {
|
||||||
|
# "9" = [
|
||||||
|
# {class = "^steam_app_";}
|
||||||
|
# {app_id = "^Steam$";}
|
||||||
|
# {class = "^steam$";}
|
||||||
|
# ];
|
||||||
|
#};
|
||||||
|
# TODO eww -> bars = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.autorandr.enable = true;
|
||||||
|
programs.autorandr.profiles =
|
||||||
|
{
|
||||||
|
kroma = let
|
||||||
|
monitorMain = "DP-2";
|
||||||
|
monitorLeft = "DP-4";
|
||||||
|
in {
|
||||||
|
main = {
|
||||||
|
config = {
|
||||||
|
${monitorLeft} = {
|
||||||
|
enable = true;
|
||||||
|
mode = "3840x2160";
|
||||||
|
rate = "60.00";
|
||||||
|
position = "0x0";
|
||||||
|
};
|
||||||
|
${monitorMain} = {
|
||||||
|
enable = true;
|
||||||
|
primary = true;
|
||||||
|
mode = "3840x2160";
|
||||||
|
rate = "144.00";
|
||||||
|
position = "3840x0";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
fingerprint = {
|
||||||
|
${monitorMain} = "00ffffffffffff001e6d9a5b078e0a000b1f0104b53c2278f919c1ae5044af260e5054210800d1c061404540314001010101010101014dd000a0f0703e803020350058542100001a000000fd0c3090505086010a202020202020000000fc003237474e3935300a2020202020000000ff003131314e5447594c423731390a02e602032d7123090707830100004410040301e2006ae305c000e60605017360216d1a0000020b309000047321602900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f47012790300030128d8060284ff0e9f002f801f006f08910002000400404f0104ff0e9f002f801f006f086200020004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d90";
|
||||||
|
${monitorLeft} = "00ffffffffffff001e6d095b39790700081a0104b53c22789f3035a7554ea3260f50542108007140818081c0a9c0d1c08100010101014dd000a0f0703e803020650c58542100001a286800a0f0703e800890650c58542100001a000000fd00283d878738010a202020202020000000fc004c4720556c7472612048440a2001850203117144900403012309070783010000023a801871382d40582c450058542100001e565e00a0a0a029503020350058542100001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c8";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
.${nixosConfig.node.name}
|
||||||
|
or {};
|
||||||
|
|
||||||
|
home.file.".xinitrc".text = ''
|
||||||
|
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
|
||||||
|
eval $(dbus-launch --exit-with-session --sh-syntax)
|
||||||
|
fi
|
||||||
|
systemctl --user import-environment DISPLAY XAUTHORITY
|
||||||
|
|
||||||
|
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
|
||||||
|
dbus-update-activation-environment DISPLAY XAUTHORITY
|
||||||
|
fi
|
||||||
|
|
||||||
|
autorandr -c
|
||||||
|
xset mouse 1 0
|
||||||
|
xset r rate 235 60
|
||||||
|
|
||||||
|
exec i3
|
||||||
|
'';
|
||||||
|
}
|
|
@ -177,27 +177,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
xdg-utils
|
|
||||||
wdisplays
|
wdisplays
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
pinentry # For yubikey
|
|
||||||
xdragon
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home.pointerCursor = {
|
|
||||||
gtk.enable = true;
|
|
||||||
name = "Adwaita-dark";
|
|
||||||
package = pkgs.gnome.adwaita-icon-theme;
|
|
||||||
# TODO XXX: not working
|
|
||||||
size = 24;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Needed to fix cursors in firefox under wayland, see https://github.com/NixOS/nixpkgs/issues/207339#issuecomment-1374497558
|
|
||||||
gtk = {
|
|
||||||
enable = true;
|
|
||||||
theme = {
|
|
||||||
package = pkgs.gnome.gnome-themes-extra;
|
|
||||||
name = "Adwaita-dark";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue