From cb169c4e06cec9b4349e3668427e729d22328a54 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Tue, 21 May 2024 19:46:17 +0300 Subject: [PATCH] nix/hm-module: remove --- flake.nix | 2 +- nix/hm-module.nix | 120 ---------------------------------------------- 2 files changed, 1 insertion(+), 121 deletions(-) delete mode 100644 nix/hm-module.nix diff --git a/flake.nix b/flake.nix index 1174b38..1f07e96 100644 --- a/flake.nix +++ b/flake.nix @@ -35,7 +35,7 @@ homeManagerModules = { default = self.homeManagerModules.hypridle; - hypridle = import ./nix/hm-module.nix self; + hypridle = builtins.throw "hypridle: the flake HM module has been removed. Use the module from Home Manager upstream."; }; checks = eachSystem (system: self.packages.${system}); diff --git a/nix/hm-module.nix b/nix/hm-module.nix deleted file mode 100644 index 89c884e..0000000 --- a/nix/hm-module.nix +++ /dev/null @@ -1,120 +0,0 @@ -self: { - config, - pkgs, - lib, - ... -}: let - inherit (builtins) toString; - inherit (lib.types) bool int listOf package str submodule; - inherit (lib.modules) mkIf; - inherit (lib.options) mkOption mkEnableOption; - inherit (lib.meta) getExe; - - cfg = config.services.hypridle; -in { - options.services.hypridle = { - enable = mkEnableOption "Hypridle, Hyprland's idle daemon"; - - package = mkOption { - description = "The hypridle package"; - type = package; - default = self.packages.${pkgs.stdenv.hostPlatform.system}.hypridle; - }; - - listeners = mkOption { - description = "The hypridle listeners"; - type = listOf (submodule { - options = { - timeout = mkOption { - description = "The timeout for the hypridle service, in seconds"; - type = int; - default = 500; - }; - - onTimeout = mkOption { - description = "The command to run when the timeout is reached"; - type = str; - default = "echo 'timeout reached'"; - }; - - onResume = mkOption { - description = "The command to run when the service resumes"; - type = str; - default = "echo 'service resumed'"; - }; - }; - }); - default = []; - }; - - lockCmd = mkOption { - description = "The command to run when the service locks"; - type = str; - default = "echo 'lock!'"; - }; - - unlockCmd = mkOption { - description = "The command to run when the service unlocks"; - type = str; - default = "echo 'unlock!'"; - }; - - afterSleepCmd = mkOption { - description = "The command to run after the service sleeps"; - type = str; - default = "echo 'Awake...'"; - }; - - beforeSleepCmd = mkOption { - description = "The command to run before the service sleeps"; - type = str; - default = "echo 'Zzz...'"; - }; - - ignoreDbusInhibit = mkOption { - description = "Whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)"; - type = bool; - default = false; - }; - }; - - config = mkIf cfg.enable { - xdg.configFile."hypr/hypridle.conf".text = '' - general { - lock_cmd = ${cfg.lockCmd} - unlock_cmd = ${cfg.unlockCmd} - before_sleep_cmd = ${cfg.beforeSleepCmd} - after_sleep_cmd = ${cfg.afterSleepCmd} - ignore_dbus_inhibit = ${ - if cfg.ignoreDbusInhibit - then "true" - else "false" - } - } - - ${builtins.concatStringsSep "\n" (map (listener: '' - listener { - timeout = ${toString listener.timeout} - on-timeout = ${listener.onTimeout} - on-resume = ${listener.onResume} - } - '') - cfg.listeners)} - ''; - - systemd.user.services.hypridle = { - Unit = { - Description = "Hypridle"; - After = ["graphical-session.target"]; - }; - - Service = { - ExecStart = "${getExe cfg.package}"; - Restart = "always"; - RestartSec = "10"; - }; - - Install.WantedBy = [ "default.target" ]; - }; - }; -}