@@ -8,6 +8,7 @@
;;; Copyright © 2020 Jesse Dowell <jessedowell@gmail.com>
;;; Copyright © 2021, 2022 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2022 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2024 Giacomo Leidi <goodoldpaul@autistici.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -51,7 +52,8 @@ (define-module (gnu packages docker)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages version-control)
- #:use-module (gnu packages virtualization))
+ #:use-module (gnu packages virtualization)
+ #:export (docker-credential-helpers))
;; Note - when changing Docker versions it is important to update the versions
;; of several associated packages (docker-libnetwork and go-sctp).
@@ -670,6 +672,72 @@ (define-public docker-cli
(home-page "https://www.docker.com/")
(license license:asl2.0)))
+;; Actual users of this procedure are
+;; docker-credentials-secretservice and docker-credential-pass, they live in
+;; different modules to avoid circular imports.
+(define* (docker-credential-helpers plugin-name #:key (inputs '()))
+ (package
+ (name (string-append "docker-credential-" plugin-name))
+ (version "0.8.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/docker/docker-credential-helpers")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1kric2yrgypdqncqfrmrh7l7904km5zisygi3fg6zlfkyh6rsm23"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:install-source? #f
+ #:go go-1.19
+ #:unpack-path "github.com/docker/docker-credential-helpers"
+ #:import-path
+ (string-append "github.com/docker/docker-credential-helpers/"
+ plugin-name "/cmd")
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'build
+ (lambda* (#:key unpack-path import-path build-flags #:allow-other-keys)
+ (apply invoke "go" "build"
+ "-v"
+ "-x"
+ (string-append "-ldflags=-s -w "
+ "-X github.com/docker/docker-credential-helpers"
+ "/credentials.Version=" #$version " "
+ "-X github.com/docker/docker-credential-helpers"
+ "/credentials.Package=" unpack-path " "
+ "-X github.com/docker/docker-credential-helpers"
+ "/credentials.Name=" #$name)
+ "-o" (string-append "bin/" #$name)
+ `(,@build-flags ,import-path))))
+ (replace 'install
+ (lambda _
+ (let* ((bin
+ (string-append #$output "/bin"))
+ (lib
+ (string-append #$output "/libexec/docker/cli-plugins"))
+ (entrypoint
+ (string-append lib "/" #$name)))
+ (mkdir-p bin)
+ (mkdir-p lib)
+ (copy-file (string-append "bin/" #$name) entrypoint)
+ (symlink entrypoint
+ (string-append bin "/" #$name))))))))
+ (native-inputs
+ (list pkg-config))
+ (inputs inputs)
+ (home-page "https://github.com/docker/docker-credential-helpers")
+ (synopsis "Store Docker login credentials in platform keystores")
+ (description
+ (string-append "docker-credential-helpers is a suite of programs to use native stores to keep
+Docker credentials safe.
+
+This package provides the @code{" name "} plugin."))
+ (license license:expat)))
+
(define-public cqfd
(package
(name "cqfd")
@@ -36,7 +36,7 @@
;;; Copyright © 2019 Danny Milosavljevic <dannym@scratchpost.org>
;;; Copyright © 2019, 2020, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2019 Florian Pelz <pelzflorian@pelzflorian.de>
-;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
+;;; Copyright © 2019, 2024 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2019 Jelle Licht <jlicht@fsfe.org>
;;; Copyright © 2019 Jonathan Frederickson <jonathan@terracrypt.net>
;;; Copyright © 2019, 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
@@ -5229,6 +5229,10 @@ (define-public libsecret
and other secrets. It communicates with the \"Secret Service\" using DBus.")
(license license:lgpl2.1+)))
+(define-public docker-credential-secretservice
+ (docker-credential-helpers "secretservice"
+ #:inputs (list libsecret)))
+
(define-public five-or-more
(package
(name "five-or-more")