diff options
author | EuAndreh <eu@euandre.org> | 2024-08-21 10:34:32 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-08-21 10:34:32 -0300 |
commit | 4cb6f2d8af3108521f40f33ac7ca83c68123eabe (patch) | |
tree | b4964f44f53d4aed79e106b0181d7e83031662d4 /src | |
parent | package.scm: Use (let ...) to simplify (etc-entries ...) function (diff) | |
download | packages-4cb6f2d8af3108521f40f33ac7ca83c68123eabe.tar.gz packages-4cb6f2d8af3108521f40f33ac7ca83c68123eabe.tar.xz |
packages.scm: Move utility functions to the beginning of the file
Diffstat (limited to 'src')
-rw-r--r-- | src/org/euandre/packages.scm | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/org/euandre/packages.scm b/src/org/euandre/packages.scm index 3d8a616..e39d475 100644 --- a/src/org/euandre/packages.scm +++ b/src/org/euandre/packages.scm @@ -138,6 +138,26 @@ +(define-public (mklist x) + (if (not x) + '() + (if (pair? x) + x + (list x)))) + +(define-public (slurp path) + (call-with-input-file + path + textual-ports:get-string-all)) + +(define-public (str . rest) + (apply string-append rest)) + +(define-public (fmt . rest) + (apply format #f rest)) + + + (define-public (pkg name version checksum) (package (name name) @@ -348,27 +368,6 @@ - - - -(define-public (mklist x) - (if (not x) - '() - (if (pair? x) - x - (list x)))) - -(define-public (slurp path) - (call-with-input-file - path - textual-ports:get-string-all)) - -(define-public (str . rest) - (apply string-append rest)) - -(define-public (fmt . rest) - (apply format #f rest)) - (define-public (user-accounts users) (map (lambda (user) (let ((name (s1:first user)) |