From 36ace852a843a727b08cdac1abb5bf762225648f Mon Sep 17 00:00:00 2001 From: Jacob Bachmann Date: Mon, 29 Apr 2024 22:37:44 +0200 Subject: [PATCH] feat: f*ck you nvidia --- flake.lock | 60 +++++++++++----------- hosts/IROH/default.nix | 4 +- hosts/IROH/hardware.nix | 2 + modules/audio.nix | 2 +- modules/default.nix | 2 +- modules/{greetd.nix => desktop.nix} | 3 ++ modules/nix.nix | 2 +- modules/packages.nix | 2 +- modules/power.nix | 5 +- users/gandalf/modules/gui/i3/autorandr.nix | 22 ++++++-- users/gandalf/modules/gui/i3/default.nix | 6 ++- users/gandalf/modules/gui/i3/rofi.nix | 13 +++++ users/gandalf/modules/gui/sway/default.nix | 2 +- users/gandalf/modules/neovim/default.nix | 11 +++- users/gandalf/modules/ssh.nix | 5 ++ 15 files changed, 95 insertions(+), 46 deletions(-) rename modules/{greetd.nix => desktop.nix} (91%) create mode 100644 users/gandalf/modules/gui/i3/rofi.nix diff --git a/flake.lock b/flake.lock index c7bc0a8..e0c7003 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1711629152, - "narHash": "sha256-GxhduJ3mRzdtdOiJTn2fD6Z5rvM51aT9X7YrZCmoKbs=", + "lastModified": 1713301451, + "narHash": "sha256-LzYVqEukjOJjm4HGFe6rtHBiuJxAyPqd2MY1k5ci9QU=", "owner": "Aylur", "repo": "ags", - "rev": "eedd643db42bb9a5f837904062efb01b6d59fa5b", + "rev": "33bcaf34d5277031ecb97047fb8ddd44abd8d80e", "type": "github" }, "original": { @@ -41,11 +41,11 @@ ] }, "locked": { - "lastModified": 1713391096, - "narHash": "sha256-5xkzsy+ILgQlmvDDipL5xqAehnjWBenAQXV4/NLg2dE=", + "lastModified": 1714203603, + "narHash": "sha256-eT7DENhYy7EPLOqHI9zkIMD9RvMCXcqh6gGqOK5BWYQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "f46814ec7cbef9c2aef18ca1cbe89f2bb1e8c394", + "rev": "c1609d584a6b5e9e6a02010f51bd368cb4782f8e", "type": "github" }, "original": { @@ -61,11 +61,11 @@ ] }, "locked": { - "lastModified": 1712655750, - "narHash": "sha256-uTvoGFzbBJfVKZVZ/+nIPP93E8EnGXwmVPIqgRlT14I=", + "lastModified": 1713850237, + "narHash": "sha256-wa7l1cfG5X4hJzFsFZEVwp6UJ6uaRqUWJA/ETwAn2TU=", "owner": "outfoxxed", "repo": "hy3", - "rev": "7d988d310f2b15eea5f2b9998f777a9590c4d1d9", + "rev": "e6cabcfa3d303c47406e458f662564d50883b4f2", "type": "github" }, "original": { @@ -90,11 +90,11 @@ ] }, "locked": { - "lastModified": 1713214463, - "narHash": "sha256-zAOOjqHAbccCRgJSuvTCA0FNLqKswN63LgVo43R7pxw=", + "lastModified": 1712434681, + "narHash": "sha256-qwmR2p1oc48Bj7gUDvb1oGL19Rjs2PmEmk4ChV01A5o=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "0a53b9957f0b17f1a0036b25198f569969ad43a0", + "rev": "818d8c4b69e0997483d60b75f701fe14b561a7a3", "type": "github" }, "original": { @@ -165,11 +165,11 @@ ] }, "locked": { - "lastModified": 1713121246, - "narHash": "sha256-502X0Q0fhN6tJK7iEUA8CghONKSatW/Mqj4Wappd++0=", + "lastModified": 1711671891, + "narHash": "sha256-C/Wwsy/RLxHP1axFFl+AnwJRWfd8gxDKKoa8nt8Qk3c=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "78fcaa27ae9e1d782faa3ff06c8ea55ddce63706", + "rev": "c1402612146ba06606ebf64963a02bc1efe11e74", "type": "github" }, "original": { @@ -180,11 +180,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1713377320, - "narHash": "sha256-OrBm62B+X9jylr6cPgKc+5OSgF2PRW9IY0ARCOtURMY=", + "lastModified": 1714201532, + "narHash": "sha256-nk0W4rH7xYdDeS7k1SqqNtBaNrcgIBYNmOVc8P2puEY=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "f2d364de6589f7a029624983593eafc3c4dac726", + "rev": "53db5e1070d07e750030bf65f1b9963df8f0c678", "type": "github" }, "original": { @@ -212,11 +212,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1712963716, - "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=", + "lastModified": 1712439257, + "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cfd6b5fc90b15709b780a5a1619695a88505a176", + "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", "type": "github" }, "original": { @@ -228,11 +228,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1713248628, - "narHash": "sha256-NLznXB5AOnniUtZsyy/aPWOk8ussTuePp2acb9U+ISA=", + "lastModified": 1714253743, + "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5672bc9dbf9d88246ddab5ac454e82318d094bb8", + "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", "type": "github" }, "original": { @@ -290,11 +290,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1712127529, - "narHash": "sha256-R3yPS5ktvzhUI+TeHTDkbKgiA8SDvozu33azFUeMVoo=", + "lastModified": 1714034203, + "narHash": "sha256-saVhZRToJDFaAXHfjAVmJW8HQArldGXRNeqgsPPujUQ=", "owner": "Alexays", "repo": "Waybar", - "rev": "42dc9cb85f27e3db02da83cd13624cfc5a7191d3", + "rev": "2481f7a2924d18ce83bc2bfc2434a06349a7bb32", "type": "github" }, "original": { @@ -340,11 +340,11 @@ ] }, "locked": { - "lastModified": 1713214484, - "narHash": "sha256-h1bSIsDuPk1FGgvTuSHJyiU2Glu7oAyoPMJutKZmLQ8=", + "lastModified": 1709299639, + "narHash": "sha256-jYqJM5khksLIbqSxCLUUcqEgI+O2LdlSlcMEBs39CAU=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "bb44921534a9cee9635304fdb876c1b3ec3a8f61", + "rev": "2d2fb547178ec025da643db57d40a971507b82fe", "type": "github" }, "original": { diff --git a/hosts/IROH/default.nix b/hosts/IROH/default.nix index 20dff89..5689d48 100755 --- a/hosts/IROH/default.nix +++ b/hosts/IROH/default.nix @@ -15,11 +15,11 @@ gui = { enable = true; greeter.enable = false; - flavour = [ "sway" ]; + flavour = [ "i3" ]; }; nvidia.enable = true; audio.enable = true; - bluetooth.enable = true; + bluetooth.enable = false; printing.enable = true; vpn.enable = true; diff --git a/hosts/IROH/hardware.nix b/hosts/IROH/hardware.nix index a7e3963..c2e1ffd 100644 --- a/hosts/IROH/hardware.nix +++ b/hosts/IROH/hardware.nix @@ -19,6 +19,7 @@ ]; # TODO once the 550 drivers are better, switch to them + /* hardware.nvidia.package = let rcu_patch = pkgs.fetchpatch { @@ -35,6 +36,7 @@ persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE="; patches = [ rcu_patch ]; }; + */ boot.resumeDevice = "/dev/disk/by-label/ROOT"; diff --git a/modules/audio.nix b/modules/audio.nix index fd67443..1a9001a 100644 --- a/modules/audio.nix +++ b/modules/audio.nix @@ -1,6 +1,6 @@ { pkgs, config, lib, ... }: lib.mkIf config.bchmnn.audio.enable { # Enable pipewire - audio - services.pipewire = { + services.pipewire = lib.mkIf (!builtins.elem "gnome" config.bchmnn.gui.flavour) { enable = true; audio.enable = true; alsa.enable = true; diff --git a/modules/default.nix b/modules/default.nix index 3751490..17659e0 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -65,9 +65,9 @@ ./ausweisapp.nix ./bluetooth.nix ./ccache.nix + ./desktop.nix ./dbus.nix ./fonts.nix - ./greetd.nix ./gstreamer.nix ./i18n.nix ./kdeconnect.nix diff --git a/modules/greetd.nix b/modules/desktop.nix similarity index 91% rename from modules/greetd.nix rename to modules/desktop.nix index 0bf259e..1e1c381 100644 --- a/modules/greetd.nix +++ b/modules/desktop.nix @@ -7,8 +7,11 @@ services.xserver.windowManager.i3.enable = builtins.elem "i3" gui.flavour; services.xserver = { + enable = (builtins.elem "i3" gui.flavour || builtins.elem "gnome" gui.flavour); libinput.enable = true; + desktopManager.gnome.enable = builtins.elem "gnome" gui.flavour; displayManager = { + gdm.enable = builtins.elem "gnome" gui.flavour; startx.enable = builtins.elem "i3" gui.flavour; }; }; diff --git a/modules/nix.nix b/modules/nix.nix index c551420..83e8af8 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ pkgs, ... }@inputs: { nix = { # TODO remove once 24.05 is released package = pkgs.nixVersions.unstable; diff --git a/modules/packages.nix b/modules/packages.nix index 24e404c..9dfee74 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -37,7 +37,7 @@ javaPackages.openjfx17 gradle_7 bun-baseline - nodejs_21 + nodejs_20 nodenv nodePackages.yarn nodePackages.pnpm diff --git a/modules/power.nix b/modules/power.nix index 0559686..b707fc2 100644 --- a/modules/power.nix +++ b/modules/power.nix @@ -1,11 +1,10 @@ -{ pkgs, ... }: { +{ pkgs, config, ... }: with config.bchmnn; { powerManagement = { enable = true; - # powertop.enable = true; }; services.tlp = { - enable = true; + enable = !builtins.elem "gnome" gui.flavour; settings = { CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power"; diff --git a/users/gandalf/modules/gui/i3/autorandr.nix b/users/gandalf/modules/gui/i3/autorandr.nix index 8c158da..62813aa 100644 --- a/users/gandalf/modules/gui/i3/autorandr.nix +++ b/users/gandalf/modules/gui/i3/autorandr.nix @@ -8,29 +8,43 @@ nomad = { config = { "LVDS-1" = { + enable = false; + }; + }; + }; + + samsung = { + fingerprint = { + "DP-1" = "00ffffffffffff004c2d830e000e0001011c0103806b3c780a23ada4544d99260f474abdef80714f81c0810081809500a9c0b300010104740030f2705a80b0588a00501d7400001e023a801871382d40582c4500501d7400001e000000fd00184b0f511e000a202020202020000000fc0053414d53554e470a202020202001b902034cf0535f101f041305142021225d5e626364071603122909070715075057070183010000e2004fe30503016e030c001000b83c20008001020304e3060d01e50e60616566e5018b849001011d80d0721c1620102c2580501d7400009e662156aa51001e30468f3300501d7400001e000000000000000000000000000000a3"; + }; + config = { + "DP-1" = { enable = true; + primary = true; + mode = "3840x2160"; + rate = "59.94"; + position = "0x0"; }; }; }; station = { - config = { "LVDS-1" = { enable = false; }; "DP-1-3" = { - enable = true; + enable = false; mode = "1920x1080"; position = "0x0"; }; "DP-1-2" = { - enable = true; + enable = false; mode = "1920x1080"; position = "1920x0"; }; "VGA-1-2" = { - enable = true; + enable = false; mode = "1920x1080"; position = "3840x0"; }; diff --git a/users/gandalf/modules/gui/i3/default.nix b/users/gandalf/modules/gui/i3/default.nix index e63416d..f058244 100644 --- a/users/gandalf/modules/gui/i3/default.nix +++ b/users/gandalf/modules/gui/i3/default.nix @@ -10,6 +10,7 @@ in imports = [ ./autorandr.nix + ./rofi.nix ]; home.packages = with pkgs; [ @@ -26,6 +27,7 @@ in nextcloud-client # nextcloud client to connect to any instance libsForQt5.kdeconnect-kde # sync phone and pc system-config-printer # printer manager + gnome3.adwaita-icon-theme ]; xsession.windowManager.i3 = { @@ -33,8 +35,10 @@ in config = { modifier = "Mod4"; terminal = "${pkgs.alacritty}/bin/alacritty"; - menu = "${pkgs.dmenu}/bin/dmenu_run"; + menu = "${config.programs.rofi.package}/bin/rofi -show drun"; startup = with pkgs; [ + { command = "${gnome.gnome-keyring}/bin/gnome-keyring-daemon --start --components=ssh,secrets,pkcs11"; } + { command = "${autorandr}/bin/autorandr -c"; } { command = "${feh}/bin/feh --bg-fill ${common.wallpaper.default}"; } { command = "${networkmanagerapplet}/bin/nm-applet"; } { command = "${blueman}/bin/blueman-applet"; } diff --git a/users/gandalf/modules/gui/i3/rofi.nix b/users/gandalf/modules/gui/i3/rofi.nix new file mode 100644 index 0000000..04c5ac3 --- /dev/null +++ b/users/gandalf/modules/gui/i3/rofi.nix @@ -0,0 +1,13 @@ +{ pkgs, lib, ... }: +let + common = (import ../common.nix) { pkgs = pkgs; lib = lib; }; +in +{ + + programs.rofi = { + enable = true; + font = common.font; + location = "center"; + }; + +} diff --git a/users/gandalf/modules/gui/sway/default.nix b/users/gandalf/modules/gui/sway/default.nix index 779bd6a..f1aa1c2 100644 --- a/users/gandalf/modules/gui/sway/default.nix +++ b/users/gandalf/modules/gui/sway/default.nix @@ -69,7 +69,7 @@ in '' + optionalString nvidia.enable '' # nvidia export WLR_RENDERER=vulkan; - export LIBVA_DRIVER_NAME,nvidia; + # export LIBVA_DRIVER_NAME,nvidia; # export GBM_BACKEND=nvidia-drm; export __GL_GSYNC_ALLOWED=0; export __GL_VRR_ALLOWED=0; diff --git a/users/gandalf/modules/neovim/default.nix b/users/gandalf/modules/neovim/default.nix index d602e29..fe478a7 100644 --- a/users/gandalf/modules/neovim/default.nix +++ b/users/gandalf/modules/neovim/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{ pkgs, ... }: { /* xdg.configFile."nvim" = { @@ -7,6 +7,15 @@ }; */ + home.packages = with pkgs; [ + lua-language-server + clang-tools + rust-analyzer + gopls + nixd + typescript + ]; + programs.neovim = { enable = true; defaultEditor = true; diff --git a/users/gandalf/modules/ssh.nix b/users/gandalf/modules/ssh.nix index 31259f3..555cba6 100644 --- a/users/gandalf/modules/ssh.nix +++ b/users/gandalf/modules/ssh.nix @@ -2,8 +2,13 @@ programs.ssh = { enable = true; addKeysToAgent = "yes"; + includes = [ + "config.d/*" + ]; }; + home.file.".ssh/config.d/.keep".source = builtins.toFile "keep" ""; + services.ssh-agent = { enable = true; };