branch: elpa/nix-mode
commit 01e37b67614ca9f02d7276149f61ebac8d34a711
Merge: 8e20de5ba7 ed00d8dff2
Author: Matthew Bauer <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #139 from akirak/fix/nix-24-for-25
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."