# Doug
Utilities to serialize a GNU Guix channel
## Usage
To serialize all packages available in current profile except packages from the
[guix](https://git.savannah.gnu.org/git/guix.git) channel:
```scheme
(use-modules (json))
(use-modules (gnu packages))
(use-modules (doug))
(scm->json
`((packages . ,(list->vector
(fold-packages
(lambda (p ps) (cons (package->alist p) ps))
'()
#:select? (negate guix-package?)))))
#:pretty #t)
```
Above code will output a json object below:
```json
{
"packages": [
{
"name": "...",
"version": "...",
"...": "..."
}
]
}
```
### In the wild
#### To filter official guix packages using `guix-package?` function
- [~whereiseveryone/guixrus](https://git.sr.ht/~whereiseveryone/guixrus/commit/e5283f49dc76969317e8e97426bcb1c57848c968#scripts/lint-1-17)
- [~whereiseveryone/website](https://git.sr.ht/~whereiseveryone/website/commit/0b6fe9d02e18292b875de730aa0ebacd65289dfd#guixrus.scm-1-90)
## License
[GPL-3.0-or-later](./LICENSES/GPL-3.0-or-later.txt)