From 767d6988c2456e024faaee3bc70c69a94c8ef0fa Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Fri, 13 Nov 2020 12:27:17 +0100 Subject: [PATCH] config/guix/channels: Add parameter to choose whether Guix commit. Remove obsolete no-rebuild-channnel.scm. --- .config/guix/channels.scm | 90 +++++++++++++++++++---------- .config/guix/no-rebuild-channel.scm | 26 --------- 2 files changed, 60 insertions(+), 56 deletions(-) delete mode 100644 .config/guix/no-rebuild-channel.scm diff --git a/.config/guix/channels.scm b/.config/guix/channels.scm index cd9feb99..e5564d73 100644 --- a/.config/guix/channels.scm +++ b/.config/guix/channels.scm @@ -1,30 +1,60 @@ -(cons* - (channel - (name 'nonguix) - (url "https://gitlab.com/nonguix/nonguix.git") - ;; (url "/home/ambrevar/projects/nonguix") - (introduction - (make-channel-introduction - "897c1a470da759236cc11798f4e0a5f7d4d59fbc" - (openpgp-fingerprint - "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))) - (branch "master")) - (channel - (name 'guix-gaming-games) - (url "https://gitlab.com/guix-gaming-channels/games.git") - ;; (url "/home/ambrevar/projects/games") - (introduction - (make-channel-introduction - "c23d64f1b8cc086659f8781b27ab6c7314c5cca5" - (openpgp-fingerprint - "50F3 3E2E 5B0C 3D90 0424 ABE8 9BDC F497 A4BB CC7F"))) - (branch "master")) - ;; (channel - ;; (name 'guix-gaming-duke-nukem-3d) - ;; (url "https://gitlab.com/guix-gaming-channels/duke-nukem-3d.git") - ;; (branch "master")) - ;; (channel - ;; (name 'guix-gaming-quake-3) - ;; (url "https://gitlab.com/guix-gaming-channels/quake-3.git") - ;; (branch "master")) - %default-channels) +(use-modules (srfi srfi-1) + (ice-9 textual-ports) + (ice-9 popen)) + +(define (find-guix-channel channel-list) + (find + (lambda (channel) (eq? (channel-name channel) 'guix)) + channel-list)) + +(define current-guix (find-guix-channel %default-channels)) + +(define (current-guix-commit) + (let* ((port (open-input-pipe "guix describe -f channels")) + (str (get-string-all port))) + (close-pipe port) + (channel-commit + (find-guix-channel (eval-string str))))) + +(define* (channel-list #:key guix-commit) + (cons* + (channel + (name 'nonguix) + (url "https://gitlab.com/nonguix/nonguix.git") + (introduction + (make-channel-introduction + "897c1a470da759236cc11798f4e0a5f7d4d59fbc" + (openpgp-fingerprint + "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))) + (branch "master")) + (channel + (name 'guix-gaming-games) + (url "https://gitlab.com/guix-gaming-channels/games.git") + ;; (url "/home/ambrevar/projects/games") + (introduction + (make-channel-introduction + "c23d64f1b8cc086659f8781b27ab6c7314c5cca5" + (openpgp-fingerprint + "50F3 3E2E 5B0C 3D90 0424 ABE8 9BDC F497 A4BB CC7F"))) + (branch "master")) + + ;; (channel + ;; (name 'guix-gaming-duke-nukem-3d) + ;; (url "https://gitlab.com/guix-gaming-channels/duke-nukem-3d.git") + ;; (branch "master")) + + ;; (channel + ;; (name 'guix-gaming-quake-3) + ;; (url "https://gitlab.com/guix-gaming-channels/quake-3.git") + ;; (branch "master")) + + (cons + (if guix-commit + (channel + (inherit current-guix) + (commit guix-commit)) + current-guix) + (delete current-guix %default-channels)))) + +;; (channel-list #:guix-commit (current-guix-commit)) +(channel-list) diff --git a/.config/guix/no-rebuild-channel.scm b/.config/guix/no-rebuild-channel.scm deleted file mode 100644 index f8baa579..00000000 --- a/.config/guix/no-rebuild-channel.scm +++ /dev/null @@ -1,26 +0,0 @@ -;; Run as ‘guix pull -C FILE’. - -(cons* - (channel - (name 'nonguix) - (url "https://gitlab.com/nonguix/nonguix.git") - (branch "master")) - (channel - (name 'guix-gaming-games) - (url "https://gitlab.com/guix-gaming-channels/games.git") - (branch "master")) - (channel - (name 'guix-gaming-duke-nukem-3d) - (url "https://gitlab.com/guix-gaming-channels/duke-nukem-3d.git") - (branch "master")) - (channel - (name 'guix-gaming-quake-3) - (url "https://gitlab.com/guix-gaming-channels/quake-3.git") - (branch "master")) - (list - (channel - ;; This channel can be used as an alternative to - ;; %default-channels to avoid rebuilding Guix on =guix pull=. - (inherit (car %default-channels)) - ;; Get commit from =guix describe -f channels=. - (commit "338defe0cbe156e8416647035403fccf059555e0"))))