config.scm.in 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2017 Caleb Ristvedt <caleb.ristvedt@cune.org>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (guix config)
  20. #:export (%guix-package-name
  21. %guix-version
  22. %guix-bug-report-address
  23. %guix-home-page-url
  24. %channel-metadata
  25. %storedir
  26. %localstatedir
  27. %sysconfdir
  28. %store-directory
  29. %state-directory
  30. %store-database-directory
  31. %config-directory
  32. %system
  33. %gzip
  34. %bzip2
  35. %xz))
  36. ;;; Commentary:
  37. ;;;
  38. ;;; Compile-time configuration of Guix. When adding a substitution variable
  39. ;;; here, make sure to equip (guix scripts pull) to substitute it.
  40. ;;;
  41. ;;; Code:
  42. (define %guix-package-name
  43. "@PACKAGE_NAME@")
  44. (define %guix-version
  45. "@PACKAGE_VERSION@")
  46. (define %guix-bug-report-address
  47. "@PACKAGE_BUGREPORT@")
  48. (define %guix-home-page-url
  49. "@PACKAGE_URL@")
  50. (define %channel-metadata
  51. ;; When true, this is an sexp containing metadata for the 'guix' channel
  52. ;; this file was built from. This is used by (guix describe).
  53. (let ((url @GUIX_CHANNEL_URL@)
  54. (commit @GUIX_CHANNEL_COMMIT@)
  55. (intro @GUIX_CHANNEL_INTRODUCTION@))
  56. (and url commit
  57. `(repository
  58. (version 0)
  59. (url ,url)
  60. (branch "master") ;XXX: doesn't really matter
  61. (commit ,commit)
  62. (name guix)
  63. ,@(if intro
  64. `((introduction
  65. (channel-introduction
  66. (version 0)
  67. (commit ,(car intro))
  68. (signer ,(cdr intro)))))
  69. '())))))
  70. (define %storedir
  71. "@storedir@")
  72. (define %localstatedir
  73. "@guix_localstatedir@")
  74. (define %sysconfdir
  75. "@guix_sysconfdir@")
  76. (define %store-directory
  77. (or (and=> (getenv "NIX_STORE_DIR") canonicalize-path)
  78. %storedir))
  79. (define %state-directory
  80. ;; This must match `NIX_STATE_DIR' as defined in `nix/local.mk'.
  81. (or (getenv "GUIX_STATE_DIRECTORY")
  82. (string-append %localstatedir "/guix")))
  83. (define %store-database-directory
  84. (or (getenv "GUIX_DATABASE_DIRECTORY")
  85. (string-append %state-directory "/db")))
  86. (define %config-directory
  87. ;; This must match `GUIX_CONFIGURATION_DIRECTORY' as defined in `nix/local.mk'.
  88. (or (getenv "GUIX_CONFIGURATION_DIRECTORY")
  89. (string-append %sysconfdir "/guix")))
  90. (define %system
  91. "@guix_system@")
  92. (define %gzip
  93. "@GZIP@")
  94. (define %bzip2
  95. "@BZIP2@")
  96. (define %xz
  97. "@XZ@")
  98. ;;; config.scm ends here