;;; guix-profiles.el --- Guix profiles
-;; Copyright © 2014 Alex Kost <alezost@gmail.com>
+;; Copyright © 2014, 2015, 2016 Alex Kost <alezost@gmail.com>
+;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
;; This file is part of GNU Guix.
(expand-file-name "~/.guix-profile")
"User profile.")
+(defvar guix-system-profile
+ (concat guix-config-state-directory "/profiles/system")
+ "System profile.")
+
(defvar guix-default-profile
- (concat guix-state-directory
+ (concat guix-config-state-directory
"/profiles/per-user/"
(getenv "USER")
"/guix-profile")
(defvar guix-current-profile guix-default-profile
"Current profile.")
+(defvar guix-system-profile-regexp
+ (concat "\\`" (regexp-quote guix-system-profile))
+ "Regexp matching system profiles.")
+
+(defun guix-system-profile? (profile)
+ "Return non-nil, if PROFILE is a system one."
+ (string-match-p guix-system-profile-regexp profile))
+
(defun guix-profile-prompt (&optional default)
"Prompt for profile and return it.
Use DEFAULT as a start directory. If it is nil, use