From 45d93bc672c2793fb61ea6c5661d14da23c10b19 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:10:22 +0200 Subject: [PATCH] try out hyprland again and waybar changes --- flake.lock | 269 +++++++++++++++++++- flake.nix | 20 +- home-manager/hyprland/hyprland-settings.nix | 3 +- home-manager/hyprland/styles/stats.css | 2 +- home-manager/hyprland/styles/style.css | 6 + home-manager/hyprland/styles/workspaces.css | 2 +- home-manager/hyprland/waybar.nix | 57 +++-- modules/graphical/hyprland.nix | 6 + modules/hardware/nvidia.nix | 4 +- overlays.nix | 1 + 10 files changed, 333 insertions(+), 37 deletions(-) diff --git a/flake.lock b/flake.lock index 7a2a6f7..6aa6b61 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,39 @@ "type": "github" } }, + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1721755137, + "narHash": "sha256-DcJkFNaHGRMIkexx/ol2oNiUFT/zqnZH6dwODdHubIU=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "4c72cd4d0b0368ce78bf94ea7f23d47670f0d429", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, "base16": { "inputs": { "fromYaml": "fromYaml" @@ -318,7 +351,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1710146030, @@ -336,7 +369,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1701680307, @@ -542,6 +575,168 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1721330371, + "narHash": "sha256-aYlHTWylczLt6ERJyg6E66Y/XSCbVL7leVcRuJmVbpI=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "4493a972b48f9c3014befbbf381ed5fff91a65dc", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs_2", + "systems": "systems_3", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1721831547, + "narHash": "sha256-ueSN0oXsQ9aqA8CGBaJULXxYWap8Zchdp8wzgWTzQe4=", + "ref": "refs/heads/main", + "rev": "8d3920c882f0587c5b3224135f668dce8bb0b04f", + "revCount": 4973, + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "xdph", + "nixpkgs" + ], + "systems": [ + "hyprland", + "xdph", + "systems" + ] + }, + "locked": { + "lastModified": 1718746314, + "narHash": "sha256-HUklK5u86w2Yh9dOkk4FdsL8eehcOZ95jPhLixGDRQY=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "1b61f0093afff20ab44d88ad707aed8bf2215290", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1721324361, + "narHash": "sha256-BiJKO0IIdnSwHQBSrEJlKlFr753urkLE48wtt0UhNG4=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "adbefbf49664a6c2c8bf36b6487fd31e3eb68086", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1721324102, + "narHash": "sha256-WAZ0X6yJW1hFG6otkHBfyJDKRpNP5stsRqdEuHrFRpk=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "962582a090bc233c4de9d9897f46794280288989", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1721324119, + "narHash": "sha256-SOOqIT27/X792+vsLSeFdrNTF+OSRp5qXv6Te+fb2Qg=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "a048a6cb015340bd82f97c1f40a4b595ca85cc30", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, "nix-colors": { "inputs": { "base16-schemes": "base16-schemes", @@ -705,6 +900,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1721379653, + "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1721548954, "narHash": "sha256-7cCC8+Tdq1+3OPyc3+gVo9dzUNkNIQfwSDJ2HSi2u3o=", @@ -720,7 +931,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1714912032, "narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=", @@ -785,11 +996,12 @@ "flake-utils": "flake-utils", "home-manager": "home-manager_2", "home-manager-unstable": "home-manager-unstable", + "hyprland": "hyprland", "nix-colors": "nix-colors", "nixos-cosmic": "nixos-cosmic", "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixpkgs-unstable": "nixpkgs-unstable", "nixvim": "nixvim", "nur": "nur", @@ -808,7 +1020,7 @@ "flake-compat": "flake-compat_4", "gnome-shell": "gnome-shell", "home-manager": "home-manager_4", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1721573849, @@ -855,6 +1067,21 @@ } }, "systems_3": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_4": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -869,7 +1096,7 @@ "type": "github" } }, - "systems_4": { + "systems_5": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -904,6 +1131,36 @@ "repo": "treefmt-nix", "type": "github" } + }, + "xdph": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1721648131, + "narHash": "sha256-cyyxu/oj4QEFp3CVx2WeXa9T4OAUyynuBJHGkBZSxJI=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "663be9cad424b170b28b9fa8a61042d721007f3b", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 8560557..af3f8f0 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,7 @@ disko.url = "github:nix-community/disko"; disko.inputs.nixpkgs.follows = "nixpkgs"; flake-utils.url = "github:numtide/flake-utils"; + hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; }; outputs = { self, nur, nixpkgs, nixos-hardware, nixos-wsl, nixpkgs-unstable , agenix, home-manager, home-manager-unstable, nix-colors, nixos-cosmic @@ -56,11 +57,9 @@ let lib = specialArgs.pkgsVersion.lib; in specialArgs.pkgsVersion.lib.nixosSystem { inherit system; - modules = modules ++ [ - ./modules - agenix.nixosModules.default - overlays - ] ++ lib.lists.optionals (!minimal) + modules = modules + ++ [ ./modules agenix.nixosModules.default overlays ] + ++ lib.lists.optionals (!minimal) [ specialArgs.home-manager-version.nixosModules.home-manager ] ++ lib.lists.optionals (!minimal && graphical) [ ./modules/graphical @@ -79,11 +78,9 @@ let lib = specialArgs.pkgsVersion.lib; in specialArgs.pkgsVersion.lib.nixosSystem { inherit system; - modules = modules ++ [ - ./modules - agenix.nixosModules.default - overlays - ] ++ lib.lists.optionals (!minimal) + modules = modules + ++ [ ./modules agenix.nixosModules.default overlays ] + ++ lib.lists.optionals (!minimal) [ specialArgs.home-manager-version.nixosModules.home-manager ]; specialArgs = specialArgs // { inherit inputs outputs; }; }; @@ -160,7 +157,8 @@ ]; }; # build vm -> nixos-rebuild build-vm --flake .#vm - "vm" = mkHost { modules = [ ./users/vm ./systems/vm/configuration.nix ]; }; + "vm" = + mkHost { modules = [ ./users/vm ./systems/vm/configuration.nix ]; }; }; }; } diff --git a/home-manager/hyprland/hyprland-settings.nix b/home-manager/hyprland/hyprland-settings.nix index bba4f61..87cdeb6 100644 --- a/home-manager/hyprland/hyprland-settings.nix +++ b/home-manager/hyprland/hyprland-settings.nix @@ -7,7 +7,6 @@ in { enable = true; #enableNvidiaPatches = true; xwayland.enable = true; - package = pkgs.hyprland; settings = { # # Please note not all available settings / options are set here. @@ -290,7 +289,9 @@ in { bind = , escape, submap, reset submap = reset + ''; + #experimental:explicit_sync = true }; }; } diff --git a/home-manager/hyprland/styles/stats.css b/home-manager/hyprland/styles/stats.css index d3b4f0c..9169773 100644 --- a/home-manager/hyprland/styles/stats.css +++ b/home-manager/hyprland/styles/stats.css @@ -2,7 +2,7 @@ #other-drawer, #stats, #stats-drawer { - margin: 0.5em; + margin: 0 0.5em; padding-left: 5px; padding-right: 5px; color: @peach; diff --git a/home-manager/hyprland/styles/style.css b/home-manager/hyprland/styles/style.css index 8ae5ce1..a01903a 100644 --- a/home-manager/hyprland/styles/style.css +++ b/home-manager/hyprland/styles/style.css @@ -64,10 +64,16 @@ box { } /* Add spacing for right side modules */ #pulseaudio, +#mpris, #backlight { padding: 0 0.5em; } +#mpris { + font-size: 12px; + color: @text; +} + #battery.charging, #battery.plugged, #battery.full diff --git a/home-manager/hyprland/styles/workspaces.css b/home-manager/hyprland/styles/workspaces.css index 412b6c5..a6d7015 100644 --- a/home-manager/hyprland/styles/workspaces.css +++ b/home-manager/hyprland/styles/workspaces.css @@ -1,5 +1,5 @@ #workspaces { - margin: 0.5em; + margin: 0 0.5em; padding-left: 5px; padding-right: 5px; color: @peach; diff --git a/home-manager/hyprland/waybar.nix b/home-manager/hyprland/waybar.nix index 3ffee90..6fb56d3 100644 --- a/home-manager/hyprland/waybar.nix +++ b/home-manager/hyprland/waybar.nix @@ -17,7 +17,7 @@ in { #systemd.target = "sway-session.target"; settings.main = { layer = "top"; - position = "top"; + position = "bottom"; #output = lib.mapAttrsToList (n: v: v.monitor) outputs; height = 25; spacing = 4; @@ -27,6 +27,15 @@ in { ]; modules-center = [ ]; modules-right = [ "group/stats" "group/other" ]; + "group/stats" = { + "orientation" = "horizontal"; + "modules" = [ "network" "cpu" "memory" "disk" "temperature" ]; + }; + "group/other" = { + "orientation" = "horizontal"; + "modules" = + [ "tray" "backlight" "pulseaudio" "mpris" "battery" "clock" ]; + }; "cpu" = { "format" = " {usage}%"; "tooltip" = true; @@ -64,11 +73,11 @@ in { "pulseaudio" = { "format" = "{volume}% {icon}"; "format-bluetooth" = "{volume}% {icon}"; - "format-muted" = "🚫"; + "format-muted" = ""; "format-icons" = { - "headphone" = ""; - "hands-free" = ""; - "headset" = ""; + "headphone" = " "; + "hands-free" = " "; + "headset" = " "; "phone" = ""; "portable" = ""; "car" = ""; @@ -99,18 +108,36 @@ in { "battery".states.critical = 15; "battery".format = "{capacity}% / {power:.2}W {icon}"; "battery".format-icons = [ "" "" "" "" "" ]; - "clock".format = "{:%F %H:%M}"; - "clock".tooltip-format = "{calendar}"; + "clock" = { + format = "{:%F %H:%M}"; + tooltip-format = "{calendar}"; + "calendar" = { + "mode" = "year"; + "mode-mon-col" = 3; + "weeks-pos" = "right"; + "on-scroll" = 1; + "format" = { + "months" = "{}"; + "days" = "{}"; + "weeks" = "W{}"; + "weekdays" = "{}"; + "today" = "{}"; + }; + }; + }; + "mpris" = { + "format" = "{player_icon} {dynamic}"; + "format-paused" = "{status_icon} {dynamic}"; + "title-len" = 35; + "dynamic-len" = 35; + "player-icons" = { + "default" = "▶"; + "mpv" = "🎵"; + }; + "status-icons" = { "paused" = "⏸"; }; + }; "tray".icon-size = 21; "tray".spacing = 10; - "group/stats" = { - "orientation" = "horizontal"; - "modules" = [ "network" "cpu" "memory" "disk" "temperature" ]; - }; - "group/other" = { - "orientation" = "horizontal"; - "modules" = [ "tray" "backlight" "pulseaudio" "battery" "clock" ]; - }; "hyprland/window" = { "format" = "{}"; "separate-outputs" = true; diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index ac0cd44..1305321 100644 --- a/modules/graphical/hyprland.nix +++ b/modules/graphical/hyprland.nix @@ -32,6 +32,12 @@ in { __GLX_VENDOR_LIBRARY_NAME = "nvidia"; #WLR_BACKENDS="x11,way }; + nix.settings = { + substituters = [ "https://hyprland.cachix.org" ]; + trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + ]; + }; hardware = { # Opengl diff --git a/modules/hardware/nvidia.nix b/modules/hardware/nvidia.nix index 286d78a..67b685a 100644 --- a/modules/hardware/nvidia.nix +++ b/modules/hardware/nvidia.nix @@ -20,7 +20,7 @@ in { driSupport32Bit = true; }; }; - in lib.mkIf cfg.enable nvidiaOption // { + in lib.mkIf cfg.enable (lib.recursiveUpdate nvidiaOption { boot.kernelParams = [ "nvidia-drm.fbdev=1" ]; services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = { @@ -45,5 +45,5 @@ in { # Optionally, you may need to select the appropriate driver version for your specific GPU. package = config.boot.kernelPackages.nvidiaPackages.beta; }; - }; + }); } diff --git a/overlays.nix b/overlays.nix index 8362db5..f6db131 100644 --- a/overlays.nix +++ b/overlays.nix @@ -14,6 +14,7 @@ waybar = prev.waybar.overrideAttrs (oldAttrs: { mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; }); + hyprland = inputs.hyprland.packages.${prev.stdenv.hostPlatform.system}.hyprland; # .png doesnt work :( #fastfetch = prev.fastfetch.overrideAttrs (oldAttrs: {