From 99b7ccfadbf312a462a0fae440b3cf2e8772fab6 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Wed, 8 Jan 2025 20:54:11 +0300 Subject: [PATCH] Make hyprland work --- flake.lock | 375 +++++++++++++++++++++++++++++++++- flake.nix | 8 + modules/hyprland/hyprland.nix | 12 +- options/theme.nix | 8 +- 4 files changed, 395 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index 0cb9a4e..a93662e 100644 --- a/flake.lock +++ b/flake.lock @@ -25,6 +25,39 @@ "type": "github" } }, + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1736102453, + "narHash": "sha256-5qb4kb7Xbt8jJFL/oDqOor9Z2+E+A+ql3PiyDvsfWZ0=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "4846091641f3be0ad7542086d52769bb7932bde6", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, "blobs": { "flake": false, "locked": { @@ -118,6 +151,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "github2forgejo": { "inputs": { "nixpkgs": [ @@ -139,6 +188,28 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "hardware": { "locked": { "lastModified": 1736283893, @@ -174,6 +245,228 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1734906540, + "narHash": "sha256-vQ/L9hZFezC0LquLo4TWXkyniWtYBlFHAKIsDc7PYJE=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "69270ba8f057d55b0e6c2dca0e165d652856e613", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1736115290, + "narHash": "sha256-Jcn6yAzfUMcxy3tN/iZRbi/QgrYm7XLyVRl9g/nbUl4=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "52202272d89da32a9f866c0d10305a5e3d954c50", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-protocols": "hyprland-protocols", + "hyprland-qtutils": "hyprland-qtutils", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems_3", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1736336083, + "narHash": "sha256-BheKUOkUW1chQkMf1k7Q0p3uIygJzltY7sf7uMTYaUU=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "983bc067dac2e737bc724721c79d87cd81f27501", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1735774328, + "narHash": "sha256-vIRwLS9w+N99EU1aJ+XNOU6mJTxrUBa31i1r82l0V7s=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "e3b6af97ddcfaafbda8e2828c719a5af84f662cb", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-qtutils": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1736257999, + "narHash": "sha256-chDO669EUPz9JAO0AhdgkmUSAhIeNfu090W//tdL200=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "6cc1cf51f2f10352ec97c2095f49dc5556e43954", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1735393019, + "narHash": "sha256-NPpqA8rtmDLsEmZOmz+qR67zsB6Y503Jnv+nSFLKJZ8=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "55608efdaa387af7bfdc0eddb404c409958efa43", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1736164519, + "narHash": "sha256-1LimBKvDpBbeX+qW7T240WEyw+DBVpDotZB4JYm8Aps=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "3c895da64b0eb19870142196fa48c07090b441c4", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1735493474, + "narHash": "sha256-fktzv4NaqKm94VAkAoVqO/nqQlw+X0/tJJNAeCSfzK4=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "de913476b59ee88685fdc018e77b8f6637a2ae0b", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1736012469, @@ -221,6 +514,29 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1735882644, + "narHash": "sha256-3FZAG+pGt3OElQjesCAWeMkQ7C/nB1oTHLRQ8ceP110=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "a5a961387e75ae44cc20f0a57ae463da5e959656", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "ageNix": "ageNix", @@ -229,6 +545,7 @@ "github2forgejo": "github2forgejo", "hardware": "hardware", "homeManager": "homeManager", + "hyprland": "hyprland", "nixpkgs": "nixpkgs_2", "simpleMail": "simpleMail", "themes": "themes" @@ -254,7 +571,7 @@ "simpleMail": { "inputs": { "blobs": "blobs", - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "nixpkgs": [ "nixpkgs" ], @@ -304,6 +621,21 @@ "type": "github" } }, + "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" + } + }, "themes": { "locked": { "lastModified": 1715166503, @@ -318,6 +650,47 @@ "repo": "ThemeNix", "type": "github" } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1734907020, + "narHash": "sha256-p6HxwpRKVl1KIiY5xrJdjcEeK3pbmc///UOyV6QER+w=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "d7f18dda5e511749fa1511185db3536208fb1a63", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index bbd1feb..bdc1821 100644 --- a/flake.nix +++ b/flake.nix @@ -4,11 +4,13 @@ nixConfig = { extra-substituters = [ "https://cache.garnix.io/" + "https://hyprland.cachix.org/" "https://nix-community.cachix.org/" ]; extra-trusted-public-keys = [ "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; }; @@ -39,6 +41,12 @@ fenix.url = "github:nix-community/fenix"; + hyprland = { + url = "github:hyprwm/Hyprland"; + + inputs.nixpkgs.follows = "nixpkgs"; + }; + # hyprcursors = { # url = "github:VirtCode/hypr-dynamic-cursors"; diff --git a/modules/hyprland/hyprland.nix b/modules/hyprland/hyprland.nix index 34f4ae2..1eec393 100644 --- a/modules/hyprland/hyprland.nix +++ b/modules/hyprland/hyprland.nix @@ -1,6 +1,8 @@ { config, lib, pkgs, ... }: with lib; merge (desktopSystemConfiguration { + hardware.graphics = enabled; + services.logind.powerKey = "ignore"; xdg.portal = enabled { @@ -9,6 +11,10 @@ extraPortals = with pkgs; [ xdg-desktop-portal-hyprland ]; + + configPackages = with pkgs; [ + hyprland + ]; }; programs.xwayland = enabled; @@ -46,7 +52,7 @@ # }; settings = { - monitor = [ ", preferred, auto, 1" ]; + monitor = [ ", preferred, auto, 1.5" ]; windowrule = [ "noinitialfocus" ]; windowrulev2 = [ "workspace special silent, initialclass:^(xwaylandvideobridge)$" ]; @@ -138,7 +144,7 @@ "SUPER , Z , exec, zulip" "SUPER , M , exec, thunderbird" "SUPER , T , exec, thunar" - "SUPER , C , exec, hyprpicker --autocopy" + # "SUPER , C , exec, hyprpicker --autocopy" " , PRINT, exec, pkill grim; grim -g \"$(slurp -w 0)\" - | swappy -f - -o - | wl-copy --type image/png" "ALT, PRINT, exec, pkill grim; grim - | swappy -f - -o - | wl-copy --type image/png" @@ -226,7 +232,7 @@ (desktopUserHomePackages (with pkgs; [ brightnessctl grim - hyprpicker + # hyprpicker slurp swappy swaybg diff --git a/options/theme.nix b/options/theme.nix index 2fe19a8..4f46028 100644 --- a/options/theme.nix +++ b/options/theme.nix @@ -1,13 +1,13 @@ { lib, pkgs, themes, ... }: { options.theme = lib.mkValue (themes.custom (themes.raw.gruvbox-dark-hard // { cornerRadius = 0; - borderWidth = 4; + borderWidth = 2; - margin = 8; + margin = 0; padding = 8; - font.size.normal = 32; - font.size.big = 40; + font.size.normal = 16; + font.size.big = 20; font.sans.name = "Lexend"; font.sans.package = pkgs.lexend;