diff options
Diffstat (limited to 'gnu/system')
| -rw-r--r-- | gnu/system/install.scm | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 1e30e33f7a5..b98b3ee601a 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm | |||
| @@ -25,9 +25,11 @@ | |||
| 25 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | 25 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 26 | 26 | ||
| 27 | (define-module (gnu system install) | 27 | (define-module (gnu system install) |
| 28 | #:use-module ((guix licenses) #:prefix license:) | ||
| 28 | #:use-module (gnu) | 29 | #:use-module (gnu) |
| 29 | #:use-module (gnu system) | 30 | #:use-module (gnu system) |
| 30 | #:use-module (gnu system privilege) | 31 | #:use-module (gnu system privilege) |
| 32 | #:use-module (guix build-system trivial) | ||
| 31 | #:use-module (gnu bootloader) | 33 | #:use-module (gnu bootloader) |
| 32 | #:use-module (gnu bootloader u-boot) | 34 | #:use-module (gnu bootloader u-boot) |
| 33 | #:use-module (guix gexp) | 35 | #:use-module (guix gexp) |
| @@ -413,6 +415,27 @@ or by starting the installer, using `guix-system-installer` command. | |||
| 413 | #$(file-append shadow "/bin/login") | 415 | #$(file-append shadow "/bin/login") |
| 414 | (command-line))))) | 416 | (command-line))))) |
| 415 | 417 | ||
| 418 | (define* (installer-command-package installer-program | ||
| 419 | #:key executable) | ||
| 420 | (package | ||
| 421 | (name executable) | ||
| 422 | (version "0") | ||
| 423 | (source #f) | ||
| 424 | (build-system trivial-build-system) | ||
| 425 | (arguments | ||
| 426 | (list #:builder (with-imported-modules '((guix build utils)) | ||
| 427 | #~(begin | ||
| 428 | (use-modules (guix build utils)) | ||
| 429 | |||
| 430 | (mkdir-p (string-append #$output "/bin")) | ||
| 431 | |||
| 432 | (symlink #$installer-program | ||
| 433 | (string-append #$output "/bin/" #$executable)))))) | ||
| 434 | (home-page #f) | ||
| 435 | (synopsis "Provides the Guix System installer as run-guix-installer command") | ||
| 436 | (description "Provides the Guix System installer as run-guix-installer command.") | ||
| 437 | (license license:gpl3+))) | ||
| 438 | |||
| 416 | (define* (%installation-services | 439 | (define* (%installation-services |
| 417 | #:key | 440 | #:key |
| 418 | (system (or (and=> | 441 | (system (or (and=> |
| @@ -430,6 +453,10 @@ or by starting the installer, using `guix-system-installer` command. | |||
| 430 | (define bare-bones-os | 453 | (define bare-bones-os |
| 431 | (load "examples/bare-bones.tmpl")) | 454 | (load "examples/bare-bones.tmpl")) |
| 432 | 455 | ||
| 456 | (define installer | ||
| 457 | (installer-program | ||
| 458 | #:guix-for-installer guix-for-system)) | ||
| 459 | |||
| 433 | (append | 460 | (append |
| 434 | ;; Generic services | 461 | ;; Generic services |
| 435 | (list (service virtual-terminal-service-type) | 462 | (list (service virtual-terminal-service-type) |
| @@ -437,8 +464,7 @@ or by starting the installer, using `guix-system-installer` command. | |||
| 437 | (service kmscon-service-type | 464 | (service kmscon-service-type |
| 438 | (kmscon-configuration | 465 | (kmscon-configuration |
| 439 | (virtual-terminal "tty1") | 466 | (virtual-terminal "tty1") |
| 440 | (login-program (installer-program | 467 | (login-program installer))) |
| 441 | #:guix-for-installer guix-for-system)))) | ||
| 442 | 468 | ||
| 443 | (simple-service 'installer-login | 469 | (simple-service 'installer-login |
| 444 | pam-root-service-type | 470 | pam-root-service-type |
| @@ -465,6 +491,13 @@ or by starting the installer, using `guix-system-installer` command. | |||
| 465 | ;; network. It can be faster than fetching from remote servers. | 491 | ;; network. It can be faster than fetching from remote servers. |
| 466 | (service avahi-service-type) | 492 | (service avahi-service-type) |
| 467 | 493 | ||
| 494 | ;; Allow runninng the installer command on headless setups. | ||
| 495 | (simple-service 'installer-program-profile | ||
| 496 | profile-service-type | ||
| 497 | (list (installer-command-package | ||
| 498 | installer | ||
| 499 | #:executable "guix-system-installer"))) | ||
| 500 | |||
| 468 | ;; The build daemon. | 501 | ;; The build daemon. |
| 469 | (service guix-service-type | 502 | (service guix-service-type |
| 470 | (guix-configuration | 503 | (guix-configuration |
