summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rwxr-xr-xetc/guix-install.sh11
-rw-r--r--etc/init.d/guix-daemon.in78
-rw-r--r--etc/release-manifest.scm108
3 files changed, 197 insertions, 0 deletions
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index bfd3842933..e7f4d2cd59 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -361,6 +361,17 @@ sys_enable_guix_daemon()
systemctl enable guix-daemon; } &&
_msg "${PAS}enabled Guix daemon via systemd"
;;
+ sysv-init)
+ { mkdir -p /etc/init.d;
+ cp "${ROOT_HOME}/.config/guix/current/etc/init.d/guix-daemon" \
+ /etc/init.d/guix-daemon;
+ chmod 775 /etc/init.d/guix-daemon;
+
+ update-rc.d guix-daemon defaults &&
+ update-rc.d guix-daemon enable &&
+ service guix-daemon start; } &&
+ _msg "${PAS}enabled Guix daemon via sysv"
+ ;;
NA|*)
_msg "${ERR}unsupported init system; run the daemon manually:"
echo " ${ROOT_HOME}/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild"
diff --git a/etc/init.d/guix-daemon.in b/etc/init.d/guix-daemon.in
new file mode 100644
index 0000000000..1cc49fed89
--- /dev/null
+++ b/etc/init.d/guix-daemon.in
@@ -0,0 +1,78 @@
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides: guix-daemon
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Guix build daemon
+# Description: Provides a daemon that does builds for Guix
+### END INIT INFO
+
+set -e
+mkdir -p "/var/run"
+if [ ! -f "@localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon" ]
+then
+ exit 5
+fi
+
+case "$1" in
+start)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ if pgrep -F "/var/run/guix-daemon.pid" guix-daemon
+ then
+ exit 0
+ else
+ echo "guix-daemon has a stale pid file" >&2
+ exit 1
+ fi
+ else
+ daemonize \
+ -a \
+ -e "/var/log/guix-daemon-stderr.log" \
+ -o "/var/log/guix-daemon-stdout.log" \
+ -E GUIX_LOCPATH=@localstatedir@/guix/profiles/per-user/root/guix-profile/lib/locale \
+ -E LC_ALL=en_US.utf8 \
+ -p "/var/run/guix-daemon.pid" \
+ @localstatedir@/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
+ --build-users-group=guixbuild
+ fi
+ ;;
+stop)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ pkill -F "/var/run/guix-daemon.pid" guix-daemon || {
+ exit 1
+ }
+ rm -f "/var/run/guix-daemon.pid"
+ exit 0
+ else
+ exit 0
+ fi
+ ;;
+status)
+ if [ -f "/var/run/guix-daemon.pid" ]
+ then
+ if pgrep -F "/var/run/guix-daemon.pid" guix-daemon
+ then
+ echo "guix-daemon is running"
+ exit 0
+ else
+ echo "guix-daemon has a stale pid file"
+ exit 1
+ fi
+ else
+ echo "guix-daemon is not running"
+ exit 3
+ fi
+ ;;
+restart|force-reload)
+ "$0" stop
+ "$0" start
+ ;;
+*)
+ echo "Usage: $0 (start|stop|status|restart|force-reload)"
+ exit 3
+ ;;
+esac
diff --git a/etc/release-manifest.scm b/etc/release-manifest.scm
new file mode 100644
index 0000000000..67b92c3921
--- /dev/null
+++ b/etc/release-manifest.scm
@@ -0,0 +1,108 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+;;; This file returns a manifest containing release-critical bit, for all the
+;;; supported architectures and cross-compilation targets.
+
+(use-modules (gnu packages)
+ (guix packages)
+ (guix profiles)
+ ((gnu ci) #:select (%cross-targets))
+ (srfi srfi-1)
+ (srfi srfi-26))
+
+(define* (package->manifest-entry* package system
+ #:key target)
+ "Return a manifest entry for PACKAGE on SYSTEM, optionally cross-compiled to
+TARGET."
+ (manifest-entry
+ (inherit (package->manifest-entry package))
+ (name (string-append (package-name package) "." system
+ (if target
+ (string-append "." target)
+ "'")))
+ (item (with-parameters ((%current-system system)
+ (%current-target-system target))
+ package))))
+
+(define %base-packages
+ ;; Packages that must be substitutable on all the platforms Guix supports.
+ (map specification->package
+ '("bootstrap-tarballs" "gcc-toolchain" "nss-certs"
+ "openssh" "emacs" "vim" "python" "guile" "guix")))
+
+(define %system-packages
+ ;; Key packages proposed by the Guix System installer.
+ (map specification->package
+ '("xorg-server" "xfce" "gnome" "mate" "enlightenment"
+ "openbox" "awesome" "i3-wm" "ratpoison"
+ "xlockmore" "slock" "libreoffice"
+ "connman" "network-manager" "network-manager-applet"
+ "openssh" "ntp" "tor"
+ "linux-libre" "grub-hybrid"
+ ;; FIXME: Add IceCat when Rust is available on i686.
+ ;;"icecat"
+ )))
+
+(define %packages-to-cross-build
+ ;; Packages that must be cross-buildable from x86_64-linux.
+ (cons (@ (gnu packages gcc) gcc)
+ (map specification->package
+ '("coreutils" "grep" "sed" "findutils" "diffutils" "patch"
+ "gawk" "gettext" "gzip" "xz"
+ "hello" "guile@2.2" "zlib"))))
+
+(define %cross-bootstrap-targets
+ ;; Cross-compilation triplets for which 'bootstrap-tarballs' must be
+ ;; buildable.
+ '("i586-pc-gnu"
+ "arm-linux-gnueabihf"
+ "aarch64-linux-gnu"))
+
+
+;;;
+;;; Manifests.
+;;;
+
+(define %base-manifest
+ (manifest
+ (append-map (lambda (system)
+ (map (cut package->manifest-entry* <> system)
+ %base-packages))
+ %hydra-supported-systems)))
+
+(define %cross-manifest
+ (manifest
+ (append-map (lambda (target)
+ (map (cut package->manifest-entry* <> "x86_64-linux"
+ #:target target)
+ %packages-to-cross-build))
+ %cross-targets)))
+
+(define %cross-bootstrap-manifest
+ (manifest
+ (map (lambda (target)
+ (package->manifest-entry*
+ (specification->package "bootstrap-tarballs")
+ "x86_64-linux" #:target target))
+ %cross-bootstrap-targets)))
+
+;; Return the union of all three manifests.
+(concatenate-manifests (list %base-manifest
+ %cross-manifest
+ %cross-bootstrap-manifest))