From fc6703d8532813f575d192ac70a973bbada15408 Mon Sep 17 00:00:00 2001
From: willifan <willifan@pm.me>
Date: Mon, 21 Apr 2025 12:09:00 +0200
Subject: [PATCH 01/10] added waybar

---
 .../desktop/compositors/default.nix           |   1 +
 .../home-manager/desktop/compositors/niri.nix |   4 -
 .../desktop/compositors/waybar.nix            | 153 ++++++++++++++++++
 3 files changed, 154 insertions(+), 4 deletions(-)
 create mode 100644 modules/default/home-manager/desktop/compositors/waybar.nix

diff --git a/modules/default/home-manager/desktop/compositors/default.nix b/modules/default/home-manager/desktop/compositors/default.nix
index 5b27783..d8aafa9 100644
--- a/modules/default/home-manager/desktop/compositors/default.nix
+++ b/modules/default/home-manager/desktop/compositors/default.nix
@@ -4,5 +4,6 @@
   imports = [
     ./niri.nix
     ./river.nix
+    ./waybar.nix
   ];
 }
diff --git a/modules/default/home-manager/desktop/compositors/niri.nix b/modules/default/home-manager/desktop/compositors/niri.nix
index ee92db5..cfbdb9f 100644
--- a/modules/default/home-manager/desktop/compositors/niri.nix
+++ b/modules/default/home-manager/desktop/compositors/niri.nix
@@ -12,7 +12,6 @@ lib.mkIf config.desktop.wm.niri.enable {
 
     home.packages = [
       pkgs.xwayland-satellite
-      pkgs.ewwbar
     ];
 
     programs.niri.settings = {
@@ -22,9 +21,6 @@ lib.mkIf config.desktop.wm.niri.enable {
         {
           command = [ "xwayland-satellite" ":0" ];
         }
-        {
-          command = [ "ewwbar" ];
-        }
       ];
 
       hotkey-overlay.skip-at-startup = true;
diff --git a/modules/default/home-manager/desktop/compositors/waybar.nix b/modules/default/home-manager/desktop/compositors/waybar.nix
new file mode 100644
index 0000000..fedf2ab
--- /dev/null
+++ b/modules/default/home-manager/desktop/compositors/waybar.nix
@@ -0,0 +1,153 @@
+{ lib, config, pkgs, ... }:
+let
+  icons = fetchTarball {
+    url = "https://files.huwe.mooo.com/waybar.tar.gz";
+    sha256 = "0h5r8r7vscm6yv25kgyzx5y325n5ri78n28vmdvgmysp351drm57";
+  };
+in
+lib.mkIf config.desktop.wm.niri.enable {
+  home-manager.users.willifan = {
+    programs.waybar = {
+      enable = true;
+      settings = {
+        mainBar = {
+          layer = "top";
+          position = "top";
+          height = 25;
+          output = [
+            "eDP-1"
+          ];
+          modules-left = [ "clock" "mpris" ];
+          modules-center = [ "niri/workspaces" ];
+          modules-right = [ "tray" "group/ressources" "group/peripherals" "group/wireless" "group/power" ];
+
+          "group/ressources" = {
+            orientation = "inherit";
+            modules = [ "group/cpu" "group/memory" ];
+          };
+          "group/peripherals" = {
+            orientation = "inherit";
+            modules = [ "group/volume" "group/backlight" ];
+          };
+          "group/wireless" = {
+            orientation = "inherit";
+            modules = [ "group/networking" "group/bluetooth" ];
+          };
+          "group/power" = {
+            orientation = "inherit";
+            modules = [ "group/battery" "image#power" ];
+          };
+
+
+          "clock" = {
+            interval = 1;
+            format = "{:%H:%M:%S}";
+          };
+          "mpris" = {
+            format = "";
+            format-playing = "{dynamic}";
+            dynamic-order = [ "title" "artist" "album" "position" "length" ];
+            dynamic-len = 30; 
+          };
+          "niri/workspaces" = {
+            all-outputs = true;
+          };
+
+          "group/cpu" = {
+            orientation = "inherit";
+            modules = [ "image#cpu" "cpu" ];
+          };
+          "image#cpu" = {
+            path = "${icons}/cpu.png";
+            size = 16;
+          };
+          "cpu" = {
+            format = "{usage}%";
+          };
+
+          "group/memory" = {
+            orientation = "inherit";
+            modules = [ "image#memory" "memory" ];
+          };
+          "image#memory" = {
+            path = "${icons}/ram.png";
+            size = 16;
+          };
+          "memory" = {
+            format = "{percentage}%";
+          };
+
+          "group/volume" = {
+            orientation = "inherit";
+            modules = [ "image#volume" "wireplumber" ];
+          };
+          "image#volume" = {
+            path = "${icons}/volume.png";
+            size = 16;
+          };
+          "wireplumber" = {
+            format = "{volume}%";
+          };
+
+          "group/backlight" = {
+            orientation = "inherit";
+            modules = [ "image#backlight" "backlight" ];
+          };
+          "image#backlight" = {
+            path = "${icons}/brightness.png";
+            size = 16;
+          };
+          "backlight" = {
+            format = "{percent}%";
+          };
+
+          "group/networking" = {
+            orientation = "inherit";
+            modules = [ "image#networking" "network" ];
+          };
+          "image#networking" = {
+            path = "${icons}/wifiHigh.png";
+            size = 16;
+          };
+          "network" = {
+            format = "{signalStrength}%";
+          };
+
+          "group/bluetooth" = {
+            orientation = "inherit";
+            modules = [ "image#bluetooth" "bluetooth" ];
+          };
+          "image#bluetooth" = {
+            path = "${icons}/bluetooth.png";
+            size = 16;
+          };
+          "bluetooth" = {
+            format = "{status}";
+          };
+
+          "group/battery" = {
+            orientation = "inherit";
+            modules = [ "image#battery" "battery" ];
+          };
+          "image#battery" = {
+            path = "${icons}/battery.png";
+            size = 16;
+          };
+          "battery" = {
+            format = "{capacity}%";
+          };
+
+          "image#power" = {
+            path = "${icons}/power.png";
+            size = 16;
+          };
+        };
+      };
+
+      systemd = {
+        enable = true;
+      };
+
+    };
+  };
+}

From 08e850ed59dc21ca6cf911c09fd8e65cf9823552 Mon Sep 17 00:00:00 2001
From: willifan <willifan@pm.me>
Date: Wed, 23 Apr 2025 17:02:42 +0200
Subject: [PATCH 02/10] migrate Lenni to AMD mainboard

---
 flake.nix                              |  2 +-
 hosts/Lenni/default.nix                |  2 +-
 hosts/Lenni/hardware-configuration.nix | 25 ++++++++++++++-----------
 3 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/flake.nix b/flake.nix
index 5f5e61b..5e35a81 100644
--- a/flake.nix
+++ b/flake.nix
@@ -81,7 +81,7 @@
               inputs.disko.nixosModules.disko
               inputs.stylix.nixosModules.stylix
               inputs.nixvim.nixosModules.nixvim
-              inputs.nixos-hardware.nixosModules.framework-12th-gen-intel
+              inputs.nixos-hardware.nixosModules.framework-13-7040-amd
               ./hosts/Lenni
               ./pkgs
             ];
diff --git a/hosts/Lenni/default.nix b/hosts/Lenni/default.nix
index 7355bfa..6229c86 100644
--- a/hosts/Lenni/default.nix
+++ b/hosts/Lenni/default.nix
@@ -1,7 +1,7 @@
 { ... }:
 {
   imports = [
-    ./auto-cpufreq.nix
+    #./auto-cpufreq.nix
     ./backlight.nix
     ./hardware-configuration.nix
     #./disko.nix
diff --git a/hosts/Lenni/hardware-configuration.nix b/hosts/Lenni/hardware-configuration.nix
index 0197924..6d4c1f3 100644
--- a/hosts/Lenni/hardware-configuration.nix
+++ b/hosts/Lenni/hardware-configuration.nix
@@ -1,22 +1,20 @@
 # 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, modulesPath, ... }:
+{ config, lib, pkgs, modulesPath, ... }:
 
 {
   imports =
-    [
-      (modulesPath + "/installer/scan/not-detected.nix")
+    [ (modulesPath + "/installer/scan/not-detected.nix")
     ];
 
-  boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
+  boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" ];
   boot.initrd.kernelModules = [ ];
-  boot.kernelModules = [ "kvm-intel" ];
+  boot.kernelModules = [ "kvm-amd" ];
   boot.extraModulePackages = [ ];
 
   fileSystems."/" =
-    {
-      device = "/dev/disk/by-uuid/e09e7d80-9d85-49e6-8b0e-1f31aea83840";
+    { device = "/dev/disk/by-uuid/e09e7d80-9d85-49e6-8b0e-1f31aea83840";
       fsType = "btrfs";
       options = [ "subvol=@" ];
     };
@@ -24,12 +22,16 @@
   boot.initrd.luks.devices."luks-a2f76baf-2f27-42a4-ae48-1963c566a9ab".device = "/dev/disk/by-uuid/a2f76baf-2f27-42a4-ae48-1963c566a9ab";
 
   fileSystems."/boot" =
-    {
-      device = "/dev/disk/by-uuid/2A99-D7CC";
+    { device = "/dev/disk/by-uuid/2A99-D7CC";
       fsType = "vfat";
       options = [ "fmask=0022" "dmask=0022" ];
     };
 
+  fileSystems."/mnt/nfs" =
+    { device = "/nix/store/8zm9gh07p3rx8b3vqiwa1qb7zsml17sk-auto.nfs";
+      fsType = "autofs";
+    };
+
   swapDevices = [ ];
 
   # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
@@ -37,8 +39,9 @@
   # still possible to use this option, but it's recommended to use it in conjunction
   # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
   networking.useDHCP = lib.mkDefault true;
-  # networking.interfaces.wlp166s0.useDHCP = lib.mkDefault true;
+  # networking.interfaces.enp195s0f3u1c2.useDHCP = lib.mkDefault true;
+  # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
 
   nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
-  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
 }

From 74f16b7a4889de37754cc648b2ac916fdecf8461 Mon Sep 17 00:00:00 2001
From: willifan <willifan@pm.me>
Date: Wed, 23 Apr 2025 18:26:59 +0200
Subject: [PATCH 03/10] switched networkmanager backend to iwd

---
 modules/default/nixos/default.nix    |  5 +----
 modules/default/nixos/networking.nix | 10 ++++++++++
 2 files changed, 11 insertions(+), 4 deletions(-)
 create mode 100644 modules/default/nixos/networking.nix

diff --git a/modules/default/nixos/default.nix b/modules/default/nixos/default.nix
index dd0d317..82e1d35 100644
--- a/modules/default/nixos/default.nix
+++ b/modules/default/nixos/default.nix
@@ -16,6 +16,7 @@
     ./keyd.nix
     ./locales.nix
     ./mimetype.nix
+    ./networking.nix
     ./optimise.nix
     ./options.nix
     ./packages.nix
@@ -25,10 +26,6 @@
     ./users.nix
   ];
 
-  networking = {
-    networkmanager.enable = true;
-    hostName = "${hostname}";
-  };
 
   console.keyMap = "en";
   nix = {
diff --git a/modules/default/nixos/networking.nix b/modules/default/nixos/networking.nix
new file mode 100644
index 0000000..ea614ba
--- /dev/null
+++ b/modules/default/nixos/networking.nix
@@ -0,0 +1,10 @@
+{ hostname, ... }:
+{
+  networking = {
+    networkmanager = {
+      enable = true;
+      wifi.backend = "iwd";
+    };
+    hostName = "${hostname}";
+  };
+}

From bfc71700b5c3842a86547d81a1d838d3b0c8cf98 Mon Sep 17 00:00:00 2001
From: willifan <willifan@pm.me>
Date: Wed, 23 Apr 2025 18:36:34 +0200
Subject: [PATCH 04/10] remove unnecessary users directory

---
 .../desktop/hyprland/common/hyprland.nix      | 266 ------------------
 1 file changed, 266 deletions(-)
 delete mode 100644 users/willifan/desktop/hyprland/common/hyprland.nix

diff --git a/users/willifan/desktop/hyprland/common/hyprland.nix b/users/willifan/desktop/hyprland/common/hyprland.nix
deleted file mode 100644
index 3f7c0f3..0000000
--- a/users/willifan/desktop/hyprland/common/hyprland.nix
+++ /dev/null
@@ -1,266 +0,0 @@
-{ pkgs, home-manager, ... }:
-{
-  home-manager.users.willifan = {
-    wayland.windowManager.hyprland = {
-      enable = true;
-      systemd.variables = ["--all"];
-      package = pkgs.hyprland;
-      settings = {
-
-
-    "$SCRIPTS" = "$XDG_CONFIG_HOME/desktop-utils/scripts";
-
-        misc = {
-        	disable_hyprland_logo=true;
-        };
-
-        monitor = [
-          ", preffered, auto, 1"
-          "eDP-1, preferred, 0x0, 1.6"
-          "desc:ViewSonic Corporation VX2705-2KP W6Z205100250, 2560x1440@144Hz, 0x384, 1.25"
-          "desc:ViewSonic Corporation VX2705-2KP W6Z210400766, 2560x1440@144Hz, 2048x384, 1.25"
-          "desc:BNQ BenQ BL2283 CAM01567019, 1920x1080@60Hz, 4096x0, 1.0, transform, 3"
-        ];
-        # Execute your favorite apps at launch
-        exec-once = [
-          ''hyprctl dispatch exec "[workspace 1 silent] kitty"''
-          ''hyprctl dispatch exec "[workspace 2 silent] firefox"''
-          #''hyprctl dispatch exec "[workspace 3 silent] "''
-          #''hyprctl dispatch exec "[workspace 4 silent] "''
-          #''hyprctl dispatch exec "[workspace 8 silent] "''
-          ''hyprctl dispatch exec "[workspace 9 silent] vesktop"''
-          ''hyprctl dispatch exec "[workspace special:ctrl silent] thunar"''
-          ''hyprctl dispatch exec "[workspace special:alt silent] obsidian"''
-          ''hyprctl dispatch exec "[workspace special:altgr silent] thunderbird"''
-          #''exec-once = hyprctl dispatch exec "[workspace special:strg silent] "''
-        ];
-
-        xwayland.force_zero_scaling = true;
-
-        input = {
-            kb_layout = "de";
-            kb_variant = "";
-            kb_model = "";
-            kb_options = "";
-            kb_rules = "";
-
-            follow_mouse = 1;
-
-            touchpad.natural_scroll = "yes";
-            
-            sensitivity = -0.8; # -1.0 - 1.0, 0 means no modification.
-            numlock_by_default = 1;
-            special_fallthrough = true;
-        };
-
-
-
-        general = {
-
-            gaps_in = 2;
-            gaps_out = 5;
-            border_size = 2;
-#            "col.active_border" = "rgba(ffa44bee)";
-#            "col.inactive_border" = "rgba(595959aa)";
-
-            layout = "dwindle";
-
-            resize_on_border = true;
-        };
-
-        decoration = {
-
-          rounding = 10;
-
-          blur = {
-          	enabled = false;
-          	size = 3;
-          	passes = 1;
-          	new_optimizations = 1;
-          };
-
-          drop_shadow = "yes";
-          shadow_range = 4;
-          shadow_render_power = 3;
-#          "col.shadow" = "rgba(1a1a1aee)";
-        };
-
-        misc = {
-            vfr = true;
-            mouse_move_enables_dpms = true;
-        };
-
-        animations = {
-            enabled = "yes";
-
-            bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
-
-            animation = [
-              "windows, 1, 7, myBezier"
-              "windowsOut, 1, 7, default, popin 80%"
-              "border, 1, 10, default"
-              "borderangle, 1, 8, default"
-              "fade, 1, 7, default"
-              "workspaces, 1, 6, default"
-              "specialWorkspace, 1, 8, default, slidefadevert 20%"
-            ];
-        };
-
-        dwindle = {
-            pseudotile = "yes"; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
-            preserve_split = "yes"; # you probably want this
-        };
-
-        gestures = {
-            workspace_swipe = "on";
-            workspace_swipe_create_new = "false";
-        };
-
-        device = {
-            name = "pixa3854:00-093a:0274-touchpad";
-            sensitivity = 0;
-            natural_scroll = "yes";
-        };
-
-        windowrule = [
-          "idleinhibit fullscreen, ^(firefox)$"
-          "float, ^(thunar)$"
-          "stayfocused, title:^(Enpass Assistant)$"
-          "pin, title:^(Enpass Assistant)$"
-          "center, title:^(Enpass Assistant)$"
-          "float, ^(Enpass)$"
-          "center, ^(Enpass)$"
-          "float, ^(blueman-manager)$"
-          "move -0% 0%, ^(blueman-manager)$"
-          "float, ^(org.gnome.Calendar)$"
-          "move 20% 5%, ^(org.gnome.Calendar)$"
-          "size 60% 60%, ^(org.gnome.Calendar)$"
-          "float, ^(org.gnome.Calculator)$"
-        ];
-
-        windowrulev2 = [
-          "center, xwayland:(1)"
-          "nofocus,class:^jetbrains-(?!toolbox),floating:1,title:^win\d+$"
-          ''workspace +0, workspace:name:special:ctrl, floating:0''
-          ''float, workspace:name:special:altgr, onworkspace:w[2]''
-          ''float, workspace:name:special:strg, onworkspace:w[1]''
-          ''workspace +0, workspace:name:special:strg, floating:0''
-        ];
-
-        "$mainMod" = "SUPER";
-
-        bind = [
-          ''$mainMod, Q, exec, kitty''
-          ''$mainMod, C, killactive, ''
-          ''$mainMod, M, exit, ''
-          ''$mainMod, E, exec, thunar''
-          ''$mainMod, V, togglefloating, ''
-          ''$mainMod, R, exec, wofi --show drun''
-          ''$mainMod, J, togglesplit, # dwindle''
-          ''$mainMod, P, exec, Enpass''
-          ''$mainMod, T, exec, hyprctl dispatch exec "[float; pin; size 40% 40%; move 100%-41% 40] kitty btop -b proc"''
-          ''$mainMod, W, exec, networkmanager_dmenu''
-          ''$mainMod, F, fullscreen''
-
-          # Move focus with mainMod + arrow keys
-          ''$mainMod, left, movefocus, l''
-          ''$mainMod, right, movefocus, r''
-          ''$mainMod, up, movefocus, u''
-          ''$mainMod, down, movefocus, d''
-
-          '', XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle''
-          '', XF86AudioPrev, exec, playerctl previous''
-          '', XF86AudioPlay, exec, playerctl play-pause''
-          '', XF86AudioNext, exec, playerctl next''
-          '', print, exec, grim -g "$(slurp)" - | wl-copy -t image/png''
-
-          # Switch workspaces with mainMod + [0-9]
-          ''$mainMod, 1, exec, $SCRIPTS/workspaces.sh 1''
-          ''$mainMod, 2, exec, $SCRIPTS/workspaces.sh 2''
-          ''$mainMod, 3, exec, $SCRIPTS/workspaces.sh 3''
-          ''$mainMod, 4, exec, $SCRIPTS/workspaces.sh 4''
-          ''$mainMod, 5, exec, $SCRIPTS/workspaces.sh 5''
-          ''$mainMod, 6, exec, $SCRIPTS/workspaces.sh 6''
-          ''$mainMod, 7, exec, $SCRIPTS/workspaces.sh 7''
-          ''$mainMod, 8, exec, $SCRIPTS/workspaces.sh 8''
-          ''$mainMod, 9, exec, $SCRIPTS/workspaces.sh 9''
-
-          # Move active window to a workspace with mainMod + SHIFT + [0-9]
-          ''$mainMod SHIFT, 1, movetoworkspace, 1''
-          ''$mainMod SHIFT, 2, movetoworkspace, 2''
-          ''$mainMod SHIFT, 3, movetoworkspace, 3''
-          ''$mainMod SHIFT, 4, movetoworkspace, 4''
-          ''$mainMod SHIFT, 5, movetoworkspace, 5''
-          ''$mainMod SHIFT, 6, movetoworkspace, 6''
-          ''$mainMod SHIFT, 7, movetoworkspace, 7''
-          ''$mainMod SHIFT, 8, movetoworkspace, 8''
-          ''$mainMod SHIFT, 9, movetoworkspace, 9''
-
-          # Monitor focus
-          ''$mainMod ALT, 1, focusmonitor, 0''
-          ''$mainMod ALT, 2, focusmonitor, 1''
-          ''$mainMod ALT, 3, focusmonitor, 2''
-          ''$mainMod ALT, 4, focusmonitor, 3''
-          ''$mainMod ALT, 5, focusmonitor, 4''
-          ''$mainMod ALT, 6, focusmonitor, 5''
-          ''$mainMod ALT, 7, focusmonitor, 6''
-          ''$mainMod ALT, 8, focusmonitor, 7''
-          ''$mainMod ALT, 9, focusmonitor, 8''
-          ''$mainMod ALT, 0, focusmonitor, 9''
-
-          # Scroll through existing workspaces with mainMod + scroll
-          ''$mainMod, mouse_down, workspace, e+1''
-          ''$mainMod, mouse_up, workspace, e-1''
-        ];
-        
-        binde = [
-          '', XF86AudioLowerVolume, exec, $SCRIPTS/volume.sh -5''
-          '', XF86AudioRaiseVolume, exec, $SCRIPTS/volume.sh 5''
-        ];
-
-        bindel = [
-          '', XF86MonBrightnessDown, exec, $SCRIPTS/brightness.sh -4800''
-          '', XF86MonBrightnessUp, exec, $SCRIPTS/brightness.sh 4800''
-        ];
-
-        bindr = [
-          ''SUPERCTRL, Control_L, togglespecialworkspace, ctrl''
-          ''SUPERALT, Alt_L, togglespecialworkspace, alt''
-          ''SUPERMOD5, ISO_Level3_Shift, togglespecialworkspace, altgr''
-          ''SUPERCTRL, Control_R, togglespecialworkspace, strg''
-        ];
-        
-        bindm = [
-          # Move/resize windows with mainMod + LMB/RMB and dragging
-          ''$mainMod, mouse:272, movewindow''
-          ''$mainMod, mouse:273, resizewindow''
-        ];
-        
-        # ------------------------------------------
-        #  ########################################
-        #  #######	    Workspaces	    ###########
-        #  ########################################
-        # ------------------------------------------
-
-        workspace = [
-          "1, persistent:true"
-          "2, persistent:true"
-          "3, persistent:true"
-          "4, persistent:true"
-          "5, persistent:true"
-          "6, persistent:true"
-          "7, persistent:true"
-          "8, persistent:true"
-          "8, persistent:true"
-          "9, persistent:true"
-
-          "name:special:ctrl, persistent:true"
-          "name:special:alt, persistent:true"
-          "name:special:altgr, persistent:true"
-          "name:special:strg, persistent:true"
-        ];
-
-      };
-    };
-  };
-}

From 31f9350f78b1b59da7af2231e135cc72664701dc Mon Sep 17 00:00:00 2001
From: willifan <willifan@pm.me>
Date: Wed, 23 Apr 2025 18:44:23 +0200
Subject: [PATCH 05/10] fix framework backlight

---
 hosts/Lenni/backlight.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hosts/Lenni/backlight.nix b/hosts/Lenni/backlight.nix
index f15267d..6db2849 100644
--- a/hosts/Lenni/backlight.nix
+++ b/hosts/Lenni/backlight.nix
@@ -1,6 +1,6 @@
 { pkgs, ... }:
 {
   services.udev.extraRules = ''
-    ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness"
+    ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness"
   '';
 }

From 928bdb251cfca564b0dd298754b2324ffe2aeecf Mon Sep 17 00:00:00 2001
From: willifan <willifan@pm.me>
Date: Thu, 24 Apr 2025 18:08:41 +0200
Subject: [PATCH 06/10] enable niri variable refresh rate

---
 modules/default/home-manager/desktop/compositors/niri.nix | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/default/home-manager/desktop/compositors/niri.nix b/modules/default/home-manager/desktop/compositors/niri.nix
index cfbdb9f..a4f5d70 100644
--- a/modules/default/home-manager/desktop/compositors/niri.nix
+++ b/modules/default/home-manager/desktop/compositors/niri.nix
@@ -15,7 +15,10 @@ lib.mkIf config.desktop.wm.niri.enable {
     ];
 
     programs.niri.settings = {
-      outputs."eDP-1".scale = 1.6;
+      outputs."eDP-1" = {
+        scale = 1.6;
+        variable-refresh-rate = true;
+      };
 
       spawn-at-startup = [
         {

From f7b6dc0403de605587335f6353af276ac21e0d98 Mon Sep 17 00:00:00 2001
From: willifan <willifan@pm.me>
Date: Thu, 24 Apr 2025 18:13:40 +0200
Subject: [PATCH 07/10] added framework firmware update tool

---
 hosts/Lenni/default.nix | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hosts/Lenni/default.nix b/hosts/Lenni/default.nix
index 6229c86..c283d16 100644
--- a/hosts/Lenni/default.nix
+++ b/hosts/Lenni/default.nix
@@ -26,6 +26,7 @@
     };
   };
 
+  services.fwupd.enable = true;
   hardware.bluetooth.enable = true;
   services.hardware.bolt.enable = true;
 

From 55007f1a44f488d6d9deaaa1067977342d4291df Mon Sep 17 00:00:00 2001
From: willifan <willifan@pm.me>
Date: Thu, 24 Apr 2025 18:15:16 +0200
Subject: [PATCH 08/10] removed unused Lenni configurations

---
 hosts/Lenni/auto-cpufreq.nix | 16 ----------------
 hosts/Lenni/backlight.nix    |  6 ------
 hosts/Lenni/default.nix      |  2 --
 3 files changed, 24 deletions(-)
 delete mode 100644 hosts/Lenni/auto-cpufreq.nix
 delete mode 100644 hosts/Lenni/backlight.nix

diff --git a/hosts/Lenni/auto-cpufreq.nix b/hosts/Lenni/auto-cpufreq.nix
deleted file mode 100644
index 8a48773..0000000
--- a/hosts/Lenni/auto-cpufreq.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ ... }:
-{
-  services.auto-cpufreq = {
-    enable = true;
-    settings = {
-      battery = {
-        governor = "powersave";
-        turbo = "never";
-      };
-      charger = {
-        governor = "powersave";
-        turbo = "never";
-      };
-    };
-  };
-}
diff --git a/hosts/Lenni/backlight.nix b/hosts/Lenni/backlight.nix
deleted file mode 100644
index 6db2849..0000000
--- a/hosts/Lenni/backlight.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ pkgs, ... }:
-{
-  services.udev.extraRules = ''
-    ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness"
-  '';
-}
diff --git a/hosts/Lenni/default.nix b/hosts/Lenni/default.nix
index c283d16..1646345 100644
--- a/hosts/Lenni/default.nix
+++ b/hosts/Lenni/default.nix
@@ -1,8 +1,6 @@
 { ... }:
 {
   imports = [
-    #./auto-cpufreq.nix
-    ./backlight.nix
     ./hardware-configuration.nix
     #./disko.nix
 

From 4910c67db8a28348c6b7d0413bf597c6f85dac16 Mon Sep 17 00:00:00 2001
From: willifan <willifan@pm.me>
Date: Thu, 24 Apr 2025 21:45:34 +0200
Subject: [PATCH 09/10] added light for screen brightness

---
 modules/default/home-manager/desktop/compositors/niri.nix | 7 +++++--
 modules/default/nixos/users.nix                           | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/default/home-manager/desktop/compositors/niri.nix b/modules/default/home-manager/desktop/compositors/niri.nix
index a4f5d70..5b620b8 100644
--- a/modules/default/home-manager/desktop/compositors/niri.nix
+++ b/modules/default/home-manager/desktop/compositors/niri.nix
@@ -8,6 +8,8 @@ lib.mkIf config.desktop.wm.niri.enable {
 
   programs.niri.enable = true;
 
+  programs.light.enable = true;
+
   home-manager.users.willifan = {
 
     home.packages = [
@@ -49,6 +51,7 @@ lib.mkIf config.desktop.wm.niri.enable {
           };
           clip-to-geometry = true;
 
+
           open-maximized = true;
         }
       ];
@@ -74,8 +77,8 @@ lib.mkIf config.desktop.wm.niri.enable {
         "XF86AudioPrev".action.spawn = [ "playerctl" "previous" ];
         "XF86AudioPlay".action.spawn = [ "playerctl" "play-pause" ];
         "XF86AudioNext".action.spawn = [ "playerctl" "next" ];
-        "XF86MonBrightnessDown".action.spawn = [ "sh" "-c" "${SCRIPTS}/brightness.sh -4800" ];
-        "XF86MonBrightnessUp".action.spawn = [ "sh" "-c" "${SCRIPTS}/brightness.sh 4800" ];
+        "XF86MonBrightnessDown".action.spawn = [ "light" "-U" "5" ];
+        "XF86MonBrightnessUp".action.spawn = [ "light" "-A" "5" ];
         "Print".action.screenshot = { };
       };
 
diff --git a/modules/default/nixos/users.nix b/modules/default/nixos/users.nix
index 260801d..d619cb6 100644
--- a/modules/default/nixos/users.nix
+++ b/modules/default/nixos/users.nix
@@ -4,7 +4,7 @@
     isNormalUser = true;
     linger = true;
     description = "willifan";
-    extraGroups = [ "networkmanager" "wheel" ];
+    extraGroups = [ "networkmanager" "wheel" "video" ];
     shell = pkgs.bash;
   };
 

From cc35fd1aba2a454e35bb89aba5817fabc18012ac Mon Sep 17 00:00:00 2001
From: willifan <willifan@pm.me>
Date: Fri, 25 Apr 2025 22:36:47 +0200
Subject: [PATCH 10/10] Added auto-epp to Lenni

---
 hosts/Lenni/default.nix | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hosts/Lenni/default.nix b/hosts/Lenni/default.nix
index 1646345..9064ff8 100644
--- a/hosts/Lenni/default.nix
+++ b/hosts/Lenni/default.nix
@@ -24,6 +24,7 @@
     };
   };
 
+services.auto-epp.enable = true;
   services.fwupd.enable = true;
   hardware.bluetooth.enable = true;
   services.hardware.bolt.enable = true;