all repos — archive/dotfiles @ 1f1c107cd2469048a6f407fbe442a32f4f98e2bf

Superseded by nixfiles

Emacs: Show numerical nix generation even for system profiles
Alan Pearce alan@alanpearce.eu
Sat, 15 Jul 2017 15:08:25 +0200
commit

1f1c107cd2469048a6f407fbe442a32f4f98e2bf

parent

4478189a54426c3956f7b2a5243c2bc9828edaf9

1 files changed, 6 insertions(+), 4 deletions(-)

jump to
M emacs/.emacs.d/init.orgemacs/.emacs.d/init.org
@@ -301,9 +301,11 @@ (list " (Nix Generation "                                          (cadr
                                           (split-string (f-base
                                                          (car
-                                                          (last (split-string
-                                                                 (s-chomp (shell-command-to-string (concat "nix-store -q --roots " invocation-directory)))
-                                                                 "\n"))))
+                                                          (last (seq-take-while
+                                                                 (lambda (s) (s-contains? "profile" s))
+                                                                 (split-string
+                                                                  (s-chomp (shell-command-to-string (concat "nix-store -q --roots " invocation-directory)))
+                                                                  "\n")))))
                                                         "-"))
                                          " "
                                          (s-left 6 (nth 3 (f-split invocation-directory)))
@@ -311,7 +313,7 @@ "..."                                          (s-right 6 (car (split-string (nth 3 (f-split invocation-directory)) "-")))
                                          ")"))
                                '(buffer-file-name " — %f")
-                               '(dired-directory (" — " dired-directory)))) 
+                               '(dired-directory (" — " dired-directory))))
 #+END_SRC
 
 ** Chrome