~ruther/guix-local

9448ec6fb20a737a852e8624b5611950886feaaa — Rutherther a month ago 94f9177
install: Add guix-system-installer executable to system profile.

To allow users in headless consoles to use the graphical installer, add an
executable. This executable is referred to by the console motd, so users
in headless setups will get to know about it.

* gnu/system/install.scm
(installer-command-package): New variable.
(%installation-services): Use it, add it to the profile-service-type

Change-Id: Id2d07b3f190aa17c99c7667c3bb31ae696499dde
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
Merges: #5346
1 files changed, 35 insertions(+), 2 deletions(-)

M gnu/system/install.scm
M gnu/system/install.scm => gnu/system/install.scm +35 -2
@@ 25,9 25,11 @@
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu system install)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (gnu)
  #:use-module (gnu system)
  #:use-module (gnu system privilege)
  #:use-module (guix build-system trivial)
  #:use-module (gnu bootloader)
  #:use-module (gnu bootloader u-boot)
  #:use-module (guix gexp)


@@ 413,6 415,27 @@ or by starting the installer, using `guix-system-installer` command.
              #$(file-append shadow "/bin/login")
              (command-line)))))

(define* (installer-command-package installer-program
                                    #:key executable)
  (package
    (name executable)
    (version "0")
    (source #f)
    (build-system trivial-build-system)
    (arguments
     (list #:builder (with-imported-modules '((guix build utils))
                       #~(begin
                           (use-modules (guix build utils))

                           (mkdir-p (string-append #$output "/bin"))

                           (symlink #$installer-program
                                    (string-append #$output "/bin/" #$executable))))))
    (home-page #f)
    (synopsis "Provides the Guix System installer as run-guix-installer command")
    (description "Provides the Guix System installer as run-guix-installer command.")
    (license license:gpl3+)))

(define* (%installation-services
          #:key
          (system (or (and=>


@@ 430,6 453,10 @@ or by starting the installer, using `guix-system-installer` command.
  (define bare-bones-os
    (load "examples/bare-bones.tmpl"))

  (define installer
    (installer-program
     #:guix-for-installer guix-for-system))

  (append
   ;; Generic services
   (list (service virtual-terminal-service-type)


@@ 437,8 464,7 @@ or by starting the installer, using `guix-system-installer` command.
         (service kmscon-service-type
                  (kmscon-configuration
                    (virtual-terminal "tty1")
                    (login-program (installer-program
                                    #:guix-for-installer guix-for-system))))
                    (login-program installer)))

         (simple-service 'installer-login
                         pam-root-service-type


@@ 465,6 491,13 @@ or by starting the installer, using `guix-system-installer` command.
         ;; network.  It can be faster than fetching from remote servers.
         (service avahi-service-type)

         ;; Allow runninng the installer command on headless setups.
         (simple-service 'installer-program-profile
                         profile-service-type
                         (list (installer-command-package
                                installer
                                #:executable "guix-system-installer")))

         ;; The build daemon.
         (service guix-service-type
                  (guix-configuration