Compare commits

..

42 Commits

Author SHA1 Message Date
xenia f4348768df change the way the zfs patch works 2025-02-05 15:38:24 -05:00
xenia d0dfe01002 oops 2025-02-03 22:27:40 -05:00
xenia 87bf9f5e0c add ZED libnotify patch to zfs 2025-02-03 21:55:32 -05:00
xenia 96d7aca602 treewide: add meta 2024-12-21 17:08:31 -05:00
xenia 444c47a548 oops 42071 2024-12-21 16:35:15 -05:00
xenia e23d199b00 oops 42070 2024-12-21 16:26:30 -05:00
xenia 8347d35d44 oops 42069 2024-12-21 16:12:39 -05:00
xenia 81788bdb46 oops 4 2024-12-21 16:00:41 -05:00
xenia d300bd56fb oops 3 2024-12-21 15:58:22 -05:00
xenia 8a31dd880d oops 2 2024-12-21 15:56:40 -05:00
xenia fa40f2533e oops 2024-12-21 15:55:18 -05:00
xenia 8ab9173e29 add user level version of crimes 2024-12-21 15:54:11 -05:00
xenia be08f6b73e oops 2024-12-17 02:33:34 -05:00
xenia 0b39734c7a experiment 2024-12-17 02:30:37 -05:00
xenia 9e31048110 genericize 2024-12-17 01:57:06 -05:00
xenia e5dd2071ec oops 2 2024-12-17 01:50:04 -05:00
xenia b4a1ccbd71 oops 2024-12-17 01:45:54 -05:00
xenia ec2a795b9b streamline unfree licensing 2024-12-17 01:41:49 -05:00
xenia 2c64b6a902 fix precedence 2024-12-17 01:13:54 -05:00
xenia f1a03dbf33 lmao whoops 2024-12-17 00:54:22 -05:00
xenia ff3680817c ghidra: add back doc entries that are needed 2024-12-17 00:54:16 -05:00
xenia 64d9bae0ce updoot nixpkgs 2024-12-15 19:35:15 -05:00
xenia 529b390d13 oops 2024-12-02 02:19:49 -05:00
xenia e67fb3b037 add templates 2024-12-02 02:14:04 -05:00
xenia 984654610a add option for nixpkgs reference in flake registry 2024-12-02 01:55:57 -05:00
xenia 4259429d0c oops 2024-12-02 00:24:10 -05:00
xenia c851c6f345 kicad patch needs update so use upstream for now 2024-12-01 23:44:05 -05:00
xenia 8a370b9c9d update readme 2024-12-01 23:25:04 -05:00
xenia f76206bc6f unstable -> stable 2024-12-01 23:20:24 -05:00
xenia c8a4d759b8 updates for 24.11 and other things 2024-12-01 23:19:10 -05:00
xenia 945e1f9915 use resholve 2024-12-01 22:11:18 -05:00
xenia 30d18a7b68 WIP archlinux bootstrap from nixos 2024-12-01 22:11:18 -05:00
xenia 17f9a4a758 pkgs: add ocaml-manual 2024-11-28 02:05:39 -05:00
xenia 80019480c4 mkFlake: passthrough derivations 2024-11-27 23:03:12 -05:00
xenia 3d44369166 update lix and nixpkgs 2024-11-27 22:49:12 -05:00
xenia 3577ecd90e pkgs: add systemd-ml 2024-11-27 22:30:22 -05:00
xenia 00e10e615f pkgs: add zbasefind 2024-11-27 22:30:22 -05:00
xenia 5d6ad133ed feedvalidator to python3Packages 2024-11-27 22:30:22 -05:00
xenia 8050f32752 pkgs: update ghidra extensions 2024-11-21 13:05:16 -05:00
xenia 98f22d7a09 pkgs: cado-nfs: makeWrapper -> makeBinaryWrapper 2024-11-21 12:57:04 -05:00
xenia c0912c19cf pkgs: ghidra -> 11.2.1 2024-11-21 12:56:59 -05:00
xenia 366544005a fork off 24.11 2024-11-21 12:34:53 -05:00
5 changed files with 147 additions and 11 deletions

View File

@ -30,16 +30,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1734119587,
"narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=",
"lastModified": 1734083684,
"narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5",
"rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}

View File

@ -2,7 +2,7 @@
description = "dragnpkgs together with nixpkgs and lix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-2.tar.gz";
@ -29,18 +29,18 @@
# self reference in the registry to be downloadable by URL in case it makes it into a
# flake.lock
meta.registry-entry = {
from = { id = "dragnpkgs-unstable"; type = "indirect"; };
from = { id = "dragnpkgs"; type = "indirect"; };
to = {
type = "git";
url = "https://git.lain.faith/haskal/dragnpkgs.git";
ref = "main";
ref = "nixos-24.11";
} // self.lib.filterAttrs
(n: _: n == "lastModified" || n == "rev" || n == "revCount" || n == "narHash")
self;
};
# the nix path entry for self
meta.path-entry = "dragnpkgs-unstable=flake:dragnpkgs-unstable";
meta.path-entry = "dragnpkgs=flake:dragnpkgs";
lib = nixpkgs.lib.extend (final: prev: {
licenses = prev.licenses // { fyptl = import ./lib/licenses/fyptl.nix; };
@ -122,17 +122,17 @@
};
};
config.nix.registry.dragnpkgs-unstable =
config.nix.registry.dragnpkgs =
lib.mkIf config.dragnpkgs.setFlakeRegistry self.meta.registry-entry;
config.nix.registry.nixpkgs = lib.mkIf config.dragnpkgs.setNixpkgsFlakeAlias {
from = { id = "nixpkgs"; type = "indirect"; };
to = { id = "dragnpkgs-unstable"; type = "indirect"; };
to = { id = "dragnpkgs"; type = "indirect"; };
};
config.nix.registry.templates = lib.mkIf config.dragnpkgs.setTemplatesFlakeAlias {
from = { id = "templates"; type = "indirect"; };
to = { id = "dragnpkgs-unstable"; type = "indirect"; };
to = { id = "dragnpkgs"; type = "indirect"; };
};
config.nix.nixPath = lib.mkIf config.dragnpkgs.setNixPath [

View File

@ -48,4 +48,8 @@ final: prev: {
lix-plugins = prev.callPackage ./pkgs/lix/lix-plugins {};
nix-plugins = builtins.throw "nix-plugins is not supported. see pkgs.lix-plugins";
zfs_2_2 = prev.zfs_2_2.overrideAttrs {
patches = [ ./pkgs/zfs/0001-ZED-add-support-for-desktop-notifications-D-Bus.patch ];
};
}

View File

@ -1,4 +1,5 @@
{
lib,
fetchFromGitHub,
stdenv,
meson,

View File

@ -0,0 +1,131 @@
From 4ec38cf16ad4cc5f7bb00b93c32cd8f1d313c14c Mon Sep 17 00:00:00 2001
From: xenia <xenia@awoo.systems>
Date: Mon, 3 Feb 2025 21:36:29 -0500
Subject: [PATCH] ZED: add support for desktop notifications (D-Bus)
---
cmd/zed/zed.d/zed-functions.sh | 85 ++++++++++++++++++++++++++++++++++
cmd/zed/zed.d/zed.rc | 7 +++
2 files changed, 92 insertions(+)
diff --git a/cmd/zed/zed.d/zed-functions.sh b/cmd/zed/zed.d/zed-functions.sh
index 3a2519633..d47ef070b 100644
--- a/cmd/zed/zed.d/zed-functions.sh
+++ b/cmd/zed/zed.d/zed-functions.sh
@@ -209,6 +209,10 @@ zed_notify()
[ "${rv}" -eq 0 ] && num_success=$((num_success + 1))
[ "${rv}" -eq 1 ] && num_failure=$((num_failure + 1))
+ zed_notify_dbus "${subject}" "${pathname}"; rv=$?
+ [ "${rv}" -eq 0 ] && num_success=$((num_success + 1))
+ [ "${rv}" -eq 1 ] && num_failure=$((num_failure + 1))
+
[ "${num_success}" -gt 0 ] && return 0
[ "${num_failure}" -gt 0 ] && return 1
return 2
@@ -624,6 +628,87 @@ zed_notify_ntfy()
}
+# zed_notify_dbus (subject, pathname)
+#
+# Send a notification via D-Bus ...
+# The variable (ZED_USE_DBUS) defines whether to use D-Bus.
+#
+# Requires systemd (busctl) executables to be installed in the standard PATH.
+#
+# References
+# ...
+#
+# Arguments
+# subject: notification subject
+# pathname: pathname containing the notification message (OPTIONAL)
+#
+# Globals
+# ZED_USE_DBUS
+#
+# Return
+# 0: notification sent
+# 1: notification failed
+# 2: not configured
+#
+zed_notify_dbus()
+{
+ local subject="$1"
+ local pathname="${2:-"/dev/null"}"
+ local msg_body
+ local msg_out
+ local msg_err
+ local exit_status=0
+ local dir
+ local userid
+
+ [ -n "${ZED_USE_DBUS}" ] || return 2
+
+ if [ ! -r "${pathname}" ]; then
+ zed_log_err "dbus cannot read \"${pathname}\""
+ return 1
+ fi
+
+ zed_check_cmd "busctl" || return 1
+
+ # Read the message body in.
+ #
+ msg_body="$(cat "${pathname}")"
+
+ if [ -z "${msg_body}" ]
+ then
+ msg_body=$subject
+ subject=""
+ fi
+
+ # Send the notification to all users with a dbus session and check for
+ # errors.
+ # We use busctl(1) manually rather than eg notify-send(1) due to its
+ # ability to send D-Bus messages from root to a non-root user with the
+ # "--machine=<user>@.host" flag.
+ for dir in /run/user/*; do
+ if [ -S "$dir/bus" ]; then
+ userid="$(basename "$dir")"
+ msg_out="$( \
+ busctl --user --machine "$userid@.host" -- \
+ call org.freedesktop.Notifications \
+ /org/freedesktop/Notifications \
+ org.freedesktop.Notifications Notify \
+ "susssasa{sv}i" \
+ "ZFS" 0 "drive-harddisk-symbolic" \
+ "$subject" "$msg_body"
+ 0 2 urgency y 2 sender-pid x "$$" "-1" \
+ 2>/dev/null
+ )"; rv=$?
+
+ if [ "${rv}" -ne 0 ]; then
+ zed_log_err "busctl exit=${rv}"
+ exit_status=1
+ fi
+ fi
+ done
+ return $exit_status
+}
+
# zed_rate_limit (tag, [interval])
#
diff --git a/cmd/zed/zed.d/zed.rc b/cmd/zed/zed.d/zed.rc
index 859c6f9cb..567cd556a 100644
--- a/cmd/zed/zed.d/zed.rc
+++ b/cmd/zed/zed.d/zed.rc
@@ -176,3 +176,10 @@ ZED_SYSLOG_SUBCLASS_EXCLUDE="history_event"
# <https://docs.ntfy.sh/install/>
# https://ntfy.sh by default; uncomment to enable an alternative service url.
#ZED_NTFY_URL="https://ntfy.sh"
+
+##
+# Whether to send desktop notifications via D-Bus
+# If defined, busctl(1) will be used to send desktop notifications via
+# the org.freedesktop.Notifications D-Bus interface
+# Disabled by default; uncomment to enable.
+#ZED_USE_DBUS=1
--
2.47.0