From 44b51bf45462a313265fe22bbf2b091efb2e1ddd Mon Sep 17 00:00:00 2001 From: voidarc Date: Mon, 13 Jul 2026 12:18:04 +0100 Subject: [PATCH] fixed hyprland config getting garbage collected --- flake.lock | 17 +++++++++++++++++ flake.nix | 4 ++++ modules/features/hyprland/default.nix | 6 ++++++ 3 files changed, 27 insertions(+) diff --git a/flake.lock b/flake.lock index 62e14ec..f695b35 100644 --- a/flake.lock +++ b/flake.lock @@ -386,6 +386,22 @@ "url": "https://git.voidarc.co.uk/voidarc/hypr" } }, + "hyprland-config": { + "flake": false, + "locked": { + "lastModified": 1783777857, + "narHash": "sha256-5tIpGp3E+hsDvWQWtAEvvQfUv+wdi6OsS1qziLPMJhk=", + "ref": "refs/heads/main", + "rev": "e561e6d3be18fc3d5dc35380dc6a87ebc518b471", + "revCount": 47, + "type": "git", + "url": "https://git.voidarc.co.uk/voidarc/hypr" + }, + "original": { + "type": "git", + "url": "https://git.voidarc.co.uk/voidarc/hypr" + } + }, "hyprland-guiutils": { "inputs": { "aquamarine": [ @@ -1026,6 +1042,7 @@ "flake-parts": "flake-parts", "gotify-desktop": "gotify-desktop", "hyprland": "hyprland", + "hyprland-config": "hyprland-config", "import-tree": "import-tree", "nixpkgs": "nixpkgs_5", "nvim": "nvim", diff --git a/flake.nix b/flake.nix index a4660e4..c7ea5d7 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,10 @@ url = "git+https://git.voidarc.co.uk/voidarc/hypr"; inputs.nixpkgs.follows = "nixpkgs"; }; + hyprland-config = { + url = "git+https://git.voidarc.co.uk/voidarc/hypr"; + flake = false; + }; otter-launcher = { url = "github:kuokuo123/otter-launcher"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/features/hyprland/default.nix b/modules/features/hyprland/default.nix index 44818b6..59a1e60 100644 --- a/modules/features/hyprland/default.nix +++ b/modules/features/hyprland/default.nix @@ -7,6 +7,7 @@ flake.nixosModules.hyprland = moduleWithSystem ({ self', pkgs, + inputs', ... }: {config, ...}: let modules = with self.nixosModules; [ @@ -39,6 +40,10 @@ '') runtimePkgs)} ''; + system.activationScripts.hyprConfig = lib.stringAfter ["specialfs"] '' + mkdir -p /run/hypr/config + ln -sfn ${inputs.hyprland-config}/* /run/hypr/config + ''; }); perSystem = { self', @@ -48,6 +53,7 @@ }: { packages = { hyprland = inputs'.hyprland.packages.default.override { + flags."--config" = "/run/hypr/config/hyprland.lua"; runtimePackages = inputs.hyprland.lib.defaultRuntimePkgs.${system} // {