[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 26928b8a20 2/7: Add `nix-store-show-log` to open
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 26928b8a20 2/7: Add `nix-store-show-log` to open a log file from nix-store-path mode. |
Date: |
Sun, 30 Oct 2022 19:58:58 -0400 (EDT) |
branch: elpa/nix-mode
commit 26928b8a201c694be7ce376a1e591e21acf3587b
Author: zainab-ali <zainab@kebab-ca.se>
Commit: zainab-ali <zainab@kebab-ca.se>
Add `nix-store-show-log` to open a log file from nix-store-path mode.
---
README.md | 5 ++++-
nix-store.el | 17 +++++++++++++++++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f3c2bd2ddd..3ef5662ced 100644
--- a/README.md
+++ b/README.md
@@ -93,9 +93,12 @@ overview of a store path. The information it shows is the
realisation status,
the hash and the size of the store path. Also it shows lists of derivers,
references, referrers and requisites of the respective path.
-You can change the order in which that information is show. See the
+You can change the order in which that information is shown. See the
documentation of the function `nix-store-show-path` for more information.
+When viewing a store buffer, the command `M-x nix-store-show-log`
+opens a local log file associated with a derivation.
+
### nix-prettify-mode.el
When nix-prettify-mode is enabled, hash-parts of the Nix store file names are
diff --git a/nix-store.el b/nix-store.el
index d633031393..099019ecdc 100644
--- a/nix-store.el
+++ b/nix-store.el
@@ -206,6 +206,23 @@ It uses \\[nix-store-show-path] to display the store path."
(interactive)
(nix-store-show-path (nix-store-path-at-point)))
+(defun nix-store-show-log ()
+ "Opens the log file for the derivation of the nix-store path."
+ (interactive)
+ (let ((drv-name (when-let*
+ ((drv-name (nix-store-path-derivers
nix-buffer-store-path))
+ (drv-name (car drv-name)))
+ (file-relative-name drv-name nix-store-dir))))
+ (if (not drv-name)
+ (message "This store path has no associated derivation.")
+ (let ((log-file (format "%s/log/nix/drvs/%s/%s.bz2"
+ nix-state-dir
+ (substring drv-name 0 2)
+ (substring drv-name 2))))
+ (if (file-exists-p log-file)
+ (find-file log-file)
+ (error "No log is available for derivation"))))))
+
(defvar nix-store-path-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "RET") 'nix-store-show-path-at-point)
- [nongnu] elpa/nix-mode updated (34d51e2731 -> 5efb5383ab), ELPA Syncer, 2022/10/30
- [nongnu] elpa/nix-mode 098433bd54 1/7: chore(deps): bump cachix/install-nix-action from 17 to 18, ELPA Syncer, 2022/10/30
- [nongnu] elpa/nix-mode 26928b8a20 2/7: Add `nix-store-show-log` to open a log file from nix-store-path mode.,
ELPA Syncer <=
- [nongnu] elpa/nix-mode e0c057fade 4/7: Add function to get nix store log path, ELPA Syncer, 2022/10/30
- [nongnu] elpa/nix-mode 1f93977c25 5/7: Bind l to nix-store-show-log, ELPA Syncer, 2022/10/30
- [nongnu] elpa/nix-mode 2915a0f4c7 3/7: Merge pull request #169 from NixOS/dependabot/github_actions/cachix/install-nix-action-18, ELPA Syncer, 2022/10/30
- [nongnu] elpa/nix-mode 634a1ffcaa 6/7: Merge pull request #170 from zainab-ali/nix-store-show-log, ELPA Syncer, 2022/10/30
- [nongnu] elpa/nix-mode 5efb5383ab 7/7: Fix auto-mode-alist for drvs, ELPA Syncer, 2022/10/30