Johan Rong 2 месяцев назад
Родитель
Сommit
61bbc342d4

+ 10 - 0
home/features/desktop/hyprland/bg/default.nix

@@ -0,0 +1,10 @@
+{ pkgs, lib, ... }:
+
+{
+  home = {
+    file = {
+      ".config/sway/bg/reef.png".source = ./reef.png;
+      ".config/sway/bg/reef-2.png".source = ./reef-2.png;
+    };
+  };
+}

BIN
home/features/desktop/hyprland/bg/reef-2.png


BIN
home/features/desktop/hyprland/bg/reef.png


+ 46 - 0
home/features/desktop/hyprland/default.nix

@@ -0,0 +1,46 @@
+{ config, pkgs, lib, ... }:
+
+let 
+  customQuickshell = pkgs.symlinkJoin {
+    name = "quickshell-wrapped";
+    paths = [ pkgs.quickshell ];
+    buildInputs = [ pkgs.makeWrapper ];
+    postBuild = ''
+      wrapProgram $out/bin/qs \
+        --prefix QML2_IMPORT_PATH : "${lib.makeSearchPath "lib/qt-6/qml" (with pkgs.kdePackages; [
+          qtdeclarative
+          qt5compat
+          qtsvg
+          qtimageformats
+          qtmultimedia
+        ])}"
+    '';
+  };
+in
+{
+  imports = [
+    ./hyprland.nix
+
+    ./bg
+
+    ./theming/notwaita.nix
+    ./theming/breeze-dark.nix
+  ];
+
+  home.packages = [
+    customQuickshell
+  ];
+
+  xdg.userDirs = {
+    enable = true;
+    createDirectories = true;
+    
+    documents = "$HOME/Documents";
+    download = "$HOME/Downloads";
+    desktop = "$HOME/Desktop";
+    music = "$HOME/Music";
+    pictures = "$HOME/Pictures";
+    videos = "$HOME/Videos";
+    projects = "$HOME/Projects";
+  };
+}

+ 5 - 0
home/features/desktop/hyprland/hyprland.nix

@@ -0,0 +1,5 @@
+{ config, pkgs, lib, ... }:
+
+{
+  
+}

+ 56 - 0
home/features/desktop/hyprland/theming/breeze-dark.nix

@@ -0,0 +1,56 @@
+{ pkgs, lib, ... }:
+{
+  home.packages = with pkgs; [
+    kdePackages.breeze
+    kdePackages.breeze-gtk
+    kdePackages.breeze-icons
+  ];
+
+  gtk = {
+    enable = true;
+    theme = {
+      name = "Breeze-Dark";
+      package = pkgs.kdePackages.breeze-gtk;
+    };
+    iconTheme = {
+      name = "breeze-dark";
+      package = pkgs.kdePackages.breeze-icons;
+    };
+  };
+
+  home = {
+    file = {
+      kdeglobals = {
+        target = ".config/kdeglobals";
+        text = ''
+          [UiSettings]
+          ColorScheme=BreezeDark
+
+          [KDE]
+          ShowDeleteCommand=true
+
+          [KFileDialog Settings]
+          Allow Expansion=false
+          Automatically select filename extension=true
+          Breadcrumb Navigation=true
+          Decoration position=2
+          Show Full Path=false
+          Show Inline Previews=true
+          Show Preview=false
+          Show Speedbar=true
+          Show hidden files=false
+          Sort by=Name
+          Sort directories first=true
+          Sort hidden files last=false
+          Sort reversed=false
+          Speedbar Width=144
+          View Style=Simple
+
+          [PreviewSettings]
+          EnableRemoteFolderThumbnail=false
+          MaximumRemoteSize=0
+        '';
+      };
+    };
+  };
+}

+ 26 - 0
home/features/desktop/hyprland/theming/notwaita.nix

@@ -0,0 +1,26 @@
+{ pkgs, lib, ... }:
+
+let
+  notwaitaBlackSrc = pkgs.fetchurl {
+    url = "https://github.com/ful1e5/notwaita-cursor/releases/download/v1.0.0-alpha1/Notwaita-Black.tar.xz";
+    sha256 = "sha256-P/F4NRBqz/6Ws9//qEKMYdqtfG5LdZa6jihqueZnx88==";
+  };
+
+  notwaitaBlackCursor = pkgs.runCommand "notwaita-black-cursor" {
+    nativeBuildInputs = [ pkgs.xz pkgs.gnutar ];
+  } ''
+    mkdir -p $out/share/icons
+    tar -xJf ${notwaitaBlackSrc} -C $out/share/icons
+  '';
+in
+{
+  home = {
+    pointerCursor = {
+      package = notwaitaBlackCursor;
+      name = "Notwaita-Black";
+      size = 20; # adjust size you want
+      gtk.enable = true;
+      x11.enable = true;
+    };
+  };
+}

+ 1 - 1
home/features/desktop/sway/default.nix

@@ -11,7 +11,7 @@
     ./ui/waybar
     ./ui/mako.nix
 
-    #./swayodroid
+    ./m3-quickshell
 
     ./theming/notwaita.nix
     ./theming/breeze-dark.nix

+ 30 - 0
home/features/desktop/sway/m3-quickshell/default.nix

@@ -0,0 +1,30 @@
+{ config, pkgs, lib, ... }:
+
+let
+  customQuickshell = pkgs.symlinkJoin {
+    name = "quickshell-wrapped";
+    paths = [ pkgs.quickshell ];
+    buildInputs = [ pkgs.makeWrapper ];
+    postBuild = ''
+      wrapProgram $out/bin/qs \
+        --prefix QML2_IMPORT_PATH : "${lib.makeSearchPath "lib/qt-6/qml" (with pkgs.kdePackages; [
+          qtdeclarative
+          qt5compat
+          qtsvg
+          qtimageformats
+          qtmultimedia
+        ])}"
+    '';
+  };
+in 
+{
+  home.packages = [
+    customQuickshell
+  ];
+
+  #programs.quickshell = {
+  #  enable = true;
+  #  configs.m3 = ./.;
+  #  activeConfig = "m3";
+  #};
+}

+ 28 - 0
home/features/desktop/sway/m3-quickshell/shell.qml

@@ -0,0 +1,28 @@
+import Quickshell
+import Quickshell.Wayland
+import QtQuick
+
+
+ShellRoot {
+    Variants {
+        model: Quickshell.screens
+
+        delegate: PanelWindow {
+            required property var modelData
+            
+            screen: modelData
+            
+            anchors.bottom: true
+            anchors.left: true
+            anchors.right: true
+            implicitHeight: 32
+            color: "#1a1b26"
+
+            Text {
+                anchors.centerIn: parent
+                text: "Monitor Profile: " + (parent.screen ? parent.screen.name : "Initializing...")
+                color: "#a9b1d6"
+            }
+        }
+    }
+}

+ 0 - 7
home/features/desktop/sway/swayodroid/default.nix

@@ -1,7 +0,0 @@
-{ config, pkgs, inputs, ... }:
-
-{
-  imports = [
-    inputs.swayodroid.homeManagerModules.default
-  ];
-}

+ 8 - 0
home/flavors/desktop/hyprland/default.nix

@@ -0,0 +1,8 @@
+{ pkgs, lib, ... }:
+{
+  imports = [
+    ../../../features/desktop/hyprland
+    ../../../features/application/bashrc.nix
+    ../../../features/application/alacritty.nix
+  ];
+}

+ 2 - 2
hosts/nixstation/configuration.nix

@@ -11,8 +11,8 @@ in
     ../../nixos/hardware/networking/bcm4360.nix
     ../../nixos/hardware/sound
     ../../nixos/hardware/bluetooth
-    ../../nixos/flavors/desktop/sway
-    ../../nixos/flavors/desktop/sway/greeter-default.nix
+    ../../nixos/flavors/desktop/hyprland
+    ../../nixos/flavors/desktop/hyprland/greeter-default.nix
     ../../nixos/features/system/basic.nix
     ../../nixos/features/system/users.nix
     ../../nixos/features/system/gaming.nix

+ 18 - 18
hosts/nixstation/home.nix

@@ -4,7 +4,7 @@ let
 in
 {
   imports = [
-    ../../home/flavors/desktop/sway
+    ../../home/flavors/desktop/hyprland
     ../../home/flavors/application/workstation
     ../../home/flavors/application/development
   ];
@@ -17,21 +17,21 @@ in
     stateVersion = "26.05";
   };
 
-  custom.swayExtras = {
-    displays = ''
-      output DP-2 pos 0 0 mode 1920x1080@143.981Hz
-      output HDMI-A-1 mode 1920x1080@143.981Hz
-
-      output * adaptive_sync off
-
-      workspace 1 output DP-2
-      workspace 2 output DP-2
-      workspace 3 output DP-2
-
-      workspace 11 output HDMI-A-1
-      workspace 12 output HDMI-A-1
-      workspace 13 output HDMI-A-1
-      workspace 14 output HDMI-A-1
-    '';
-  };
+  #custom.swayExtras = {
+  #  displays = ''
+  #    output DP-2 pos 0 0 mode 1920x1080@143.981Hz
+  #    output HDMI-A-1 mode 1920x1080@143.981Hz
+#
+  #    output * adaptive_sync off
+#
+  #    workspace 1 output DP-2
+  #    workspace 2 output DP-2
+  #    workspace 3 output DP-2
+#
+  #    workspace 11 output HDMI-A-1
+  #    workspace 12 output HDMI-A-1
+  #    workspace 13 output HDMI-A-1
+  #    workspace 14 output HDMI-A-1
+  #  '';
+  #};
 }

+ 60 - 0
nixos/flavors/desktop/hyprland/default.nix

@@ -0,0 +1,60 @@
+{ config, pkgs, ... }:
+{
+  imports = [
+    
+  ];
+
+  environment.systemPackages = with pkgs; [
+    cliphist
+    wl-clipboard
+    mission-center
+    hyprpicker
+    nomacs
+    gammastep
+    geoclue2
+    wtype
+
+    kitty
+    alacritty
+
+    hyprlauncher
+  ];
+
+  programs.hyprland = {
+    enable = true;
+    withUWSM = true;
+    xwayland.enable = true;
+  };
+
+  programs.kdeconnect.enable = true;
+
+  environment.variables = {
+    GDK_BACKEND = "wayland";
+    XDG_SESSION_TYPE = "wayland";
+    WLR_DRM_NO_ATOMIC = "1";
+    NIXOS_OZONE_WL = "1";
+    WLR_RENDERER = "vulkan";
+    WLR_NO_HARDWARE_CURSORS = "1";
+    ELECTRON_OZONE_PLATFORM_HINT = "wayland";
+  };
+
+  xdg.portal = {
+    enable = true;
+
+    wlr.enable = true;
+
+    extraPortals = with pkgs; [
+      xdg-desktop-portal-wlr
+    ];
+  };
+
+  environment.sessionVariables = {
+    NIXOS_OZONE_WL = "1";
+    QT_QPA_PLATFORM = "wayland";
+    XDG_CURRENT_DESKTOP = "hyprland";
+    WLR_NO_HARDWARE_CURSORS = "1";
+  };
+
+  services.gnome.gnome-keyring.enable = true;
+  security.pam.services.login.enableGnomeKeyring = true;
+}

+ 22 - 0
nixos/flavors/desktop/hyprland/greeter-default.nix

@@ -0,0 +1,22 @@
+{ config, pkgs, ... }:
+
+
+let
+  users = import ./../../../../config/users.nix;
+in
+{
+  environment.systemPackages = with pkgs; [
+    tuigreet
+  ];
+
+  security.pam.services.greetd.enableGnomeKeyring = true;
+  services.greetd = {
+    enable = true;
+    settings.default_session = {
+      command = ''
+        ${pkgs.tuigreet}/bin/tuigreet --time --cmd "start-hyprland"
+      '';
+      user = users.default;
+    };
+  };
+}