From 2523da17f1eec13ff934a79531e169f2a48b90c2 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Tue, 30 Sep 2025 16:35:28 +0200 Subject: [PATCH] Add caffeinate to nix darwin --- modules/cli/darwin.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/cli/darwin.nix b/modules/cli/darwin.nix index 47f7af5..300cd76 100644 --- a/modules/cli/darwin.nix +++ b/modules/cli/darwin.nix @@ -1,4 +1,3 @@ -# Common file for both nixos and nix-darwin {pkgs, ...}: { imports = [ ./nix/nix.nix @@ -31,4 +30,14 @@ }; info.enable = true; }; + + launchd.user.agents.caffeinate = { + command = "${pkgs.darwin.PowerManagement}/bin/caffeinate -diu"; + serviceConfig = { + KeepAlive = true; + RunAtLoad = true; + StandardOutPath = "/tmp/caffeinate.log"; + StandardErrorPath = "/tmp/caffeinate.err"; + }; + }; }