diff --git a/flake.lock b/flake.lock index 1cf6656..1a6416b 100644 --- a/flake.lock +++ b/flake.lock @@ -23,6 +23,39 @@ "type": "github" } }, + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1731959031, + "narHash": "sha256-TGcvIjftziC1CjuiHCzrYDwmOoSFYIhdiKmLetzB5L0=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "4468981c1c50999f315baa1508f0e53c4ee70c52", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, "basix": { "inputs": { "flake-compat": "flake-compat", @@ -177,6 +210,22 @@ "type": "github" } }, + "flake-compat_4": { + "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" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -251,7 +300,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1710146030, @@ -269,7 +318,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1731533236, @@ -286,6 +335,28 @@ } }, "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" + } + }, + "gitignore_2": { "inputs": { "nixpkgs": [ "lanzaboote", @@ -348,10 +419,250 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1728669738, + "narHash": "sha256-EDNAU9AYcx8OupUzbTbWE1d3HYdeG0wO6Msg3iL1muk=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "0264e698149fcb857a66a53018157b41f8d97bb0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1733248371, + "narHash": "sha256-FFLJzFTyNhS7tBEEECx0B8Ye/bpmxhFVEKlECgMLc6c=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "cc95e5babc6065bc3ab4cd195429a9900836ef13", + "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_3", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems_3", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1734005819, + "narHash": "sha256-hbA0aFybdxjpu4Tr4xH57mOLjRMqcop6iBVA0ZFIIx4=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "aefaeedf5e3f773c923373795267c1633141566c", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1728345020, + "narHash": "sha256-xGbkc7U/Roe0/Cv3iKlzijIaFBNguasI31ynL2IlEoM=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "a7c183800e74f337753de186522b9017a07a8cee", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-qtutils": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1733472316, + "narHash": "sha256-PvXiFLIExJEJj+goLbIuXLTN5CSDSAUsAfiYSdbbWg0=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "969427419276c7ee170301ef1ebe0f68eb6eb2e2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1728168612, + "narHash": "sha256-AnB1KfiXINmuiW7BALYrKqcjCnsLZPifhb/7BsfPbns=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "f054f2e44d6a0b74607a6bc0f52dba337a3db38e", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1732288281, + "narHash": "sha256-XTU9B53IjGeJiJ7LstOhuxcRjCOFkQFl01H78sT9Lg4=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "b26f33cc1c8a7fd5076e19e2cce3f062dca6351c", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1726874836, + "narHash": "sha256-VKR0sf0PSNCB0wPHVKSAn41mCNVCnegWmgkrneKDhHM=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "500c81a9e1a76760371049a8d99e008ea77aa59e", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "hyprwm-contrib": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733056338, + "narHash": "sha256-sp14z0mrqrtmouz1+bU4Jh8/0xi+xwQHF2l7mhGSSVU=", + "owner": "hyprwm", + "repo": "contrib", + "rev": "d7c55140f1785b8d9fef351f1cd2a4c9e1eaa466", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "contrib", + "type": "github" + } + }, "lanzaboote": { "inputs": { "crane": "crane", - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "flake-parts": "flake-parts_2", "flake-utils": "flake-utils_2", "nixpkgs": [ @@ -442,8 +753,8 @@ "inputs": { "niri-stable": "niri-stable", "niri-unstable": "niri-unstable", - "nixpkgs": "nixpkgs_3", - "nixpkgs-stable": "nixpkgs-stable_2", + "nixpkgs": "nixpkgs_4", + "nixpkgs-stable": "nixpkgs-stable_3", "xwayland-satellite-stable": "xwayland-satellite-stable", "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, @@ -586,6 +897,22 @@ } }, "nixpkgs-stable": { + "locked": { + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { "locked": { "lastModified": 1710695816, "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", @@ -601,7 +928,7 @@ "type": "github" } }, - "nixpkgs-stable_2": { + "nixpkgs-stable_3": { "locked": { "lastModified": 1733730953, "narHash": "sha256-dlK7n82FEyZlHH7BFHQAM5tua+lQO1Iv7aAtglc1O5s=", @@ -635,11 +962,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1733940404, - "narHash": "sha256-Pj39hSoUA86ZePPF/UXiYHHM7hMIkios8TYG29kQT4g=", + "lastModified": 1733392399, + "narHash": "sha256-kEsTJTUQfQFIJOcLYFt/RvNxIK653ZkTBIs4DG+cBns=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5d67ea6b4b63378b9c13be21e2ec9d1afc921713", + "rev": "d0797a04b81caeae77bcff10a9dde78bc17f5661", "type": "github" }, "original": { @@ -650,6 +977,22 @@ } }, "nixpkgs_4": { + "locked": { + "lastModified": 1733940404, + "narHash": "sha256-Pj39hSoUA86ZePPF/UXiYHHM7hMIkios8TYG29kQT4g=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5d67ea6b4b63378b9c13be21e2ec9d1afc921713", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1733940404, "narHash": "sha256-Pj39hSoUA86ZePPF/UXiYHHM7hMIkios8TYG29kQT4g=", @@ -664,7 +1007,7 @@ "type": "indirect" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1733024928, "narHash": "sha256-n/DOfpKH1vkukuBnach91QBQId2dr5tkE7/7UrkV2zw=", @@ -680,7 +1023,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1656753965, "narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=", @@ -696,7 +1039,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1731531548, "narHash": "sha256-sz8/v17enkYmfpgeeuyzniGJU0QQBfmAjlemAUYhfy8=", @@ -712,7 +1055,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1733097829, "narHash": "sha256-9hbb1rqGelllb4kVUCZ307G2k3/UhmA8PPGBoyuWaSw=", @@ -750,7 +1093,7 @@ "flake-utils": "flake-utils_3", "mnw": "mnw", "nil": "nil", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "nmd": "nmd", "plugin-alpha-nvim": "plugin-alpha-nvim", "plugin-base16": "plugin-base16", @@ -870,7 +1213,7 @@ "plugin-vim-startify": "plugin-vim-startify", "plugin-which-key": "plugin-which-key", "rnix-lsp": "rnix-lsp", - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1734023787, @@ -2785,7 +3128,7 @@ }, "portfolio": { "inputs": { - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "sam-zola": "sam-zola" }, "locked": { @@ -2802,18 +3145,42 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_3", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1733318908, + "narHash": "sha256-SVQVsbafSM1dJ4fpgyBqLZ+Lft+jcQuMtEL3lQWx2Sk=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "6f4e2a2112050951a314d2733a994fbab94864c6", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "pre-commit-hooks-nix": { "inputs": { "flake-compat": [ "lanzaboote", "flake-compat" ], - "gitignore": "gitignore", + "gitignore": "gitignore_2", "nixpkgs": [ "lanzaboote", "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { "lastModified": 1717664902, @@ -2832,7 +3199,7 @@ "rnix-lsp": { "inputs": { "naersk": "naersk", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "utils": "utils_2" }, "locked": { @@ -2856,16 +3223,18 @@ "deploy-rs": "deploy-rs", "firefox-addons": "firefox-addons", "home-manager": "home-manager_2", + "hyprland": "hyprland", + "hyprwm-contrib": "hyprwm-contrib", "lanzaboote": "lanzaboote", "niri": "niri", "nix-flatpak": "nix-flatpak", "nix-index-db": "nix-index-db", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nvf": "nvf", "plasma-manager": "plasma-manager", "portfolio": "portfolio", - "systems": "systems_6", + "systems": "systems_7", "treefmt-nix": "treefmt-nix" } }, @@ -2964,16 +3333,16 @@ }, "systems_3": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -3008,6 +3377,21 @@ } }, "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_7": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -3024,7 +3408,7 @@ }, "treefmt-nix": { "inputs": { - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_9" }, "locked": { "lastModified": 1733761991, @@ -3073,6 +3457,47 @@ "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": 1733157064, + "narHash": "sha256-NetqJHAN4bbZDQADvpep+wXk2AbMZ2bN6tINz8Kpz6M=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "fd85ef39369f95eed67fdf3f025e86916edeea2f", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + }, "xwayland-satellite-stable": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 49842ac..cdf4cbc 100644 --- a/flake.nix +++ b/flake.nix @@ -58,6 +58,11 @@ url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; }; + hyprland.url = "github:hyprwm/Hyprland"; + hyprwm-contrib = { + url = "github:hyprwm/contrib"; + inputs.nixpkgs.follows = "nixpkgs"; + }; niri.url = "github:sodiboo/niri-flake"; nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.5.0"; nvf.url = "github:notashelf/nvf"; @@ -69,4 +74,15 @@ }; treefmt-nix.url = "github:numtide/treefmt-nix"; }; + nixConfig = { + extra-substituters = [ + # use nixos cache first + "https://cache.nixos.org?priority=10" + "https://hyprland.cachix.org" + ]; + extra-trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + ]; + }; } diff --git a/home/programs/hypr/default.nix b/home/programs/hypr/default.nix new file mode 100644 index 0000000..da93cc1 --- /dev/null +++ b/home/programs/hypr/default.nix @@ -0,0 +1,7 @@ +_: { + imports = [ + ./land + ./idle.nix + ./lock.nix + ]; +} diff --git a/home/programs/hypr/idle.nix b/home/programs/hypr/idle.nix new file mode 100644 index 0000000..c3f72ac --- /dev/null +++ b/home/programs/hypr/idle.nix @@ -0,0 +1,30 @@ +_: { + services.hypridle = { + enable = true; + + settings = { + general = { + lock_cmd = "pidof hyprlock || hyprlock"; + unlock_cmd = "pkill --signal SIGUSR1 hyprlock"; + before_sleep_cmd = "loginctl lock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on"; + }; + + listener = [ + { + timeout = 300; # 5m + on-timeout = "loginctl lock-session"; + } + { + timeout = 330; # 5.5m + on-timeout = "hyprctl dipsatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + { + timeout = 600; # 10m + on-timeout = "systemctl suspend"; + } + ]; + }; + }; +} diff --git a/home/programs/hypr/land/binds.nix b/home/programs/hypr/land/binds.nix new file mode 100644 index 0000000..98482d8 --- /dev/null +++ b/home/programs/hypr/land/binds.nix @@ -0,0 +1,61 @@ +_: { + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + bind = [ + "$mod, Return, exec, foot" + "$mod, w, exec, firefox" + ", Print, exec, grimblast --notify copy output" + "$mod, q, killactive" + "$mod SHIFT, q, exit" + "$mod, Space, exec, fuzzel" + "CTRL, Print, exec, grimblast --notify --freeze copy area" + + "$mod, h, movefocus, l" + "$mod, j, movefocus, d" + "$mod, k, movefocus, u" + "$mod, l, movefocus, r" + + "$mod SHIFT, h, movewindow, l" + "$mod SHIFT, j, movewindow, d" + "$mod SHIFT, k, movewindow, u" + "$mod SHIFT, l, movewindow, r" + + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + + "$mod SHIFT, 1, movetoworkspacesilent, 1" + "$mod SHIFT, 2, movetoworkspacesilent, 2" + "$mod SHIFT, 3, movetoworkspacesilent, 3" + "$mod SHIFT, 4, movetoworkspacesilent, 4" + "$mod SHIFT, 5, movetoworkspacesilent, 5" + "$mod SHIFT, 6, movetoworkspacesilent, 6" + "$mod SHIFT, 7, movetoworkspacesilent, 7" + "$mod SHIFT, 8, movetoworkspacesilent, 8" + "$mod SHIFT, 9, movetoworkspacesilent, 9" + "$mod SHIFT, 0, movetoworkspacesilent, 10" + + "$mod, t, togglefloating" + ", F11, fullscreen, 0" + "$mod, f, fullscreen, 1" + + "$mod, e, togglespecialworkspace, file_manager_tui" + "$mod SHIFT, e, togglespecialworkspace, file_manager_gui" + ]; + + binde = [ + ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + + ", XF86MonBrightnessUp, exec, brightnessctl set 2%+" + ", XF86MonBrightnessDown, exec, brightnessctl set 2%- -n" + ]; + }; +} diff --git a/home/programs/hypr/land/default.nix b/home/programs/hypr/land/default.nix new file mode 100644 index 0000000..8c38118 --- /dev/null +++ b/home/programs/hypr/land/default.nix @@ -0,0 +1,79 @@ +{ + inputs, + pkgs, + ... +}: { + imports = [./binds.nix]; + home.packages = [ + inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast + ]; + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + systemd = { + enable = true; + variables = ["--all"]; + }; + + settings = { + workspace = [ + "special:terminal, on-created-empty:foot" + "special:mixer_gui, on-created-empty:pavucontrol" + "special:file_manager_gui, on-created-empty:nautilus" + "special:file_manager_tui, on-created-empty:foot -- yazi" + ]; + + windowrulev2 = [ + # fixes fullscreen windows (mostly games) + "stayfocused, initialtitle:^()$, initialclass:^(steam)$" + "minsize 1 1, initialtitle:^()$, initialclass:^(steam)$" + "maximize, initialtitle:^(\S+)$, initialclass:^(steamwebhelper)$" + + "immediate, initialclass:^(steam_app_)(.*)$" + "fullscreen, initialclass:^(steam_app_)(.*)$" + ]; + + render = { + explicit_sync = 1; + explicit_sync_kms = 1; + expand_undersized_textures = false; + }; + + animations = { + enabled = true; + bezier = "myBezier, 0.05, 0.9, 0.1, 1.1"; + animation = [ + "windows, 1, 5, myBezier" + "windowsOut, 1, 5, default, popin 80%" + "windowsMove, 1, 5, default, popin 80%" + "fade, 1, 5, default" + "border, 1, 5, default" + "borderangle, 0, 8, default" + "workspaces, 0" + "specialWorkspace, 0" + ]; + }; + + input = { + kb_options = "compose:ralt"; + touchpad = { + natural_scroll = true; + scroll_factor = 0.8; + tap-to-click = false; + }; + }; + + gestures = { + workspace_swipe = true; + workspace_swipe_direction_lock = false; + workspace_swipe_cancel_ratio = 0.15; + }; + + misc = { + force_default_wallpaper = 0; + disable_hyprland_logo = true; + middle_click_paste = false; + }; + }; + }; +} diff --git a/home/programs/hypr/lock.nix b/home/programs/hypr/lock.nix new file mode 100644 index 0000000..d857801 --- /dev/null +++ b/home/programs/hypr/lock.nix @@ -0,0 +1,35 @@ +_: { + programs.hyprlock = { + enable = true; + settings = { + general = { + disable_loading_bar = true; + hide_cursor = true; + no_fade_in = false; + }; + + background = [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + } + ]; + + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + outline_thickness = 5; + shadow_passes = 2; + } + ]; + }; + }; +} diff --git a/home/programs/waybar/default.nix b/home/programs/waybar/default.nix index ecda1cf..c15a308 100644 --- a/home/programs/waybar/default.nix +++ b/home/programs/waybar/default.nix @@ -24,7 +24,7 @@ in { margin-right = 6; margin-bottom = 0; - modules-left = ["niri/workspaces" "niri/window"]; + modules-left = ["hyprland/workspaces" "hyprland/window"]; modules-center = ["group/clock"]; modules-right = ["tray" "group/status" "group/power"] diff --git a/home/services/swaync/default.nix b/home/services/swaync/default.nix index 5d94c2b..1028d2d 100644 --- a/home/services/swaync/default.nix +++ b/home/services/swaync/default.nix @@ -1,10 +1,4 @@ -{ - osConfig, - lib, - lib', - ... -}: let - inherit (lib) optionalString; +{lib, ...}: let inherit (builtins) readFile; in { services.swaync = { diff --git a/hosts/solaire/default.nix b/hosts/solaire/default.nix index d064feb..76a7658 100644 --- a/hosts/solaire/default.nix +++ b/hosts/solaire/default.nix @@ -19,7 +19,7 @@ in { "${system}/services/logind.nix" "${system}/services/greetd.nix" - "${system}/programs/niri" + "${system}/programs/hyprland.nix" "${system}/services/gnome.nix" "${system}/services/documentation.nix" @@ -33,14 +33,13 @@ in { "${home}/services/udiskie.nix" "${home}/programs/games" - "${home}/programs/niri" "${home}/programs/waybar" "${home}/programs/fuzzel.nix" + "${home}/programs/hypr" "${home}/services/swaync" "${home}/programs/swaybg.nix" "${home}/programs/swaylock.nix" - "${home}/programs/swayidle.nix" "${home}/terminal/emulators/foot.nix" diff --git a/modules/theme/default.nix b/modules/theme/default.nix index c143e5d..1407737 100644 --- a/modules/theme/default.nix +++ b/modules/theme/default.nix @@ -7,12 +7,15 @@ ... }: let inherit (lib) mkEnableOption mkOption mkIf attrNames; + inherit (lib.strings) removePrefix; inherit (lib.types) path package enum; - inherit (lib') generateGtkColors; + inherit (lib') generateGtkColors rgba; cfg = config.theme; in { imports = [ ./gtk.nix + inputs.niri.nixosModules.niri + inputs.hyprland.nixosModules.default ]; options.theme = { enable = mkEnableOption "theme"; @@ -21,8 +24,8 @@ in { Name of the tinted-theming color scheme to use. ''; type = enum (attrNames inputs.basix.schemeData.base16); - example = "rose-pine"; - default = "rose-pine"; + example = "catppuccin-mocha"; + default = "catppuccin-mocha"; }; wallpaper = mkOption { @@ -42,14 +45,14 @@ in { description = '' Name of the cursor theme. ''; - default = "BreezeX-RosePine-Linux"; + default = "phinger-cursors-dark"; }; package = mkOption { type = package; description = '' Package providing the cursor theme. ''; - default = pkgs.rose-pine-cursor; + default = pkgs.phinger-cursors; }; size = mkOption { description = '' @@ -74,6 +77,20 @@ in { services.swaync.style = generateGtkColors lib scheme.palette; + wayland.windowManager.hyprland.settings = { + env = [ + "HYPRCURSOR_THEME,phinger-cursors-light" + "HYPRCURSOR_SIZE,32" + ]; + general = { + border_size = 4; + "col.active_border" = "rgb(${removePrefix "#" scheme.palette.base0E})"; + }; + decoration = { + rounding = 10; + blur.enabled = true; + }; + }; programs = { niri = { settings = { @@ -86,7 +103,6 @@ in { }; foot.settings.colors = let - inherit (lib.strings) removePrefix; # because someone thought this was a great idea: https://github.com/tinted-theming/schemes/commit/61058a8d2e2bd4482b53d57a68feb56cdb991f0b palette = builtins.mapAttrs (_: color: removePrefix "#" color) scheme.palette; in { @@ -129,11 +145,11 @@ in { colors = { background = "${scheme.palette.base01}f2"; text = "${scheme.palette.base05}ff"; - match = "${scheme.palette.base0D}ff"; + match = "${scheme.palette.base0E}ff"; selection = "${scheme.palette.base03}ff"; selection-text = "${scheme.palette.base06}ff"; - selection-match = "${scheme.palette.base0D}ff"; - border = "${scheme.palette.base0D}ff"; + selection-match = "${scheme.palette.base0E}ff"; + border = "${scheme.palette.base0E}ff"; }; }; diff --git a/modules/theme/gtk.nix b/modules/theme/gtk.nix index 0b86628..03015d6 100644 --- a/modules/theme/gtk.nix +++ b/modules/theme/gtk.nix @@ -4,7 +4,7 @@ pkgs, ... }: let - inherit (lib) mkIf mkOption pathExists; + inherit (lib) mkOption pathExists; inherit (lib.types) bool package str; cfg = config.theme.gtk; in { @@ -18,13 +18,15 @@ in { name = mkOption { type = str; description = "Name for the GTK theme"; - default = "rose-pine"; + default = "Catppuccin-GTK-Dark"; }; package = mkOption { type = package; description = "Package providing the GTK theme"; - default = pkgs.rose-pine-gtk-theme; + default = pkgs.magnetic-catppuccin-gtk.overrideAttrs { + accent = "purple"; + }; }; }; @@ -58,18 +60,6 @@ in { }) ]; - programs.regreet = { - theme = { - inherit (cfg.theme) name package; - }; - iconTheme = { - inherit (cfg.iconTheme) name package; - }; - cursorTheme = mkIf config.theme.enable { - inherit (config.theme.cursorTheme) name package; - }; - }; - home-manager.users.nezia = { gtk = { enable = true; diff --git a/system/nix/default.nix b/system/nix/default.nix index f1d782f..3cef10e 100644 --- a/system/nix/default.nix +++ b/system/nix/default.nix @@ -7,6 +7,7 @@ accept-flake-config = true; warn-dirty = false; auto-optimise-store = true; + trusted-users = ["root" "@wheel"]; experimental-features = [ "nix-command" "flakes" diff --git a/system/programs/hyprland.nix b/system/programs/hyprland.nix new file mode 100644 index 0000000..ba4df01 --- /dev/null +++ b/system/programs/hyprland.nix @@ -0,0 +1,11 @@ +{ + inputs, + pkgs, + ... +}: { + programs.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + }; +} diff --git a/system/services/greetd.nix b/system/services/greetd.nix index 741d148..384235c 100644 --- a/system/services/greetd.nix +++ b/system/services/greetd.nix @@ -1,82 +1,50 @@ { inputs, - config, lib, - lib', pkgs, ... -}: let - inherit (lib) getExe evalModules; - inherit (lib') blurImage; - inherit (inputs) niri; +}: +# thanks https://git.jacekpoz.pl/poz/niksos/src/commit/f8d5e7ccd9c769f7c0b564f10dff419285e75248/modules/services/greetd.nix +let + inherit (lib) getExe getExe' concatStringsSep; + inherit (inputs.hyprland.packages.${pkgs.stdenv.system}) hyprland; + + hyprctl = getExe' hyprland "hyprctl"; + Hyprland = getExe' hyprland "Hyprland"; + + greeter = getExe pkgs.greetd.gtkgreet; + + hyprlandConfig = pkgs.writeText "greetd-hyprland-config" '' + misc { + force_default_wallpaper=0 + focus_on_activate=1 + } + + animations { + enabled=0 + first_launch_animation=0 + } + + workspace=1,default:true,gapsout:0,gapsin:0,border:false,decorate:false + + exec-once=[workspace 1;fullscreen;noanim] ${greeter} -l; ${hyprctl} dispatch exit + exec-once=${hyprctl} dispatch focuswindow ${greeter} + ''; in { - services.greetd = let - home-config = config.home-manager.users.nezia; - # huge thanks to https://github.com/sodiboo/system/blob/262e7e80ac9ae0511f8565713feaa8315d084025/login.mod.nix#L22-L67 - # this is needed because we are also importing the default settings - niri-cfg-modules = evalModules { - modules = [ - niri.lib.internal.settings-module - (let - cfg = home-config.programs.niri.settings; - in { - programs.niri.settings = { - inherit (cfg) input outputs layout; - hotkey-overlay.skip-at-startup = true; - # causes a deprecation warning otherwise - cursor = builtins.removeAttrs cfg.cursor ["hide-on-key-press"]; - - window-rules = [ - { - draw-border-with-background = false; - clip-to-geometry = true; - geometry-corner-radius = { - top-left = 8.0; - top-right = 8.0; - bottom-left = 8.0; - bottom-right = 8.0; - }; - } - ]; - }; - }) - ]; - }; - - # validates config and creates a derivation - niri-config = niri.lib.internal.validated-config-for pkgs config.programs.niri.package niri-cfg-modules.config.programs.niri.finalConfig; - in { + services.greetd = { enable = true; settings = { - default_session = let - niri = getExe config.programs.niri.package; - regreet = getExe config.programs.regreet.package; - # needed because we need to run niri msg quit inside of niri itself (it needs the socket) - greeterScript = pkgs.writeScript "greeter-script" '' - ${regreet} && ${niri} msg action quit --skip-confirmation - ''; - in { - command = "${niri} -c ${niri-config} -- ${greeterScript}"; - user = "greeter"; + default_session = { + command = "${Hyprland} --config ${hyprlandConfig}"; + user = "nezia"; }; }; }; - programs.regreet = { - enable = true; - settings = { - background = { - path = blurImage pkgs config.theme.wallpaper; + environment.etc."greetd/environments".text = concatStringsSep "\n" ["Hyprland"]; - fit = "Fill"; - }; - GTK = { - application_prefer_dark_theme = true; - }; - }; - }; security.pam.services = { - login.enableGnomeKeyring = true; greetd.enableGnomeKeyring = true; + login.enableGnomeKeyring = true; greetd.fprintAuth = false; }; }