config.scm.in 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019 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. %storedir
  25. %localstatedir
  26. %sysconfdir
  27. %store-directory
  28. %state-directory
  29. %store-database-directory
  30. %config-directory
  31. %system
  32. %gzip
  33. %bzip2
  34. %xz))
  35. ;;; Commentary:
  36. ;;;
  37. ;;; Compile-time configuration of Guix. When adding a substitution variable
  38. ;;; here, make sure to equip (guix scripts pull) to substitute it.
  39. ;;;
  40. ;;; Code:
  41. (define %guix-package-name
  42. "@PACKAGE_NAME@")
  43. (define %guix-version
  44. "@PACKAGE_VERSION@")
  45. (define %guix-bug-report-address
  46. "@PACKAGE_BUGREPORT@")
  47. (define %guix-home-page-url
  48. "@PACKAGE_URL@")
  49. (define %storedir
  50. "@storedir@")
  51. (define %localstatedir
  52. "@guix_localstatedir@")
  53. (define %sysconfdir
  54. "@guix_sysconfdir@")
  55. (define %store-directory
  56. (or (and=> (getenv "NIX_STORE_DIR") canonicalize-path)
  57. %storedir))
  58. (define %state-directory
  59. ;; This must match `NIX_STATE_DIR' as defined in `nix/local.mk'.
  60. (or (getenv "GUIX_STATE_DIRECTORY")
  61. (string-append %localstatedir "/guix")))
  62. (define %store-database-directory
  63. (or (getenv "GUIX_DATABASE_DIRECTORY")
  64. (string-append %state-directory "/db")))
  65. (define %config-directory
  66. ;; This must match `GUIX_CONFIGURATION_DIRECTORY' as defined in `nix/local.mk'.
  67. (or (getenv "GUIX_CONFIGURATION_DIRECTORY")
  68. (string-append %sysconfdir "/guix")))
  69. (define %system
  70. "@guix_system@")
  71. (define %gzip
  72. "@GZIP@")
  73. (define %bzip2
  74. "@BZIP2@")
  75. (define %xz
  76. "@XZ@")
  77. ;;; config.scm ends here