diff --git a/flake.lock b/flake.lock index a119bf6..5550a2c 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ ] }, "locked": { - "lastModified": 1745357003, - "narHash": "sha256-jYwzQkv1r7HN/4qrAuKp+NR4YYNp2xDrOX5O9YVqkWo=", + "lastModified": 1744289235, + "narHash": "sha256-ZFkHLdimtFzQACsVVyZkZlfYdj4iNy3PkzXfrwmlse8=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "a19cf76ee1a15c1c12083fa372747ce46387289f", + "rev": "c8282f4982b56dfa5e9b9f659809da93f8d37e7a", "type": "github" }, "original": { @@ -40,11 +40,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1746206240, - "narHash": "sha256-bKe8SSg1HPWE7b4iRQJwiOVCrvvgttuHCOIa4U/38AY=", + "lastModified": 1745432946, + "narHash": "sha256-6JNCfG67V5muUwEGdv5HmnbW6UlGrjcblVObvJCVXy4=", "owner": "Saghen", "repo": "blink.cmp", - "rev": "4f38ce99a472932d5776337f08f7a8180f1f571a", + "rev": "5d90bfc6245eb89b6c6f22f4fa3a7202df17cb24", "type": "github" }, "original": { @@ -158,11 +158,11 @@ ] }, "locked": { - "lastModified": 1746317522, - "narHash": "sha256-/jZ4Wd4HHUEWPSlNj48k1E4Mh+1fUbwI/vSlPPIMG3U=", + "lastModified": 1745427103, + "narHash": "sha256-J4v65MKoXt95nmCYr6a7Cdiyl9QmPp6u3+7aJ71zxbk=", "owner": "nix-community", "repo": "home-manager", - "rev": "621986fed37c5d0cb8df010ed8369694dc47c09b", + "rev": "6d1f834ca63700604a96d8c38aa8ac272d95071a", "type": "github" }, "original": { @@ -207,11 +207,11 @@ ] }, "locked": { - "lastModified": 1745948457, - "narHash": "sha256-lzTV10FJTCGNtMdgW5YAhCAqezeAzKOd/97HbQK8GTU=", + "lastModified": 1742215578, + "narHash": "sha256-zfs71PXVVPEe56WEyNi2TJQPs0wabU4WAlq0XV7GcdE=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "ac903e80b33ba6a88df83d02232483d99f327573", + "rev": "2fd36421c21aa87e2fe3bee11067540ae612f719", "type": "github" }, "original": { @@ -265,11 +265,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1746310409, - "narHash": "sha256-iSyQZMaYjVfr+vb7jO0N9Bh8V9m51ZYUqxWd9BimUpQ=", + "lastModified": 1745328209, + "narHash": "sha256-eP3x+JNE1T6RjXhimaEnoc4GvNJcyzppW1vpAs287Zg=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "adbae0f74d951e06c575bad3c81a944027dfe413", + "rev": "241a4935a244f403fa7108259075b04c81ed258f", "type": "github" }, "original": { @@ -358,11 +358,11 @@ ] }, "locked": { - "lastModified": 1745951494, - "narHash": "sha256-2dModE32doiyQMmd6EDAQeZnz+5LOs6KXyE0qX76WIg=", + "lastModified": 1739048983, + "narHash": "sha256-REhTcXq4qs3B3cCDtLlYDz0GZvmsBSh947Ub6pQWGTQ=", "owner": "hyprwm", "repo": "hyprland-qtutils", - "rev": "4be1d324faf8d6e82c2be9f8510d299984dfdd2e", + "rev": "3504a293c8f8db4127cb0f7cfc1a318ffb4316f8", "type": "github" }, "original": { @@ -387,11 +387,11 @@ ] }, "locked": { - "lastModified": 1745357019, - "narHash": "sha256-q/C3qj9FWHQenObXuw/nGIT8iIsWFjgmcQYcA+ZfpPs=", + "lastModified": 1744468525, + "narHash": "sha256-9HySx+EtsbbKlZDlY+naqqOV679VdxP6x6fP3wxDXJk=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "397600c42b8d7a443a5b4e92aa15f46650a90f18", + "rev": "f1000c54d266e6e4e9d646df0774fac5b8a652df", "type": "github" }, "original": { @@ -412,11 +412,11 @@ ] }, "locked": { - "lastModified": 1745975815, - "narHash": "sha256-s3GzsRxBL/N/xYgUXZhQh4t62uR1BN4zxXgWBtJ3lWM=", + "lastModified": 1743950287, + "narHash": "sha256-/6IAEWyb8gC/NKZElxiHChkouiUOrVYNq9YqG0Pzm4Y=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "05878d9470c9e5cbc8807813f9ec2006627a0ca0", + "rev": "f2dc70e448b994cef627a157ee340135bd68fbc6", "type": "github" }, "original": { @@ -527,11 +527,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1746141548, - "narHash": "sha256-IgBWhX7A2oJmZFIrpRuMnw5RAufVnfvOgHWgIdds+hc=", + "lastModified": 1744932701, + "narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f02fddb8acef29a8b32f10a335d44828d7825b78", + "rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef", "type": "github" }, "original": { @@ -543,11 +543,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1746232882, - "narHash": "sha256-MHmBH2rS8KkRRdoU/feC/dKbdlMkcNkB5mwkuipVHeQ=", + "lastModified": 1745234285, + "narHash": "sha256-GfpyMzxwkfgRVN0cTGQSkTC0OHhEkv3Jf6Tcjm//qZ0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7a2622e2c0dbad5c4493cb268aba12896e28b008", + "rev": "c11863f1e964833214b767f4a369c6e6a7aba141", "type": "github" }, "original": { @@ -616,11 +616,11 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1746287507, - "narHash": "sha256-XzxmpEUbCXcBS7H00QmTAQf9xrMdvaFHrprkwb4i9CU=", + "lastModified": 1745151211, + "narHash": "sha256-qFXfTdO1yvW6DmUPfVLIJgDHfkSd5yimZWvBMrlP/ow=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "c09c8cbc0d650d451e4b48d00c63831437dae1b2", + "rev": "1dd4328f82115887901a685ecd9fa6e1d1db2d0c", "type": "github" }, "original": { @@ -720,11 +720,11 @@ ] }, "locked": { - "lastModified": 1745871725, - "narHash": "sha256-M24SNc2flblWGXFkGQfqSlEOzAGZnMc9QG3GH4K/KbE=", + "lastModified": 1744644585, + "narHash": "sha256-p0D/e4J6Sv6GSb+9u8OQcVHSE2gPNYB5ygIfGDyEiXQ=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "76bbf1a6b1378e4ab5230bad00ad04bc287c969e", + "rev": "be6771e754345f18244fb00aae5c9e5ab21ccc26", "type": "github" }, "original": { diff --git a/hosts/wizdesk/home-manager.nix b/hosts/wizdesk/home-manager.nix index d9c9e48..e2f73aa 100644 --- a/hosts/wizdesk/home-manager.nix +++ b/hosts/wizdesk/home-manager.nix @@ -134,8 +134,12 @@ screenshot.enable = true; }; - # Enable hypridle + # Enable hypridle and hyprlock hypridle.enable = true; + hyprlock = { + enable = true; + background = "/mnt/internal/personal/wallpapers/wallhaven-2em8y6.jpg"; + }; # Add monitor configuration to hyprland extraConfig = # hyprlang diff --git a/modules/hyprland/README.md b/modules/hyprland/README.md index 2841664..6d2ca48 100644 --- a/modules/hyprland/README.md +++ b/modules/hyprland/README.md @@ -1,6 +1,6 @@ The [NixOS] module installs [Hyprland] onto the system. -Whilst the [Home Manager] module generates the dotfiles for [Hyprland] and optionally [hypridle]. +Whilst the [Home Manager] module generates the dotfiles for [Hyprland] and optionally [hyprlock] and [hypridle]. It can be configured through `modules.hyprland`. @@ -18,6 +18,15 @@ There are no monitors configured by default, so you should use this option to do Whether to configure and enable the [hypridle] package. Be mindful that it may not auto-start, I have yet to find why but even though it configures to start after `graphical-session.target`, that isn't reached in Hyprland sometimes. +### hyprlock.enable + +Whether to configure and enable the [hyprlock] package, by itself it does nothing but when [hypridle] is also enabled it +will automatically call [hyprlock] after a 120 second timeout. + +### hyprlock.background + +A path to an image that will be used as background when [hyprlock] is invoked. + ### scripts.screenshot.enable When enabled it will create two script files in `$XDG_DATA_HOME/scripts/hyprland` and two keybinds for you to run these @@ -45,6 +54,7 @@ services. If this module ever gets actually used by someone, then I'll refine it [hyprland]: https://hyprland.org/ +[hyprlock]: https://github.com/hyprwm/hyprlock [hypridle]: https://github.com/hyprwm/hypridle [home manager]: https://github.com/nix-community/home-manager [nixos]: https://nixos.org diff --git a/modules/hyprland/home-manager.nix b/modules/hyprland/home-manager.nix index 7a2439e..06cecd5 100644 --- a/modules/hyprland/home-manager.nix +++ b/modules/hyprland/home-manager.nix @@ -23,6 +23,16 @@ in hypridle.enable = lib.mkEnableOption "hypridle"; + hyprlock = { + enable = lib.mkEnableOption "hyprlock"; + background = lib.mkOption { + type = lib.types.path; + default = ""; + example = "~/wallpapers/abc.png"; + description = "The image to be used as background for hyprlock."; + }; + }; + scripts = { screenshot.enable = lib.mkEnableOption "screenshot"; startup.enable = lib.mkEnableOption "startup"; @@ -40,21 +50,129 @@ in sha256 = "1clw669i1n3dhawdw4clmjv75fy3smycb5iqk3sanzpr3y0i4vwx"; }; - # Enable hypridle + # Enable hypridle and hyprlock services.hypridle = lib.mkIf cfg.hypridle.enable { enable = true; - settings = { - listener = [ - { - timeout = 180; - on-timeout = "hyprctl dispatch dpms off"; - on-resume = "hyprctl dispatch dpms on"; - } - ]; + general = { + after_sleep_cmd = "hyprctl dispatch dpms on"; + ignore_dbus_inhibit = false; + lock_cmd = "hyprlock"; + }; + + listener = + [ + { + timeout = 180; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ] + ++ lib.optionals cfg.hyprlock.enable [ + { + timeout = 120; + on-timeout = "hyprlock"; + } + ]; }; }; + programs.hyprlock = lib.mkIf cfg.hyprlock.enable { + enable = true; + extraConfig = # hyprlang + '' + source = $HOME/.config/hypr/frappe.conf + + $accent = $mauve + $accentAlpha = $mauveAlpha + $font = JetBrainsMono Nerd Font + + # GENERAL + general { + disable_loading_bar = true + hide_cursor = true + } + + # BACKGROUND + background { + monitor = + path = ${cfg.hyprlock.background} + blur_passes = 0 + color = $base + } + + # LAYOUT + label { + monitor = + text = Layout: $LAYOUT + color = $text + font_size = 25 + font_family = $font + position = 30, -30 + halign = left + valign = top + } + + # TIME + label { + monitor = + text = $TIME + color = $text + font_size = 90 + font_family = $font + position = -30, 0 + halign = right + valign = top + } + + # DATE + label { + monitor = + text = cmd[update:43200000] date +"%A, %d %B %Y" + color = $text + font_size = 25 + font_family = $font + position = -30, -150 + halign = right + valign = top + } + + # USER AVATAR + image { + monitor = + path = $HOME/.face + size = 100 + border_color = $accent + position = 0, 75 + halign = center + valign = center + } + + # INPUT FIELD + input-field { + monitor = + size = 300, 60 + outline_thickness = 4 + dots_size = 0.2 + dots_spacing = 0.2 + dots_center = true + outer_color = $accent + inner_color = $surface0 + font_color = $text + fade_on_empty = false + placeholder_text = 󰌾 Logged in as $USER + hide_input = false + check_color = $accent + fail_color = $red + fail_text = $FAIL ($ATTEMPTS) + capslock_color = $yellow + position = 0, -47 + halign = center + valign = center + } + ''; + }; + # Set-up the scripts for services and apps. home.packages = lib.mkIf cfg.scripts.startup.enable [ (import ./scripts/start_services.nix pkgs) diff --git a/modules/neovim/lua/plugins/astrolsp.lua b/modules/neovim/lua/plugins/astrolsp.lua index f2fc00b..1a51e7a 100644 --- a/modules/neovim/lua/plugins/astrolsp.lua +++ b/modules/neovim/lua/plugins/astrolsp.lua @@ -9,7 +9,7 @@ return { ---@param opts AstroLSPOpts ---@return AstroLSPOpts opts = function(_, opts) - local system_flake_path = os.getenv "FLAKE" or os.getenv "NH_FLAKE" or error "FLAKE environment variable must be set." + local system_flake_path = vim.fn.getenv "FLAKE" or error "FLAKE environment variable must be set." local hostname = vim.fn.hostname() ---@type AstroLSPOpts diff --git a/modules/neovim/lua/plugins/user.lua b/modules/neovim/lua/plugins/user.lua index d607509..33b8f83 100644 --- a/modules/neovim/lua/plugins/user.lua +++ b/modules/neovim/lua/plugins/user.lua @@ -71,6 +71,16 @@ return { }) end, }, + { + "nvim-telescope/telescope.nvim", + optional = true, + opts = { + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + }, + }, }, }, @@ -135,6 +145,11 @@ return { dependencies = { "nvim-treesitter/nvim-treesitter", }, - event = "VeryLazy", + opts = {}, + }, + + -- Better UI hooks + { + "stevearc/dressing.nvim", }, } diff --git a/shared/home-manager/gaming.nix b/shared/home-manager/gaming.nix index 86bb334..0c79867 100644 --- a/shared/home-manager/gaming.nix +++ b/shared/home-manager/gaming.nix @@ -17,7 +17,7 @@ heroic protontricks r2modman - wineWowPackages.stableFull + wineWowPackages.unstableFull winetricks # Games