From 3ebdcf1f501fdb863e97bebe03beb4d6e5c70ad4 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Thu, 22 Aug 2024 20:09:35 -0700 Subject: [PATCH] added hyprcursor and a theme --- flake.lock | 279 +++++++++++++++++++++++-------- flake.nix | 2 + modules/hyprland/default.nix | 5 +- modules/hyprland/hyprcursors.nix | 53 ++++++ modules/hyprland/keybinds.nix | 4 +- 5 files changed, 272 insertions(+), 71 deletions(-) create mode 100644 modules/hyprland/hyprcursors.nix diff --git a/flake.lock b/flake.lock index c97e806..c0ed8b7 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ ] }, "locked": { - "lastModified": 1722532933, - "narHash": "sha256-mlU97SAd7HiAItg+3R1870Igje1iJhQjba7hNQa0T78=", + "lastModified": 1723635448, + "narHash": "sha256-DitGGbiTNxU/5DP1BmAE68AeyWiyjRVStlUXPMhQqIU=", "owner": "atuinsh", "repo": "atuin", - "rev": "2ce1a06f9519c7d9ab7f17b036794eff1569925b", + "rev": "72a562a38e15e12b39381d435f6977eb938783b0", "type": "github" }, "original": { @@ -72,11 +72,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1722407091, - "narHash": "sha256-+xR0ZqooQvAjxcpoDBCqiUCKrBK8/RGVffRzlKH7urw=", + "lastModified": 1723530607, + "narHash": "sha256-FaXZZLLDW1D+pj7UgrIslDS8XjMMG3Pus5gAvUYWQS0=", "owner": "nix-community", "repo": "fenix", - "rev": "0900ff903f376cc822ca637fef58c1ca4f44fab5", + "rev": "296d44c440302980824c5f3b67e477cf0522e0c1", "type": "github" }, "original": { @@ -172,7 +172,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_2" + "systems": "systems_4" }, "locked": { "lastModified": 1681202837, @@ -190,7 +190,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_3" + "systems": "systems_5" }, "locked": { "lastModified": 1710146030, @@ -208,7 +208,7 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_4" + "systems": "systems_6" }, "locked": { "lastModified": 1710146030, @@ -241,12 +241,11 @@ ] }, "locked": { - "lastModified": 1721042469, - "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", + "lastModified": 1724227338, + "narHash": "sha256-TuSaYdhOxeaaE9885mFO1lZHHax33GD5A9dczJrGUjw=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", ->>>>>>> ed56ac1 (flake update) + "rev": "6cedaa7c1b4f82a266e5d30f212273e60d62cb0d", "type": "github" }, "original": { @@ -308,11 +307,11 @@ ] }, "locked": { - "lastModified": 1722462338, - "narHash": "sha256-ss0G8t8RJVDewA3MyqgAlV951cWRK6EtVhVKEZ7J5LU=", + "lastModified": 1723986931, + "narHash": "sha256-Fy+KEvDQ+Hc8lJAV3t6leXhZJ2ncU5/esxkgt3b8DEY=", "owner": "nix-community", "repo": "home-manager", - "rev": "6e090576c4824b16e8759ebca3958c5b09659ee8", + "rev": "2598861031b78aadb4da7269df7ca9ddfc3e1671", "type": "github" }, "original": { @@ -329,11 +328,11 @@ ] }, "locked": { - "lastModified": 1722407237, - "narHash": "sha256-wcpVHUc2nBSSgOM7UJSpcRbyus4duREF31xlzHV5T+A=", + "lastModified": 1723986931, + "narHash": "sha256-Fy+KEvDQ+Hc8lJAV3t6leXhZJ2ncU5/esxkgt3b8DEY=", "owner": "nix-community", "repo": "home-manager", - "rev": "58cef3796271aaeabaed98884d4abaab5d9d162d", + "rev": "2598861031b78aadb4da7269df7ca9ddfc3e1671", "type": "github" }, "original": { @@ -342,18 +341,97 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": "hyprlang", + "nixpkgs": [ + "mcmojave-hyprcursor", + "nixpkgs" + ], + "systems": "systems_2" + }, + "locked": { + "lastModified": 1721330371, + "narHash": "sha256-aYlHTWylczLt6ERJyg6E66Y/XSCbVL7leVcRuJmVbpI=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "4493a972b48f9c3014befbbf381ed5fff91a65dc", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": "hyprutils", + "nixpkgs": [ + "mcmojave-hyprcursor", + "hyprcursor", + "nixpkgs" + ], + "systems": [ + "mcmojave-hyprcursor", + "hyprcursor", + "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": [ + "mcmojave-hyprcursor", + "hyprcursor", + "hyprlang", + "nixpkgs" + ], + "systems": [ + "mcmojave-hyprcursor", + "hyprcursor", + "hyprlang", + "systems" + ] + }, + "locked": { + "lastModified": 1721324102, + "narHash": "sha256-WAZ0X6yJW1hFG6otkHBfyJDKRpNP5stsRqdEuHrFRpk=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "962582a090bc233c4de9d9897f46794280288989", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, "kmonad": { "inputs": { "nixpkgs": "nixpkgs_3" }, "locked": { "dir": "nix", - "lastModified": 1722406785, - "narHash": "sha256-9M09FN+zOW0QNzM7zqtY0kzvD3GoaPZl4r9NA+fgVrc=", + "lastModified": 1724217668, + "narHash": "sha256-cqeOaZkDdcttgWjlokEXYyokBm3guoOGQUC1lvOurO0=", "owner": "kmonad", "repo": "kmonad", - "rev": "840af41fab33829ed03ba932aa017f8912e6fb75", ->>>>>> ed56ac1 (flake update) + "rev": "4c324f1631b3b2f7e17e804b0ed3ac314e57bcb8", "type": "github" }, "original": { @@ -363,9 +441,29 @@ "type": "github" } }, + "mcmojave-hyprcursor": { + "inputs": { + "hyprcursor": "hyprcursor", + "nixpkgs": "nixpkgs_4", + "systems": "systems_3" + }, + "locked": { + "lastModified": 1722822648, + "narHash": "sha256-aM3y6Fq156ilzKUPrZTwp+XWmIqcoQeklRERN0Y0Nvo=", + "owner": "libadoxon", + "repo": "mcmojave-hyprcursor", + "rev": "ad4bbde8d87810f74fe72ae102ce824f26bb1b07", + "type": "github" + }, + "original": { + "owner": "libadoxon", + "repo": "mcmojave-hyprcursor", + "type": "github" + } + }, "nicks_nextcloud_integrations": { "inputs": { - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "rust-overlay": "rust-overlay_2" }, "locked": { @@ -390,11 +488,11 @@ ] }, "locked": { - "lastModified": 1722082646, - "narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=", + "lastModified": 1724299755, + "narHash": "sha256-P5zMA17kD9tqiqMuNXwupkM7buM3gMNtoZ1VuJTRDE4=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6", + "rev": "a8968d88e5a537b0491f68ce910749cd870bdbef", "type": "github" }, "original": { @@ -407,14 +505,14 @@ "inputs": { "flake-compat": "flake-compat_2", "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_7" }, "locked": { - "lastModified": 1722253092, - "narHash": "sha256-37vyqHPx57deHhwvi4jwyNQLYkhm/rlVTYKOG1iahsc=", + "lastModified": 1724065442, + "narHash": "sha256-8ZUoyeO7Q70bLuijVYvToBSkApw9kfc5hMykTGxB64I=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "f373ad59ae5866f0f98216bd5c71526b373450d2", + "rev": "0bec2bfb8a2d4dd16e5b012982ca95e57d50e6a2", "type": "github" }, "original": { @@ -489,6 +587,22 @@ } }, "nixpkgs_4": { + "locked": { + "lastModified": 1722062969, + "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1692447944, "narHash": "sha256-fkJGNjEmTPvqBs215EQU4r9ivecV5Qge5cF/QDLVn3U=", @@ -504,7 +618,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1681358109, "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", @@ -520,7 +634,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1723688146, "narHash": "sha256-sqLwJcHYeWLOeP/XoLwAtYjr01TISlkOfz+NG82pbdg=", @@ -536,13 +650,13 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { - "lastModified": 1722421184, - "narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=", + "lastModified": 1724224976, + "narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58", + "rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", "type": "github" }, "original": { @@ -552,13 +666,13 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { - "lastModified": 1722185531, - "narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=", + "lastModified": 1724224976, + "narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d", + "rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", "type": "github" }, "original": { @@ -576,16 +690,16 @@ "git-hooks": "git-hooks", "home-manager": "home-manager_2", "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_9", "nuschtosSearch": "nuschtosSearch", "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1722492816, - "narHash": "sha256-aZe7oSm/+GM1whS6bxZy+DJgbcy8rDIkygBA0owCvmU=", + "lastModified": 1724340365, + "narHash": "sha256-SFJuLI6FpuLHI0PdZAIOAJoeR6Z+cRkbTUQ5TuqJw5s=", "owner": "nix-community", "repo": "nixvim", - "rev": "820f8d58eafd7121989fea3ae9e71f29699d856b", + "rev": "1854d591cb0e5be6ad97f5091766cdf28e948265", "type": "github" }, "original": { @@ -603,11 +717,11 @@ ] }, "locked": { - "lastModified": 1722144272, - "narHash": "sha256-olZbfaEdd+zNPuuyYcYGaRzymA9rOmth8yXOlVm+LUs=", + "lastModified": 1723969429, + "narHash": "sha256-BuewfNEXEf11MIkJY+uvWsdLu1dIvgJqntWChvNdALg=", "owner": "NuschtOS", "repo": "search", - "rev": "16565307c267ec219c2b5d3494ba66df08e7d403", + "rev": "a05d1805f2a2bc47d230e5e92aecbf69f784f3d0", "type": "github" }, "original": { @@ -623,9 +737,10 @@ "headscale": "headscale", "home-manager": "home-manager", "kmonad": "kmonad", + "mcmojave-hyprcursor": "mcmojave-hyprcursor", "nicks_nextcloud_integrations": "nicks_nextcloud_integrations", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "nixpkgs-stable": "nixpkgs-stable", "nixvim": "nixvim", "utils": "utils" @@ -634,11 +749,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1722337341, - "narHash": "sha256-Myc+UnbLDQccueeO1q5CF0sNiGebQo1N+cdOpDMhNsg=", + "lastModified": 1723473250, + "narHash": "sha256-Ls0e6R4FmGUFXZlUcm6ZQaVNJ4Yj/nua4SSctXIopao=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "4feec4b0c1d5aad7aba34e0397fe7bd984c9a634", + "rev": "32a86cb1dad2b208e8f36f1bb50c2e4806b0371f", "type": "github" }, "original": { @@ -669,7 +784,7 @@ "rust-overlay_2": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1692497375, @@ -702,31 +817,31 @@ }, "systems_2": { "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" } }, "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" } }, @@ -760,6 +875,36 @@ "type": "github" } }, + "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": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -768,11 +913,11 @@ ] }, "locked": { - "lastModified": 1722330636, - "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=", + "lastModified": 1723808491, + "narHash": "sha256-rhis3qNuGmJmYC/okT7Dkc4M8CeUuRCSvW6kC2f3hBc=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "768acdb06968e53aa1ee8de207fd955335c754b7", + "rev": "1d07739554fdc4f8481068f1b11d6ab4c1a4167a", "type": "github" }, "original": { @@ -783,7 +928,7 @@ }, "utils": { "inputs": { - "systems": "systems_5" + "systems": "systems_7" }, "locked": { "lastModified": 1710146030, diff --git a/flake.nix b/flake.nix index f77d4d1..fb12c2c 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,8 @@ }; nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; + + mcmojave-hyprcursor.url = "github:libadoxon/mcmojave-hyprcursor"; nixpkgs-stable = { url = "github:NixOS/nixpkgs/release-23.11"; diff --git a/modules/hyprland/default.nix b/modules/hyprland/default.nix index a141518..edc9ff4 100644 --- a/modules/hyprland/default.nix +++ b/modules/hyprland/default.nix @@ -14,9 +14,10 @@ in imports = [ ../ewwbar - ./window_rules.nix - ./keybinds.nix ./displays.nix + ./keybinds.nix + ./hyprcursors.nix + ./window_rules.nix ]; home.packages = with pkgs; [ diff --git a/modules/hyprland/hyprcursors.nix b/modules/hyprland/hyprcursors.nix new file mode 100644 index 0000000..6b4cff2 --- /dev/null +++ b/modules/hyprland/hyprcursors.nix @@ -0,0 +1,53 @@ +# Borrowed from https://github.com/cafetestrest/nixos/blob/87e6b88b39f01c893888e3dea9785b21c2d0b2b9/home-manager/hypr/hyprcursors.nix#L6 +{ config, lib, pkgs, ... }: + +with lib; + +let + cursor = "McMojave"; + + McMojave = with pkgs; stdenv.mkDerivation rec { + name = "McMojave"; + src = fetchFromGitHub { + owner = "OtaK"; + repo = "McMojave-hyprcursor"; + rev = "main"; + sha256 = "sha256-+Qo88EJC0nYDj9FDsNtoA4nttck81J9CQFgtrP4eBjk="; + }; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/icons/McMojave + cp -R dist/* $out/share/icons/McMojave/ + + runHook postInstall + ''; + + }; + + #TODO rename this and put into hyprcursors folder + + cursorPackage = McMojave; + + cfg = config.module.hypr.hyprcursors; +in +{ + options = { + module.hypr.hyprcursors.enable = mkEnableOption "Enables hyprcursors"; + }; + + config = mkIf cfg.enable { + home.packages = [ + cursorPackage + ]; + + # xdg.dataFile.".icons/${cursor}".source = "${cursorPackage}/share/icons/${cursor}"; + + home.file = { + ".icons/${cursor}" = { + source = "${cursorPackage}/share/icons/${cursor}"; + }; + }; + }; +} diff --git a/modules/hyprland/keybinds.nix b/modules/hyprland/keybinds.nix index fa48a4d..1dd6085 100644 --- a/modules/hyprland/keybinds.nix +++ b/modules/hyprland/keybinds.nix @@ -49,8 +49,8 @@ in "$mod, mouse_down, workspace, e+1" "$mod, mouse_up, workspace, e-1" - "CTRL_SHIFT, h, ewwtilities prev-next-workspace 0" - "CTRL_SHIFT, l, ewwtilities prev-next-workspace 1" + "CTRL_SHIFT, h, exec, ewwtilities prev-next-workspace 0" + "CTRL_SHIFT, l, exec, ewwtilities prev-next-workspace 1" ] ++ # Change workspace (map (n: