mirror-all: add v1.0.0
authoralex <[email protected]>
Sun, 15 Dec 2024 18:45:19 +0000 (10:45 -0800)
committeralex <[email protected]>
Sun, 15 Dec 2024 18:45:19 +0000 (10:45 -0800)
infiniteadaptability/mirror-all.scm [new file with mode: 0644]

diff --git a/infiniteadaptability/mirror-all.scm b/infiniteadaptability/mirror-all.scm
new file mode 100644 (file)
index 0000000..0eb5d88
--- /dev/null
@@ -0,0 +1,58 @@
+(define-module (infiniteadaptability mirror-all)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix licenses)
+  #:use-module (guix packages)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
+  #:use-module (gnu packages debian)
+  #:use-module (gnu packages ssh)
+  #:use-module (gnu packages version-control))
+
+(define-public mirror-all
+  (let ((version "1.0.0")
+        (commit "1eac03b07eec444a02ad19099b60a01ca8566b8a")
+        (revision 0))
+    (package
+      (name "mirror-all")
+      (version (if (zero? revision) version
+                   (string-append version "-"
+                                  (number->string revision) "."
+                                  (string-take commit 7))))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://git.infiniteadaptability.org/mirror-all.git")
+               (commit commit)))
+         (sha256
+          (base32 "0nlcd6i6z7j6151xxs66m3n2zadd0jp64lgp2bq6rccpgv05wsdh"))
+         (file-name (string-append "mirror-all-" version "-checkout"))))
+      (build-system gnu-build-system)
+      (arguments
+       '(#:phases (modify-phases %standard-phases
+                    (delete 'configure)
+                    (delete 'build)
+                    (add-after 'install 'wrap
+                      (lambda* (#:key inputs outputs #:allow-other-keys)
+                        (let ((out (assoc-ref outputs "out")))
+                          (wrap-program (string-append out "/bin/mirror-all")
+                            `("PATH" ":" prefix
+                              (,(string-append (assoc-ref inputs "git") "/bin")
+                               ,(string-append (assoc-ref inputs "coreutils") "/bin")
+                               ,(string-append (assoc-ref inputs "openssh") "/bin"))))
+                         #t))))
+         #:make-flags (list (string-append "PREFIX=" %output))))
+      (native-inputs `(("debianutils" ,debianutils)))
+      (inputs `(("bash" ,bash)
+                ("coreutils" ,coreutils)
+                ("openssh" ,openssh)
+                ("git" ,git)))
+      (home-page "https://git.infiniteadaptability.org/mirror-all")
+      (synopsis "mirror all repositories in a directory")
+      (description "Script for mirroring all repositories in a directory.")
+      (license unlicense))))
+
+mirror-all
+