;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015-2024 Ludovic Courtès ;;; Copyright © 2016 Chris Marusich ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020, 2021 Ricardo Wurmus ;;; Copyright © 2021 raid5atemyhomework ;;; Copyright © 2020 Christine Lemmer-Webber ;;; Copyright © 2020, 2021 Brice Waegeneire ;;; Copyright © 2022 Tobias Geerinckx-Rice ;;; Copyright © 2023 Brian Cully ;;; Copyright © 2024 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; 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. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; 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 ;;; along with GNU Guix. If not, see . (define-module (gnu services) #:use-module (guix gexp) #:use-module (guix monads) #:use-module (guix store) #:use-module (guix records) #:use-module (guix profiles) #:use-module (guix discovery) #:use-module (guix combinators) #:use-module (guix channels) #:use-module (guix describe) #:use-module (guix sets) #:use-module (guix ui) #:use-module (guix diagnostics) #:autoload (guix openpgp) (openpgp-format-fingerprint) #:use-module (guix modules) #:use-module (guix packages) #:use-module (guix utils) #:use-module (guix deprecation) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages hurd) #:use-module (gnu packages linux) #:use-module (gnu system privilege) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (srfi srfi-9 gnu) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:use-module (srfi srfi-71) #:use-module (ice-9 vlist) #:use-module (ice-9 match) #:autoload (ice-9 pretty-print) (pretty-print) #:export (service-extension service-extension? service-extension-target service-extension-compute service-type service-type? service-type-name service-type-extensions service-type-compose service-type-extend service-type-default-value service-type-description service-type-location %service-type-path fold-service-types lookup-service-types service service? service-kind service-value service-parameters ;deprecated simple-service modify-services service-back-edges instantiate-missing-services fold-services remove-service-extensions for-home for-home? validate-service-list service-error? missing-value-service-error? missing-value-service-error-type missing-value-service-error-location missing-target-service-error? missing-target-service-error-service missing-target-service-error-target-type ambiguous-target-service-error? ambiguous-target-service-error-service ambiguous-target-service-error-target-type system-service-type provenance-service-type sexp->system-provenance system-provenance boot-service-type cleanup-service-type activation-service-type activation-service->script %linux-bare-metal-service %hurd-rc-script %hurd-startup-service special-files-service-type extra-special-file etc-service-type etc-directory privileged-program-service-type setuid-program-service-type ; deprecated profile-service-type firmware-service-type gc-root-service-type linux-builder-service-type linux-builder-configuration linux-builder-configuration? linux-builder-configuration-kernel linux-builder-configuration-modules linux-loadable-module-service-type %boot-service %activation-service etc-service) ; deprecated #:re-export (;; Note: Re-export 'delete' to allow for proper syntax matching ;; in 'modify-services' forms. See ;; . delete)) ;;; Comment: ;;; ;;; This module defines a broad notion of "service types" and "services." ;;; ;;; A service type describe how its instances extend instances of other ;;; service types. For instance, some services extend the instance of ;;; ACCOUNT-SERVICE-TYPE by providing it with accounts and groups to create; ;;; others extend SHEPHERD-ROOT-SERVICE-TYPE by passing it instances of ;;; . ;;; ;;; When applicable, the service type defines how it can itself be extended, ;;; by providing one procedure to compose extensions, and one procedure to ;;; extend itself. ;;; ;;; A notable service type is SYSTEM-SERVICE-TYPE, which has a single ;;; instance, which is the root of the service DAG. Its value is the ;;; derivation that produces the 'system' directory as returned by ;;; 'operating-system-derivation'. ;;; ;;; The 'fold-services' procedure can be passed a list of procedures, which it ;;; "folds" by propagating extensions down the graph; it returns the root ;;; service after the applying all its extensions. ;;; ;;; Code: (define-record-type <