;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Mathieu Othacehe ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; 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 system images hurd) #:use-module (guix gexp) #:use-module (gnu bootloader) #:use-module (gnu bootloader grub) #:use-module (gnu image) #:use-module (gnu packages ssh) #:use-module (guix platforms x86) #:use-module (gnu services) #:use-module (gnu services ssh) #:use-module (gnu system) #:use-module (gnu system file-systems) #:use-module (gnu system hurd) #:use-module (gnu system image) #:use-module (srfi srfi-26) #:export (hurd-barebones-os hurd-disk-image hurd-image-type hurd-qcow2-image-type hurd-barebones-disk-image hurd-barebones-qcow2-image)) (define hurd-barebones-os (operating-system (inherit %hurd-default-operating-system) (bootloader (bootloader-configuration (bootloader grub-minimal-bootloader) (targets '("/dev/sdX")))) (file-systems (cons (file-system (device (file-system-label "my-root")) (mount-point "/") (type "ext2")) %base-file-systems)) (host-name "guixygnu") (timezone "Europe/Amsterdam") (packages (cons openssh-sans-x %base-packages/hurd)) (services (cons (service openssh-service-type (openssh-configuration (openssh openssh-sans-x) (use-pam? #f) (port-number 2222) (permit-root-login #t) (allow-empty-passwords? #t) (password-authentication? #t))) %base-services/hurd)))) (define hurd-initialize-root-partition #~(lambda* (#:rest args) (apply initialize-root-partition (append args (list #:make-device-nodes make-hurd-device-nodes ;; XXX Creating a db.sqlite with journal_mode=WAL ;; yields "unable to open database file" on GNU/Hurd ;; for an sqlite with the hurd-locking-mode.patch; ;; see . #:wal-mode? #f))))) (define hurd-disk-image (image-without-os (format 'disk-image) (platform i586-gnu) (partitions (list (partition (size 'guess) (offset root-offset) (label root-label) (file-system "ext2") (file-system-options '("-o" "hurd" "-O" "ext_attr")) (flags '(boot)) (initializer hurd-initialize-root-partition)))))) (define hurd-image-type (image-type (name 'hurd-raw) (constructor (cut image-with-os hurd-disk-image <>)))) (define hurd-qcow2-image-type (image-type (name 'hurd-qcow2) (constructor (lambda (os) (image (inherit hurd-disk-image) (format 'compressed-qcow2) (operating-system os)))))) (define hurd-barebones-disk-image (image (inherit (os+platform->image hurd-barebones-os i586-gnu #:type hurd-image-type)) (name 'hurd-barebones-disk-image))) (define hurd-barebones-qcow2-image (image (inherit (os+platform->image hurd-barebones-os i586-gnu #:type hurd-qcow2-image-type)) (name 'hurd-barebones.qcow2))) ;; Return the default image. hurd-barebones-qcow2-image ersion): New procedures. (go-module->guix-package): Add the #:go keyword in the generated package definition if the required go is newer than the default go. * tests/go.scm (mock-http-get): Use gexps for package arguments. Change-Id: I8d005740a442330ac307a40a53764c803ceffc4f Efraim Flashner 2021-09-28tests: go: Fix typo....* tests/go.scm (fixture-go-mod-unparseable): Rename this… (fixture-go-mod-unparsable): …to this. Adjust the only caller. Tobias Geerinckx-Rice 2021-09-01import: go: Improve error handling....* guix/import/go.scm (go-module->guix-package*): Handle errors, remove memoize. (go-module-recursive-import): Remove 'guard', add memoize. * guix/scripts/import/go.scm (guix-import-go): Adjust. * tests/go.scm: Adjust. Signed-off-by: Ludovic Courtès <ludo@gnu.org> zimoun 2021-07-18import: go: Upgrade go.mod parser....Upgrade the go.mod parser to handle the full go.mod spec, and to gracefully handle unexpected/malformed syntax. Restructure parser usage, making the parse tree available for other uses. guix/import/go.scm (parse-go.mod): Parse using (ice-9 peg) instead of regex matching for more robustness. Return a list of directives. (go.mod-directives): New procedure. (go.mod-requirements): Likewise. (go-module->guix-package): Use it. (%go.mod-replace-directive-rx): Remove unused variable. tests/go.scm (testing-parse-mod): Adjust accordingly. (go.mod-requirements) (fixture-go-mod-unparseable) (fixture-go-mod-retract) (fixture-go-mod-strings): New variables. ("parse-go.mod: simple") ("parse-go.mod: comments and unparseable lines") ("parse-go.mod: retract") ("parse-go.mod: raw strings and quoted strings") ("parse-go.mod: complete"): New tests. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Sarah Morgensen 2021-07-17tests/go: Remove unused variable....* tests/go.scm: Delete extraneous newline. (fixture-latest-for-go-check): Remove variable. Maxim Cournoyer