From 49742e2e92b4c2e7d0010cdf089ec2499cabf120 Mon Sep 17 00:00:00 2001 From: CDaut Date: Wed, 17 Apr 2024 22:26:50 +0200 Subject: [PATCH] X is the most fucked up software on the planet --- configuration.nix | 23 +++++++++++++------ hardware_configuration.nix | 42 ++++++++++++++++++++++++++++++++++ home.nix | 2 ++ programm_configs/autorandr.nix | 41 +++++++++++++++++++++++++++++++++ programm_configs/picom.nix | 15 ++++++------ 5 files changed, 109 insertions(+), 14 deletions(-) create mode 100644 hardware_configuration.nix create mode 100644 programm_configs/autorandr.nix diff --git a/configuration.nix b/configuration.nix index c546c4e..a558f72 100644 --- a/configuration.nix +++ b/configuration.nix @@ -7,9 +7,19 @@ ]; # Bootloader. - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/sda"; - boot.loader.grub.useOSProber = true; + boot.loader = { + efi.canTouchEfiVariables = true; + grub = { + enable = true; + devices = [ "nodev" ]; + efiSupport = true; + useOSProber = true; + }; + }; + + boot.initrd.kernelModules = ["amdgpu"]; + + services.hardware.bolt.enable = true; networking.hostName = "nixpad"; # Define your hostname. @@ -39,14 +49,13 @@ xkb.layout = "de"; xkb.variant = ""; enable = true; - videoDrivers = [ "nvidia" ]; + dpi = 100; displayManager = { defaultSession = "none+i3"; - # TODO: adapt to actual monitor config setupCommands = '' - ${pkgs.xorg.xrandr}/bin/xrandr --output Virtual1 --mode 1920x1080; - ''; + ${pkgs.xorg.xrandr}/bin/xrandr --output eDP-1 --mode 3840x2160; + ''; }; windowManager.i3 = { diff --git a/hardware_configuration.nix b/hardware_configuration.nix new file mode 100644 index 0000000..c9932c3 --- /dev/null +++ b/hardware_configuration.nix @@ -0,0 +1,42 @@ +# 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, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/9acc939a-f9d8-4e3b-a3b2-a90752de8ce7"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-38517f01-1bef-4603-bcfe-8c66124dc32a".device = "/dev/disk/by-uuid/38517f01-1bef-4603-bcfe-8c66124dc32a"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/F0FA-6F3D"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.enp12s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp82s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home.nix b/home.nix index fd749d0..52cf416 100644 --- a/home.nix +++ b/home.nix @@ -27,6 +27,7 @@ in ./programm_configs/picom.nix ./programm_configs/zsh.nix ./programm_configs/gnome.nix + ./programm_configs/autorandr.nix ]; # The home.packages option allows you to install Nix packages into your @@ -40,6 +41,7 @@ in firefox tex jetbrains.idea-ultimate + arandr ]; # dotfiles diff --git a/programm_configs/autorandr.nix b/programm_configs/autorandr.nix new file mode 100644 index 0000000..ba45bcc --- /dev/null +++ b/programm_configs/autorandr.nix @@ -0,0 +1,41 @@ +{ pkgs, ... }: +{ + programs.autorandr = { + enable = true; + profiles = { + "docked" = { + fingerprint = { + HDMI-2-2 = "00ffffffffffff0030aee06557394834311d0103803c22782eb9a5a356509f260e5054adcf00d1c08180818a9500b300714f01010101023a801871382d40582c450056502100001e2a4480a0703827403020350056502100001a000000fd00314c365a15000a202020202020000000fc004c454e204c3237692d32380a20015f020327f14b010203040514111213101f230907078301000065030c001000681a00000101304c00011d007251d01e206e28550056502100001e8c0ad08a20e02d10103e96005650210000188c0ad090204031200c40550056502100001800000000000000000000000000000000000000000000000000000000000000000000f8"; + + eDP-1 = "00ffffffffffff004c83414100000000131d0104b5221378029491ae513eb7240b505400000001010101010101010101010101010101f0d40040f17018803020440058c21000001bf0d40040f17018803020440058c21000001b0000000f00ff093cff093c2c800000000000000000fe0041544e413536575230382d3020011502030f00e3058000e6060501736d0700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ab"; + }; + config = { + HDMI-2-2 = { + enable = true; + primary = true; + position = "5760x0"; + mode = "1920x1080"; + gamma = "1.0:0.909:0.833"; + rate = "60.00"; + scale = { + x = 1.0; + y = 1.0; + }; + }; + eDP-1 = { + enable = true; + primary = false; + position = "0x0"; + mode = "3840x2160"; + gamma = "1.0:0.909:0.833"; + rate = "60.00"; + scale = { + x = 0.5; + y = 0.5; + }; + }; + }; + }; + }; + }; +} diff --git a/programm_configs/picom.nix b/programm_configs/picom.nix index 4dc4dd4..4764d6a 100644 --- a/programm_configs/picom.nix +++ b/programm_configs/picom.nix @@ -3,7 +3,8 @@ services.picom = { enable = true; backend = "xrender"; - fade = true; + # TODO: figure out why this is so slooo + fade = false; # The time between steps in a fade in milliseconds. fadeDelta = 10; @@ -26,12 +27,12 @@ ]; settings = { - blur = { - background = true; - method = "kernel"; - kern = "7x7gaussian"; - strength = 20; - }; + #blur = { + # background = true; + # method = "kernel"; + # kern = "7x7gaussian"; + # strength = 20; + #}; detect-rounded-corners = true; shadow-ignore-shaped = false; };