Skip to content

Commit

Permalink
Merge pull request #139 from akirak/fix/nix-24-for-25
Browse files Browse the repository at this point in the history
nix.el: Fix for Nix 2.5
  • Loading branch information
matthewbauer committed Oct 19, 2021
2 parents 8e20de5 + ed00d8d commit 01e37b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nix.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 01e37b6

Please sign in to comment.