bug#42286: SWH fallback fails (git-fetch)

2020-07-10 Thread Ludovic Courtès
Hi!

zimoun  skribis:

> On Fri, 10 Jul 2020 at 00:24, Ludovic Courtès  wrote:
>> Hi!
>>
>> zimoun  skribis:
>>
>>> Trying to download from Software Heritage...
>>> Backtrace:
>>>4 (primitive-load "/gnu/store/s56y8npabah6jc1bqrhsac6wqb1?")
>>> In ./guix/swh.scm:
>>>573:13  3 (swh-download "https://github.com/zimoun/hello-example?"; ?)
>>>224:22  2 (call "https://archive.softwareheritage.org/api/1/revi?"; ?)
>>> In web/client.scm:
>>> 563:0  1 (http-get "https://archive.softwareheritage.org/api/1/?"; ?)
>>> 231:6  0 (tls-wrap # _ # _)
>>>
>>> web/client.scm:231:6: In procedure tls-wrap:
>>> Error while printing exception.
>>> builder for `/gnu/store/jn6f86hg9zyyhms1vn56hviv4m9yjm8j-git-checkout.drv' 
>>> failed with exit code 1
>>
>> Should be fixed with commit a7696b9733d4ede9817a0a0accb5ce5b85d9a2d3.
>> Let me know if anything’s amiss.
>
> Cool! Works. :-)
>
> I was almost there. :-) The missing trick was because the Guile bug
>
> I was not aware and so the new "http-get*".

Yeah.  :-)

> Is it worth to add the test in guix-build.sh?

We don’t add tests that depend on external services, so we can’t really
do that.  Or we would need to mock the original server, SWH, etc. but
that seems tricky.

Thanks,
Ludo’.





bug#42298: Nonexistent Git commit referenced from current Guix package

2020-07-10 Thread Ludovic Courtès
Hi,

Leo Famulari  skribis:

> The current Guix package points to a Git commit that does not exist,
> which breaks the ability to build the package.
>
> The current package version is '1.1.0-16.d3eee3c'.
>
> That commit d3eee3c [0] is the commit that updated the Guix package
> previously, to '1.1.0-15.03deb1e'.
>
> However, there is no commit 03deb1e [1].

Yes, it was a mistake, and that’s why 1.1.0-16 was committed minutes
later:

  
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=b919d4048e72f8e5740606cdb3dac0592de21f36

Someone who encounters this bug should run ‘guix pull’.

HTH!

Ludo’.





bug#42151: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd.

2020-07-10 Thread Ludovic Courtès
Hi!

Jan Nieuwenhuizen  skribis:

>>From dc6f96fc7de50602fb28d7ad7b8cbff09e55f538 Mon Sep 17 00:00:00 2001
> From: "Jan (janneke) Nieuwenhuizen" 
> Date: Fri, 3 Jul 2020 23:45:20 +0200
> Subject: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd.
> Content-Transfer-Encoding: 8bit
> Content-Type: text/plain; charset=UTF-8
>
> This fixes .
>
> * guix/store/database.scm (call-with-database): When building for the Hurd,
> do not set journal_model=WAL.
> ---
>  guix/store/database.scm | 12 +---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/guix/store/database.scm b/guix/store/database.scm
> index a38e4d7e52..da46b0abce 100644
> --- a/guix/store/database.scm
> +++ b/guix/store/database.scm
> @@ -1,6 +1,7 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright © 2017, 2019 Caleb Ristvedt 
>  ;;; Copyright © 2018, 2020 Ludovic Courtès 
> +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -20,6 +21,7 @@
>  (define-module (guix store database)
>#:use-module (sqlite3)
>#:use-module (guix config)
> +  #:use-module (guix gexp)
>#:use-module (guix serialization)
>#:use-module (guix store deduplication)
>#:use-module (guix base16)
> @@ -27,6 +29,7 @@
>#:use-module (guix build syscalls)
>#:use-module ((guix build utils)
>  #:select (mkdir-p executable-file?))
> +  #:use-module (guix utils)
>#:use-module (guix build store-copy)
>#:use-module (srfi srfi-1)
>#:use-module (srfi srfi-11)
> @@ -105,9 +108,12 @@ create it and initialize it as a new database."
>   (mkdir-p (dirname file))
>   #t)))
>  (db   (sqlite-open file)))
> -;; Turn DB in "write-ahead log" mode, which should avoid SQLITE_LOCKED
> -;; errors when we have several readers: 
> .
> -(sqlite-exec db "PRAGMA journal_mode=WAL;")
> +;; Using WAL breaks for the Hurd .
> +(unless (let-system (system target)
> +  (equal? target "i586-pc-gnu"))
> +  ;; Turn DB in "write-ahead log" mode, which should avoid SQLITE_LOCKED
> +  ;; errors when we have several readers: 
> .
> +  (sqlite-exec db "PRAGMA journal_mode=WAL;"))

I think this has the same effect as:

  (unless #t
(sqlite-exec db "PRAGMA journal_mode=WAL;"))

because this code is not in a gexp, so ‘let-system’ evaluates to an
object (not #f), and that’s it, it’s never lowered and the ‘equal?’ call
is never made.

You want to disable WAL mode not just when running this code natively on
GNU/Hurd, but also when building a database that will eventually be used
on GNU/Hurd, right?

In that case, I think you’ll have to add, say, a #:wal-mode? parameter
to ‘call-with-database’ (defaulting to #true), and change the caller to
set it appropriately.  The caller, directly or indirectly, is in a gexp,
where you can use the ‘let-system’ expression above.

Does that make sense?

Thanks, and apologies for the delay!

Ludo’.





bug#42151: [PATCH 2/3] gnu: guile-sqlite3: Use sqlite/hurd for locking on the Hurd.

2020-07-10 Thread Ludovic Courtès
"Jan (janneke) Nieuwenhuizen"  skribis:

> This fixes
>
> guix offload: error: exception occurred on remote host 'localhost': 
> (%exception # synchronous mode: locking protocol" status: 1>>)
>
> * gnu/packages/guile.scm (guile-sqlite3)[inputs]: Use sqlite/hurd instead of
> sqlite.
> ---
>  gnu/packages/guile.scm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
> index a32bd33293..c651e2427a 100644
> --- a/gnu/packages/guile.scm
> +++ b/gnu/packages/guile.scm
> @@ -665,7 +665,7 @@ Guile's foreign function interface.")
> ("pkg-config" ,pkg-config)))
>  (inputs
>   `(("guile" ,guile-3.0)
> -   ("sqlite" ,sqlite)))
> +   ("sqlite" ,sqlite/hurd)))

This should be guarded by ‘if (hurd-target?)’, right?

Ludo’.





bug#42151: [PATCH 1/3] gnu: Add sqlite/hurd with locking fix.

2020-07-10 Thread Ludovic Courtès
"Jan (janneke) Nieuwenhuizen"  skribis:

> * gnu/packages/patches/sqlite3-hurd.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/packages/sqlite.scm (sqlite/hurd): New variable.

[…]

> +++ b/gnu/packages/patches/sqlite3-hurd.patch
> @@ -0,0 +1,51 @@
> +Adapted from Debian: 
> https://sources.debian.org/patches/sqlite3/3.31.1-5/20-hurd-locking-style.patch
> +Upstream status: Not offered upstream.

The URL is 404, could you fix it?  It would also be great if you could
add a sentence or two explaining what this works around, so that our
future selves know how to deal with this patch.  :-)

Otherwise LGTM, you can push with changes along these lines!

Ludo’.





bug#42151: [PATCH 3/3] gnu: guix: Use sqlite/hurd for locking on the Hurd.

2020-07-10 Thread Ludovic Courtès
"Jan (janneke) Nieuwenhuizen"  skribis:

> * gnu/packages/package-management.scm (guix)[inputs]: Use sqlite/hurd.

Same here.

Which makes me thing: how about applying the sqlite/hurd patch in a
build phase of sqlite that would be Hurd-specific?  That way, we’d still
have a single sqlite package.

Thanks,
Ludo’.





bug#42151: [PATCH 0/3] offload to Childhurd fails: setting synchronous mode: locking protocol

2020-07-10 Thread Ludovic Courtès
Hi,

Jan Nieuwenhuizen  skribis:

> Ludovic Courtès writes:
>
> Hi!
>
>>> It seems there is a compatibility bug/problem/thing with the db.sqlite
>>> that we produce on GNU/Linux.  While an unpatched sqlite3 on the Hurd
>>> can read it, and work with it, the unpatched sqlite has locking
>>> problems.  I found a workaround, though: dumping and loading  the
>>> database file.
>
> [..]
>
>>> So...about the compatibility problem.  I tried to diff the db.sqlite-orig
>>> db.sqlite-init binary files: they look completely different.  Not sure
>>> how to handle this workaround, maybe we can insert a two system* calls
>>> somewhere when building the disk image?
>>
>> Weird, weird!
>>
>> Could you compare ‘db.dump’ created on GNU/Hurd with ‘db.dump’ created
>> from the same ‘sqlite3 -init’ command on GNU/Linux?
>
> Yeah, they are identical.  The initial dump can only be created atm on
> GNU/Linux; the dump can be loaded (obviously) anywhere like so
>
>>> $ sqlite3 -init db.dump db.sqlite-init .quit
>
> and the resulting initial db.sqlite is the same.  Guess we can do that
> by hand for now...
>
>> (Perhaps loading the dump reorders entries or something.)
>
> Yes, "or something" certainly! :)  I have no clue...

Sorry for catching up days later but… did disabling WAL mode fix this
discrepancy?  IOW, without WAL mode, is the file produced on GNU/Linux
bit-identical to that produced on GNU/Hurd?

> If/when we decide to pinpoint this bug, what could be a first step?  Who
> is creating the database right now, is that the C++ daemon or
> guile-sqlite3.  IWBN to have that code create/save a smaller version and
> see when reading fails.

As you found out it’s created by (guix store database) in this case.

Thanks,
Ludo’.





bug#42151: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd.

2020-07-10 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hi!

> Jan Nieuwenhuizen  skribis:
>
>>>From dc6f96fc7de50602fb28d7ad7b8cbff09e55f538 Mon Sep 17 00:00:00 2001
>> From: "Jan (janneke) Nieuwenhuizen" 
>> Date: Fri, 3 Jul 2020 23:45:20 +0200
>> Subject: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd.
>> Content-Transfer-Encoding: 8bit
>> Content-Type: text/plain; charset=UTF-8
>>
>> This fixes .
[...]
>> diff --git a/guix/store/database.scm b/guix/store/database.scm
>> index a38e4d7e52..da46b0abce 100644
>> --- a/guix/store/database.scm
>> +++ b/guix/store/database.scm
[...]
>> +;; Using WAL breaks for the Hurd .
>> +(unless (let-system (system target)
>> +  (equal? target "i586-pc-gnu"))
>> +  ;; Turn DB in "write-ahead log" mode, which should avoid SQLITE_LOCKED
>> +  ;; errors when we have several readers: 
>> .
>> +  (sqlite-exec db "PRAGMA journal_mode=WAL;"))
>
> I think this has the same effect as:
>
>   (unless #t
> (sqlite-exec db "PRAGMA journal_mode=WAL;"))
>
> because this code is not in a gexp, so ‘let-system’ evaluates to an
> object (not #f), and that’s it, it’s never lowered and the ‘equal?’ call
> is never made.

Oops.  Great catch, thanks!

> You want to disable WAL mode not just when running this code natively on
> GNU/Hurd, but also when building a database that will eventually be used
> on GNU/Hurd, right?

Exactly.

> In that case, I think you’ll have to add, say, a #:wal-mode? parameter
> to ‘call-with-database’ (defaulting to #true), and change the caller to
> set it appropriately.  The caller, directly or indirectly, is in a gexp,
> where you can use the ‘let-system’ expression above.
>
> Does that make sense?

Yes, very much so. [...] After some typing, it turns out that the whole
let-system is gone, we can set use a hard-coded #:wal-mode? #t in
hurd-initialize-root-partition.

> Thanks, and apologies for the delay!

Sure, I'm happy I didn't "just push" ;-)

I'm sending a v2 patch set in a minute.

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42151: [PATCH v2 3/4] gnu: guix: Use sqlite/hurd for locking on the Hurd.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
* gnu/packages/package-management.scm (guix)[inputs]: Use sqlite/hurd.
---
 gnu/packages/package-management.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/package-management.scm 
b/gnu/packages/package-management.scm
index 9986976cc6..64c6931011 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -343,7 +343,7 @@ $(prefix)/etc/init.d\n")))
  ("zlib" ,zlib)  ;for 'guix publish'
  ("lzlib" ,lzlib);for 'guix publish' and 'guix substitute'
 
- ("sqlite" ,sqlite)
+ ("sqlite" ,sqlite/hurd)
  ("libgcrypt" ,libgcrypt)
 
  ("guile" ,guile-3.0-latest)
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42151: [PATCH v2 4/4] image: Do not set journal_model=WAL for the Hurd.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
This fixes .

* gnu/system/images/hurd.scm (hurd-initialize-root-partition): Use #:wal-mode #f
in call to ...
* gnu/build/image.scm (initialize-root-partition): ... this, add #:wal-mode?
parameter, pass it to ...
(register-closure): ... this, add #:wal-mode? parameter, pass it to ...
* guix/store/database.scm (with-database): ... this, add #:wal-mode?
parameter, pass it to ...
(call-with-database): ... this, add #:wal-mode? parameter; when
set to #f, do not set journal_model=WAL.
---
 gnu/build/image.scm| 26 --
 gnu/system/images/hurd.scm |  4 ++--
 guix/store/database.scm| 29 -
 3 files changed, 38 insertions(+), 21 deletions(-)

diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index e7b0418182..d8efa73f16 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -131,20 +131,23 @@ given CONFIG file."
 (define* (register-closure prefix closure
#:key
(deduplicate? #t) (reset-timestamps? #t)
-   (schema (sql-schema)))
+   (schema (sql-schema))
+   (wal-mode? #t))
   "Register CLOSURE in PREFIX, where PREFIX is the directory name of the
 target store and CLOSURE is the name of a file containing a reference graph as
 produced by #:references-graphs..  As a side effect, if RESET-TIMESTAMPS? is
 true, reset timestamps on store files and, if DEDUPLICATE? is true,
-deduplicates files common to CLOSURE and the rest of PREFIX."
+deduplicates files common to CLOSURE and the rest of PREFIX.  Pass WAL-MODE?
+to call-with-database."
   (let ((items (call-with-input-file closure read-reference-graph)))
 (parameterize ((sql-schema schema))
   (with-database (store-database-file #:prefix prefix) db
-(register-items db items
-#:prefix prefix
-#:deduplicate? deduplicate?
-#:reset-timestamps? reset-timestamps?
-#:registration-time %epoch)
+   #:wal-mode? wal-mode?
+   (register-items db items
+   #:prefix prefix
+   #:deduplicate? deduplicate?
+   #:reset-timestamps? reset-timestamps?
+   #:registration-time %epoch)
 
 (define* (initialize-efi-partition root
#:key
@@ -164,14 +167,16 @@ deduplicates files common to CLOSURE and the rest of 
PREFIX."
 (register-closures? #t)
 system-directory
 make-device-nodes
+(wal-mode? #t)
 #:allow-other-keys)
   "Initialize the given ROOT directory. Use BOOTCFG and BOOTCFG-LOCATION to
 install the bootloader configuration.
 
 If REGISTER-CLOSURES? is true, register REFERENCES-GRAPHS in the store.  If
 DEDUPLICATE? is true, then also deduplicate files common to CLOSURES and the
-rest of the store when registering the closures. SYSTEM-DIRECTORY is the name
-of the directory of the 'system' derivation."
+rest of the store when registering the closures.  SYSTEM-DIRECTORY is the name
+of the directory of the 'system' derivation.  Pass WAL-MODE? to
+register-closure."
   (populate-root-file-system system-directory root)
   (populate-store references-graphs root)
 
@@ -184,7 +189,8 @@ of the directory of the 'system' derivation."
 (register-closure root
   closure
   #:reset-timestamps? #t
-  #:deduplicate? deduplicate?))
+  #:deduplicate? deduplicate?
+  #:wal-mode? wal-mode?))
   references-graphs))
 
   (when bootloader-installer
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index 31942e7386..4e1db37104 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -61,8 +61,8 @@
   #~(lambda* (#:rest args)
   (apply initialize-root-partition
  (append args
- (list #:make-device-nodes
-   make-hurd-device-nodes)
+ (list #:make-device-nodes make-hurd-device-nodes
+   #:wal-mode? #f)
 
 (define hurd-disk-image
   (image
diff --git a/guix/store/database.scm b/guix/store/database.scm
index a38e4d7e52..50b66ce282 100644
--- a/guix/store/database.scm
+++ b/guix/store/database.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2019 Caleb Ristvedt 
 ;;; Copyright © 2018, 2020 Ludovic Courtès 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 (define-module (guix store database)
   #:use-module (sqlite3)
   #:use-module

bug#42151: [PATCH v2 2/4] gnu: guile-sqlite3: Use sqlite/hurd for locking on the Hurd.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
This fixes

guix offload: error: exception occurred on remote host 'localhost': 
(%exception #>)

* gnu/packages/guile.scm (guile-sqlite3)[inputs]: Use sqlite/hurd instead of
sqlite.
---
 gnu/packages/guile.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index a32bd33293..c651e2427a 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -665,7 +665,7 @@ Guile's foreign function interface.")
("pkg-config" ,pkg-config)))
 (inputs
  `(("guile" ,guile-3.0)
-   ("sqlite" ,sqlite)))
+   ("sqlite" ,sqlite/hurd)))
 (synopsis "Access SQLite databases from Guile")
 (description
  "This package provides Guile bindings to the SQLite database system.")
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42151: [PATCH v2 1/4] gnu: Add sqlite/hurd with locking fix.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
* gnu/packages/patches/sqlite3-hurd.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/sqlite.scm (sqlite/hurd): Use it in new variable.
---
 gnu/local.mk|  1 +
 gnu/packages/patches/sqlite3-hurd.patch | 51 +
 gnu/packages/sqlite.scm |  9 +
 3 files changed, 61 insertions(+)
 create mode 100644 gnu/packages/patches/sqlite3-hurd.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5c3b391960..e452004945 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1370,6 +1370,7 @@ dist_patch_DATA = 
\
   %D%/packages/patches/sdl-pango-header-guard.patch\
   %D%/packages/patches/sdl-pango-matrix_declarations.patch \
   %D%/packages/patches/sdl-pango-sans-serif.patch  \
+  %D%/packages/patches/sqlite3-hurd.patch  \
   %D%/packages/patches/patchutils-test-perms.patch \
   %D%/packages/patches/patch-hurd-path-max.patch   \
   %D%/packages/patches/perl-autosplit-default-time.patch   \
diff --git a/gnu/packages/patches/sqlite3-hurd.patch 
b/gnu/packages/patches/sqlite3-hurd.patch
new file mode 100644
index 00..de87a30cb1
--- /dev/null
+++ b/gnu/packages/patches/sqlite3-hurd.patch
@@ -0,0 +1,51 @@
+Adapted from Debian: 
https://sources.debian.org/patches/sqlite3/3.31.1-5/20-hurd-locking-style.patch
+Upstream status: Not offered upstream.
+
+diff -purN sqlite-autoconf-3310100/sqlite3.c sqlite-autoconf-3310100-/sqlite3.c
+--- sqlite-autoconf-3310100/sqlite3.c  2020-01-27 21:25:19.0 +0100
 sqlite-autoconf-3310100-/sqlite3.c 2020-07-01 11:50:13.768333806 +0200
+@@ -33189,7 +33189,7 @@ SQLITE_PRIVATE const char *sqlite3Opcode
+ # include 
+ #endif
+ 
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ /* # include  */
+ # include 
+ # include 
+@@ -35676,7 +35676,7 @@ static int dotlockClose(sqlite3_file *id
+ **
+ ** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off
+ */
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ 
+ /*
+ ** Retry flock() calls that fail with EINTR
+@@ -38586,7 +38586,7 @@ IOMETHODS(
+   0 /* xShmMap method */
+ )
+ 
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ IOMETHODS(
+   flockIoFinder,/* Finder function name */
+   flockIoMethods,   /* sqlite3_io_methods object name */
+@@ -41142,6 +41142,8 @@ SQLITE_API int sqlite3_os_init(void){
+ UNIXVFS("unix",  autolockIoFinder ),
+ #elif OS_VXWORKS
+ UNIXVFS("unix",  vxworksIoFinder ),
++#elif defined(__GNU__)
++UNIXVFS("unix",  flockIoFinder ),
+ #else
+ UNIXVFS("unix",  posixIoFinder ),
+ #endif
+@@ -41151,7 +41153,7 @@ SQLITE_API int sqlite3_os_init(void){
+ #if OS_VXWORKS
+ UNIXVFS("unix-namedsem", semIoFinder ),
+ #endif
+-#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
++#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS || defined(__GNU__)
+ UNIXVFS("unix-posix",posixIoFinder ),
+ #endif
+ #if SQLITE_ENABLE_LOCKING_STYLE
diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm
index 8468131ddf..d5c44b0d0f 100644
--- a/gnu/packages/sqlite.scm
+++ b/gnu/packages/sqlite.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2017 Jelle Licht 
 ;;; Copyright © 2018 Tobias Geerinckx-Rice 
 ;;; Copyright © 2018 Alex Vong 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -107,3 +108,11 @@ is in the public domain.")
 ;; commit fad5b1a6d8d9c36bea5785ae4fbc1beb37e644d7.
 (define-public sqlite-with-column-metadata
   (deprecated-package "sqlite-with-column-metadata" sqlite))
+
+(define-public sqlite/hurd
+  ;; TODO move into sqlite on the next rebuild cycle.
+  (package
+(inherit sqlite)
+(name "sqlite-for-hurd")
+(source (origin (inherit (package-source sqlite))
+(patches (search-patches "sqlite3-hurd.patch"))
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42151: [PATCH 3/3] gnu: guix: Use sqlite/hurd for locking on the Hurd.

2020-07-10 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen"  skribis:

>> * gnu/packages/package-management.scm (guix)[inputs]: Use sqlite/hurd.
>
> Same here.
>
> Which makes me thing: how about applying the sqlite/hurd patch in a
> build phase of sqlite that would be Hurd-specific?  That way, we’d still
> have a single sqlite package.

Ah, yes that sounds better.  We don't need sqlite/hurd "sqlite-for-hurd"
and all that.  I'll give that a go! 

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#26302: Deploying the i18n’d web site

2020-07-10 Thread pelzflorian (Florian Pelz)
Find attached a desperate patch for guix-maintenance that works around
all listed issues, perhaps not in a nice way.

On Thu, Jul 09, 2020 at 04:48:43PM +0200, pelzflorian (Florian Pelz) wrote:
> With what I currently have
> redirection explodes
> 
> http://guix.gnu.org/manual/html_node/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/html_node
> 
> !! I think this happened too back then.  I have not investigated this yet.
>

This is fixed by redirecting not to relative paths,

(redirect "/manual/html_node/Substitutes.html" 
"../en/html_node/Substitutes.html")

but to absolute paths

(redirect "/manual/html_node/Substitutes.html" 
"/manual/en/html_node/Substitutes.html")

I think this issue existed before any of my i18n changes.


> Previously when visiting
> 
> http://guix.gnu.org/graphics
> 
> then nginx too looked up the index file
> 
> http://guix.gnu.org/graphics/index.html
> 
> This broke.  “rewrite (.*)/$ $1/index.html;” had not fixed it.
> 
> !! I do not know what to do about it.


The patch introduces a long list of explicit redirects for all URLs
not ending in a slash (except for 
URLs, they are too many).  This is an unmaintainable solution if we
want to keep using URLs not ending in a slash.  If we don’t want that,
then if you agree all is ready, please deploy the i18n’d site by
applying this patch to guix-maintenance and shortly thereafter
merge/rebase the guix-artworks wip-i18n branch (shortly because
redirects won’t work in the meantime).

Regards,
Florian
>From 2506c25468b3e2bd07b3a4b6f0d8b21173ecd65e Mon Sep 17 00:00:00 2001
From: Florian Pelz 
Date: Fri, 10 Jul 2020 19:07:32 +0200
Subject: [PATCH 1/2] berlin: Redirect to localized website by browser language
 settings.

* hydra/nginx/berlin.scm (%nginx-configuration): Load required nginx
dynamic module.
(%extra-content): Set $lang variable with it.
(guix.gnu.org-locations): Redirect html URLs according to $lang.  Use
absolute target URLs.  Add redirects for URLs that do not end in a
slash.  Fix a redirect for the Power Management Services manual entry.
(%berlin-servers): Rewrite to index files.
(redirect): Give redirect locations highest priority.
---
 hydra/nginx/berlin.scm | 735 -
 1 file changed, 510 insertions(+), 225 deletions(-)

diff --git a/hydra/nginx/berlin.scm b/hydra/nginx/berlin.scm
index 8c90eb1..e461b5b 100644
--- a/hydra/nginx/berlin.scm
+++ b/hydra/nginx/berlin.scm
@@ -14,7 +14,7 @@
 
 (define (redirect old new)
   (nginx-location-configuration
-   (uri old)
+   (uri (string-append "= " old)) ;= means highest priority
(body (list (string-append "return 301 " new ";\n")
 
 (define (publish-locations url)
@@ -196,235 +196,505 @@ PUBLISH-URL."
;; available at gnu.org/s/guix--e.g.,
;; .
(redirect "/news/feed.xml" "/feeds/blog.atom")
-   (redirect "/news/porting-guix-and-guixsd.html" 
"/blog/2015/porting-guix-and-guixsd")
-   (redirect "/news/gnu-guix-welcomes-three-students-for-gsoc.html" 
"/blog/2015/gnu-guix-welcomes-three-students-for-gsoc")
-   (redirect "/news/gnu-guix-recruits-for-gsoc.html" 
"/blog/2015/gnu-guix-recruits-for-gsoc")
-   (redirect "/news/one-week-to-fosdem.html" "/blog/2014/one-week-to-fosdem")
-   (redirect "/news/gnu-dmd-02-released.html" "/blog/2014/gnu-dmd-02-released")
-   (redirect "/news/emacs-as-a-general-purpose-package-manager.html" 
"/blog/2014/emacs-as-a-general-purpose-package-manager")
-   (redirect "/news/join-gnu-guix-for-gsoc-2017.html" 
"/blog/2017/join-gnu-guix-for-gsoc-2017")
-   (redirect "/news/gnu-guix-05-released.html" 
"/blog/2013/gnu-guix-05-released")
-   (redirect "/news/guix-at-the-2014-gnu-hackers-meeting.html" 
"/blog/2014/guix-at-the-2014-gnu-hackers-meeting")
-   (redirect "/news/state-of-aarch64-on-guix.html" 
"/blog/2017/state-of-aarch64-on-guix")
-   (redirect "/news/coming-events.html" "/blog/2017/coming-events")
-   (redirect "/news/gnu-dmd-01-released.html" "/blog/2013/gnu-dmd-01-released")
-   (redirect "/news/announcing-guix-hpc.html" "/blog/2017/announcing-guix-hpc")
-   (redirect "/news/gnu-guix-looks-for-gsoc-students.html" 
"/blog/2014/gnu-guix-looks-for-gsoc-students")
-   (redirect "/news/guix-at-the-european-lisp-symposium.html" 
"/blog/2013/guix-at-the-european-lisp-symposium")
-   (redirect "/news/gnu-guix-08-released.html" 
"/blog/2014/gnu-guix-08-released")
-   (redirect "/news/gnu-guix-090-released.html" 
"/blog/2015/gnu-guix-090-released")
-   (redirect "/news/index.html" "/blog/")
-   (redirect "/news/gnu-guix-welcomes-four-students-for-gsoc.html" 
"/blog/2016/gnu-guix-welcomes-four-students-for-gsoc")
-   (redirect "/news/gnu-guix-081-released.html" 
"/blog/2015/gnu-guix-081-released")
-   (redirect "/news/timely-delivery-of-security-updates.html" 
"/blog/2016/timely-delivery-of-security-updates")
-   (redirect "/news/guix-at-openbio-codefest-2014.html" 
"/blog/2014/guix-at-openbio-codefest-2

bug#26302: Deploying the i18n’d web site

2020-07-10 Thread pelzflorian (Florian Pelz)
On Thu, Jul 09, 2020 at 05:56:43PM +0100, Christopher Baines wrote:
> Thanks for your continued time working on this Florian. I've made a
> little bit of progress now, I've taken the wip-i18n branch, applied the
> patch attached to this email and deployed that at [1].
> 
> 1: http://guix-website-test.cbaines.net/
> 
> This isn't a close test of the configuration for berlin, but might come
> in useful when testing the NGinx configuration.
> 
> Thanks,
> 
> Chris

This is a nice replica but with all the same issues.  Have you made
improvements that should be added to my last patch for
guix-maintenance before it is deployed?

Regards,
Florian





bug#42151: [PATCH 2/3] gnu: guile-sqlite3: Use sqlite/hurd for locking on the Hurd.

2020-07-10 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen"  skribis:
>
>> This fixes
>>
>> guix offload: error: exception occurred on remote host 'localhost': 
>> (%exception #> synchronous mode: locking protocol" status: 1>>)
>>
>> * gnu/packages/guile.scm (guile-sqlite3)[inputs]: Use sqlite/hurd instead of
>> sqlite.
>> ---
>>  gnu/packages/guile.scm | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
>> index a32bd33293..c651e2427a 100644
>> --- a/gnu/packages/guile.scm
>> +++ b/gnu/packages/guile.scm
>> @@ -665,7 +665,7 @@ Guile's foreign function interface.")
>> ("pkg-config" ,pkg-config)))
>>  (inputs
>>   `(("guile" ,guile-3.0)
>> -   ("sqlite" ,sqlite)))
>> +   ("sqlite" ,sqlite/hurd)))
>
> This should be guarded by ‘if (hurd-target?)’, right?

Yeah...but all changed now...look out for v3.  Thanks!

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42151: [PATCH 1/3] gnu: Add sqlite/hurd with locking fix.

2020-07-10 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen"  skribis:
>
>> * gnu/packages/patches/sqlite3-hurd.patch: New file.
>> * gnu/local.mk (dist_patch_DATA): Add it.
>> * gnu/packages/sqlite.scm (sqlite/hurd): New variable.
>
> […]
>
>> +++ b/gnu/packages/patches/sqlite3-hurd.patch
>> @@ -0,0 +1,51 @@
>> +Adapted from Debian: 
>> https://sources.debian.org/patches/sqlite3/3.31.1-5/20-hurd-locking-style.patch
>> +Upstream status: Not offered upstream.
>
> The URL is 404, could you fix it?

That's weird...Changing it (in completely rewritten patch) to


https://sources.debian.org/patches/sqlite3/3.32.3-1/20-hurd-locking-style.patch/

> It would also be great if you could
> add a sentence or two explaining what this works around, so that our
> future selves know how to deal with this patch.  :-)

Ah, sure!

> Otherwise LGTM, you can push with changes along these lines!

As it's so much changed, I'll send it by one more time :-)

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42151: [PATCH v3 1/2] gnu: sqlite: Add locking-mode fix for the Hurd.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
* gnu/packages/patches/sqlite-hurd.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/sqlite.scm (sqlite)[native-inputs]: Add it when building
for the Hurd.
[arguments]: Apply it when building for the Hurd.
---
 gnu/local.mk   |  1 +
 gnu/packages/patches/sqlite-hurd.patch | 58 ++
 gnu/packages/sqlite.scm| 19 +
 3 files changed, 78 insertions(+)
 create mode 100644 gnu/packages/patches/sqlite-hurd.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5c3b391960..42c9d0f379 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1370,6 +1370,7 @@ dist_patch_DATA = 
\
   %D%/packages/patches/sdl-pango-header-guard.patch\
   %D%/packages/patches/sdl-pango-matrix_declarations.patch \
   %D%/packages/patches/sdl-pango-sans-serif.patch  \
+  %D%/packages/patches/sqlite-hurd.patch   \
   %D%/packages/patches/patchutils-test-perms.patch \
   %D%/packages/patches/patch-hurd-path-max.patch   \
   %D%/packages/patches/perl-autosplit-default-time.patch   \
diff --git a/gnu/packages/patches/sqlite-hurd.patch 
b/gnu/packages/patches/sqlite-hurd.patch
new file mode 100644
index 00..d80a2c5be8
--- /dev/null
+++ b/gnu/packages/patches/sqlite-hurd.patch
@@ -0,0 +1,58 @@
+Adapted from Debian: 
https://sources.debian.org/patches/sqlite3/3.32.3-1/20-hurd-locking-style.patch
+Upstream status: Not upstreamed.
+
+This patch is needed to get offloading to work.
+
+Sqlite can use simple file locking mode, but that does not work for the Hurd;
+a second sqlite process fails with a "locking protocol" error.
+
+See also: https://bugs.debian.org/529734.
+
+diff -purN sqlite-autoconf-3310100/sqlite3.c sqlite-autoconf-3310100-/sqlite3.c
+--- sqlite-autoconf-3310100/sqlite3.c  2020-01-27 21:25:19.0 +0100
 sqlite-autoconf-3310100-/sqlite3.c 2020-07-01 11:50:13.768333806 +0200
+@@ -33189,7 +33189,7 @@ SQLITE_PRIVATE const char *sqlite3Opcode
+ # include 
+ #endif
+ 
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ /* # include  */
+ # include 
+ # include 
+@@ -35676,7 +35676,7 @@ static int dotlockClose(sqlite3_file *id
+ **
+ ** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off
+ */
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ 
+ /*
+ ** Retry flock() calls that fail with EINTR
+@@ -38586,7 +38586,7 @@ IOMETHODS(
+   0 /* xShmMap method */
+ )
+ 
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ IOMETHODS(
+   flockIoFinder,/* Finder function name */
+   flockIoMethods,   /* sqlite3_io_methods object name */
+@@ -41142,6 +41142,8 @@ SQLITE_API int sqlite3_os_init(void){
+ UNIXVFS("unix",  autolockIoFinder ),
+ #elif OS_VXWORKS
+ UNIXVFS("unix",  vxworksIoFinder ),
++#elif defined(__GNU__)
++UNIXVFS("unix",  flockIoFinder ),
+ #else
+ UNIXVFS("unix",  posixIoFinder ),
+ #endif
+@@ -41151,7 +41153,7 @@ SQLITE_API int sqlite3_os_init(void){
+ #if OS_VXWORKS
+ UNIXVFS("unix-namedsem", semIoFinder ),
+ #endif
+-#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
++#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS || defined(__GNU__)
+ UNIXVFS("unix-posix",posixIoFinder ),
+ #endif
+ #if SQLITE_ENABLE_LOCKING_STYLE
diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm
index 8468131ddf..eeb77749d8 100644
--- a/gnu/packages/sqlite.scm
+++ b/gnu/packages/sqlite.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2017 Jelle Licht 
 ;;; Copyright © 2018 Tobias Geerinckx-Rice 
 ;;; Copyright © 2018 Alex Vong 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
 
 (define-module (gnu packages sqlite)
   #:use-module (gnu packages)
+  #:use-module (gnu packages hurd)
   #:use-module (gnu packages readline)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
@@ -65,6 +67,11 @@
   "1bj936svd8i5g25xd1bj52hj4zca01fgl3sqkj86z9q5pkz4wa32"
(build-system gnu-build-system)
(inputs `(("readline" ,readline)))
+   (native-inputs (if (hurd-target?)
+  ;; TODO move into origin on the next rebuild cycle.
+  `(("hurd-locking-mode.patch"
+ ,@(search-patches "sqlite-hurd.patch")))
+  '()))
(outputs '("out" "static"))
(arguments
 `(#:configure-flags
@@ -79,6 +86,18 @@
;; Column metadata is required by GNU Jami and Qt, 
et.al.
"-DSQLITE_ENABLE_COLUMN_METADATA"))
   #:phases (modify-phases %standard-phases
+ ;; TODO: remove in the next rebuild cycle
+ ,@(if (hurd-target?)
+   `((add-after 'unpack 'patch-sqlit

bug#42151: [PATCH v3 2/2] image: Do not set journal_model=WAL for the Hurd.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
This fixes .

* gnu/system/images/hurd.scm (hurd-initialize-root-partition): Use #:wal-mode #f
in call to ...
* gnu/build/image.scm (initialize-root-partition): ... this, add #:wal-mode?
parameter, pass it to ...
(register-closure): ... this, add #:wal-mode? parameter, pass it to ...
* guix/store/database.scm (with-database): ... this, add #:wal-mode?
parameter, pass it to ...
(call-with-database): ... this, add #:wal-mode? parameter; when
set to #f, do not set journal_model=WAL.
---
 gnu/build/image.scm| 26 --
 gnu/system/images/hurd.scm |  4 ++--
 guix/store/database.scm| 29 -
 3 files changed, 38 insertions(+), 21 deletions(-)

diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index e7b0418182..d8efa73f16 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -131,20 +131,23 @@ given CONFIG file."
 (define* (register-closure prefix closure
#:key
(deduplicate? #t) (reset-timestamps? #t)
-   (schema (sql-schema)))
+   (schema (sql-schema))
+   (wal-mode? #t))
   "Register CLOSURE in PREFIX, where PREFIX is the directory name of the
 target store and CLOSURE is the name of a file containing a reference graph as
 produced by #:references-graphs..  As a side effect, if RESET-TIMESTAMPS? is
 true, reset timestamps on store files and, if DEDUPLICATE? is true,
-deduplicates files common to CLOSURE and the rest of PREFIX."
+deduplicates files common to CLOSURE and the rest of PREFIX.  Pass WAL-MODE?
+to call-with-database."
   (let ((items (call-with-input-file closure read-reference-graph)))
 (parameterize ((sql-schema schema))
   (with-database (store-database-file #:prefix prefix) db
-(register-items db items
-#:prefix prefix
-#:deduplicate? deduplicate?
-#:reset-timestamps? reset-timestamps?
-#:registration-time %epoch)
+   #:wal-mode? wal-mode?
+   (register-items db items
+   #:prefix prefix
+   #:deduplicate? deduplicate?
+   #:reset-timestamps? reset-timestamps?
+   #:registration-time %epoch)
 
 (define* (initialize-efi-partition root
#:key
@@ -164,14 +167,16 @@ deduplicates files common to CLOSURE and the rest of 
PREFIX."
 (register-closures? #t)
 system-directory
 make-device-nodes
+(wal-mode? #t)
 #:allow-other-keys)
   "Initialize the given ROOT directory. Use BOOTCFG and BOOTCFG-LOCATION to
 install the bootloader configuration.
 
 If REGISTER-CLOSURES? is true, register REFERENCES-GRAPHS in the store.  If
 DEDUPLICATE? is true, then also deduplicate files common to CLOSURES and the
-rest of the store when registering the closures. SYSTEM-DIRECTORY is the name
-of the directory of the 'system' derivation."
+rest of the store when registering the closures.  SYSTEM-DIRECTORY is the name
+of the directory of the 'system' derivation.  Pass WAL-MODE? to
+register-closure."
   (populate-root-file-system system-directory root)
   (populate-store references-graphs root)
 
@@ -184,7 +189,8 @@ of the directory of the 'system' derivation."
 (register-closure root
   closure
   #:reset-timestamps? #t
-  #:deduplicate? deduplicate?))
+  #:deduplicate? deduplicate?
+  #:wal-mode? wal-mode?))
   references-graphs))
 
   (when bootloader-installer
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index 31942e7386..4e1db37104 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -61,8 +61,8 @@
   #~(lambda* (#:rest args)
   (apply initialize-root-partition
  (append args
- (list #:make-device-nodes
-   make-hurd-device-nodes)
+ (list #:make-device-nodes make-hurd-device-nodes
+   #:wal-mode? #f)
 
 (define hurd-disk-image
   (image
diff --git a/guix/store/database.scm b/guix/store/database.scm
index a38e4d7e52..50b66ce282 100644
--- a/guix/store/database.scm
+++ b/guix/store/database.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2019 Caleb Ristvedt 
 ;;; Copyright © 2018, 2020 Ludovic Courtès 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 (define-module (guix store database)
   #:use-module (sqlite3)
   #:use-module

bug#42298: Nonexistent Git commit referenced from current Guix package

2020-07-10 Thread Leo Famulari
On Fri, Jul 10, 2020 at 10:17:14AM +0200, Ludovic Courtès wrote:
> Hi,
> 
> Leo Famulari  skribis:
> 
> > The current Guix package points to a Git commit that does not exist,
> > which breaks the ability to build the package.
> >
> > The current package version is '1.1.0-16.d3eee3c'.
> >
> > That commit d3eee3c [0] is the commit that updated the Guix package
> > previously, to '1.1.0-15.03deb1e'.
> >
> > However, there is no commit 03deb1e [1].
> 
> Yes, it was a mistake, and that’s why 1.1.0-16 was committed minutes
> later:
> 
>   
> https://git.savannah.gnu.org/cgit/guix.git/commit/?id=b919d4048e72f8e5740606cdb3dac0592de21f36
> 
> Someone who encounters this bug should run ‘guix pull’.

Alright, closing.





bug#42315: `guix system vm-image` does not produce image with btrfs

2020-07-10 Thread Jack Hill

Hi Guix,

I'm using guix from commit: ec4c404c0575b340a04b3922fb828ac5417832dd

I want to create a vm-image with a btrfs filesystem. Following the manual 
for Invoking guix system 
, I 
ran:


`guix system vm-image --image-size=120GB -t btrfs vm-config.scm`

with the operating system config below.

It produced a working vm image. However, the root file system was ext4.

Is this supposed to work, or did I misunderstand the documentation?

In an ideal world, I hope that this would work, but if we don't support it 
yet, I think that we should clarify the documentation, and make guix 
system vm-image error when passed a file system type it doesn't support.


Best,
Jack

(use-modules (gnu) (guix))
(use-service-modules networking ssh)
(use-package-modules bootloaders certs
 package-management)


(operating-system
 (host-name "guix")
 (timezone "America/New_York")
 (locale "en_US.utf8")
 (initrd-modules (cons "virtio_scsi" %base-initrd-modules))

 ;; Label for the GRUB boot menu.
 (label (string-append "GNU Guix " (package-version guix)))

 (firmware '())

 ;; Below we assume /dev/vda is the VM's hard disk.
 ;; Adjust as needed.
 (bootloader (bootloader-configuration
  (bootloader grub-bootloader)
  (target "/dev/vda")
  (terminal-outputs '(console
 (file-systems (cons (file-system
  (mount-point "/")
  (device "/dev/vda1")
  (type "btrfs")
  (flags '(no-atime))
  (options "compress=zstd"))
 %base-file-systems))

 (users (cons (user-account
(name "jackhill")
(comment "Jack Hill")
(group "users")
(supplementary-groups '("wheel" "netdev"
   %base-user-accounts))

 ;; password-less sudo.
 (sudoers-file (plain-file "sudoers" "\
root ALL=(ALL) ALL
%wheel ALL=NOPASSWD: ALL\n"))

 (packages (append (list nss-certs)
   %base-packages))

 (services
  (append (list (service openssh-service-type
 (openssh-configuration
  (password-authentication? #f)
  (authorized-keys
   `(("jackhill" ,(local-file
   
"/home/jackhill/.ssh/id_ed25519.pub"))

;; Use the DHCP client service rather than NetworkManager.
(service dhcp-client-service-type))
  %base-services)))