From e852be16f009d91bff53277a90b75687c9fff8c9 Mon Sep 17 00:00:00 2001
From: Soispha <soispha@vhack.eu>
Date: Fri, 29 Dec 2023 21:37:01 +0100
Subject: feat(hm/pkgs/hibernate): Init

---
 hm/soispha/pkgs/scripts.nix                | 11 +++++++++++
 hm/soispha/pkgs/scripts/wrappers/hibernate | 15 +++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100755 hm/soispha/pkgs/scripts/wrappers/hibernate

(limited to 'hm/soispha')

diff --git a/hm/soispha/pkgs/scripts.nix b/hm/soispha/pkgs/scripts.nix
index d7924686..f366b138 100644
--- a/hm/soispha/pkgs/scripts.nix
+++ b/hm/soispha/pkgs/scripts.nix
@@ -126,6 +126,17 @@
       inherit (pkgs.bat-extras) batgrep;
     };
   };
+  hibernate-scr = write_script {
+    name = "hibernate";
+    path = "wrappers";
+    dependencies = builtins.attrValues {
+      inherit
+        (pkgs)
+        systemd
+        taskwarrior
+        ;
+    };
+  };
   ll-scr = sysLib.writeShellScriptWithLibraryUnwrapped {
     name = "ll";
     src = ./scripts/wrappers/ll;
diff --git a/hm/soispha/pkgs/scripts/wrappers/hibernate b/hm/soispha/pkgs/scripts/wrappers/hibernate
new file mode 100755
index 00000000..e239cacd
--- /dev/null
+++ b/hm/soispha/pkgs/scripts/wrappers/hibernate
@@ -0,0 +1,15 @@
+#!/usr/bin/env dash
+
+# shellcheck source=/dev/null
+SHELL_LIBRARY_VERSION="1.10.0" . %SHELL_LIBRARY_PATH
+
+task context none
+
+# We have ensured that only one task is active
+active="$(task +ACTIVE _ids)";
+task stop "$active"
+
+systemctl hibernate "$@"
+
+
+# vim: ft=sh
-- 
cgit 1.4.1