2013-01-05 18:47:50 -05:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2023-09-11 08:54:29 -04:00
|
|
|
;;; Copyright © 2012-2016, 2018-2019, 2021, 2023 Ludovic Courtès <ludo@gnu.org>
|
2018-05-27 13:19:30 -04:00
|
|
|
;;; Copyright © 2017 Caleb Ristvedt <caleb.ristvedt@cune.org>
|
2012-11-03 16:07:52 -04:00
|
|
|
;;;
|
2013-01-05 18:47:50 -05:00
|
|
|
;;; This file is part of GNU Guix.
|
2012-11-03 16:07:52 -04:00
|
|
|
;;;
|
2013-01-05 18:47:50 -05:00
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
2012-11-03 16:07:52 -04:00
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
;;; your option) any later version.
|
|
|
|
;;;
|
2013-01-05 18:47:50 -05:00
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
2012-11-03 16:07:52 -04:00
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
2013-01-05 18:47:50 -05:00
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
2012-11-03 16:07:52 -04:00
|
|
|
|
|
|
|
(define-module (guix config)
|
|
|
|
#:export (%guix-package-name
|
|
|
|
%guix-version
|
|
|
|
%guix-bug-report-address
|
2013-01-05 09:55:47 -05:00
|
|
|
%guix-home-page-url
|
2016-07-20 13:27:32 -04:00
|
|
|
|
2021-01-27 08:46:10 -05:00
|
|
|
%channel-metadata
|
|
|
|
|
2016-07-20 13:27:32 -04:00
|
|
|
%storedir
|
|
|
|
%localstatedir
|
|
|
|
%sysconfdir
|
|
|
|
|
2012-12-05 17:02:47 -05:00
|
|
|
%store-directory
|
|
|
|
%state-directory
|
2018-05-27 13:19:30 -04:00
|
|
|
%store-database-directory
|
2013-12-29 09:52:50 -05:00
|
|
|
%config-directory
|
2016-07-20 13:27:32 -04:00
|
|
|
|
2012-12-05 17:02:47 -05:00
|
|
|
%system
|
2023-09-11 08:54:29 -04:00
|
|
|
%git
|
2013-04-12 11:30:27 -04:00
|
|
|
%gzip
|
|
|
|
%bzip2
|
|
|
|
%xz))
|
2012-11-03 16:07:52 -04:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;;;
|
pull: Install (guix config) module to override the user's one.
* build-aux/build-self.scm (zlib, gzip, bzip2, xz): New variables.
(build)[storedir, localstatedir, sysconfdir, sbindir]: New variables.
[builder]: Pass them to 'build-guix'.
* guix/build/pull.scm (build-guix): Add #:system, #:storedir,
#:localstatedir, #:sysconfdir, #:sbindir, #:package-name,
#:package-version, #:bug-report-address, #:home-page-url, #:libgcrypt,
#:zlib, #:gzip, #:bzip2, and #:xz. Remove #:gcrypt.
Instantiate all the substitution variables in (guix config). Remove
code to delete OUT/guix/config.{scm,go}.
* guix/config.scm.in: Add note about (guix script pull).
2016-07-20 16:23:15 -04:00
|
|
|
;;; Compile-time configuration of Guix. When adding a substitution variable
|
|
|
|
;;; here, make sure to equip (guix scripts pull) to substitute it.
|
2012-11-03 16:07:52 -04:00
|
|
|
;;;
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(define %guix-package-name
|
|
|
|
"@PACKAGE_NAME@")
|
|
|
|
|
|
|
|
(define %guix-version
|
|
|
|
"@PACKAGE_VERSION@")
|
|
|
|
|
|
|
|
(define %guix-bug-report-address
|
|
|
|
"@PACKAGE_BUGREPORT@")
|
|
|
|
|
2013-01-05 09:55:47 -05:00
|
|
|
(define %guix-home-page-url
|
|
|
|
"@PACKAGE_URL@")
|
|
|
|
|
2021-01-27 08:46:10 -05:00
|
|
|
(define %channel-metadata
|
|
|
|
;; When true, this is an sexp containing metadata for the 'guix' channel
|
|
|
|
;; this file was built from. This is used by (guix describe).
|
2021-01-27 16:23:19 -05:00
|
|
|
(let ((url @GUIX_CHANNEL_URL@)
|
|
|
|
(commit @GUIX_CHANNEL_COMMIT@)
|
|
|
|
(intro @GUIX_CHANNEL_INTRODUCTION@))
|
|
|
|
(and url commit
|
|
|
|
`(repository
|
|
|
|
(version 0)
|
|
|
|
(url ,url)
|
|
|
|
(branch "master") ;XXX: doesn't really matter
|
|
|
|
(commit ,commit)
|
|
|
|
(name guix)
|
|
|
|
,@(if intro
|
|
|
|
`((introduction
|
|
|
|
(channel-introduction
|
|
|
|
(version 0)
|
|
|
|
(commit ,(car intro))
|
|
|
|
(signer ,(cdr intro)))))
|
|
|
|
'())))))
|
2021-01-27 08:46:10 -05:00
|
|
|
|
2016-07-20 13:27:32 -04:00
|
|
|
(define %storedir
|
|
|
|
"@storedir@")
|
|
|
|
|
|
|
|
(define %localstatedir
|
|
|
|
"@guix_localstatedir@")
|
|
|
|
|
|
|
|
(define %sysconfdir
|
|
|
|
"@guix_sysconfdir@")
|
|
|
|
|
2012-12-05 17:02:47 -05:00
|
|
|
(define %store-directory
|
2014-01-08 15:37:06 -05:00
|
|
|
(or (and=> (getenv "NIX_STORE_DIR") canonicalize-path)
|
2016-07-20 13:27:32 -04:00
|
|
|
%storedir))
|
2012-12-05 17:02:47 -05:00
|
|
|
|
|
|
|
(define %state-directory
|
2016-04-21 12:07:52 -04:00
|
|
|
;; This must match `NIX_STATE_DIR' as defined in `nix/local.mk'.
|
2019-02-03 16:10:06 -05:00
|
|
|
(or (getenv "GUIX_STATE_DIRECTORY")
|
2016-07-20 13:27:32 -04:00
|
|
|
(string-append %localstatedir "/guix")))
|
2012-12-05 17:02:47 -05:00
|
|
|
|
2018-05-27 13:19:30 -04:00
|
|
|
(define %store-database-directory
|
2019-02-03 16:10:06 -05:00
|
|
|
(or (getenv "GUIX_DATABASE_DIRECTORY")
|
2018-05-27 13:19:30 -04:00
|
|
|
(string-append %state-directory "/db")))
|
|
|
|
|
2013-12-29 09:52:50 -05:00
|
|
|
(define %config-directory
|
2016-06-23 13:44:38 -04:00
|
|
|
;; This must match `GUIX_CONFIGURATION_DIRECTORY' as defined in `nix/local.mk'.
|
2016-07-20 13:27:32 -04:00
|
|
|
(or (getenv "GUIX_CONFIGURATION_DIRECTORY")
|
|
|
|
(string-append %sysconfdir "/guix")))
|
2013-12-29 09:52:50 -05:00
|
|
|
|
2012-12-05 17:02:47 -05:00
|
|
|
(define %system
|
|
|
|
"@guix_system@")
|
|
|
|
|
2023-09-11 08:54:29 -04:00
|
|
|
(define %git
|
|
|
|
"@GIT@")
|
|
|
|
|
2013-04-12 11:30:27 -04:00
|
|
|
(define %gzip
|
|
|
|
"@GZIP@")
|
|
|
|
|
|
|
|
(define %bzip2
|
|
|
|
"@BZIP2@")
|
|
|
|
|
|
|
|
(define %xz
|
|
|
|
"@XZ@")
|
|
|
|
|
2012-11-03 16:07:52 -04:00
|
|
|
;;; config.scm ends here
|