From: Jakub Czajka Date: Fri, 23 Dec 2022 19:47:12 +0000 (+0100) Subject: [common] Install programs from local source code. X-Git-Url: https://git.ekhem.eu.org/?a=commitdiff_plain;h=97878bee2ea940265aa0dbb7b2c0fb4f506cdb53;p=guix.git [common] Install programs from local source code. Guix downloads programs and source code from the internet. However, if we want to install custom versions of these programs, we need to compile them manually from local source code. This commit adds helper functions for working with such programs. --- diff --git a/README b/README index 2c0b177..0a911a7 100644 --- a/README +++ b/README @@ -8,7 +8,9 @@ installation instructions. Files ----- -* home.scm - home directory configuration for the GNU Guix operating system. -* system.scm - system configuration for the GNU Guix operating system. -* conf/home/ - custom GNU Guix programs and services for the home directory. -* / - program-specific dotfiles. +* home.scm - home directory configuration for the GNU Guix operating system. +* system.scm - system configuration for the GNU Guix operating system. +* conf/home/ - custom GNU Guix programs and services for the home directory. +* conf/common/ - custom GNU Guix programs and services shared by home and system + configurations. +* / - program-specific dotfiles. diff --git a/conf/common/local-package.scm b/conf/common/local-package.scm new file mode 100644 index 0000000..d3b754a --- /dev/null +++ b/conf/common/local-package.scm @@ -0,0 +1,31 @@ +;; Copyright (c) 2022 Jakub Czajka +;; License: GPL-3.0 or later. +;; +;; local-package.scm - install package from local source code. + +(define-module (conf common local-package) + #:use-module (guix gexp) + #:use-module (guix packages) + #:export (local-package)) + +(define (local-package guix-package) + (define guix-package-name + (package-name guix-package)) + + (define local-package-name + (string-concatenate + (list "conf-" guix-package-name))) + + (define local-source-path + (string-concatenate + (list (getenv "GUIX_PACKAGE_PATH") "/" guix-package-name))) + + (define local-source + (local-file local-source-path + local-package-name + #:recursive? #t)) + + (package + (inherit guix-package) + (name local-package-name) + (source local-source)))