aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020-2024 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@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/>.

(define-module (gnu system hurd)
  #:use-module (ice-9 match)
  #:use-module (guix gexp)
  #:use-module (guix profiles)
  #:use-module (guix utils)
  #:use-module (gnu bootloader)
  #:use-module (gnu bootloader grub)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages certs)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages cross-base)
  #:use-module (gnu packages file)
  #:use-module (gnu packages gawk)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages guile-xyz)
  #:use-module (gnu packages hurd)
  #:use-module (gnu packages less)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages texinfo)
  #:use-module (gnu services)
  #:use-module (gnu services base)
  #:use-module (gnu services hurd)
  #:use-module (gnu services shepherd)
  #:use-module (gnu system)
  #:use-module (gnu system setuid)
  #:use-module (gnu system shadow)
  #:use-module (gnu system vm)
  #:export (%base-packages/hurd
            %base-services/hurd
            %base-services+qemu-networking/hurd
            %desktop-services/hurd
            %hurd-default-operating-system
            %hurd-default-operating-system-kernel
            %hurd64-default-operating-system
            %hurd64-default-operating-system-kernel
            %setuid-programs/hurd))

;;; Commentary:
;;;
;;; This module provides system-specifics for the GNU/Hurd operating system
;;; and virtual machine.
;;;
;;; Code:

(define %hurd-default-operating-system-kernel
  (if (system-hurd?)
      gnumach
      ;; A cross-built GNUmach does not work
      (with-parameters ((%current-system "i686-linux")
                        (%current-target-system #f))
        gnumach)))

(define %hurd64-default-operating-system-kernel
  (if (system-hurd?)
      gnumach
      ;; A cross-built GNUmach does not work
      (with-parameters ((%current-system "x86_64-linux")
                        (%current-target-system #f))
        gnumach)))

(define %base-packages/hurd
  ;; Note: the Shepherd comes before the Hurd, not just because its duty is to
  ;; shepherd the herd, but also because we want its 'halt' and 'reboot'
  ;; commands to take precedence.
  (list shepherd-1.0 hurd netdde bash coreutils file findutils grep sed
        diffutils patch gawk tar gzip bzip2 xz lzip
        guile-3.0-latest guile-colorized guile-readline
        net-base nss-certs inetutils less procps shadow sudo which
        info-reader))

(define %base-services/hurd
  (append (list (service hurd-console-service-type
                         (hurd-console-configuration (hurd hurd)))
                (service guix-service-type
                         (guix-configuration
                          (extra-options '("--disable-chroot"
                                           "--disable-deduplication"))))
                (service special-files-service-type
                         `(("/bin/sh" ,(file-append bash "/bin/sh"))
                           ("/usr/bin/env" ,(file-append coreutils
                                                         "/bin/env"))))
                (service syslog-service-type))
          (map (lambda (n)
                 (service hurd-getty-service-type
                          (hurd-getty-configuration
                           (tty (string-append "tty" (number->string n))))))
               (iota 6 1))))

(define %base-services+qemu-networking/hurd
  (cons
   (service static-networking-service-type
            (list %loopback-static-networking

                  ;; QEMU user-mode networking.  To get "eth0", you need
                  ;; QEMU to emulate a device for which Mach has an
                  ;; in-kernel driver, for instance with:
                  ;; --device rtl8139,netdev=net0 --netdev user,id=net0
                  %qemu-static-networking))
   %base-services/hurd))

(define %desktop-services/hurd %base-services/hurd)

(define %setuid-programs/hurd
  ;; Default set of setuid-root programs.
  (map file-like->setuid-program
       (list (file-append shadow "/bin/passwd")
             (file-append shadow "/bin/sg")
             (file-append shadow "/bin/su")
             (file-append shadow "/bin/newgrp")
             (file-append shadow "/bin/newuidmap")
             (file-append shadow "/bin/newgidmap")
             (file-append sudo "/bin/sudo")
             (file-append sudo "/bin/sudoedit"))))

(define %hurd-default-operating-system
  (operating-system
    (kernel %hurd-default-operating-system-kernel)
    (kernel-arguments '())
    (hurd hurd)
    (bootloader (bootloader-configuration
                 (bootloader grub-minimal-bootloader)
                 (targets '("/dev/vda"))))
    (initrd #f)
    (initrd-modules '())
    (firmware '())
    (host-name "guixygnu")
    (file-systems '())
    (packages %base-packages/hurd)
    (timezone "GNUrope")
    (locale-libcs (list glibc/hurd))
    (name-service-switch #f)
    (essential-services (hurd-default-essential-services this-operating-system))
    (privileged-programs '())
    (setuid-programs %setuid-programs/hurd)))

(define %hurd64-default-operating-system
  (operating-system
    (inherit %hurd-default-operating-system)
    (kernel %hurd64-default-operating-system-kernel)))

"vendor/github.com/marten-seemann", "vendor/github.com/mikioh", "vendor/github.com/opencontainers", and "vendor/github.com/raulk". [arguments] <#:phases>: Simplify 'copy-input-to-vendor-directory by replacing it with 'fix-embed-go-libp2p-asn-util. [inputs]: Remove go-github-com-docker-go-units, go-github-com-flynn-noise, go-github-com-gorilla-websocket, go-github-com-klauspost-compress, go-github-com-libp2p-go-buffer-pool, go-github-com-libp2p-go-flow-metrics, go-github-com-libp2p-go-nat, go-github-com-libp2p-go-reuseport, go-github-com-libp2p-go-yamux-v4, go-github-com-libp2p-zeroconf-v2, go-github-com-multiformats-go-multiaddr-fmt, go-github-com-multiformats-go-multistream, go-github-com-pion-webrtc-v3, go-github-com-quic-go-quic-go, and go-github-com-quic-go-webtransport-go; add go-github-com-ipfs-go-ds-badger, go-github-com-ipfs-go-ds-leveldb, and go-github-com-libp2p-go-libp2p. Change-Id: Ied37be0a18e98bd5fe6d1c6d721d0c5733460721 Sharlatan Hellseher 2024-09-09gnu: Add go-github-com-libp2p-go-libp2p....* gnu/packages/ipfs.scm (go-github-com-libp2p-go-libp2p): New variable. Change-Id: I28d21513a07a4e11e7411390c692472473bf1844 Sharlatan Hellseher 2024-09-09gnu: Add go-github-com-ipfs-go-ds-leveldb....* gnu/packages/ipfs.scm (go-github-com-ipfs-go-ds-leveldb): New variable. Change-Id: Ida3a850c9d7ca25b694e580837b3bda918875825 Sharlatan Hellseher 2024-09-09gnu: Add go-github-com-ipfs-go-ds-badger....* gnu/packages/ipfs.scm (go-github-com-ipfs-go-ds-badger): New variable. Change-Id: I4c2422650a729829210e158abe155823e014bd9d Sharlatan Hellseher 2024-09-03gnu: kubo: Unbandle more inputs...* gnu/packages/ipfs.scm (kubo): Unbandle more inputs [source]: Delete "vendor/github.com/libp2p/zeroconf", "vendor/github.com/pion", and "vendor/github.com/rs". [inputs]: Add go-github-com-libp2p-zeroconf-v2, go-github-com-pion-webrtc-v3, and go-github-com-rs-cors. Change-Id: I3922b573829329018b83aa639e583573a1af8644 Sharlatan Hellseher 2024-08-29Revert "gnu: Add go-github-com-ipfs-go-ipfs-posinfo."...This reverts commit db1b89d8e63c84e548c79b932247917a73d20890. It was accidently pushed after review precess and attempt to exclude it from Kubo, introduce regression seen in <https://ci.guix.gnu.org/build/5513172/log/raw>. The project is deprecated and patch is not required. Sharlatan Hellseher 2024-08-29gnu: kubo: Unbundle more inputs....* gnu/packages/ipfs.scm (kubo): [snippet]: Delete "vendor/github.com/libp2p/go-doh-resolver" and "vendor/github.com/libp2p/go-bitfield". [inputs]: Add go-github-com-libp2p-go-doh-resolver, and go-github-com-ipfs-go-bitfield. Change-Id: I417802e02b482164fdb65852a19187fb63bd9199 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com> Artyom V. Poptsov 2024-08-29gnu: Add go-github-com-ipfs-go-ipfs-posinfo....* gnu/packages/ipfs.scm (go-github-com-ipfs-go-ipfs-posinfo): New variable. Change-Id: I19486debf95e0877d735fd18fab9faf1cf26c484 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com> Artyom V. Poptsov 2024-08-29gnu: Add go-github-com-ipfs-go-bitfield....* gnu/packages/ipfs.scm (go-github-com-ipfs-go-bitfield): New variable. Change-Id: I95e627fb5f4dfcca5e4b70e753b544b4965b96c2 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com> Artyom V. Poptsov 2024-08-27gnu: kubo: Unbandle more inputs....* gnu/packages/ipfs.scm (kubo): Unbandle more inputs. [arguments] <#:phases>: Add 'copy-input-to-vendor-directory phase. [inputs]: Add go-github-com-libp2p-go-cidranger, go-github-com-libp2p-go-libp2p-asn-util, go-github-com-libp2p-go-reuseport, and go-github-com-libp2p-go-yamux-v4. Change-Id: I55c7c9cfed58f20a435fbc0a5905a2834fe67675 Sharlatan Hellseher 2024-08-27gnu: go-github-com-libp2p-go-socket-activation: Move to golang-web....* gnu/packages/ipfs.scm (go-github-com-libp2p-go-socket-activation): Move from here ... * gnu/packages/golang-web.scm: ... to here. Change-Id: I06909891fcceac21ceff0d9515c2a45ef6ea1b09 Sharlatan Hellseher 2024-08-26gnu: Remove go-github-com-multiformats-go-multiaddr-0.12....* gnu/packages/golang-web.scm (go-github-com-multiformats-go-multiaddr-0.12): Delete variable. (go-github-com-multiformats-go-multiaddr-dns, go-github-com-multiformats-go-multiaddr-fmt): [propagated-inputs]: Remove go-github-com-multiformats-go-multiaddr-0.12; add go-github-com-multiformats-go-multiaddr. * gnu/packages/ipfs.scm (go-github-com-libp2p-go-socket-activation): [propagated-inputs]: Remove go-github-com-multiformats-go-multiaddr-0.12; add go-github-com-multiformats-go-multiaddr. * gnu/packages/ipfs.scm (kubo): [inputs]: Remove go-github-com-multiformats-go-multiaddr-0.12; add go-github-com-multiformats-go-multiaddr. Change-Id: Iedc07cfa3f627dbf279e077808167dfe902f4163 Sharlatan Hellseher 2024-08-25gnu: Remove go-github-com-ipfs-go-ipfs-api....Unmaintained: "This package is no longer being maintained. Please use kubo/client/rpc instead. This repository has been archived by the owner on Feb 7, 2024. It is now read-only." * gnu/packages/ipfs.scm (go-github-com-ipfs-go-ipfs-api): Delete variable. Change-Id: I270f92a863739dfb038a7762dc55080e3610bebe Sharlatan Hellseher 2024-08-25gnu: Remove gx....This project is abandoned and not in use by IPFS/Kubo any longer, see <https://github.com/whyrusleeping/gx/issues/247>. * gnu/packages/ipfs.scm (gx, go-github-com-whyrusleeping-gx-util): Delete variables. Change-Id: Ieee46293e73add367344d486e7b7317913543f32 Sharlatan Hellseher 2024-08-25gnu: Remove gx-go....This project is abandoned and not in use by IPFS/Kubo any longer, see <https://github.com/whyrusleeping/gx-go/issues/65>. * gnu/packages/ipfs.scm (gx-go): Delete variable. Change-Id: Ic1235801a958c066de5af35947fad90cafc97dd0 Sharlatan Hellseher 2024-08-25gnu: kubo: Unbandle more inputs....* gnu/packages/ipfs.scm (kubo): Unbandle more inputs. [inputs]: Remove go-github-com-go-logr-logr; add go-github-com-go-logr-stdr, go-github-com-ipfs-go-ipfs-redirects-file, go-github-com-libp2p-go-flow-metrics, go-github-com-prometheus-statsd-exporter, and go-github-com-quic-go-webtransport-go. Change-Id: Ie8e6680cf152ccbd21e3c7beaf3febfaa6191083 Sharlatan Hellseher 2024-08-25gnu: Add go-github-com-ipfs-go-ipfs-redirects-file....* gnu/packages/ipfs.scm (go-github-com-ipfs-go-ipfs-redirects-file): New variable. Change-Id: I15876b3cd4ef58191e628bd08bc855ab4aafcdf1 Sharlatan Hellseher 2024-08-21gnu: kubo: Unbundle more inputs....* gnu/packages/ipfs.scm (kubo): Unbundle more inputs. [inputs]: Remove go-github-com-jackpal-go-nat-pmp; add go-github-com-ipfs-go-verifcid, go-github-com-libp2p-go-buffer-pool, go-github-com-libp2p-go-msgio, and go-github-com-libp2p-go-nat. Change-Id: I51d19718d365427d9c22374799b4a2e091ef7a94 Sharlatan Hellseher 2024-08-21gnu: Add go-github-com-ipfs-go-verifcid....* gnu/packages/ipfs.scm (go-github-com-ipfs-go-verifcid): New variable. Change-Id: I30b800dc0575ed3d7b208a1860c305911e1944d2 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com> Artyom V. Poptsov