branch: elpa/nix-mode
commit ed00d8dff2765ca59a48689f5cf5267c817e1442
Author: Akira Komamura <[email protected]>
Commit: Akira Komamura <[email protected]>
nix.el: Fix for Nix 2.5
---
nix.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/nix.el b/nix.el
index bf5887b27e..acdf23aeb1 100644
--- a/nix.el
+++ b/nix.el
@@ -186,10 +186,11 @@ OPTIONS a list of options to accept."
(defun nix-is-24 ()
"Whether Nix is a version with Flakes support."
- ;; earlier versions reported as 3, now it’s just nix-2.4
(let ((version (nix-version)))
- (or (string-prefix-p "nix (Nix) 3" version)
- (string-prefix-p "nix (Nix) 2.4" version))))
+ (save-match-data
+ (when (string-match (rx bol "nix (Nix) " (group (+ digit) (? "." (+
digit))))
+ version)
+ (version<= "2.4" (match-string 1 version))))))
(defun nix-has-flakes ()
"Whether Nix is a version with Flakes support."