diff options
| author | Oleg Pykhalov <go.wigust@gmail.com> | 2024-06-02 20:21:07 +0300 |
|---|---|---|
| committer | Oleg Pykhalov <go.wigust@gmail.com> | 2024-06-02 20:21:07 +0300 |
| commit | e0e440fe8b412ade2e95a29b07fa240c8a53602e (patch) | |
| tree | c7bbaff5b2ac69086f54659d2ea7664d792058b1 /guix.scm | |
| parent | Use configuration passed as command line argument. (diff) | |
| download | ddcutil-daemon-master.tar.gz | |
Diffstat (limited to 'guix.scm')
| -rw-r--r-- | guix.scm | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/guix.scm b/guix.scm new file mode 100644 index 0000000..5e654dd --- /dev/null +++ b/guix.scm @@ -0,0 +1,38 @@ +(use-modules (guix build utils) + (guix build-system go) + (guix gexp) + (guix git-download) + (guix packages) + (ice-9 popen) + (ice-9 rdelim)) + +(define %source-dir (dirname (current-filename))) + +(define (git-output . args) + "Execute 'git ARGS ...' command and return its output without trailing +newspace." + (with-directory-excursion %source-dir + (let* ((port (apply open-pipe* OPEN_READ "git" args)) + (output (read-string port))) + (close-pipe port) + (string-trim-right output #\newline)))) + +(define (current-commit) + (git-output "log" "-n" "1" "--pretty=format:%H")) + +(define-public ddcutil-daemon + (package + (name "ddcutil-daemon") + (version "0.0.1") + (source (local-file %source-dir + #:recursive? #t + #:select? (git-predicate %source-dir))) + (build-system go-build-system) + (arguments + (list #:import-path "github.com/kitnil/ddcutil-daemon")) + (home-page "") + (synopsis "") + (description "") + (license #f))) + +ddcutil-daemon |
