summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/distribution.scm43
1 files changed, 43 insertions, 0 deletions
diff --git a/services/distribution.scm b/services/distribution.scm
new file mode 100644
index 0000000..09e6c56
--- /dev/null
+++ b/services/distribution.scm
@@ -0,0 +1,43 @@
+(define-module (services distribution)
+ #:use-module (gnu services)
+ #:use-module (gnu services base)
+ #:use-module (gnu services configuration)
+ #:use-module (gnu services desktop)
+ #:use-module (guix gexp))
+
+;; DATA
+
+(define nonguix-authorized-guix-key-content
+ (string-append "(public-key \n"
+ "(ecc \n"
+ "(curve Ed25519) \n"
+ "(q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#))) \n"))
+
+(define nonguix-authorized-guix-key-name
+ "nonguix-authorized-guix-key")
+
+(define nonguix-substitute-urls
+ (list "https://substitutes.nonguix.org"))
+
+;; ABSTRACTION 2
+
+(define nonguix-authorized-guix-keys
+ (list (plain-file nonguix-authorized-guix-key-name
+ nonguix-authorized-guix-key-content)))
+
+;; ABSTRACTION 1
+
+(define (nonguix-substitute config)
+ (guix-configuration (inherit config)
+ (substitute-urls (append %default-substitute-urls
+ nonguix-substitute-urls))
+ (authorized-keys (append %default-authorized-guix-keys
+ nonguix-authorized-guix-keys))))
+
+;; PUBLIC
+
+(define-public %distribution-services
+ (modify-services %desktop-services
+ (guix-service-type config
+ =>
+ (nonguix-substitute config))))