From dce44fa1756c9e70b9e667d540b1b12d754dbe63 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Sun, 22 Nov 2026 16:44:15 -0500 Subject: new laptop --- modules/desktop/hyprland.nix | 242 ------------------------------------------- modules/desktop/niri.nix | 38 +++++-- modules/hardware/gpu.nix | 10 +- modules/hardware/laptop.nix | 2 +- modules/security.nix | 2 - 5 files changed, 32 insertions(+), 262 deletions(-) delete mode 100644 modules/desktop/hyprland.nix (limited to 'modules') diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix deleted file mode 100644 index 3ab743f..0000000 --- a/modules/desktop/hyprland.nix +++ /dev/null @@ -1,242 +0,0 @@ -{ - config, - options, - lib, - pkgs, - ... -}: let - hyprlandConf = config.modules.desktop.hyprland; - device = config.modules.device; - defaultApps = config.modules.desktop.defaultApplications.apps; - configDir = config.nixosConfig.configDir; - - # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} - workspaces = builtins.concatLists (builtins.genList ( - x: let - ws = let - c = (x + 1) / 10; - in - builtins.toString (x + 1 - (c * 10)); - in - [ - "$mod, ${ws}, exec, /etc/nixos/bin/hyprland/workspace ${toString (x + 1)}" - "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" - ] - ) - 10); - - decoration = { - rounding = 7; - blur = { - enabled = true; - size = 3; - passes = 1; - }; - }; - - animations = { - enabled = true; - animation = [ - "border, 1, 2, default" - "fade, 1, 4, default" - "windows, 1, 3, default, popin 80%" - "workspaces, 1, 2, default, slide" - ]; - }; - - keybinds = let - monocle = "dwindle:no_gaps_when_only"; - in [ - # Compositor commands - "$mod ALTL, Q, exec, pkill Hyprland" - "$mod, Q, killactive" - - # Layout - "$mod, F, fullscreen" - "$mod, Space, togglefloating" - "$mod, S, togglesplit" - "$mod, P, pseudo" - "$mod SHIFT, grave, movetoworkspace, special" - "$mod, grave, togglespecialworkspace" - - # Group - "$mod, G, togglegroup" - "$mod, TAB, changegroupactive" - - #Focus windows - "$mod, left, movefocus, l" - "$mod, right, movefocus, r" - "$mod, up, movefocus, u" - "$mod, down, movefocus, d" - - #Focus monitor - "$mod SHIFT, left, focusmonitor, l" - "$mod SHIFT, right, focusmonitor, r" - - #Exec binds - "$mod, D, exec, wofi --show drun" - "$mod, Return, exec, ${defaultApps.terminal.cmd}" - "$mod, W, exec, ${defaultApps.browser.cmd}" - "$mod ALT, B, exec, killall -SIGUSR2 waybar" - - #Screenshot - "$mod, Print, exec, slurp | grim -g - ~/pic/$(date +%s).png" - ] - ++ workspaces; - - mousebinds = let - in [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - ]; -in { - options.modules.desktop.hyprland = { - enable = lib.mkOption { - type = lib.types.bool; - default = false; - }; - xwayland = lib.mkOption { - type = lib.types.bool; - default = true; - }; - }; - - config = lib.mkIf (hyprlandConf.enable) (lib.mkMerge [ - { - home.packages = [ - pkgs.killall - pkgs.wl-clipboard - pkgs.wdisplays - pkgs.swaylock - pkgs.swayidle - pkgs.slurp - pkgs.grim - pkgs.mako - pkgs.libnotify - pkgs.wofi - pkgs.jq - pkgs.awww - ]; - - modules.device.displayProtocol = "wayland"; - - xdg.portal = { - enable = true; - wlr = { - enable = true; - settings = { - screencast = { - chooser_type = "simple"; - chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or"; - }; - }; - }; - extraPortals = [ - pkgs.xdg-desktop-portal-gtk - pkgs.xdg-desktop-portal-hyprland - ]; - config.common.default = ["wlr" "gtk" "hyprland" ]; - }; - - environment.sessionVariables.NIXOS_OZONE_WL = "1"; - home.manager.wayland.windowManager.hyprland = { - enable = true; - xwayland.enable = hyprlandConf.xwayland; - systemd.enable = true; - - settings = { - "$mod" = "SUPER"; - - input = { - kb_layout = "us"; - follow_mouse = 1; - sensitivity = 0; - }; - - dwindle = { - pseudotile = true; - preserve_split = true; - }; - - general = { - gaps_in = 5; - gaps_out = 10; - border_size = 2; - "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; - "col.inactive_border" = "rgba(595959aa)"; - - layout = "dwindle"; - }; - exec-once = [ - "swww init" - "swww img ${configDir}/hypr/wallpaper.png" - ]; - - env = lib.mkMerge [ - ([ - "XDG_CURRENT_DESKTOP,Hyprland" - "XDG_SESSION_TYPE,wayland" - "XDG_SESSION_DESKTOP,Hyprland" - - "GDK_BACKEND,wayland,x11" - "SDL_VIDEODRIVER,wayland" - "CLUTTER_BACKEND,wayland" - "MOZ_ENABLE_WAYLAND,1" - "MOZ_DISABLE_RDD_SANDBOX,1" - "_JAVA_AWT_WM_NONREPARENTING,1" - "QT_AUTO_SCREEN_SCALE_FACTOR,1" - "QT_QPA_PLATFORM,wayland" - "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" - - "disable_hyprland_logo,true" - "force_default_wallpaper,0" - ]) - ( lib.mkIf (config.modules.device.gpu == "nvidia") - [ - "GBM_BACKEND,nvidia" - "__GLX_VENDOR_LIBRARY_NAME,nvidia" - "LIBVA_DRIVER_NAME,nvidia" - "NVD_BACKEND,direct" - "WLR_DRM_NO_ATOMIC,1" - "WLR_USE_LIBINPUT,1" - "WLR_RENDERER_ALLOW_SOFTWARE,1" - ])]; - - decoration = decoration; - animations = animations; - bind = keybinds; - bindm = mousebinds; - }; - }; - - programs.waybar = { - enable = true; - }; - - home.manager.xdg.configFile."hypr/hyprpaper.conf".source = "${configDir}/hypr/hyprpaper.conf"; - #Symlink waybar - system.userActivationScripts.linkwaybar.text = '' - if [[ ! -h "$HOME/.config/waybar" ]]; then - ln -s "${configDir}/waybar" "$HOME/.config/waybar" - fi - ''; - - security.pam.services.swaylock = {}; - } - (lib.mkIf (config.modules.desktop.greetd.enable) { - services.greetd.settings = { - default_session.command = '' - ${pkgs.greetd.tuigreet}/bin/tuigreet \ - --time \ - --asterisks \ - --user-menu \ - --cmd Hyprland - ''; - }; - - environment.etc."greetd/environments".text = '' - Hyprland - ''; - }) - ]); -} diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix index eeef603..292c5ba 100644 --- a/modules/desktop/niri.nix +++ b/modules/desktop/niri.nix @@ -21,8 +21,9 @@ in { { programs.niri.enable = true; programs.waybar.enable = true; - programs.xwayland.enable = true; + #programs.xwayland.enable = true; + services.gnome.gnome-keyring.enable = true; home.manager.services.polkit-gnome.enable = true; fonts.packages = @@ -34,33 +35,50 @@ in { libnotify killall wdisplays - xwayland-satellite wofi mako jq awww + swaybg + networkmanagerapplet + xwayland-satellite adwaita-icon-theme adwaita-icon-theme-legacy ]; home.manager.xdg.configFile."niri/config.kdl".source = "${configDir}/niri/${config.networking.hostName}.kdl"; + home.file.".icons/default".source = "${pkgs.adwaita-icon-theme}/share/icons/Adwaita"; + + home.manager.gtk.cursorTheme = { + name = "Adwaita"; + size = 12; + }; + + xdg.portal = { + enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + ]; + config.common.default = ["gtk" ]; + }; programs.regreet = { enable = true; - theme.name = "Adwaita"; + theme.name = "Adwaita-dark"; cursorTheme.name = "Adwaita"; }; - home.file.".icons/default".source = "${pkgs.adwaita-icon-theme}/share/icons/Adwaita"; - modules.device.displayProtocol = "wayland"; - environment.sessionVariables.NIXOS_OZONE_WL = "1"; + environment = { + sessionVariables.NIXOS_OZONE_WL = "1"; + pathsToLink = [ "/libexec" ]; + }; - home.manager.gtk.cursorTheme = { - name = "Adwaita"; - size = 12; + services.dbus = { + enable = true; + implementation = "broker"; }; system.userActivationScripts.linkwaybar.text = '' @@ -69,7 +87,5 @@ in { fi ''; } - (lib.mkIf (config.modules.desktop.greetd.enable) { - }) ]); } diff --git a/modules/hardware/gpu.nix b/modules/hardware/gpu.nix index 32fdf68..fce0f70 100644 --- a/modules/hardware/gpu.nix +++ b/modules/hardware/gpu.nix @@ -22,18 +22,16 @@ in { }; } (lib.mkIf (device.gpu == "intel") { - boot.initrd.kernelModules = ["i915"]; services.xserver.videoDrivers = ["modesetting"]; hardware.graphics.extraPackages = [ - pkgs.intel-compute-runtime + pkgs.vpl-gpu-rt pkgs.intel-media-driver - pkgs.intel-vaapi-driver - pkgs.libva-vdpau-driver - pkgs.libvdpau-va-gl ]; - environment.variables.VDPAU_DRIVER = "va_gl"; + environment.sessionVariables = { + LIBVA_DRIVER_NAME = "iHD"; + }; }) (lib.mkIf (device.gpu == "nvidia") { hardware.graphics.extraPackages = with pkgs; [ nvidia-vaapi-driver ]; diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index af8d581..32c7ed5 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -28,7 +28,7 @@ in { CPU_MAX_PERF_ON_AC = 100; CPU_MIN_PERF_ON_BAT = 0; - CPU_MAX_PERF_ON_BAT = 33; + CPU_MAX_PERF_ON_BAT = 50; START_CHARGE_THRESH_BAT0 = 75; STOP_CHARGE_THRESH_BAT0 = 95; diff --git a/modules/security.nix b/modules/security.nix index 3100f54..9c85577 100644 --- a/modules/security.nix +++ b/modules/security.nix @@ -9,9 +9,7 @@ in { config = { security.polkit.enable = true; - services.pcscd.enable = true; - services.gnome.gnome-keyring.enable = true; programs.gnupg.agent = { enable = true; -- cgit v1.2.3