From 46422e73b86f3c0899345dfdcbbf621771b5f666 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 2 Sep 2026 16:18:23 -0300 Subject: Depend on pkgs and move code there; drop other distros but guix --- .gitignore | 4 - .guix-channel | 12 +- Formula/git-permalink-0-1-0.rb | 17 - Formula/git-permalink-0-2-0.rb | 17 - Formula/td.rb | 17 - Makefile | 70 +- build.nix | 6 - default.nix | 111 -- email.txt | 1 + maintainer.key | 80 +- meta.capim | 6 - meta.txt | 2 + mkdeps.sh | 4 +- paku.json | 87 -- paku.lock | 192 --- src/alpine/git-permalink-0-1-0/APKBUILD | 37 - src/alpine/git-permalink-0-2-0/APKBUILD | 37 - src/alpine/guile-heredoc/APKBUILD | 37 - src/alpine/remembering-0-1-2/APKBUILD | 37 - src/alpine/td/APKBUILD | 37 - src/bin/paku.in | 1169 ---------------- src/org/euandre/packages.scm | 1539 ++------------------- src/org/euandre/queue.scm | 2011 ---------------------------- src/secrets/eu@euandre.org.rsa.gpg | 69 - src/secrets/eu@euandre.org.rsa.pub | 14 - tests/checks/apk.sh | 41 - tests/checks/deb.sh | 25 - tests/checks/homebrew.sh | 26 - tests/internet/etc/dkimproxyout.conf.in | 9 - tests/internet/etc/dovecot/dovecot.conf.in | 54 - tests/internet/etc/postfix/main.cf.in | 40 - tests/internet/etc/postfix/master.cf | 51 - tests/internet/etc/sasl2/smtpd.conf | 3 - tests/internet/key.txt | 1 - tests/internet/system.scm | 54 +- tests/internet/tests.scm | 72 - tests/local/etc/postfix/main.cf | 25 - tests/local/etc/postfix/master.cf | 30 - tests/local/system.scm | 27 +- tests/tests.scm | 71 + tests/unit.scm | 18 + tests/vm-check.sh | 127 -- tld.txt | 1 + 43 files changed, 322 insertions(+), 5966 deletions(-) delete mode 100644 Formula/git-permalink-0-1-0.rb delete mode 100644 Formula/git-permalink-0-2-0.rb delete mode 100644 Formula/td.rb delete mode 100644 build.nix delete mode 100644 default.nix create mode 100644 email.txt delete mode 100644 meta.capim create mode 100644 meta.txt delete mode 100644 paku.json delete mode 100644 paku.lock delete mode 100644 src/alpine/git-permalink-0-1-0/APKBUILD delete mode 100644 src/alpine/git-permalink-0-2-0/APKBUILD delete mode 100644 src/alpine/guile-heredoc/APKBUILD delete mode 100644 src/alpine/remembering-0-1-2/APKBUILD delete mode 100644 src/alpine/td/APKBUILD delete mode 100755 src/bin/paku.in delete mode 100644 src/org/euandre/queue.scm delete mode 100644 src/secrets/eu@euandre.org.rsa.gpg delete mode 100644 src/secrets/eu@euandre.org.rsa.pub delete mode 100755 tests/checks/apk.sh delete mode 100755 tests/checks/deb.sh delete mode 100755 tests/checks/homebrew.sh delete mode 100644 tests/internet/etc/dkimproxyout.conf.in delete mode 100644 tests/internet/etc/dovecot/dovecot.conf.in delete mode 100644 tests/internet/etc/postfix/main.cf.in delete mode 100644 tests/internet/etc/postfix/master.cf delete mode 100644 tests/internet/etc/sasl2/smtpd.conf delete mode 100644 tests/internet/key.txt delete mode 100644 tests/internet/tests.scm delete mode 100644 tests/local/etc/postfix/main.cf delete mode 100644 tests/local/etc/postfix/master.cf create mode 100644 tests/tests.scm create mode 100644 tests/unit.scm delete mode 100755 tests/vm-check.sh create mode 100644 tld.txt diff --git a/.gitignore b/.gitignore index d6dbab8..ff210e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,2 @@ /*.scm -/*.scm-* /*.sentinel -/tests/internet/etc/postfix/main.cf -/tests/internet/etc/dkimproxyout.conf -/tests/internet/etc/dovecot/dovecot.conf diff --git a/.guix-channel b/.guix-channel index 6979193..ada58cf 100644 --- a/.guix-channel +++ b/.guix-channel @@ -1,4 +1,14 @@ (channel (version 0) (directory "src") - (keyring-reference "main")) + (keyring-reference "main") + (dependencies + (channel + (name papoim) + (url "git://papo.im/pkgs") + (branch "main") + (introduction + (channel-introduction + (version 0) + (commit "b28de051e942840c3b202ce728053d450a6ca803") + (signer "5BDA E9B8 B2F6 C6BC BB0D 6CE5 81F9 0EC3 CD35 6060")))))) diff --git a/Formula/git-permalink-0-1-0.rb b/Formula/git-permalink-0-1-0.rb deleted file mode 100644 index fc4f728..0000000 --- a/Formula/git-permalink-0-1-0.rb +++ /dev/null @@ -1,17 +0,0 @@ -class GitPermalink010 < Formula - desc 'Git extension to generate web permalinks of files in a repository' - homepage 'https://euandre.org/s/git-permalink/' - url 'https://euandre.org/git/git-permalink/snapshot/git-permalink-v0.1.0.tar.xz' - sha256 '252c98e349fed8df180ace540675b69a811ff56a9f06fa505eb475e047648a1f' - license 'AGPL-3.0-or-later' - - def install - system 'make', "PREFIX=#{prefix}" - system 'make', 'check', "PREFIX=#{prefix}" - system 'make', 'install', "PREFIX=#{prefix}" - end - - test do - system "#{bin}/git-permalink", '-V' - end -end diff --git a/Formula/git-permalink-0-2-0.rb b/Formula/git-permalink-0-2-0.rb deleted file mode 100644 index b236c0e..0000000 --- a/Formula/git-permalink-0-2-0.rb +++ /dev/null @@ -1,17 +0,0 @@ -class GitPermalink020 < Formula - desc 'Git extension to generate web permalinks of files in a repository' - homepage 'https://euandre.org/s/git-permalink/' - url 'https://euandre.org/git/git-permalink/snapshot/git-permalink-v0.2.0.tar.xz' - sha256 '9ea6562812f6127771bc2b86919ea63056fcc0f5c1e556875855c924ee8b1183' - license 'AGPL-3.0-or-later' - - def install - system 'make', "PREFIX=#{prefix}" - system 'make', 'check', "PREFIX=#{prefix}" - system 'make', 'install', "PREFIX=#{prefix}" - end - - test do - system "#{bin}/git-permalink", '-V' - end -end diff --git a/Formula/td.rb b/Formula/td.rb deleted file mode 100644 index eeb58d2..0000000 --- a/Formula/td.rb +++ /dev/null @@ -1,17 +0,0 @@ -class Td < Formula - desc 'Minimalistic bug tracker CLI' - homepage 'https://euandre.org/s/td/' - url 'https://euandre.org/git/td/snapshot/td-4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8.tar.xz' - sha256 'a25561ae8062788bfb79df2de5f26e5f1100638fbeabff934490cdf0a9dde105' - license 'AGPL-3.0-or-later' - - def install - system 'make', "PREFIX=#{prefix}" - system 'make', 'check', "PREFIX=#{prefix}" - system 'make', 'install', "PREFIX=#{prefix}" - end - - test do - system "#{bin}/td", '-V' - end -end diff --git a/Makefile b/Makefile index af4d841..27e141f 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ N = `nproc` + .SUFFIXES: .SUFFIXES: .in .sentinel @@ -13,13 +14,20 @@ N = `nproc` +all: +include deps.mk + + +test-config-files-local = \ + +test-config-files-internet = \ + test-config-files = \ - tests/internet/etc/postfix/main.cf \ - tests/internet/etc/dkimproxyout.conf \ - tests/internet/etc/dovecot/dovecot.conf \ + $(test-config-files-local) \ + $(test-config-files-internet) \ + derived-assets = \ - queue.scm.sentinel \ packages.scm.sentinel \ local.scm.sentinel \ internet.scm.sentinel \ @@ -27,57 +35,53 @@ derived-assets = \ $(test-config-files) \ side-assets = \ - queue.scm \ - queue.scm-* \ dynamic.scm \ packages.scm \ local.scm \ internet.scm \ + tests/cert/ \ + all: $(derived-assets) -all: maintainer.key.sentinel -queue.scm.sentinel: src/org/euandre/queue.scm -packages.scm.sentinel: src/org/euandre/queue.scm src/org/euandre/packages.scm -local.scm.sentinel: src/org/euandre/queue.scm tests/local/system.scm -internet.scm.sentinel: src/org/euandre/queue.scm src/org/euandre/packages.scm \ - tests/internet/system.scm +$(test-config-files): Makefile deps.mk +local.scm.sentinel: tests/local/system.scm +internet.scm.sentinel: tests/internet/system.scm -queue.scm.sentinel packages.scm.sentinel: Makefile - rm -f `basename $@ .sentinel`* - guix build -c$N -v3 -Lsrc -r`basename $@ .sentinel` -Kf src/org/euandre/`basename $@ .sentinel` +packages.scm.sentinel: src/org/euandre/packages.scm Makefile deps.mk + rm -f packages.scm + guix build -c$N -v3 -Lsrc -r packages.scm -Kf src/org/euandre/packages.scm touch $@ -local.scm.sentinel internet.scm.sentinel: queue.scm.sentinel packages.scm.sentinel - rm -f `basename $@ .sentinel`* - guix build -c$N -v3 -Lsrc -r`basename $@ .sentinel` -Kf tests/`basename $@ .scm.sentinel`/system.scm +local.scm.sentinel internet.scm.sentinel: packages.scm.sentinel + rm -f $* + guix build -c$N -v3 -Lsrc -r $* -Kf tests/`basename $* .scm`/system.scm touch $@ -maintainer.key.sentinel: meta.capim - ID="`awk '$$1 == ":email" && $$0=$$2' meta.capim | tr -d '"'`" && \ - gpg --export --armour "$$ID" | ifnew $* +maintainer.key.sentinel: email.txt + gpg --export --armour "`cat email.txt`" | ifnew $* touch $@ +check-guile: + guix repl -L src/ tests/unit.scm + +check-unit: check-guile + local-files = \ - /etc/postfix/master.cf \ - /etc/postfix/main.cf \ internet-files = \ - $(local-files) \ - /etc/sasl2/smtpd.conf \ - /etc/dkimproxyout.conf \ - /etc/dovecot/dovecot.conf \ + $(local-files) \ -check-guix-static-local: local.scm.sentinel $(test-config-files) +check-guix-static-local: local.scm.sentinel $(test-config-files-local) for f in $(local-files); do \ diff -U5 local.scm"$$f" tests/local"$$f"; \ done -check-guix-static-internet: internet.scm.sentinel $(test-config-files) +check-guix-static-internet: internet.scm.sentinel $(test-config-files-internet) for f in $(internet-files); do \ diff -U5 internet.scm"$$f" tests/internet"$$f"; \ done @@ -85,15 +89,13 @@ check-guix-static-internet: internet.scm.sentinel $(test-config-files) check-guix-static: check-guix-static-local check-guix-static-internet check-guix-dynamic: - rm -f dynamic.scm* - guix build -c$N -v3 -Lsrc -r dynamic.scm -Km tests/internet/tests.scm + rm -f dynamic.scm + guix build -c$N -v3 -Lsrc -r dynamic.scm -Km tests/tests.scm check-guix: check-guix-static check-guix-dynamic -check-unit: check-guix - -check-integration: +check-integration: check-guix ## Run all tests. Each test suite is isolated, so that a parallel diff --git a/build.nix b/build.nix deleted file mode 100644 index 1c578ad..0000000 --- a/build.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs ? - import { overlays = [ (import ./default.nix { inherit pkgs; }) ]; } -}: - -map (name: pkgs.org-euandre."${name}") - (builtins.attrNames pkgs.org-euandre) diff --git a/default.nix b/default.nix deleted file mode 100644 index 5272575..0000000 --- a/default.nix +++ /dev/null @@ -1,111 +0,0 @@ -{ pkgs }: -self: super: { - org-euandre = rec { - git-permalink-0-1-0 = pkgs.stdenv.mkDerivation rec { - name = "git-permalink"; - version = "0.1.0"; - - src = fetchTarball { - url = - "https://euandre.org/git/git-permalink/snapshot/git-permalink-v0.1.0.tar.xz"; - sha256 = "1jb0rgcj5b4bkm5gds3l0dymf3gd644r2njmirs9345vf54if45y"; - }; - - nativeBuildInputs = with pkgs; [ - ]; - - buildInputs = with pkgs; [ - ]; - - makeFlags = [ "PREFIX=$(out)" ]; - - doCheck = true; - enableParallelBuilding = true; - - meta = with pkgs.lib; { - description = "Git extension to generate web permalinks of files in a repository"; - longDescription = '' - It knows about many of the existing code forges, but allows for URL - template overrides to be used on custom domains or deployments via git - config. - ''; - homepage = "https://euandre.org/s/git-permalink/"; - changelog = "https://euandre.org/s/git-permalink/CHANGELOG.html"; - downloadPage = "https://euandre.org/s/git-permalink/#releases"; - license = licenses.agpl3Plus; - platforms = platforms.unix; - }; - }; - git-permalink-0-2-0 = pkgs.stdenv.mkDerivation rec { - name = "git-permalink"; - version = "0.2.0"; - - src = fetchTarball { - url = - "https://euandre.org/git/git-permalink/snapshot/git-permalink-v0.2.0.tar.xz"; - sha256 = "1bzx4gdfc87jfshaqifxpc3llp2j98wkzjjslzwbrqn59jzakxc9"; - }; - - nativeBuildInputs = with pkgs; [ - ]; - - buildInputs = with pkgs; [ - ]; - - makeFlags = [ "PREFIX=$(out)" ]; - - doCheck = true; - enableParallelBuilding = true; - - meta = with pkgs.lib; { - description = "Git extension to generate web permalinks of files in a repository"; - longDescription = '' - It knows about many of the existing code forges, but allows for URL - template overrides to be used on custom domains or deployments via git - config. - ''; - homepage = "https://euandre.org/s/git-permalink/"; - changelog = "https://euandre.org/s/git-permalink/CHANGELOG.html"; - downloadPage = "https://euandre.org/s/git-permalink/#releases"; - license = licenses.agpl3Plus; - platforms = platforms.unix; - }; - }; - td = pkgs.stdenv.mkDerivation rec { - name = "td"; - version = "4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8"; - - src = fetchTarball { - url = - "https://euandre.org/git/td/snapshot/td-4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8.tar.xz"; - sha256 = "1xqr2vc270jydk508pbkhcchmbg74w4bf83ch2d85nqja14r64n9"; - }; - - nativeBuildInputs = with pkgs; [ - ]; - - buildInputs = with pkgs; [ - ]; - - makeFlags = [ "PREFIX=$(out)" ]; - - doCheck = true; - enableParallelBuilding = true; - - meta = with pkgs.lib; { - description = "Minimalistic bug tracker CLI"; - longDescription = '' - Create and maintain a TODOs.md files as a bug database. - - It is a tool for distributed, offline issue tracking, reified as a simple text - file in the repository. - ''; - homepage = "https://euandre.org/s/td/"; - changelog = "https://euandre.org/s/td/CHANGELOG.html"; - downloadPage = "https://euandre.org/s/td/#releases"; - license = licenses.agpl3Plus; - platforms = platforms.unix; - }; - }; - }; -} diff --git a/email.txt b/email.txt new file mode 100644 index 0000000..687840f --- /dev/null +++ b/email.txt @@ -0,0 +1 @@ +eu@euandre.org diff --git a/maintainer.key b/maintainer.key index d548547..2519d0f 100644 --- a/maintainer.key +++ b/maintainer.key @@ -11,45 +11,45 @@ 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 @@ -95,5 +95,5 @@ T0PAbuproAk2TXn8NDzsFJP6ERM+3c1ARNiwZ8wCjiNChxX5cEh4ciNltkQ54ZF/ rN/8i+o7WAE9xdIdVHZg0H+WPWa/lOs5yfsSXES3Y7wxOR8chW038/y82TECk7LP +dZyFKJ26VSvqPHxMqmji/UJjOB+K5xaaCflnzsKzsaEf5fRCIrCp6ldIXh0/x0s pqsEJPXPOb40oBnNzLOSv9X++wKq+oXWEX8OSqhr -=bNun +=mG9H -----END PGP PUBLIC KEY BLOCK----- diff --git a/meta.capim b/meta.capim deleted file mode 100644 index 203cd70..0000000 --- a/meta.capim +++ /dev/null @@ -1,6 +0,0 @@ -{ - :maintainer" { - :name "EuAndreh" - :email "eu@euandre.org" - } -} diff --git a/meta.txt b/meta.txt new file mode 100644 index 0000000..336582a --- /dev/null +++ b/meta.txt @@ -0,0 +1,2 @@ +set ops +maturity alpha diff --git a/mkdeps.sh b/mkdeps.sh index 92b70ea..7361b96 100755 --- a/mkdeps.sh +++ b/mkdeps.sh @@ -1,2 +1,4 @@ #!/bin/sh -set -eu +set -euo pipefail + +export LANG=POSIX.UTF-8 diff --git a/paku.json b/paku.json deleted file mode 100644 index 47dbd40..0000000 --- a/paku.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "guix": { - "module-use": [ - "guile", - "texinfo" - ] - }, - "mappings": { - "guix": { - "packages": { - "guile": [ - "guile-3.0" - ] - } - } - }, - "namespace": "org.euandre", - "name": "EuAndreh", - "maintainer": { - "name": "EuAndreh", - "email": "eu@euandre.org" - }, - "base-url": "https://euandre.org/s/package-repository", - "vcs": { - "git": "git://euandre.org/package-repository", - "http": "https://euandre.org/git/package-repository", - "tarball": "https://euandre.org/git/package-repository/snapshot/package-repository-main.tar.xz" - }, - "defaults": { - "templates": { - "tarball": "https://euandre.org/git/@name@/snapshot/@name@-@version@.tar.xz", - "repository": "https://euandre.org/git/@name@/", - "base-url": "https://euandre.org/s/@name@", - "homepage": "https://euandre.org/s/@name@/", - "changelog": "https://euandre.org/s/@name@/CHANGELOG.html", - "downloads-page": "https://euandre.org/s/@name@/#releases", - "fname": "@name@-@version@.tar.xz" - }, - "format": ".tar.xz", - "maintainer": "EuAndreh ", - "default_branch": "main", - "versions": { - "tags": "all", - "branches": [ - "main" - ] - }, - "license": "AGPL-3.0-or-later", - "architectures": [ - "i386", - "x86_64", - "arm", - "aarch64" - ] - }, - "packages": { - "any": [ - { - "name": "git-permalink", - "branches": [], - "exclude-tags": [ - "v0.2.1", - "v0.2.2", - "v0.2.3", - "v0.3.0", - "v0.3.1" - ] - }, - { - "name": "remembering", - "branches": [], - "exclude-tags": [ - "v0.1.0", - "v0.1.1", - "v0.1.2", - "v0.2.0", - "v0.2.1", - "v0.3.0" - ] - }, - "td" - ], - "all": [ - "guile-heredoc" - ] - } -} diff --git a/paku.lock b/paku.lock deleted file mode 100644 index 156bf87..0000000 --- a/paku.lock +++ /dev/null @@ -1,192 +0,0 @@ -{ - "base-url" : "https://euandre.org/s/package-repository", - "datadir" : ".paku", - "defaults" : { - "architectures" : [ - "i386", - "x86_64", - "arm", - "aarch64" - ], - "default_branch" : "main", - "format" : ".tar.xz", - "license" : "AGPL-3.0-or-later", - "maintainer" : "EuAndreh ", - "templates" : { - "base-url" : "https://euandre.org/s/@name@", - "changelog" : "https://euandre.org/s/@name@/CHANGELOG.html", - "downloads-page" : "https://euandre.org/s/@name@/#releases", - "fname" : "@name@-@version@.tar.xz", - "homepage" : "https://euandre.org/s/@name@/", - "repository" : "https://euandre.org/git/@name@/", - "tarball" : "https://euandre.org/git/@name@/snapshot/@name@-@version@.tar.xz" - }, - "versions" : { - "branches" : [ - "main" - ], - "tags" : "all" - } - }, - "guix" : { - "module-use" : [ - "guile", - "texinfo" - ] - }, - "maintainer" : { - "email" : "eu@euandre.org", - "name" : "EuAndreh" - }, - "mappings" : { - "guix" : { - "packages" : { - "guile" : [ - "guile-3.0" - ] - } - } - }, - "name" : "EuAndreh", - "namespace" : "org.euandre", - "packages" : { - "all" : [ - "guile-heredoc" - ], - "any" : [ - { - "branches" : [], - "exclude-tags" : [ - "v0.2.1", - "v0.2.2", - "v0.2.3", - "v0.3.0", - "v0.3.1" - ], - "name" : "git-permalink" - }, - { - "branches" : [], - "exclude-tags" : [ - "v0.1.0", - "v0.1.1", - "v0.1.2", - "v0.2.0", - "v0.2.1", - "v0.3.0" - ], - "name" : "remembering" - }, - "td" - ] - }, - "pkgs" : [ - { - "architectures" : "any", - "base-url" : "https://euandre.org/s/git-permalink", - "changelog" : "https://euandre.org/s/git-permalink/CHANGELOG.html", - "date" : "2021-06-13", - "description" : "Git extension to generate web permalinks of files in a repository", - "description-b64" : "R2l0IGV4dGVuc2lvbiB0byBnZW5lcmF0ZSB3ZWIgcGVybWFsaW5rcyBvZiBmaWxlcyBpbiBhIHJlcG9zaXRvcnk=", - "downloads-page" : "https://euandre.org/s/git-permalink/#releases", - "fname" : "git-permalink-v0.1.0.tar.xz", - "full-name" : "git-permalink-0-1-0", - "homepage" : "https://euandre.org/s/git-permalink/", - "i18n" : false, - "inputs" : [], - "label" : "0-1-0", - "license" : "AGPL-3.0-or-later", - "long-description" : "It knows about many of the existing code forges, but allows for URL\ntemplate overrides to be used on custom domains or deployments via git\nconfig.", - "long-description-b64" : "SXQga25vd3MgYWJvdXQgbWFueSBvZiB0aGUgZXhpc3RpbmcgY29kZSBmb3JnZXMsIGJ1dCBhbGxvd3MgZm9yIFVSTAp0ZW1wbGF0ZSBvdmVycmlkZXMgdG8gYmUgdXNlZCBvbiBjdXN0b20gZG9tYWlucyBvciBkZXBsb3ltZW50cyB2aWEgZ2l0CmNvbmZpZy4=", - "maintainer" : "EuAndreh ", - "maintainer-b64" : "RXVBbmRyZWggPGV1QGV1YW5kcmUub3JnPg==", - "manpages" : true, - "name" : "git-permalink", - "native-inputs" : [], - "revision" : "40320b17d1a51c8cc187891388195a3b57e714f5", - "sha256" : "252c98e349fed8df180ace540675b69a811ff56a9f06fa505eb475e047648a1f", - "sha256guix" : "07waci3y0xdlbr8gl1lzdbsiz0csnrshcm6f18cdzn7y97irhb15", - "sha256nix" : "1jb0rgcj5b4bkm5gds3l0dymf3gd644r2njmirs9345vf54if45y", - "sha512" : "4d508704333c7c19432a5e021e561e5fe96175631230b09a672cfca984c55ee83dc55e82f4c29e7666db55997ddff59e54fc1d3c4cd72f78dc688fd1dd68a091", - "type" : "tag", - "url" : "https://euandre.org/git/git-permalink/snapshot/git-permalink-v0.1.0.tar.xz", - "version" : "0.1.0", - "vlabel" : "0.1.0", - "vname" : "v0.1.0", - "vversion" : "v0.1.0" - }, - { - "architectures" : "any", - "base-url" : "https://euandre.org/s/git-permalink", - "changelog" : "https://euandre.org/s/git-permalink/CHANGELOG.html", - "date" : "2021-06-19", - "description" : "Git extension to generate web permalinks of files in a repository", - "description-b64" : "R2l0IGV4dGVuc2lvbiB0byBnZW5lcmF0ZSB3ZWIgcGVybWFsaW5rcyBvZiBmaWxlcyBpbiBhIHJlcG9zaXRvcnk=", - "downloads-page" : "https://euandre.org/s/git-permalink/#releases", - "fname" : "git-permalink-v0.2.0.tar.xz", - "full-name" : "git-permalink-0-2-0", - "homepage" : "https://euandre.org/s/git-permalink/", - "i18n" : false, - "inputs" : [], - "label" : "0-2-0", - "license" : "AGPL-3.0-or-later", - "long-description" : "It knows about many of the existing code forges, but allows for URL\ntemplate overrides to be used on custom domains or deployments via git\nconfig.", - "long-description-b64" : "SXQga25vd3MgYWJvdXQgbWFueSBvZiB0aGUgZXhpc3RpbmcgY29kZSBmb3JnZXMsIGJ1dCBhbGxvd3MgZm9yIFVSTAp0ZW1wbGF0ZSBvdmVycmlkZXMgdG8gYmUgdXNlZCBvbiBjdXN0b20gZG9tYWlucyBvciBkZXBsb3ltZW50cyB2aWEgZ2l0CmNvbmZpZy4=", - "maintainer" : "EuAndreh ", - "maintainer-b64" : "RXVBbmRyZWggPGV1QGV1YW5kcmUub3JnPg==", - "manpages" : true, - "name" : "git-permalink", - "native-inputs" : [], - "revision" : "2b98d4b91dbde288a6168594ec9c48a60dd91f83", - "sha256" : "9ea6562812f6127771bc2b86919ea63056fcc0f5c1e556875855c924ee8b1183", - "sha256guix" : "10qiigp29jamb23mdrf1yp0gqmihlsg931ibpiqpf4pn28l5d9ly", - "sha256nix" : "1bzx4gdfc87jfshaqifxpc3llp2j98wkzjjslzwbrqn59jzakxc9", - "sha512" : "c75da25709b6b074812d34dfa5371a6dd53d31f1ce2828c594cf3c62bdd90b421d14f5733782fcaed178db830236eeb87a8ae2fb90e773270222ae64750625d0", - "type" : "tag", - "url" : "https://euandre.org/git/git-permalink/snapshot/git-permalink-v0.2.0.tar.xz", - "version" : "0.2.0", - "vlabel" : "0.2.0", - "vname" : "v0.2.0", - "vversion" : "v0.2.0" - }, - { - "architectures" : "any", - "base-url" : "https://euandre.org/s/td", - "changelog" : "https://euandre.org/s/td/CHANGELOG.html", - "date" : "2022-03-27", - "description" : "Minimalistic bug tracker CLI", - "description-b64" : "TWluaW1hbGlzdGljIGJ1ZyB0cmFja2VyIENMSQ==", - "downloads-page" : "https://euandre.org/s/td/#releases", - "fname" : "td-4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8.tar.xz", - "full-name" : "td", - "homepage" : "https://euandre.org/s/td/", - "i18n" : true, - "inputs" : [], - "label" : "latest", - "license" : "AGPL-3.0-or-later", - "long-description" : "Create and maintain a TODOs.md files as a bug database.\n\nIt is a tool for distributed, offline issue tracking, reified as a simple text\nfile in the repository.", - "long-description-b64" : "Q3JlYXRlIGFuZCBtYWludGFpbiBhIFRPRE9zLm1kIGZpbGVzIGFzIGEgYnVnIGRhdGFiYXNlLgoKSXQgaXMgYSB0b29sIGZvciBkaXN0cmlidXRlZCwgb2ZmbGluZSBpc3N1ZSB0cmFja2luZywgcmVpZmllZCBhcyBhIHNpbXBsZSB0ZXh0CmZpbGUgaW4gdGhlIHJlcG9zaXRvcnku", - "maintainer" : "EuAndreh ", - "maintainer-b64" : "RXVBbmRyZWggPGV1QGV1YW5kcmUub3JnPg==", - "manpages" : true, - "name" : "td", - "native-inputs" : [], - "revision" : "4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8", - "sha256" : "a25561ae8062788bfb79df2de5f26e5f1100638fbeabff934490cdf0a9dde105", - "sha256guix" : "01g1vnlz1kch8j9zzaxyixih04azdvrfabfzg7xqny32h2p62md2", - "sha256nix" : "1xqr2vc270jydk508pbkhcchmbg74w4bf83ch2d85nqja14r64n9", - "sha512" : "59071e6fbe3a70a8c0b435a050f274f768e1476759e8645d960e5f1a12d88f9eab6765b3ecc7a2696a9205f454d6d3ae5a080d63b133b3574baeb48f048a1952", - "type" : "branch", - "url" : "https://euandre.org/git/td/snapshot/td-4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8.tar.xz", - "version" : "main", - "vlabel" : "4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8", - "vname" : "latest", - "vversion" : "4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8" - } - ], - "vcs" : { - "git" : "git://euandre.org/package-repository", - "http" : "https://euandre.org/git/package-repository", - "tarball" : "https://euandre.org/git/package-repository/snapshot/package-repository-main.tar.xz" - } -} diff --git a/src/alpine/git-permalink-0-1-0/APKBUILD b/src/alpine/git-permalink-0-1-0/APKBUILD deleted file mode 100644 index e779a54..0000000 --- a/src/alpine/git-permalink-0-1-0/APKBUILD +++ /dev/null @@ -1,37 +0,0 @@ -# Maintainer: EuAndreh -pkgname='git-permalink' -pkgver='v0.1.0' -pkgrel='0' -pkgdesc='Git extension to generate web permalinks of files in a repository' -url='https://euandre.org/s/git-permalink/' -arch='noarch' -license='AGPL-3.0-or-later' -depends='' -makedepends='' -checkdepends='' -install='' -subpackages='git-permalink-doc' -source='https://euandre.org/git/git-permalink/snapshot/git-permalink-v0.1.0.tar.xz' -pkgbasedir="$startdir/.abuild/pkg" -srcdir="$startdir/.abuild/src" -builddir="$srcdir/git-permalink-v0.1.0" - -build() { - make PREFIX=/usr -} - -check() { - make check -} - -package() { - make install DESTDIR="$pkgdir" PREFIX=/usr -} - -cleanup_srcdir() { - rm -rf "$startdir/.abuild" -} - -sha512sums=' -4d508704333c7c19432a5e021e561e5fe96175631230b09a672cfca984c55ee83dc55e82f4c29e7666db55997ddff59e54fc1d3c4cd72f78dc688fd1dd68a091 git-permalink-v0.1.0.tar.xz -' diff --git a/src/alpine/git-permalink-0-2-0/APKBUILD b/src/alpine/git-permalink-0-2-0/APKBUILD deleted file mode 100644 index ac6adfa..0000000 --- a/src/alpine/git-permalink-0-2-0/APKBUILD +++ /dev/null @@ -1,37 +0,0 @@ -# Maintainer: EuAndreh -pkgname='git-permalink' -pkgver='v0.2.0' -pkgrel='0' -pkgdesc='Git extension to generate web permalinks of files in a repository' -url='https://euandre.org/s/git-permalink/' -arch='noarch' -license='AGPL-3.0-or-later' -depends='' -makedepends='' -checkdepends='' -install='' -subpackages='git-permalink-doc' -source='https://euandre.org/git/git-permalink/snapshot/git-permalink-v0.2.0.tar.xz' -pkgbasedir="$startdir/.abuild/pkg" -srcdir="$startdir/.abuild/src" -builddir="$srcdir/git-permalink-v0.2.0" - -build() { - make PREFIX=/usr -} - -check() { - make check -} - -package() { - make install DESTDIR="$pkgdir" PREFIX=/usr -} - -cleanup_srcdir() { - rm -rf "$startdir/.abuild" -} - -sha512sums=' -c75da25709b6b074812d34dfa5371a6dd53d31f1ce2828c594cf3c62bdd90b421d14f5733782fcaed178db830236eeb87a8ae2fb90e773270222ae64750625d0 git-permalink-v0.2.0.tar.xz -' diff --git a/src/alpine/guile-heredoc/APKBUILD b/src/alpine/guile-heredoc/APKBUILD deleted file mode 100644 index be17531..0000000 --- a/src/alpine/guile-heredoc/APKBUILD +++ /dev/null @@ -1,37 +0,0 @@ -# Maintainer: EuAndreh -pkgname='guile-heredoc' -pkgver='0.0.1_git20221116' -pkgrel='0' -pkgdesc='Guile heredoc syntax' -url='https://euandre.org/s/guile-heredoc/' -arch='noarch' -license='AGPL-3.0-or-later' -depends='' -makedepends='' -checkdepends='' -install='' -subpackages='guile-heredoc-doc' -source='https://euandre.org/git/guile-heredoc/snapshot/guile-heredoc-065435cdce609604e33b879b9be3e81ab89f3e7b.tar.xz' -pkgbasedir="$startdir/.abuild/pkg" -srcdir="$startdir/.abuild/src" -builddir="$srcdir/guile-heredoc-065435cdce609604e33b879b9be3e81ab89f3e7b" - -build() { - make PREFIX=/usr -} - -check() { - make check -} - -package() { - make install DESTDIR="$pkgdir" PREFIX=/usr -} - -cleanup_srcdir() { - rm -rf "$startdir/.abuild" -} - -sha512sums=' -09071e6fbe3a70a8c0b435a050f274f768e1476759e8645d960e5f1a12d88f9eab6765b3ecc7a2696a9205f454d6d3ae5a080d63b133b3574baeb48f048a1952 guile-heredoc-065435cdce609604e33b879b9be3e81ab89f3e7b.tar.xz -' diff --git a/src/alpine/remembering-0-1-2/APKBUILD b/src/alpine/remembering-0-1-2/APKBUILD deleted file mode 100644 index 8309abc..0000000 --- a/src/alpine/remembering-0-1-2/APKBUILD +++ /dev/null @@ -1,37 +0,0 @@ -# Maintainer: EuAndreh -pkgname='remembering' -pkgver='v0.1.2' -pkgrel='0' -pkgdesc='Add memory to dmenu, fzf and similar tools' -url='https://euandre.org/s/remembering/' -arch='noarch' -license='AGPL-3.0-or-later' -depends='' -makedepends='' -checkdepends='' -install='' -subpackages='remembering-doc' -source='https://euandre.org/git/remembering/snapshot/remembering-v0.1.2.tar.xz' -pkgbasedir="$startdir/.abuild/pkg" -srcdir="$startdir/.abuild/src" -builddir="$srcdir/remembering-v0.1.2" - -build() { - make PREFIX=/usr -} - -check() { - make check -} - -package() { - make install DESTDIR="$pkgdir" PREFIX=/usr -} - -cleanup_srcdir() { - rm -rf "$startdir/.abuild" -} - -sha512sums=' -9611c50963e9db2a2732e07e64d4435ececff291bd2302ffca93fbe596144a97cb06b1f464385de19151841b44e0bf151cc92ce28eb01d836e3dfcca05170999 remembering-v0.1.2.tar.xz -' diff --git a/src/alpine/td/APKBUILD b/src/alpine/td/APKBUILD deleted file mode 100644 index 37abdce..0000000 --- a/src/alpine/td/APKBUILD +++ /dev/null @@ -1,37 +0,0 @@ -# Maintainer: EuAndreh -pkgname='td' -pkgver='0.0.1_git20220327' -pkgrel='0' -pkgdesc='Minimalistic bug tracker CLI' -url='https://euandre.org/s/td/' -arch='noarch' -license='AGPL-3.0-or-later' -depends='' -makedepends='' -checkdepends='' -install='' -subpackages='td-doc td-lang' -source='https://euandre.org/git/td/snapshot/td-4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8.tar.xz' -pkgbasedir="$startdir/.abuild/pkg" -srcdir="$startdir/.abuild/src" -builddir="$srcdir/td-4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8" - -build() { - make PREFIX=/usr -} - -check() { - make check -} - -package() { - make install DESTDIR="$pkgdir" PREFIX=/usr -} - -cleanup_srcdir() { - rm -rf "$startdir/.abuild" -} - -sha512sums=' -59071e6fbe3a70a8c0b435a050f274f768e1476759e8645d960e5f1a12d88f9eab6765b3ecc7a2696a9205f454d6d3ae5a080d63b133b3574baeb48f048a1952 td-4a8a7a2662c94b2581f587e9a4b81feba4f5e7d8.tar.xz -' diff --git a/src/bin/paku.in b/src/bin/paku.in deleted file mode 100755 index 71f29c2..0000000 --- a/src/bin/paku.in +++ /dev/null @@ -1,1169 +0,0 @@ -#!/usr/bin/env perl - -use v5.34; -use warnings; -use feature 'signatures'; -no warnings ('experimental::signatures'); -use Scalar::Util qw(looks_like_number); -use Getopt::Std (); - -use JSON (); - -use File::Basename (); -use File::Temp (); -use File::Fetch (); - -use Digest::MD5 (); -use Digest::SHA (); -use MIME::Base64 (); - -sub usage($fh) { - print $fh <<~'EOF' - Usage: - paku [-f FILE] ACTION - paku [-f FILE] -C CONFIG_PATH - paku -h - EOF -} - -sub help($fh) { - print $fh <<~'EOF' - - - Options: - -f FILE use data from FILE (default: paku.lock) - -C CONFIG get the final value of CONFIG_PATH - -h, --help show this message - - ACTION what to emit, one of: - - guix - - debian - - alpine - - nix - - html - - guix-channel-key - - - Generate package definitions for different package managers. - - - Examples: - - Emit Guix package definitions using all defaults: - - $ paku guix > packages.scm - $ guix build -f packages.scm - - - Emit Debian build recipes from "debian.json", and execute - them as is: - - $ paku -f debian.json debian | make -f- - - - Find out what is the final value of "datadir": - - $ paku -C 'datadir' - EOF -} - - -for (@ARGV) { - last if $_ eq '--'; - if ($_ eq '--help') { - usage *STDOUT; - help *STDOUT; - exit; - } -} - -my %opts; -if (!Getopt::Std::getopts('f:C:h', \%opts)) { - usage *STDERR; - exit 2; -} - -if ($opts{h}) { - usage *STDOUT; - help *STDOUT; - exit; -} - - -my $fname = $opts{f} || 'paku.lock'; - - -sub load_json() { - my $json_str = do { - open my $fh, $fname or die "Failed opening \"$fname\""; - local $/; - <$fh>; - }; - return JSON::decode_json($json_str); -} - - - -sub get_in($j, @l) { - my ($head, @tail) = @l; - if (!defined $head) { - return ref $j ? - JSON::encode_json $j : - $j; - } elsif (looks_like_number($head)) { - return get_in($j->[$head], @tail); - } else { - return get_in($j->{$head}, @tail); - } -} - -if ($opts{C}) { - say get_in(load_json(), split(/\./, $opts{C})); - exit; -} - - -my $licenses = { - guix => { - 'AGPL-3.0-or-later' => 'agpl3+', - }, - nix => { - 'AGPL-3.0-or-later' => 'agpl3Plus', - }, -}; -sub license_for($target, $mappings, $id) { - return $mappings->{$id} || $licenses->{$target}->{$id} || $id; -} - -sub inputs_for($mappings, @inputs) { - my @out = (); - for (@inputs) { - if (!$mappings->{$_}) { - push @out, $_; - } else { - push @out, @{$mappings->{$_}}; - } - } - return @out; -} - -sub emit_packages() { - for (@ARGV) { - my $fh; - my $size = (stat($_))[7]; - - open ($fh, '<', $_) or die "Can't open \"$_\": $!"; - my $md5 = Digest::MD5->new->addfile($fh)->hexdigest; - close $fh; - - open ($fh, '<', $_) or die "Can't open \"$_\": $!"; - my $sha1 = Digest::SHA->new(1)->addfile($fh)->hexdigest; - close $fh; - - open ($fh, '<', $_) or die "Can't open \"$_\": $!"; - my $sha256 = Digest::SHA->new(256)->addfile($fh)->hexdigest; - close $fh; - - open ($fh, '<', $_) or die "Can't open \"$_\": $!"; - my $sha512 = Digest::SHA->new(512)->addfile($fh)->hexdigest; - close $fh; - - print `ar -p $_ control.tar.xz | tar -xJO ./control`; - say "Filename: ./$_"; - say "Size: $size"; - say "MD5sum: $md5"; - say "SHA1: $sha1"; - say "SHA256: $sha256"; - print "\n"; - } -} - -sub emit_release() { - my $f = $ARGV[0] or die 'Missing "Packages" file'; - my $name = File::Basename::basename $f; - my $size = (stat($f))[7]; - - my $now = `env LANG=POSIX.UTF-8 date -u '+%a, %d %b %Y %H:%M:%S +0000'`; - chomp $now; - - my $fh; - - open ($fh, '<', $f) or die "Can't open \"$f\": $!"; - my $md5 = Digest::MD5->new->addfile($fh)->hexdigest; - close $fh; - - open ($fh, '<', $f) or die "Can't open \"$f\": $!"; - my $sha1 = Digest::SHA->new(1)->addfile($fh)->hexdigest; - close $fh; - - open ($fh, '<', $f) or die "Can't open \"$f\": $!"; - my $sha256 = Digest::SHA->new(256)->addfile($fh)->hexdigest; - close $fh; - - open ($fh, '<', $f) or die "Can't open \"$f\": $!"; - my $sha512 = Digest::SHA->new(512)->addfile($fh)->hexdigest; - close $fh; - - print <<~EOF; - Date: $now - MD5Sum: - $md5 $size $name - SHA1: - $sha1 $size $name - SHA256: - $sha256 $size $name - SHA512: - $sha512 $size $name - EOF - exit; -} - -sub emit_build_nix() { - my $json = load_json(); - my $ns = $json->{namespace}; - $ns =~ s/\./-/g; - print <<~EOF; - { pkgs ? - import { overlays = [ (import ./default.nix { inherit pkgs; }) ]; } - }: - - map (name: pkgs.$ns."\${name}") - (builtins.attrNames pkgs.$ns) - EOF -} - -sub emit_nix() { - my $json = load_json(); - my $ns = $json->{namespace}; - $ns =~ s/\./-/g; - print <<~EOF; - { pkgs }: - self: super: { - $ns = rec { - EOF - my $license_mapping = $json->{mappings}{nix}{licenses}; - for my $pkg (@{$json->{pkgs}}) { - my $long = $pkg->{'long-description'}; - $long =~ s/^(.)/ $1/gm; - my $license = license_for 'nix', $license_mapping, $pkg->{license}; - - print <<~EOF; - $pkg->{'full-name'} = pkgs.stdenv.mkDerivation rec { - name = "$pkg->{name}"; - version = "$pkg->{vlabel}"; - - src = fetchTarball { - url = - "$pkg->{url}"; - sha256 = "$pkg->{sha256nix}"; - }; - - nativeBuildInputs = with pkgs; [ - EOF - - for my $input (@{$pkg->{'native-inputs'}}) { - print <<~EOF; - $input - EOF - } - print <<~EOF; - ]; - - buildInputs = with pkgs; [ - EOF - for my $input (@{$pkg->{inputs}}) { - print <<~EOF; - $input - EOF - } - print <<~EOF; - ]; - - makeFlags = [ "PREFIX=\$(out)" ]; - - doCheck = true; - enableParallelBuilding = true; - - meta = with pkgs.lib; { - description = "$pkg->{description}"; - longDescription = '' - $long - ''; - homepage = "$pkg->{homepage}"; - changelog = "$pkg->{changelog}"; - downloadPage = "$pkg->{'downloads-page'}"; - license = licenses.$license; - platforms = platforms.unix; - }; - }; - EOF - } - print <<~EOF; - }; - } - EOF -} - -sub emit_guix() { - my $json = load_json(); - my $ns = $json->{namespace}; - $ns =~ s/\./ /g; - print <<~EOF; - (define-module ($ns packages) - EOF - for my $module (@{$json->{guix}{'module-use'}}) { - print <<~EOF; - #:use-module (gnu packages $module) - EOF - } - print <<~EOF; - #:use-module ((guix licenses) #:prefix licenses:) - #:use-module (guix gexp) - #:use-module (guix packages) - #:use-module (guix download) - #:use-module (guix build-system gnu)) - - EOF - - my $pkg_mapping = $json->{mappings}{guix}{packages}; - my $license_mapping = $json->{mappings}{guix}{licenses}; - my @pkgs = (); - for my $pkg (@{$json->{pkgs}}) { - my $long = $pkg->{'long-description'}; - $long =~ s/^(.)/ $1/gm; - my $license = license_for 'guix', $license_mapping, $pkg->{license}; - - push @pkgs, $pkg->{'full-name'}; - print <<~EOF; - (define-public $pkg->{'full-name'} - (package - (name "$pkg->{name}") - (version "$pkg->{vlabel}") - (source - (origin - (method url-fetch) - (uri "$pkg->{url}") - (sha256 - (base32 "$pkg->{sha256guix}")))) - (build-system gnu-build-system) - (native-inputs - EOF - - print ' (list'; - for (inputs_for $pkg_mapping, @{$pkg->{'native-inputs'}}) { - print "\n $_"; - } - print "))\n"; - - print " (inputs\n"; - print ' (list'; - for (inputs_for $pkg_mapping, @{$pkg->{inputs}}) { - print "\n $_"; - } - print "))\n"; - - print <<~EOF; - (arguments - (list - #:make-flags #~(list (string-append "PREFIX=" #\$output)) - #:phases - #~(modify-phases %standard-phases - (delete 'configure)))) - (synopsis "$pkg->{description}") - (description - "$pkg->{'long-description'}") - (home-page "$pkg->{homepage}") - (license licenses:$license))) - - EOF - } - print '(list'; - for (@pkgs) { - print "\n $_"; - } - print ")\n"; -} - -sub emit_guix_channel_key() { - my $json = load_json(); - my $name = $json->{maintainer}{name}; - my $id = $json->{maintainer}{email}; - print <<~EOF; - .POSIX: - - $name.key: - gpg --armour --export $id > \$\@ - EOF -} - -sub emit_debian() { - my $json = load_json(); - my @debs = (); - my @targets = (); - - for my $pkg (@{$json->{pkgs}}) { - push @targets, <<~EOF; - \$(DIR)/debian/tarballs/$pkg->{fname}: - mkdir -p \$(\@D) - wget -O \$\@ \\ - '$pkg->{url}' - - \$(DIR)/debian/builddirs/$pkg->{name}-$pkg->{vversion}: \$(DIR)/debian/tarballs/$pkg->{fname} - mkdir -p \$(\@D) - tar -C \$(\@D) -xf \$(DIR)/debian/tarballs/$pkg->{fname} - touch \$\@ - - EOF - - - next if $pkg->{architectures} ne 'any'; - - - my $deb_name = "$pkg->{name}_" . ( - $pkg->{label} eq 'latest' ? 'latest' : $pkg->{vversion} - ) . "_all.deb"; - my $deb_path = "\$(DIR)/debian/public/$deb_name"; - - push @debs, "\t$deb_path \\\n"; - - my $ver = $pkg->{label} eq 'latest' ? '0.' . $pkg->{vversion} . '.latest' : $pkg->{vversion}; - $ver =~ s/^v//; - - push @targets, <<~EOF; - \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}/DEBIAN: \$(DIR)/debian/builddirs/$pkg->{name}-$pkg->{vversion} - \$(MAKE) \\ - -C \$(DIR)/debian/builddirs/$pkg->{name}-$pkg->{vversion} \\ - install \\ - PREFIX=/usr \\ - DESTDIR="\$\$PWD"/\$(\@D) - mkdir -p \$\@ - touch \$\@ - - \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}/DEBIAN/control: \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}/DEBIAN - printf '' > \$\@ - printf 'Package: $pkg->{name}\\n' >> \$\@ - printf 'Version: $ver\\n' >> \$\@ - printf 'Section: custom\\n' >> \$\@ - printf 'Depends:\\n' >> \$\@ - printf 'Priority: optional\\n' >> \$\@ - printf 'Architecture: all\\n' >> \$\@ - printf 'Essential: no\\n' >> \$\@ - - printf 'Maintainer: ' >> \$\@ - printf '$pkg->{"maintainer-b64"}' | base64 -d >> \$\@ - printf '\\n' >> \$\@ - - printf 'Description: ' >> \$\@ - printf '$pkg->{"description-b64"}' | base64 -d >> \$\@ - printf '\\n' >> \$\@ - - printf '$pkg->{'long-description-b64'}' | \\ - base64 -d | \\ - sed 's|^\$\$|.|' | \\ - sed 's|^| |' >> \$\@ - printf '\\n' >> \$\@ - - \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}.deb: \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}/DEBIAN/control - dpkg-deb --build \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion} - - $deb_path: \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}.deb - mkdir -p \$(\@D) - cp \$(DIR)/debian/destdirs/$pkg->{name}-$pkg->{vversion}.deb \$\@ - - - EOF - } - - - print <<~EOF; - .POSIX: - - DIR = $json->{datadir} - - debs = \\ - EOF - print @debs, "\n"; - print <<~EOF; - GPGKEY = '$json->{maintainer}{name} <$json->{maintainer}{email}>' - - - all: \\ - \$(DIR)/debian/public/InRelease \$(DIR)/debian/public/Release.gpg \\ - \$(DIR)/debian/public/public-key.asc debian.out.txt - - debian.out.txt: - \@printf '\$(DIR)/debian/public/*\\n' > \$\@ - - - \$(DIR)/debian/public/Packages: \$(debs) - cd \$(\@D) && paku debian-packages *.deb > \$(\@F) - - \$(DIR)/debian/public/Release: \$(DIR)/debian/public/Packages - paku debian-release \$(DIR)/debian/public/Packages > \$\@ - - \$(DIR)/debian/public/Release.gpg: \$(DIR)/debian/public/Release - gpg -abs -o \$\@ \$(DIR)/debian/public/Release - - \$(DIR)/debian/public/InRelease: \$(DIR)/debian/public/Release - gpg --default-key \$(GPGKEY) -a --clear-sign -o \$\@ \$(DIR)/debian/public/Release - - \$(DIR)/debian/public/public-key.asc: \$(debs) - gpg --armour --export \$(GPGKEY) > \$\@ - - - EOF - print @targets; -} - -sub emit_alpine() { - my $d = $ARGV[0] or die 'Missing "src/alpine/" directory'; - my $json = load_json(); - for my $pkg (@{$json->{pkgs}}) { - my @subpackages = (); - if ($pkg->{manpages}) { - push @subpackages, "$pkg->{name}-doc"; - } - if ($pkg->{i18n}) { - push @subpackages, "$pkg->{name}-lang"; - } - - my $date = $pkg->{date} =~ s/-//gr; - my $ver = $pkg->{label} eq 'latest' ? "0.0.1_git$date" : $pkg->{vversion}; - my $dir = "$d/$pkg->{'full-name'}"; - mkdir "$dir"; - open(my $fh, '>', "$dir/APKBUILD"); - print $fh <<~EOF; - # Maintainer: $pkg->{maintainer} - pkgname='$pkg->{name}' - pkgver='$ver' - pkgrel='0' - pkgdesc='$pkg->{description}' - url='$pkg->{homepage}' - arch='noarch' - license='$pkg->{license}' - depends='' - makedepends='' - checkdepends='' - install='' - subpackages='@subpackages' - source='$pkg->{url}' - pkgbasedir="\$startdir/.abuild/pkg" - srcdir="\$startdir/.abuild/src" - builddir="\$srcdir/$pkg->{name}-$pkg->{vversion}" - - build() { - make PREFIX=/usr - } - - check() { - make check - } - - package() { - make install DESTDIR="\$pkgdir" PREFIX=/usr - } - - cleanup_srcdir() { - rm -rf "\$startdir/.abuild" - } - - sha512sums=' - $pkg->{sha512} $pkg->{fname} - ' - EOF - close $fh; - } - my @apks = (); - my @targets = (); - - for my $pkg (@{$json->{pkgs}}) { - next if $pkg->{architectures} ne 'any'; - - my $date = $pkg->{date} =~ s/-//gr; - my $ver = $pkg->{label} eq 'latest' ? "0.0.1_git$date" : $pkg->{vversion}; - - my $recipe_dir = "src/alpine/$pkg->{'full-name'}/"; - my $apk_name = "$pkg->{name}-$ver-r0.apk"; - my $apk_path = "\$(DIR)/alpine/REPODEST/alpine/x86_64/$apk_name"; - - push @apks, "\t$apk_path \\\n"; - - push @targets, <<~EOF; - $apk_path: $recipe_dir/APKBUILD - cd $recipe_dir && abuild \\ - -s \$\$OLDPWD/\$(DIR)/alpine/SRCDEST \\ - -P \$\$OLDPWD/\$(DIR)/alpine/REPODEST \\ - sanitycheck clean fetch verify unpack build check rootpkg index clean - - EOF - } - - - print <<~EOF; - .POSIX: - - DIR = $json->{datadir} - RSAKEY = $json->{maintainer}{email} - - - apks = \\ - EOF - - print @apks, "\n"; - print "\n\n"; - print <<~EOF; - all: \$(apks) \$(DIR)/alpine/REPODEST/alpine/\$(RSAKEY).rsa.pub alpine.out.txt - - alpine.out.txt: - \@printf '\$(DIR)/alpine/REPODEST/alpine/*\\n' > \$\@ - - \$(apks): src/secrets/\$(RSAKEY).rsa - - \$(DIR)/alpine/REPODEST/alpine/\$(RSAKEY).rsa.pub: src/secrets/\$(RSAKEY).rsa - mkdir -p \$(\@D) - cp src/secrets/\$(RSAKEY).rsa.pub \$\@ - - src/secrets/\$(RSAKEY).rsa: src/secrets/\$(RSAKEY).rsa.gpg - gpg -d -o \$\@ \$\@.gpg - chmod 400 \$\@ - - EOF - print @targets; -} - -sub pascal_case($s) { - return join('', map(ucfirst, split '-', $s)) -} - -sub emit_homebrew() { - my $d = $ARGV[0] or die 'Missing "Formula/" directory'; - my $json = load_json(); - for my $pkg (@{$json->{pkgs}}) { - open(my $fh, '>', "$d/$pkg->{'full-name'}.rb"); - my $class_name = pascal_case $pkg->{'full-name'}; - print $fh <<~EOF; - class $class_name < Formula - desc '$pkg->{description}' - homepage '$pkg->{homepage}' - url '$pkg->{url}' - sha256 '$pkg->{sha256}' - license 'AGPL-3.0-or-later' - - def install - system 'make', "PREFIX=#{prefix}" - system 'make', 'check', "PREFIX=#{prefix}" - system 'make', 'install', "PREFIX=#{prefix}" - end - - test do - system "#{bin}/$pkg->{name}", '-V' - end - end - EOF - close $fh; - } -} - -sub emit_html() { - my $json = load_json(); - print <<~EOF; - - - - - - - $json->{name} package index - - - - -
-

- $json->{name} package index -

-
    - EOF - - for my $pkg (@{$json->{pkgs}}) { - my $guix_suffix = $pkg->{label} eq 'latest' ? '' : "\@$pkg->{version}"; - my $apt_suffix = $pkg->{label} eq 'latest' ? '' : "=$pkg->{label}"; - my $id = $pkg->{name} . ( - $pkg->{label} eq 'latest' ? '' : "-$pkg->{vversion}" - ); - print <<~EOF; -
  • -
    - - $pkg->{name} - ($pkg->{vname}) - $pkg->{description} - -

    - Homepage -

    -
    -

    Guix

    -

    - After following the - Guix instructions - to include this channel, you can launch a shell - that includes this package: -

    -
    \$ guix shell $pkg->{name}$guix_suffix
    -

    - Alternatively, you can install it imperatively: -

    -
    \$ guix install $pkg->{name}$guix_suffix
    -
    -
    -

    Debian

    -

    - After following the - Debian instructions - to include this repository to - /etc/apt/sources.list, you can - install it: -

    -
    # apt install $pkg->{name}$apt_suffix
    -
    -
    -

    Alpine

    -

    - After folowwing the - Alpine instructions - to include this repository to - /etc/apk/repositories, you can - install it: -

    -
    # apk add $pkg->{name}
    -
    -
    -

    Nix

    -

    - After following the - Nix instructions - to include this repository as an overlay, you - can launch a shell that includes this package: -

    -
    \$ nix-shell -p $pkg->{'full-name'}
    -

    - Alternatively, you can install it imperatively: -

    -
    \$ nix-env -i $pkg->{'full-name'}
    -
    -
    -

    Homebrew

    -

    - After following the - Homebrew instructions - to include this repository as a tap, you can - install it with: -

    -
    \$ brew install $pkg->{'full-name'}
    -
    -
    -
  • - EOF - } - - my $channel_name = $json->{namespace} =~ s/\./-/gr; - my $overlay_name = $json->{namespace} =~ s/\./-/gr; - my $tap_name = $json->{namespace} =~ s/\./\//gr; - print <<~EOF; -
-
-

Guix instructions

-

- Add this channel to your - ~/.config/guix/channels.scm: -

-
(cons*
-		 (channel
-		  (name '$channel_name)
-		  (url "$json->{vcs}->{git}")
-		  (branch "main")
-		  (introduction
-		   (make-channel-introduction
-		    "d749e053e6db365069cb9b2ef47a78b06f9e7361"
-		    (openpgp-fingerprint
-		     "5BDA E9B8 B2F6 C6BC BB0D  6CE5 81F9 0EC3 CD35 6060"))))
-		 %default-channels)
-

- Afterwards, do a guix pull to make the - packages in this channel available to your profile. -

-

- See also the - Guix manual on channels - for more information. -

-
-
-

Debian instructions

-

- Include my public key for validating the repository - signatures: -

-
\$ wget -qO- $json->{'base-url'}/debian/public-key.asc |
-		    sudo tee /etc/apt/trusted.gpg.d/$json->{namespace}.asc
-

- Afterwards, include this repository to the list of - repositories that apt(8) uses for sources - by adding its URL to - /etc/apt/sources.list: -

-
\$ echo 'deb $json->{'base-url'}/debian ./' |
-		    sudo tee -a /etc/apt/sources.list
-		\$ sudo apt update
-

- After that the packages from this repository will - be available. -

-
-
-

Alpine instructions

-

- Get my public key used to sign the repository: -

-
\$ wget -qO- $json->{'base-url'}/alpine/$json->{maintainer}{email}.rsa.pub |
-		    doas tee /etc/apk/keys/$json->{maintainer}{email}.rsa.pub
-

- Then include this repository in the - apk-repositories(5) list that - apk(8) uses to retrive package files for - installation: -

-
\$ echo '$json->{'base-url'}/alpine' |
-		    doas tee -a /etc/apk/repositories
-

- After that the packages frmo this repository will be - available. -

-
-
-

Nix instructions

-

- Add this repository as an overlay to your - /etc/nixos/configuration.nix: -

-
  nixpkgs = {
-		    overlays = [
-		      (import (fetchTarball {
-		        url = "$json->{vcs}->{tarball}";
-		      }) { inherit pkgs; })
-		    ];
-		  };
-

- All the packages live under the - $overlay_name attribute set, like. - $overlay_name.$json->{pkgs}[0]->{name}, - so it can be included in the list of packages: -

-
  environment.systemPackages = with pkgs; [
-		    ...
-		    $overlay_name.$json->{pkgs}[0]->{name}
-		  ];
-

- To make the overlay available outside the system - environment of - /etc/nixos/configuration.nix, you need to - add this overlay to your - ~/.config/nixpkgs/overlays/ directory, - like a - ~/.config/nixpkgs/overlays/$json->{namespace}.nix - file containing: -

-
import (fetchTarball {
-		  url = "$json->{vcs}->{tarball}";
-		}) { pkgs = import <nixpkgs> {}; }
-

- Then you'd be able to launch a shell with a package - from this overlay: -

-
\$ nix-shell -p $overlay_name.$json->{pkgs}[0]->{name}
-
-
-

Homebrew instructions

-

- Add this repository as a tap: -

-
\$ brew tap --force-auto-update $tap_name $json->{vcs}->{http}
-

- The explicit --force-auto-update option - is required, because homebrew(1) will only - fetch updates automatically for repositories hosted on - GitHub. With this option, repositories not on GitHub - are treated equally. -

-
-
- - - EOF -} - - -sub run_template($name, $version, $template) { - return ($template =~ s/\@name\@/$name/gr) =~ s/\@version\@/$version/gr; -} - -sub set_difference($s1, $s2) { - my %idx = (); - for (@{$s1}) { - $idx{$_} = 1; - } - for (@{$s2}) { - delete $idx{$_}; - } - return keys(%idx); -} - -sub emit_refresh() { - my $json_str = do { - local $/; - ; - }; - my $json = JSON::decode_json($json_str); - - my $defaults = { - datadir => '.paku', - guix => {}, - mappings => {}, - maintainer => { - name => '', - email => '', - }, - namespace => '', - name => '', - 'base-url' => '', - vcs => { - git => '', - http => '', - tarball => '', - }, - pkgs => [], - }; - my $out = { - %$defaults, - %$json, - }; - - my $default_package = { - maintainer => $out->{defaults}{maintainer} || '', - 'exclude-tags' => [], - }; - for my $package_any (@{$out->{packages}{any}}) { - my $package = ref $package_any ? - { %$default_package, %$package_any } : - { %$default_package, name => $package_any }; - - my $repo_url = run_template($package->{name}, '', $out->{defaults}{templates}{repository}); - my $dir = File::Temp::newdir(); - `git clone '$repo_url' '$dir'`; - die if $?; - - my @versions = (); - my $tags_any = $package->{tags} || $out->{defaults}{versions}{tags}; - my @tags = (); - if (ref $tags_any) { - push @tags, @$tags_any; - } elsif ($tags_any eq 'all') { - my @ret = `git -C '$dir' tag`; - die if $?; - chomp @ret; - - push @tags, set_difference(\@ret, $package->{'exclude-tags'}); - } else { - die "Unknown value of \"tags\": $tags_any"; - } - - for (@tags) { - my $ver = $_ =~ s/^v//gr; - my %version = ( - type => 'tag', - vversion => $_, - version => $ver, - vname => $_, - vlabel => $ver, - label => $ver =~ s/\./-/gr, - ); - push @versions, \%version; - } - - my $default_branch = - $package->{default_branch} || - $out->{defaults}{default_branch} || - 'main'; - my $branches = $package->{branches} || $out->{defaults}{versions}{branches}; - for (@{$branches}) { - my $revision = `git -C '$dir' rev-parse '$_'`; - die if $?; - chomp $revision; - - my $label = $_ eq $default_branch ? 'latest' : $_; - - my %version = ( - type => 'branch', - vversion => $revision, - version => $_, - vname => $label, - vlabel => $revision, - label => $label, - ); - push @versions, \%version; - } - - for my $version (@versions) { - my $pkg = { - %$version, - name => $package->{name}, - architectures => 'any', - }; - - my $full_name = $pkg->{name} . ( - $pkg->{label} eq 'latest' ? '' : "-$pkg->{label}" - ); - $pkg->{'full-name'} = $full_name; - - my $revision = `git -C '$dir' rev-parse '$pkg->{vversion}'`; - die if $?; - chomp $revision; - $pkg->{revision} = $revision; - - `git -C '$dir' checkout '$pkg->{vversion}'`; - die if $?; - my $url = run_template($package->{name}, $pkg->{vversion}, $out->{defaults}{templates}{tarball}); - $pkg->{url} = $url; - - my $date = `git -C '$dir' log -1 --format=%cs`; - die if $?; - chomp $date; - $pkg->{date} = $date; - - $pkg->{manpages} = -d "$dir/doc/" ? JSON::true : JSON::false; - $pkg->{i18n} = -d "$dir/po/" ? JSON::true : JSON::false; - - for (qw(description long-description)) { - my $s = do { local(@ARGV, $/) = "$dir/$_"; <> }; - chomp $s; - $pkg->{$_} = $package->{$_} || $s; - } - - my @sha_guix = `guix download '$url'`; - die if $?; - chomp @sha_guix; - $pkg->{sha256guix} = $sha_guix[-1]; - - my $sha_nix = `nix-prefetch-url --unpack '$url'`; - die if $?; - chomp $sha_nix; - $pkg->{sha256nix} = $sha_nix; - - - my $ff = File::Fetch->new(uri => $url); - my $where = $ff->fetch(to => '/tmp'); - my $fh; - - open ($fh, '<', $where) or die "Can't open \"$where\": $!"; - my $sha256 = Digest::SHA->new(256)->addfile($fh)->hexdigest; - close $fh; - $pkg->{sha256} = $sha256; - - open ($fh, '<', $where) or die "Can't open \"$where\": $!"; - my $sha512 = Digest::SHA->new(512)->addfile($fh)->hexdigest; - close $fh; - $pkg->{sha512} = $sha512; - - unlink $where; - - - for (qw(base-url homepage changelog downloads-page fname)) { - $pkg->{$_} = $package->{$_} || - run_template( - $pkg->{name}, - $pkg->{vversion}, - $out->{defaults}{templates}{$_} - ); - } - - for (qw(inputs native-inputs)) { - $pkg->{$_} = $package->{$_} || []; - } - - for (qw(maintainer license)) { - $pkg->{$_} = $package->{$_} || $out->{defaults}{$_}; - } - - for (qw(maintainer description long-description)) { - $pkg->{"$_-b64"} = MIME::Base64::encode_base64($pkg->{$_}, ''); - } - - push @{$out->{pkgs}}, $pkg; - } - } - print JSON->new->pretty->canonical->encode($out); -} - - -my %actions = ( - 'debian-packages' => \&emit_packages, - 'debian-release' => \&emit_release, - 'build-nix' => \&emit_build_nix, - nix => \&emit_nix, - guix => \&emit_guix, - 'guix-channel-key' => \&emit_guix_channel_key, - debian => \&emit_debian, - alpine => \&emit_alpine, - homebrew => \&emit_homebrew, - html => \&emit_html, - refresh => \&emit_refresh, -); - -my $action = $ARGV[0] or die "Missing ACTION"; -shift; -my $fn = $actions{$action} or die "Unknown ACTION: \"$action\""; -&$fn; diff --git a/src/org/euandre/packages.scm b/src/org/euandre/packages.scm index d4e7e77..e1adef9 100644 --- a/src/org/euandre/packages.scm +++ b/src/org/euandre/packages.scm @@ -1,1457 +1,178 @@ (define-module (org euandre packages) - #:use-module ((gnu build linux-container) #:prefix container:) + #:use-module ((im papo packages) #:prefix pkgs:) #:use-module ((guix licenses) #:prefix licenses:) - #:use-module ((guix transformations) #:prefix transformations:) - #:use-module ((ice-9 match) #:prefix m:) - #:use-module ((ice-9 textual-ports) #:prefix textual-ports:) - #:use-module ((org euandre queue) #:prefix q:) - #:use-module ((srfi srfi-1) #:prefix s1:) #:use-module (gnu) #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) #:use-module (guix git-download) - #:use-module (guix least-authority) #:use-module (guix packages) - #:use-module (guix records) #:use-module (guix utils) - #:export ( - syskeep-configuration - make-syskeep-configuration - syskeep-configuration? - syskeep-configuration-package - syskeep-configuration-log-file - - - transactor-configuration - make-transactor-configuration - transactor-configuration? - transactor-configuration-package - transactor-configuration-user - transactor-configuration-group - transactor-configuration-port - transactor-configuration-log-file - transactor-configuration-data-directory - transactor-configuration-run-in-container? - transactor-configuration-container-name - - - git-configuration - make-git-configuration - git-configuration? - git-configuration-package - git-configuration-user - git-configuration-group - git-configuration-export-all? - git-configuration-base-path - git-configuration-user-path - git-configuration-run-in-container? - git-configuration-container-name - - - binder-configuration - make-binder-configuration - binder-configuration? - binder-configuration-name - binder-configuration-package - binder-configuration-user - binder-configuration-group - binder-configuration-log-file - binder-configuration-data-directory - binder-configuration-run-directory - binder-configuration-run-in-container? - binder-configuration-container-name - binder-configuration-options - binder-configuration-listen-socket - binder-configuration-upstream-socket - - - glaze-configuration - make-glaze-configuration - glaze-configuration? - glaze-configuration-name - glaze-configuration-package - glaze-configuration-user - glaze-configuration-group - glaze-configuration-log-file - glaze-configuration-data-directory - glaze-configuration-run-directory - glaze-configuration-run-in-container? - glaze-configuration-container-name - glaze-configuration-options - glaze-configuration-listen-socket - glaze-configuration-upstream-socket - - - hsts-configuration - make-hsts-configuration - hsts-configuration? - hsts-configuration-name - hsts-configuration-package - hsts-configuration-user - hsts-configuration-group - hsts-configuration-log-file - hsts-configuration-data-directory - hsts-configuration-run-directory - hsts-configuration-run-in-container? - hsts-configuration-container-name - hsts-configuration-options - hsts-configuration-listen-socket - hsts-configuration-upstream-socket - - - untls-configuration - make-untls-configuration - untls-configuration? - untls-configuration-name - untls-configuration-package - untls-configuration-user - untls-configuration-group - untls-configuration-log-file - untls-configuration-data-directory - untls-configuration-run-directory - untls-configuration-run-in-container? - untls-configuration-container-name - untls-configuration-options - untls-configuration-listen-socket - untls-configuration-upstream-socket - - - wscat-configuration - make-wscat-configuration - wscat-configuration? - wscat-configuration-name - wscat-configuration-package - wscat-configuration-user - wscat-configuration-group - wscat-configuration-log-file - wscat-configuration-data-directory - wscat-configuration-run-directory - wscat-configuration-run-in-container? - wscat-configuration-container-name - wscat-configuration-options - wscat-configuration-listen-socket - wscat-configuration-upstream-socket - - - cicd-configuration - make-cicd-configuration - cicd-configuration? - cicd-configuration-name - cicd-configuration-package - cicd-configuration-user - cicd-configuration-group - cicd-configuration-log-file - cicd-configuration-data-directory - cicd-configuration-run-directory - cicd-configuration-run-in-container? - cicd-configuration-container-name - - - papod-configuration - make-papod-configuration - papod-configuration? - papod-configuration-name - papod-configuration-package - papod-configuration-user - papod-configuration-group - papod-configuration-log-file - papod-configuration-data-directory - papod-configuration-run-directory - papod-configuration-run-in-container? - papod-configuration-container-name - papod-configuration-options - papod-configuration-listen-socket - papod-configuration-upstream-socket - - fmt - str - service-type-for)) + #:export ()) (use-package-modules - admin - base - bittorrent - gawk - guile - java - sqlite - texinfo - version-control) -(use-service-modules - admin - mcron - shepherd - sysctl) - + compiler-tools + gcc + video + xml) +(use-service-modules) -(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)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Config ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(define-public (str . rest) - (apply string-append rest)) +(define +working-dir+ + (dirname (dirname (dirname (current-source-directory))))) -(define-public (fmt . rest) - (apply format #f rest)) +(define +tld+ + (string-trim-right + (pkgs:slurp + (pkgs:str +working-dir+ "/tld.txt")))) -(define-public mktorrent-latest - ((transformations:options->transformation - '((with-commit . "mktorrent=de7d011b35458de1472665f50b96c9cf6c303f39"))) - mktorrent)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;; Package definition functions ;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(define-public (pkg name version checksum) +(define (hunspell-dictionary-utf8 dict-name) (package - (name name) - (version version) + (name + (string-append "hunspell-dict-" dict-name "-utf8")) + (version "630b34e6f8f3cbe7aa7b27b6d8ab118e27252fd1") (source (origin (method git-fetch) (uri (git-reference - (url - (str "git://euandre.org/" name)) + (url "https://github.com/wooorm/dictionaries") (commit version))) - (sha256 - (base32 checksum)) (file-name - (git-file-name name version)))) - (build-system gnu-build-system) + (git-file-name "hunspell-dictionary-utf8" version)) + (sha256 + (base32 "1iknwzh5h04m067ddw9hlzc1qqj4mr9mdkcfapsnay304laaiyn5")))) + (build-system trivial-build-system) (arguments - (list - #:strip-binaries? #f - #:make-flags - #~(list - "-e" - (string-append "CC=" #$(cc-for-target)) - (string-append "PREFIX=" #$output) - (string-append "VERSION=" #$version)) - #:phases - #~(modify-phases %standard-phases - (delete 'configure)))) - (synopsis #f) ;; FIXME: get - (description #f) ;; from tarball! - (home-page (str "https://euandre.org/s/" name "/")) - (license licenses:agpl3+))) - - -(define-public eut - (pkg - "eut" - "ec7e36c2eb4a05c188fd222a1a775ef6f55be6b8" - "1knz14jkx8yc7fv5m2apshfsn3xym55vb78wx3kgq061jy58nxfd")) - -(define-public remembering - (pkg - "remembering" - "e1570edd3cdaa040f9664adb315f72e33f8b67c2" - "0y20flrbjh5gbbzl7h3rimg8jwy2ikgkj03yxclj8qg8mq2f9f4a")) - -(define-public cage - (pkg - "cage" - "c0482531fc16a55715b759b695d27d555d927ab8" - "1v5m7xqfb14y283mlc2kd714hnih1dwcmjcf4i6j52pphjscilys")) - -(define-public nicely - (pkg - "nicely" - "8c963ba56495a382480ab96423df22beb19cb592" - "0c9vqjxlh4gjh09pavs5dscgxcnbii7jp1d8v0jhq3qjz9lf3k2w")) - -(define-public q - (pkg - "q" - "d13bcb36bc84de95ebb9e8c27605c09b08c35cc5" - "1jbg9f6dwkkcjxbhc3a1pnaas6xgd1f0hiv95h6hchgs88phwssl")) - -(define-public syskeep - (pkg - "syskeep" - "2215cc0999e43b32751bc493f2fe9d2e8c822170" - "0p38fb8m35kjp9fj7bmwcayf9r4638q5fcin18ny7y65scij4jbb")) - -(define-public backupit - (pkg - "backupit" - "331f37ba29b1cb317b9bf1984e0efce40b14c03f" - "1zhwp1widxghjimg838fp7mffrsj97a5w22fy0ydr0pzh3rjzs23")) - -(define-public cicd - (pkg - "cicd" - "63d46fe31f3ae7b7eed1a2c801448160fe9e77d8" - "00brrbm6s45nqpbw2sigcwjwj2dgyl0rvagmgrgj930y9qv2nn31")) - -(define-public guile-heredoc + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let ((source-prefix (string-append (assoc-ref %build-inputs "source") + "/dictionaries/" + ,dict-name + "/index")) + (install-prefix (string-append %output "/share/hunspell/"))) + (mkdir-p install-prefix) + (copy-file (string-append source-prefix ".aff") + (string-append install-prefix ,dict-name ".aff")) + (copy-file (string-append source-prefix ".dic") + (string-append install-prefix ,dict-name ".dic")))))) + (synopsis (string-append "Hunspell " dict-name " dictionary in UTF-8")) + (description (string-append "Hunspell " dict-name " dictionary in UTF-8")) + (license licenses:expat) + (home-page "https://github.com/wooorm/dictionaries"))) + + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Inherited packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define-public gm2 (package - (inherit - (pkg - "guile-heredoc" - "065435cdce609604e33b879b9be3e81ab89f3e7b" - "179qq17mgi4kakhj9w1dk26afljh5yad4j9ih9d8wms70x6h211m")) + (inherit gcc) + (name "gm2") + (arguments + (substitute-keyword-arguments (package-arguments gcc) + ((#:modules modules %default-gnu-modules) + (append '((ice-9 regex)) + modules)) + ((#:configure-flags flags) + #~(append + '("--enable-languages=m2") + (filter (lambda (s) + (not (string-match "--enable-languages.*" s))) + #$flags))))) (native-inputs - (list - guile-3.0 - texinfo)))) + (modify-inputs (package-native-inputs gcc) + (append flex))))) -(define-public adoc +(define-public ffmpegx (package - (inherit - (pkg - "adoc" - "fab32a816259c943802ffa4c041ac63ac34e646a" - "04sk5bafw2h969v4fl9qzc67m4sjdlrw87xdliv7rny7v9d53zi8")) - (propagated-inputs - (append - (format-inputs (list eut)) - (normalize-inputs '(ruby-asciidoctor tidy-html)))))) - -(define-public eslaides - (pkg - "eslaides" - "40eb0452fd7689d1c40e4d53c1473fd42195cc49" - "0g4qdcfmk8asi1fzr1yk8khpngg9cg21i14xblxfisqsfaq5jycb")) - -(define-public mkwb - (package - (inherit - (pkg - "mkwb" - "1c36a265c6b34c28c424eb0bc11ba3b0f9b932d0" - "1w8f3rsncxrb383i7pwg8bxrijvvg7q2l6b0fgjfdv1rs4xzlmqw")) - (propagated-inputs - (format-inputs (list eut adoc eslaides))))) - -(define-public (mkwbsite pkg) - (package - (inherit pkg) - (native-inputs - (append - (format-inputs (list mkwb mktorrent-latest)) - (normalize-inputs '(gnupg jq rsync po4a gettext ghostscript moreutils)))) + (inherit ffmpeg) + (name "ffmpegx") (arguments - (substitute-keyword-arguments (package-arguments pkg) - ((#:phases phases) - #~(modify-phases #$phases - (add-before 'build 'sethome-ghostscript - (lambda _ - (setenv "HOME" (getcwd)))))))))) - -(define-public euandre.org - (mkwbsite - (pkg - "euandre.org" - "6e493d66649925fccaa351f65ee6cac2dedf264f" - "05isnj2mmwg6k1qd94r3yaycy556f5d7br3f2vdmriqazrgj0grg"))) - -(define-public papo.im - (mkwbsite - (pkg - "papo.im" - "fa07fa576e07b4cc6b7c9123bd3a6c91e6afc609" - "084w89v15nmr45nv9av8pz7iq99aw3ggaxr0gzqfjbskb3wvvkml"))) - -(define-public datomic - (let ((p (pkg - "datomic" - "13edba0fa2bd4c3847160809499ce837f52d1264" - "158sqawmbszawa132bhfghzlkhd3b0bicdg5dr93v56vvm4i25kl"))) - (package - (inherit p) - (arguments - (substitute-keyword-arguments (package-arguments p) - ((#:phases phases) - #~(modify-phases #$phases - (add-after 'install 'wrap-program - (lambda* _ - (wrap-program - (string-append #$output "/bin/transactor") - `("PATH" ":" = - (,(string-append #$coreutils "/bin") - ,(string-append #$gawk "/bin") - ,(string-append #$openjdk23 "/bin") - ,(string-append #$sed "/bin") - ,(string-append #$sqlite-next "/bin"))))))))))))) - - - -(define-public (format-inputs l) - (map (lambda (p) - (list (package-name p) - p - "out")) - l)) - -(define-public (normalize-inputs l) - (map (compose (lambda (l) - (cons (package-name (car l)) - l)) - list - specification->package+output - symbol->string) - l)) - -(define-public (gopkgbs name inputs version checksum) - (let ((p (pkg name version checksum))) - (package - (inherit p) - (arguments - (substitute-keyword-arguments (package-arguments p) - ((#:phases phases) - #~(modify-phases #$phases - (add-before 'build 'setenv-golang - (lambda _ - (define (path->flags option) - (let ((search-path (getenv "GOLIBPACKPATH"))) - (string-join - (map (lambda (path) - (string-append option " " path)) - (if search-path - (string-split search-path #\:) - '())) - " "))) - (setenv "GOCFLAGS" (path->flags "-I")) - (setenv "GOLDFLAGS" (path->flags "-L")))))))) - (native-inputs - (append - (format-inputs - (list - eut - q:gol)) - (normalize-inputs - '(gettext - po4a - ruby-asciidoctor)) - inputs)) - (native-search-paths - (list - (search-path-specification - (variable "GOLIBPACKPATH") - (files - (list "lib/go")))))))) - - -(define-public gotext - (gopkgbs - "gotext" - (format-inputs (list)) - "25af4baaab8db74ba809c863e93dd56e6ffb23ed" - "1cwh5fc45dii6mpg4fr6a3fdqy37ib63ax8srfhr9jwzw6majha2")) - -(define-public uuid - (gopkgbs - "uuid" - (format-inputs (list gotext)) - "8cba50466b837d2f4149ca22d6645f6d6127c63a" - "139d8vwd9l6hha2cc5skhh799c5b0n1l0dkp8r8m6nisla8bpals")) - -(define-public gobang - (gopkgbs - "gobang" - (format-inputs (list gotext uuid)) - "79011564903bd53bb036dea4c1f0745e40efb73c" - "1rjnvz2wznkxcdhdf0h6mvza2wj2hpirb4vzjxs49g7mfhsp394h")) - - -(define-public (gopkg name inputs version checksum) - (gopkgbs - name - (append inputs (format-inputs (list gotext uuid gobang))) - version - checksum)) - - -(define-public pds - (gopkg - "pds" - (format-inputs (list)) - "aa855d0dc1c62094d0fbf750f60b5b9f776b47d2" - "0k10pqqz0pmd4w7lq4qnwr96fl3vhi3c0b4f41knwaslr2lv17xl")) - -(define-public urubu - (gopkg - "urubu" - (format-inputs (list)) - "b2351328e54d4793d6691382079a9895dc84696d" - "1aqrg165qsi0pfihjqndjzqrdd4ipjydjm71rzccz34xf7k7m3ch")) - -(define-public stm - (gopkg - "stm" - (format-inputs (list pds)) - "cb89a691031acd7beac798a74d174b572b22319e" - "1ld84nchnbh7g1dcjw2hvzpqwlpa450rs3i3i0x918911264wcv9")) - -(define-public scrypt - (gopkg - "scrypt" - (format-inputs (list q:scryptkdf)) - "6071b32e9a6ab214a18c7ef7ffe59c0d6d68e9ca" - "0iv4lalmrn3hb71wzrgqgji72f4dwklbaphj3h8nj6lr1zpjzvyq")) - -(define-public golite - (gopkg - "golite" - (format-inputs (list q:sqlitex)) - "170dfdf2783c8c2431861f77193c92f40860ea07" - "13y9vzxhr8jn7px2sgfgjapykr258q12ckf458qi0rkcma1vsz59")) - -(define-public fiinha - (gopkg - "fiinha" - (format-inputs (list q:sqlitex golite)) - "24fafda1fe9e962c8e508220c7023dabd5407e4a" - "1h4ig562flpqsxi52h04npj0nm6038chby8nd2lb8vj1nhiq77al")) - -(define-public cracha - (gopkg - "cracha" - (format-inputs (list q:sqlitex golite q:scryptkdf scrypt fiinha)) - "84865499aa10aa42c8b9ac06325a05dd8354f458" - "0hsnw1rng4ccdmgp4vfgn8jnyp05mqs5z7qvw7micia07li73m70")) - -(define-public binder - (gopkg - "binder" - (normalize-inputs '(socat lsof)) - "a45f1e444f6f053635315c8f6fad6ad465f8b0dc" - "0vwmhb76cw499751228jkd6057bj57wkg1jlwal13mm4x0453mjv")) - -(define-public glaze - (gopkg - "glaze" - (format-inputs (list)) - "24e540da26aad0fb6fc6a8845b1cf83757b15dd0" - "0idyds5wh9rzav7n8q64gwhlsjrzh0kgwp98rwq5rkrc08dqv3sb")) - -(define-public hsts - (gopkg - "hsts" - (format-inputs (list)) - "783845f84860968dd5e0f971fea42045c8b8e58c" - "0c17x9mdka213fkkccxff1wld38qhpfr8gs2h3kzg0s8wnnfvn42")) - -(define-public untls - (gopkg - "untls" - (format-inputs (list)) - "b66067d503bac4cfeda83331e045d9c79d8b43c1" - "09pmvaw6rslvasaa6k598aki6c01anfgazzzkcggisdj775wl6in")) - -(define-public wscat - (gopkg - "wscat" - (format-inputs (list)) - "9cc15130935dfaa6b58231ec708a2c71e54c3968" - "1z85p3v40368jyphip067rlx1m1gpmbvh5d4rjvx1lz81ncpsyf8")) - -(define-public gistatic - (gopkg - "gistatic" - (format-inputs (list)) - "1eec478135876b7f325c507d1284aa5782bad09d" - "1hsdqaszkr52cy80yid5i7r7fa4crc7qkpd5mglzbd9v4v2sispy")) - -(define-public chat.papo.im + (substitute-keyword-arguments (package-arguments ffmpeg) + ((#:configure-flags flags) + #~(append + #$flags + '("--enable-libxml2"))))) + (inputs + (modify-inputs (package-inputs ffmpeg) + (append libxml2))))) + +(define-public mpvx (package - (inherit - (pkg - "chat.papo.im" - "f9c959b2d8e36460395a425a51d480fac635c5ec" - "0h2y0kdfzpsgi64zi7brnj1p0dqz0fx4ksvy57wakr7pvv6rpf64")) - (native-inputs - (normalize-inputs '(node))))) - -(define-public papod - (gopkg - "papod" - (format-inputs - (list stm pds golite q:sqlitex scrypt q:scryptkdf fiinha cracha)) - "3da803b0ff65cf2af71b810ec8fbd28307280d79" - "1ppg1hg9qlkxg7mzsca0j3wdml5773s2x2h8d1j25hk7cg8kqiaj")) - - - -(define-public (user-accounts users) - (map (lambda (user) - (let ((name (s1:first user)) - (comment (s1:second user)) - (groups (s1:third user))) - (user-account - (name name) - (comment comment) - (group "users") - (supplementary-groups groups)))) - users)) - -(define-public (users->keys users) - (let ((users-with-keys (filter (compose not null? cdddr) - users))) - (append - (map (lambda (user) - (let ((name (s1:first user)) - (key (s1:fourth user))) - `(,name ,(plain-file (str name "-id_rsa.pub") - (slurp key))))) - users-with-keys) - `(("git" ,@(map (lambda (user) - (let ((name (s1:first user)) - (key (s1:fourth user))) - (plain-file (str name "-git-id_rsa.pub") - (slurp key)))) - users-with-keys)))))) - -(define (tuple->entry tuple) - (let* ((name (s1:first tuple)) - (package (s1:second tuple)) - (path (str "/etc/" name))) - (list - name - (computed-file - (str "syskeep-" name) - #~(begin - (use-modules - ((ice-9 textual-ports) #:prefix textual-ports:)) - - (define (slurp p) - (call-with-input-file p textual-ports:get-string-all)) - - (define (spit p s) - (call-with-output-file - p - (lambda (port) - (display s port)))) - - (spit #$output - (slurp #$(file-append package path)))))))) - -(define (etc-entries package paths) - (let ((tuples (map (lambda (path) - (list path package)) - paths))) - (map tuple->entry tuples))) - -(define-public (package-set symbols records) - (append - %base-packages - records - (map - (compose list specification->package+output symbol->string) - symbols))) - -(define-public skeletons - (etc-entries - syskeep - '(".profile"))) - -(define-public base-services - (append - (list -#; - (service fail2ban-service-type)) - %base-services)) - -(define-public (activation-gexp name user log-file data-directory run-directory) - #~(begin - (use-modules (guix build utils)) - (when #$log-file - (format (current-error-port) - "Creating ~a log directory for \"~a\".~%" #$name #$log-file) - (mkdir-p (dirname #$log-file)) - (when (not (file-exists? #$log-file)) - (call-with-output-file #$log-file (const #t))) - (chmod #$log-file #o644)) - (let ((user (getpwnam #$user))) - (when #$data-directory - (format (current-error-port) - "Creating ~a data directory \"~a\".~%" #$name #$data-directory) - (mkdir-p #$data-directory) - (chown #$data-directory (passwd:uid user) (passwd:gid user)) - (chmod #$data-directory #o750)) - (when #$run-directory - (format (current-error-port) - "Creating ~a run directory \"~a\".~%" #$name #$run-directory) - (mkdir-p #$run-directory) - (chown #$run-directory (passwd:uid user) (passwd:gid user)) - (chmod #$run-directory #o755))))) - - - -(define-record-type* - syskeep-configuration - make-syskeep-configuration - syskeep-configuration? - (package syskeep-configuration-package (default syskeep)) - (tld syskeep-configuration-tld (default #f)) - (secrets-user syskeep-configuration-secrets-user (default "secrets-keeper")) - (secrets-group syskeep-configuration-secrets-group (default "secrets-keeper")) - (become-secrets-group syskeep-configuration-become-secrets-group (default "become-secrets-keeper")) - (log-file syskeep-configuration-log-file (default "/var/log/cronjobs/cronjobs.log"))) - -(define (syskeep-profile config) - (match-record config - (package) - (package-set - '(parted - glibc-locales - guile-heredoc - acl - bind:utils - knot:tools - certbot - jq - file - git - lsof - moreutils - mailutils-sendmail - curl - make - borg - pv - rsync - sqlite - strace - rlwrap - trash-cli - tree) - (list - uuid - backupit - eut - nicely - package)))) - -(define (syskeep-rotations config) - (match-record config - (log-file) - (list -#; - (log-rotation - (frequency 'weekly) - (files (list log-file)) - (options '("rotate 52")))))) - -(define (syskeep-cronjobs config) - (match-record config - () - (list - #~(job "0 0 * * *" "cronjob env BORG_REPO=/mnt/backup/borg backupit -q -t cron") - #~(job "0 1 * * *" "cronjob backupit -q -t cron") - #~(job "0 2 * * *" "cronjob reconfigure") - #~(job "0 3 * * 0" "cronjob gc") - #~(job "0 4 * * *" "cronjob guix pull -v3") - #~(job "0 5 * * 0" "cronjob reconfigure") - #~(job "0 5 * * *" "cronjob check")))) - -(define (syskeep-etc-files config) - (match-record config - (package) - (etc-entries - package - '("rc.sh" - "backupit.txt" - "ssh.conf" - "init.scm" - "gitconfig")))) - -(define (syskeep-accounts config) - (match-record config - (secrets-user secrets-group become-secrets-group) - (list - (user-account - (name secrets-user) - (group secrets-group) - (system? #t) - (comment "System account used to manage production secrets") - (home-directory "/var/empty") - (create-home-directory? #f) - (shell - (file-append shadow "/sbin/nologin"))) - (user-group - (name secrets-group) - (system? #t)) - (user-group - (name become-secrets-group) - (system? #t))))) - -(define (syskeep-activation config) - (match-record config - (tld log-file) - (let ((privkey-path (fmt "../../opt/secrets/root@~a.id_rsa.txt" tld))) - #~(begin - #$(activation-gexp "syskeep" "root" log-file #f #f) - (define (dir target) - (format (current-error-port) - "Creating directory: \"~a\".~%" target) - (mkdir-p target)) - (define (link from to) - (format (current-error-port) - "Symlink: \"~a\" -> \"~a\".~%" to from) - (when (file-exists? to) - (delete-file to)) - (symlink from to)) - (dir "/var/crash") - (chmod "/var/crash" #o777) - (link "mnt/production/opt" "/opt") - (link "mnt/production/srv" "/srv") - (link "../mnt/production/mail" "/var/mail") - (dir "/root/.ssh") - (link #$privkey-path "/root/.ssh/id_rsa") - (link "../../etc/ssh.conf" "/root/.ssh/config") - (link "../../etc/id_rsa.pub" "/root/.ssh/id_rsa.pub") - (link "../../etc/known_hosts" "/root/.ssh/known_hosts"))))) - -(define-public (syskeep-sysctl _config) - '(("kernel/core_pattern" . "/var/crash/core-%t-%e-%p-%s-%u-%g"))) - -(define-public syskeep-sudoers-file - (plain-file "sudoers-syskeep" "\ -root ALL=(ALL) ALL -%wheel ALL= ALL -%wheel ALL= NOPASSWD: /run/current-system/profile/bin/reconfigure, /run/current-system/profile/bin/herd, /run/current-system/profile/bin/repo -%become-secrets-keeper ALL=(secrets-keeper) NOPASSWD: /run/current-system/profile/bin/rsync, /run/current-system/profile/bin/setfacl, /run/current-system/profile/bin/rm -%git ALL=(cicd) NOPASSWD: /run/current-system/profile/bin/cicd -")) - -(define-public syskeep-service-type - (service-type - (name 'syskeep) - (extensions - (list - (service-extension log-rotation-service-type - syskeep-rotations) - (service-extension mcron-service-type - syskeep-cronjobs) - (service-extension etc-service-type - syskeep-etc-files) - (service-extension account-service-type - syskeep-accounts) - (service-extension activation-service-type - syskeep-activation) - (service-extension sysctl-service-type - syskeep-sysctl) - (service-extension profile-service-type - syskeep-profile))) - (default-value (syskeep-configuration)) - (description "Common configuration of maintained servers."))) - - - -(define-record-type* - transactor-configuration - make-transactor-configuration - transactor-configuration? - (package transactor-configuration-package (default datomic)) - (user transactor-configuration-user (default "transactor")) - (group transactor-configuration-group (default "peer")) - (port transactor-configuration-port (default 50200)) - (log-file transactor-configuration-log-file (default "/var/log/transactor/transactor.log")) - (base-directory transactor-configuration-data-directory (default "/var/lib/transactor")) - (run-in-container? transactor-configuration-run-in-container? (default #t)) - (container-name transactor-configuration-container-name (default "datomic-container"))) - -(define-public (transactor-command config) - (match-record config - (package user group base-directory run-in-container? container-name) - (let ((bin (file-append package "/bin/transactor"))) - (if (not run-in-container?) - bin - (least-authority-wrapper - bin - #:user user - #:group group - #:directory base-directory - #:name container-name - #:namespaces (s1:fold delq container:%namespaces '(net)) - #:preserved-environment-variables - '() - #:mappings - (list - (file-system-mapping - (source base-directory) - (target source) - (writable? #t)))))))) - -(define-public (transactor-shepherd-services config) - (match-record config - (port user group log-file base-directory) - (list - (shepherd-service - (provision '(transactor)) - (requirement '()) - (start - #~(make-forkexec-constructor - (list #$(transactor-command config) - "-p" (number->string #$port) - (string-append #$base-directory "/data/storage.db")) - #:user #$user - #:group #$group - #:log-file #$log-file - #:directory #$base-directory)) - (stop #~(make-kill-destructor)) - (documentation "Daemon transactor process."))))) - -(define-public (transactor-activation config) - (match-record config - (user log-file base-directory) - #~(begin - (use-modules - (guix build utils)) - (format - (current-error-port) - "Creating Transactor data directories under: \"~a\".~%" - #$base-directory) - (mkdir-p/perms (string-append #$base-directory "/data") - (getpwnam #$user) - #o750) - (mkdir-p/perms (string-append #$base-directory "/backup") - (getpwnam #$user) - #o750) - (format - (current-error-port) - "Creating Transactor log directory for \"~a\".~%" - #$log-file) - (mkdir-p (dirname #$log-file)) - (when (not (file-exists? #$log-file)) - (call-with-output-file #$log-file (const #t))) - (chmod #$log-file #o644)))) - -(define-public (transactor-accounts config) - (match-record config - (user group) - (list - (user-account - (name user) - (group group) - (comment "Datomic transactor system user") - (create-home-directory? #f) - (shell - (file-append shadow "/sbin/nologin")) - (system? #t)) - (user-group - (name group) - (system? #t))))) - -(define (transactor-cronjobs config) - (match-record config - (base-directory) - (let ((from (string-append base-directory "/data/storage.db")) - (to (string-append base-directory "/backup"))) - (list - #~(job "0 23 * * *" (format #f "cronjob datomic backup ~a ~a" #$from #$to)) - #~(job "0 6 * * *" (format #f "cronjob datomic gc ~a" #$from)))))) - -(define-public transactor-service-type - (service-type - (name 'transactor) - (extensions - (list - (service-extension shepherd-root-service-type - transactor-shepherd-services) - (service-extension activation-service-type - transactor-activation) - (service-extension account-service-type - transactor-accounts) - (service-extension mcron-service-type - transactor-cronjobs) - (service-extension profile-service-type - (compose list transactor-configuration-package)))) - (default-value (transactor-configuration)) - (description "Transactor service."))) - - -(define-record-type* - git-configuration - make-git-configuration - git-configuration? - (package git-configuration-package (default git)) - (user git-configuration-user (default "git")) - (group git-configuration-group (default "git")) - (export-all? git-configuration-export-all? (default #f)) - (base-path git-configuration-base-path (default "/srv/git")) - (user-path git-configuration-user-path (default #f)) - (run-in-container? git-configuration-run-in-container? (default #f)) - (container-name git-configuration-container-name (default "git-container")) - (run-server? git-configuration-run-server? (default #f))) - -(define-public (git-command config) - (match-record config - (package user group base-path run-in-container? container-name) - (let ((bin (file-append package "/bin/git"))) - (if (not run-in-container?) - bin - (least-authority-wrapper - bin - #:user user - #:group group - #:name container-name - #:directory base-path - #:preserved-environment-variables - '() - #:mappings - (list - (file-system-mapping - (source base-path) - (target source) - (writable? #t)))))))) - -(define-public (git-shepherd-services config) - (match-record config - (user group export-all? base-path user-path run-server?) - (if (not run-server?) - (list) - (list - (shepherd-service - (provision '(git)) - (requirement '(networking)) - (start - #~(make-forkexec-constructor - (list #$(git-command config) - "daemon" "--syslog" "--reuseaddr" - #$@(mklist (and export-all? "--export-all")) - #$@(mklist (and base-path (str "--base-path=" base-path))) - #$@(mklist (and user-path (str "--user-path=" user-path)))) - #:user #$user - #:group #$group)) - (documentation "Daemon process of the git:// protocol.")))))) - -(define-public (git-accounts config) - (match-record config - (user group base-path) - (list - (user-account - (name user) - (group group) - (system? #t) - (comment "External SSH Git service user") - (home-directory base-path) - (create-home-directory? #f)) - (user-group - (name group) - (system? #t))))) - -(define-public git-service-type - (service-type - (name 'git) - (extensions - (list - (service-extension shepherd-root-service-type - git-shepherd-services) - (service-extension account-service-type - git-accounts) - (service-extension profile-service-type - (compose list git-configuration-package)))) - (default-value (git-configuration)) - (description "Better git:// service."))) - - - -(define-record-type* - binder-configuration - make-binder-configuration - binder-configuration? - (name binder-configuration-name (default "binder")) - (package binder-configuration-package (default binder)) - (user binder-configuration-user (default "binder")) - (group binder-configuration-group (default "binder")) - (log-file binder-configuration-log-file (default "/var/log/binder/binder.log")) - (data-directory binder-configuration-data-directory (default #f)) - (run-directory binder-configuration-run-directory (default "/var/run/binder")) - (run-in-container? binder-configuration-run-in-container? (default #t)) - (container-name binder-configuration-container-name (default "binder-container")) - (options binder-configuration-options (default '())) - (listen-socket binder-configuration-listen-socket (default "0.0.0.0:4443")) - (upstream-socket binder-configuration-upstream-socket (default "/var/run/untls/untls.socket"))) - -(define-record-type* - glaze-configuration - make-glaze-configuration - glaze-configuration? - (name glaze-configuration-name (default "glaze")) - (package glaze-configuration-package (default glaze)) - (user glaze-configuration-user (default "glaze")) - (group glaze-configuration-group (default "glaze")) - (log-file glaze-configuration-log-file (default "/var/log/glaze/glaze.log")) - (data-directory glaze-configuration-data-directory (default "/var/lib/glaze")) - (run-directory glaze-configuration-run-directory (default "/var/run/glaze")) - (run-in-container? glaze-configuration-run-in-container? (default #t)) - (container-name glaze-configuration-container-name (default "glaze-container")) - (options glaze-configuration-options (default '())) - (listen-socket glaze-configuration-listen-socket (default "/var/run/glaze/glaze.socket")) - (upstream-socket glaze-configuration-upstream-socket (default #f))) - -(define-record-type* - hsts-configuration - make-hsts-configuration - hsts-configuration? - (name hsts-configuration-name (default "hsts")) - (package hsts-configuration-package (default hsts)) - (user hsts-configuration-user (default "hsts")) - (group hsts-configuration-group (default "hsts")) - (log-file hsts-configuration-log-file (default "/var/log/hsts/hsts.log")) - (data-directory hsts-configuration-data-directory (default #f)) - (run-directory hsts-configuration-run-directory (default "/var/run/hsts")) - (run-in-container? hsts-configuration-run-in-container? (default #t)) - (container-name hsts-configuration-container-name (default "hsts-container")) - (options hsts-configuration-options (default '())) - (listen-socket hsts-configuration-listen-socket (default "/var/run/hsts/hsts.socket")) - (upstream-socket hsts-configuration-upstream-socket (default #f))) - -(define-record-type* - untls-configuration - make-untls-configuration - untls-configuration? - (name untls-configuration-name (default "untls")) - (package untls-configuration-package (default untls)) - (user untls-configuration-user (default "untls")) - (group untls-configuration-group (default "untls")) - (log-file untls-configuration-log-file (default "/var/log/untls/untls.log")) - (data-directory untls-configuration-data-directory (default #f)) - (run-directory untls-configuration-run-directory (default "/var/run/untls")) - (run-in-container? untls-configuration-run-in-container? (default #t)) - (container-name untls-configuration-container-name (default "untls-container")) - (options untls-configuration-options (default '())) - (listen-socket untls-configuration-listen-socket (default "/var/run/untls/untls.socket")) - (upstream-socket untls-configuration-upstream-socket (default #f))) - -(define-record-type* - wscat-configuration - make-wscat-configuration - wscat-configuration? - (name wscat-configuration-name (default "wscat")) - (package wscat-configuration-package (default wscat)) - (user wscat-configuration-user (default "wscat")) - (group wscat-configuration-group (default "wscat")) - (log-file wscat-configuration-log-file (default "/var/log/wscat/wscat.log")) - (data-directory wscat-configuration-data-directory (default #f)) - (run-directory wscat-configuration-run-directory (default "/var/run/wscat")) - (run-in-container? wscat-configuration-run-in-container? (default #t)) - (container-name wscat-configuration-container-name (default "wscat-container")) - (options wscat-configuration-options (default '())) - (listen-socket wscat-configuration-listen-socket (default "/var/run/wscat/wscat.socket")) - (upstream-socket wscat-configuration-upstream-socket (default "/var/run/papod/papod.socket"))) - -(define-public (profile-for config-type) - (lambda (config) - (m:match config - (($ config-type _name package) - (list package))))) - -(define-public (rotations-for config-type) - (lambda (config) - (m:match config - (($ config-type _name _package _user _group log-file) - (list -#; - (log-rotation - (frequency 'weekly) - (files (list log-file)) - (options '("rotate 5200")))))))) - -(define-public (activation-for config-type) - (lambda (config) - (m:match config - (($ config-type name _package user _group log-file data-directory - run-directory) - (activation-gexp name user log-file data-directory run-directory))))) - -(define-public (accounts-for config-type) - (lambda (config) - (m:match config - (($ config-type name _package user group) - (list - (user-group - (name group) - (system? #t)) - (user-account - (name user) - (group group) - (system? #t) - (comment (format #f "The user for runtime execution of ~a code" name)) - (home-directory "/var/empty") - (create-home-directory? #f) - (shell - (file-append shadow "/sbin/nologin")))))))) - -(define-public (cmd-for config-type config) - (m:match config - (($ config-type name package user group _log-file data-directory - _run-directory run-in-container? container-name) - (let ((bin (file-append package (str "/bin/" name)))) - (if (not run-in-container?) - bin - (least-authority-wrapper - bin - #:user user - #:group group - #:name container-name - #:directory (or data-directory "/") - #:preserved-environment-variables - '() - #:mappings - (mklist - (and data-directory - (file-system-mapping - (source data-directory) - (target source) - (writable? #t)))))))))) - -(define-public (shepherd-services-for config-type) - (lambda (config) - (m:match config - (($ config-type name _package user group log-file data-directory - _run-directory _run-in-container? _container-name options - listen-socket upstream-socket) - (list - (shepherd-service - (provision (list (string->symbol name))) - (requirement '(networking)) - (auto-start? #f) - (start - #~(make-forkexec-constructor - (list #$(cmd-for config-type config) - #$@options - #$@(mklist listen-socket) - #$@(mklist upstream-socket)) - #:user #$user - #:group #$group - #:log-file #$log-file - #:directory #$data-directory)) - (documentation - (fmt "The Shepherd service that runs the server via \"~a\"." name)))))))) - -(define-public (service-type-for name config-type config extensions) - (service-type - (name name) - (extensions - (append - (list - (service-extension shepherd-root-service-type - (shepherd-services-for config-type)) - (service-extension profile-service-type - (profile-for config-type)) - (service-extension activation-service-type - (activation-for config-type)) - (service-extension account-service-type - (accounts-for config-type)) - (service-extension log-rotation-service-type - (rotations-for config-type))) - extensions)) - (default-value config) - (description - (fmt "The top-level generic system service, generated for ~a code. - -It includes: -- the Shepherd service for starting, stopping and reloading the service; -- activation script for setting up the initial directories and permissions; -- the group and account for running the production service; -- log management (storage and rotation) for logs produced by the running services. - -The default configuration should provide sane values for all of these." - name)))) - -(define-public (without-shepherd-services lst) - (filter (lambda (extension) - (not (eq? shepherd-root-service-type - (service-extension-target extension)))) - lst)) - -(define-public (replacing-shepherd-services service fn) - (service-type - (inherit service) - (extensions - (append - (without-shepherd-services - (service-type-extensions service)) - (list - (service-extension shepherd-root-service-type - fn)))))) - -(define-public (with-services-from-args service config-type args) - (replacing-shepherd-services - service - (lambda (config) - (m:match config - (($ config-type _name _package user group log-file data-directory) - (map (lambda (tuple) - (let ((provision (s1:first tuple)) - (args (s1:second tuple))) - (shepherd-service - (provision provision) - (requirement '(networking)) - (auto-start? #f) - (start - #~(make-forkexec-constructor - (list #$(cmd-for config-type config) - #$@args) - #:user #$user - #:group #$group - #:log-file #$log-file - #:directory #$data-directory))))) - args)))))) - - - -(define-public binder-service-type - (service-type-for 'binder (binder-configuration) '())) - -(define-public glaze-service-type - (service-type-for 'glaze (glaze-configuration) '())) - -(define-public hsts-service-type - (service-type-for 'hsts (hsts-configuration) '())) - -(define-public untls-service-type - (service-type-for 'untls (untls-configuration) '())) + (inherit mpv) + (name "mpvx") + (propagated-inputs + (modify-inputs (package-propagated-inputs mpv) + (replace "ffmpeg" ffmpegx))))) -(define-public wscat-service-type - (service-type-for 'wscat (wscat-configuration) '())) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Our packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(define-record-type* - cicd-configuration - make-cicd-configuration - cicd-configuration? - (name cicd-configuration-name (default "cicd")) - (package cicd-configuration-package (default cicd)) - (user cicd-configuration-user (default "cicd")) - (group cicd-configuration-group (default "cicd")) - (log-file cicd-configuration-log-file (default "/var/log/cicd/cicd.log")) - (data-directory cicd-configuration-data-directory (default "/var/lib/cicd")) - (run-directory cicd-configuration-run-directory (default "/var/run/cicd")) - (run-in-container? cicd-configuration-run-in-container? (default #f)) - (container-name cicd-configuration-container-name (default "cicd"))) +(define-public euandre.org + (pkgs:mkwbpkg + +tld+ + "euandre.org" + (list pkgs:eslaides pkgs:eut pkgs:mktorrent pkgs:mkwb pkgs:xadoc) + '(ghostscript gnupg imagemagick lilypond moreutils ruby-asciidoctor + tidy-html) + "7c016c48b6356147c567a9222de45dd50dd8a405" + "18fx5ww67hligr2mfgcvcmn4pdwjnr4qqgkbh306ia7rd2km8yyw" + "" + "")) -(define (cicd-profile config) - (match-record config - (package) - (list - q - package))) +(define-public hunspell-dict-en-utf8 + (hunspell-dictionary-utf8 "en")) -(define (cicd-shepherd-services config) - (match-record config - (user group log-file data-directory) - (list - (shepherd-service - (provision '(cicd)) - (requirement '()) - (auto-start? #f) - (start - #~(make-forkexec-constructor - (list - #$(cmd-for config) - "daemon") - #:user #$user - #:group #$group - #:log-file #$log-file - #:directory #$data-directory)) - (documentation "The background daemon service that powers the CI."))))) +(define-public hunspell-dict-pt-utf8 + (hunspell-dictionary-utf8 "pt")) -(define-public cicd-service-type - (service-type - (name 'cicd) - (extensions - (list - (service-extension shepherd-root-service-type - cicd-shepherd-services) - (service-extension profile-service-type - cicd-profile) - (service-extension activation-service-type - (activation-for )) - (service-extension account-service-type - (accounts-for )) - (service-extension log-rotation-service-type - (rotations-for )))) - (default-value (cicd-configuration)) - (description (fmt "The CI agent service that backs a Git server.")))) +(define-public hunspell-dict-fr-utf8 + (hunspell-dictionary-utf8 "fr")) +(define-public hunspell-dict-eo-utf8 + (hunspell-dictionary-utf8 "eo")) -(define-record-type* - papod-configuration - make-papod-configuration - papod-configuration? - (name papod-configuration-name - (default "papod")) - (package papod-configuration-package - (default papod)) - (user papod-configuration-user - (default "papod")) - (group papod-configuration-group - (default "papod")) - (log-file papod-configuration-log-file - (default "/var/log/papod/papod.log")) - (data-directory papod-configuration-data-directory - (default "/var/lib/papod")) - (run-directory papod-configuration-run-directory - (default "/var/run/papod")) - (run-in-container? papod-configuration-run-in-container? - (default #t)) - (container-name papod-configuration-container-name - (default "papod-container")) - (options papod-configuration-options - (default '())) - (listen-socket papod-configuration-listen-socket - (default "/var/run/papod/papod.socket")) - (upstream-socket papod-configuration-upstream-socket - (default #f))) +(define-public hunspell-dict-es-utf8 + (hunspell-dictionary-utf8 "es")) +(define-public hunspell-dict-de-utf8 + (hunspell-dictionary-utf8 "de")) -#; -(define-public papod-service-type - (pkg:service-type-for 'papod - - (papod-configuration) - '())) +(define-public hunspell-dict-it-utf8 + (hunspell-dictionary-utf8 "it")) (list - mktorrent-latest - remembering - eut - cage - backupit - nicely - syskeep - q - cicd - guile-heredoc - adoc - eslaides - mkwb + gm2 + ffmpegx + mpvx euandre.org - - datomic - - gotext - uuid - gobang - pds - stm - golite - binder - glaze - hsts - untls - wscat - gistatic - urubu - fiinha - cracha - - papo.im - chat.papo.im - papod) + hunspell-dict-en-utf8 + hunspell-dict-pt-utf8 + hunspell-dict-fr-utf8 + hunspell-dict-eo-utf8 + hunspell-dict-es-utf8 + hunspell-dict-de-utf8 + hunspell-dict-it-utf8) diff --git a/src/org/euandre/queue.scm b/src/org/euandre/queue.scm deleted file mode 100644 index 16c9b1a..0000000 --- a/src/org/euandre/queue.scm +++ /dev/null @@ -1,2011 +0,0 @@ -(define-module (org euandre queue) - #:use-module ((ice-9 textual-ports) #:prefix textual-ports:) - #:use-module ((gnu build linux-container) #:prefix container:) - #:use-module ((guix licenses) #:prefix license:) - #:use-module ((srfi srfi-1) #:prefix s1:) - #:use-module (guix build-system meson) - #:use-module (guix build-system gnu) - #:use-module (guix build-system python) - #:use-module (guix build-system trivial) - #:use-module (guix download) - #:use-module (guix git-download) - #:use-module (guix least-authority) - #:use-module (guix packages) - #:use-module (guix records) - #:use-module (guix utils) - #:use-module (gnu) - #:use-module (gnu system privilege) - #:export ( - shadow-group-configuration - make-shadow-group-configuration - shadow-group-configuration? - shadow-group-configuration-group - - shadow-group-activation - shadow-group-accounts - shadow-group-service-type - - - - cyrus-service-configuration - make-cyrus-service-configuration - cyrus-service-configuration? - cyrus-service-configuration-name - cyrus-service-configuration-authmech - cyrus-service-configuration-log-level - cyrus-service-configuration-raw-file - - - cyrus-sasl-configuration - make-cyrus-sasl-configuration - cyrus-sasl-configuration? - cyrus-sasl-configuration-package - cyrus-sasl-configuration-user - cyrus-sasl-configuration-group - cyrus-sasl-configuration-supplementary-groups - cyrus-sasl-configuration-authmech - cyrus-sasl-configuration-services - cyrus-sasl-configuration-config-dirname - cyrus-sasl-configuration-run-directory - cyrus-sasl-configuration-run-in-container? - cyrus-sasl-configuration-container-name - cyrus-sasl-configuration-container-namespaces - - cyrus-sasl-etc-files - cyrus-sasl-activation - cyrus-sasl-accounts - cyrus-sasl-shepherd-service - cyrus-sasl-service-type - - - - dkimproxyout-configuration - make-dkimproxyout-configuration - dkimproxyout-configuration? - dkimproxyout-configuration-package - dkimproxyout-configuration-user - dkimproxyout-configuration-group - dkimproxyout-configuration-supplementary-groups - dkimproxyout-configuration-config-name - dkimproxyout-configuration-config-extra - dkimproxyout-configuration-raw-file - dkimproxyout-configuration-listen - dkimproxyout-configuration-relay - dkimproxyout-configuration-domains - dkimproxyout-configuration-selector - dkimproxyout-configuration-key-size - dkimproxyout-configuration-data-directory - dkimproxyout-configuration-run-in-container? - dkimproxyout-configuration-container-name - dkimproxyout-configuration-container-namespaces - - dkimproxyout-etc-files - dkimproxyout-accounts - dkimproxyout-activation - dkimproxyout-shepherd-service - dkimproxyout-service-type - - - - postfix-configuration - make-postfix-configuration - postfix-configuration? - - postfix-configuration-postfix - postfix-configuration-enable-submission? - postfix-configuration-set-sendmail? - postfix-configuration-master.cf-file - postfix-configuration-main.cf-file - postfix-configuration-master.cf-extra - postfix-configuration-main.cf-extra - postfix-configuration-config-dirname - postfix-configuration-mail-directory - postfix-configuration-data-directory - postfix-configuration-queue-directory - postfix-configuration-user - postfix-configuration-group - postfix-configuration-setgid-group - postfix-configuration-root-aliases - postfix-configuration-cert-file - postfix-configuration-key-file - postfix-configuration-hostname - postfix-configuration-run-in-container? - postfix-configuration-container-name - postfix-configuration-container-namespaces - - postfix-aliases - postfix-accounts - postfix-activation - postfix-etc-files - postfix-privileged-programs - postfix-shepherd-service - local-postfix-service-type - internet-postfix-service-type - - - - dovecot-configuration - make-dovecot-configuration - dovecot-configuration? - - dovecot-configuration-package - dovecot-configuration-mail-location - dovecot-configuration-raw-file - dovecot-configuration-extra-content - dovecot-configuration-config-dirname - dovecot-configuration-config-filename - dovecot-configuration-user - dovecot-configuration-group - dovecot-configuration-supplementary-groups - dovecot-configuration-auth-worker-group - dovecot-configuration-untrusted-user - dovecot-configuration-untrusted-group - dovecot-configuration-untrusted-supplementary-groups - dovecot-configuration-base-dir - dovecot-configuration-state-dir - dovecot-configuration-hostname - dovecot-configuration-run-in-container? - dovecot-configuration-container-name - dovecot-configuration-container-namespaces - - dovecot-etc-files - dovecot-accounts - dovecot-activation - dovecot-shepherd-service - dovecot-service-type)) -(use-package-modules - admin - check - crypto - cyrus-sasl - dbm - flex - gcc - golang - libedit - m4 - mail - onc-rpc - perl - python-build - python-crypto - python-web - python-xyz - sqlite - ssh - time - tls - version-control - video - xml) -(use-service-modules - certbot - cgit - dns - mail - shepherd - ssh - web) - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; finished packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - - -(define-public postfix - (package - (name "postfix") - (version "3.8-20221023") - (source - (origin - (method url-fetch) - (uri - (string-append - "http://cdn.postfix.johnriley.me/mirrors/postfix-release/experimental/postfix-" - version - ".tar.gz")) - (sha256 - (base32 "0aaylhn81n9z3kidx53kzf2jrilr3lgwfxsk1r4hn7nkrp62bcwm")))) - (build-system gnu-build-system) - (arguments - (list - #:tests? #f - #:modules `((srfi srfi-26) - ,@%default-gnu-imported-modules) - #:phases - #~(modify-phases %standard-phases - (add-before 'configure 'patch-/bin/sh - (lambda _ - (substitute* (find-files "." "^Makefile") - (("/bin/sh") - (which "sh"))))) - (add-before 'configure 'patch-bdb-include - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "makedefs" - (("/usr/include") - (string-append (assoc-ref inputs "bdb") - "/include"))))) - (add-before 'configure 'dont-hardcode-PATH - (lambda _ - (substitute* '("postfix-install" - "conf/post-install") - (("^PATH=") - "# PATH=")))) - (add-before 'configure 'fix-strict-PATH - (lambda _ - (substitute* "src/util/sys_defs.h" - (("^#define (ROOT_PATH|_PATH_DEFPATH|_PATH_STDPATH).*") - "#define ROOT_PATH \"/run/setuid-programs:/run/current-system/profile/bin:/run/current-system/profile/sbin\"\n")))) - (add-before 'configure 'use-relative-symlink-to-store - (lambda _ - (substitute* "postfix-install" - (("ln -sf") - "ln -rsf")))) - (add-before 'configure 'fix-absolute-path-to-setuid-programs - (lambda _ - (substitute* "conf/postfix-script" - (("\\$command_directory/postqueue") - "/run/setuid-programs/postqueue") - (("\\$command_directory/postdrop") - "/run/setuid-programs/postdrop")))) - (add-before 'configure 'disable-warning-on-non-writable-config-files - (lambda _ - (substitute* "conf/postfix-script" - (("find \\$todo \\\\\\( -perm -020 -o -perm -002 \\\\\\) \\\\\n") - " # find $todo \\( -perm -020 -o -perm -002 \\)")))) - (add-before 'configure 'disable-write-to-/etc/postfix - (lambda _ - (substitute* "src/postconf/postconf_edit.c" - (("pcf_set_config_dir.*") - "return;")))) - (add-before 'configure 'setup-environment - (lambda* (#:key outputs inputs #:allow-other-keys) - (setenv "CCARGS" - (string-join (list - "-DNO_NIS" - "-DUSE_TLS" - "-DUSE_SASL_AUTH" - "-DUSE_CYRUS_SASL" - "-I" - (string-append - (assoc-ref inputs "cyrus-sasl") "/include/sasl")) - " ")) - (setenv "AUXLIBS" "-lnsl -lcrypto -lssl -lsasl2") - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (sbin (string-append out "/sbin")) - (lib (string-append out "/lib/postfix")) - (libexec (string-append out "/libexec/postfix")) - (etc (string-append out "/etc/postfix")) - (man (string-append out "/share/man")) - (doc (string-append out "/share/doc/postfix-" #$version)) - (html (string-append doc "/html"))) - (setenv "install_root" "wip-prefix") - (setenv "newaliases_path" (string-append bin "/newaliases")) - (setenv "mailq_path" (string-append bin "/mailq")) - (setenv "sendmail_path" (string-append sbin "/sendmail")) - (setenv "command_directory" sbin) - (setenv "shlib_directory" lib) - (setenv "daemon_directory" libexec) - (setenv "meta_directory" etc) - (setenv "sample_directory" etc) - (setenv "manpage_directory" man) - (setenv "readme_directory" doc) - (setenv "html_directory" html) - (setenv "sample_directory" (string-append out "/share/postfix"))))) - (replace 'configure - (lambda _ - (invoke "make" "makefiles" - "pie=yes" - "dynamicmaps=yes"))) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (invoke "make" "non-interactive-package") - (delete-file-recursively "wip-prefix/var") - (copy-recursively "wip-prefix/etc" (string-append out "/etc")) - (copy-recursively (string-append "wip-prefix" out) out))))))) - (inputs - (list bdb - cyrus-sasl - libnsl - openssl - perl)) - (native-inputs - (list m4)) - (home-page "https://www.postfix.org") - (synopsis "sendmail compatible MTA") - (description - "Postfix is Wietse Venema's mail server that started life at IBM research -as an alternative to the widely-used Sendmail program. Now at Google, Wietse -continues to support Postfix. - -Postfix attempts to be fast, easy to administer, and secure. The outside has a -definite Sendmail-ish flavor, but the inside is completely different.") - (license (list license:ibmpl1.0 - license:epl2.0)))) - -(define-public mailutils-sendmail - (package - (inherit mailutils) - (name "mailutils-sendmail") - (arguments - (substitute-keyword-arguments (package-arguments mailutils) - ((#:tests? _ #f) #f) - ((#:configure-flags flags) - #~(append '("CFLAGS=-DPATH_SENDMAIL=\\\"/run/setuid-programs/sendmail\\\"") #$flags)))))) - -(define-public rottlog-mailutils-sendmail - (package - (inherit rottlog) - (name "rottlog-mailutils-sendmail") - (inputs - (list coreutils - mailutils-sendmail)))) - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WIP packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - - -(define-public pax-utils - (package - (name "pax-utils") - (version "1.3.7") - (source - (origin - (method url-fetch) - (uri - (string-append - "https://distfiles.gentoo.org/distfiles/pax-utils-" - version - ".tar.xz")) - (sha256 - (base32 "16lkrvgffprwnd8w3bbiph6zq72cbaqn7p6an3vmrlk8jv9650qh")))) - (build-system meson-build-system) - (synopsis "ELF utils that can check files for security relevant properties") - (description - "A suite of ELF tools to aid auditing systems. Contains various ELF -related utils for ELF32, ELF64 binaries useful for displaying PaX and security -information on a large group of binary files.") - (home-page "https://distfiles.gentoo.org/distfiles/pax-utils-1.3.7.tar.xz") - (license license:gpl2))) - -(define (hunspell-dictionary-utf8 dict-name) - (package - (name (string-append "hunspell-dict-" dict-name "-utf8")) - (version "630b34e6f8f3cbe7aa7b27b6d8ab118e27252fd1") - (source - (origin - (method git-fetch) - (uri - (git-reference - (url "https://github.com/wooorm/dictionaries") - (commit version))) - (file-name - (git-file-name "hunspell-dictionary-utf8" version)) - (sha256 - (base32 "1iknwzh5h04m067ddw9hlzc1qqj4mr9mdkcfapsnay304laaiyn5")))) - (build-system trivial-build-system) - (arguments - `(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (let ((source-prefix (string-append (assoc-ref %build-inputs "source") - "/dictionaries/" - ,dict-name - "/index")) - (install-prefix (string-append %output "/share/hunspell/"))) - (mkdir-p install-prefix) - (copy-file (string-append source-prefix ".aff") - (string-append install-prefix ,dict-name ".aff")) - (copy-file (string-append source-prefix ".dic") - (string-append install-prefix ,dict-name ".dic")))))) - (synopsis (string-append "Hunspell " dict-name " dictionary in UTF-8")) - (description (string-append "Hunspell " dict-name " dictionary in UTF-8")) - (license license:expat) - (home-page "https://github.com/wooorm/dictionaries"))) - -(define-public hunspell-dict-en-utf8 (hunspell-dictionary-utf8 "en")) -(define-public hunspell-dict-pt-utf8 (hunspell-dictionary-utf8 "pt")) -(define-public hunspell-dict-fr-utf8 (hunspell-dictionary-utf8 "fr")) -(define-public hunspell-dict-eo-utf8 (hunspell-dictionary-utf8 "eo")) -(define-public hunspell-dict-es-utf8 (hunspell-dictionary-utf8 "es")) - -(define python-pytest-tornado5 - (package - (name "python-pytest-tornado5") - (version "2.0.0") - (source - (origin - (method url-fetch) - (uri - (pypi-uri "pytest-tornado5" version)) - (sha256 - (base32 "0qb62jw2w0xr6y942yp0qxiy755bismjfpnxaxjjm05gy2pymr8d")))) - (build-system python-build-system) - (arguments - (list - #:tests? #f)) - (propagated-inputs (list python-pytest python-tornado)) - (home-page "https://github.com/vidartf/pytest-tornado") - (synopsis - "A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications.") - (description - "This package provides a py.test plugin providing fixtures and markers to -simplify testing of asynchronous tornado applications.") - (license license:asl2.0))) - -(define python-ordereddict - (package - (name "python-ordereddict") - (version "1.1") - (source - (origin - (method url-fetch) - (uri - (pypi-uri "ordereddict" version)) - (sha256 - (base32 "07qvy11nvgxpzarrni3wrww3vpc9yafgi2bch4j2vvvc42nb8d8w")))) - (build-system python-build-system) - (arguments - `(#:tests? #f - #:phases - (modify-phases %standard-phases - (delete 'sanity-check)))) - (home-page "UNKNOWN") - (synopsis - "A drop-in substitute for Py2.7's new collections.OrderedDict that works in Python 2.4-2.6.") - (description "This package provides a drop-in substitute for Py2.7's new -collections.OrderedDict that works in Python 2.4-2.6.") - (license #f))) - -(define python-funcsigs - (package - (name "python-funcsigs") - (version "1.0.2") - (source - (origin - (method url-fetch) - (uri - (pypi-uri "funcsigs" version)) - (sha256 - (base32 "0l4g5818ffyfmfs1a924811azhjj8ax9xd1cffr1mzd3ycn0zfx7")))) - (build-system python-build-system) - (arguments - `(#:tests? #f)) - (propagated-inputs - (list python-ordereddict)) -#; - (native-inputs - (list python-unittest2)) - (home-page "http://funcsigs.readthedocs.org") - (synopsis - "Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+") - (description - "Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+") - (license #f))) - -(define python-apscheduler - (package - (name "python-apscheduler") - (version "3.9.1") - (source - (origin - (method url-fetch) - (uri - (pypi-uri "APScheduler" version)) - (sha256 - (base32 "1qzi1pr7q72vs49p7vr1mp350zaggs52lpq43lvqsjcmcd5mgrk5")))) - (build-system python-build-system) - (arguments - `(#:tests? #f)) - (propagated-inputs - (list python-funcsigs - ; python-futures - python-pytz - python-six - python-tzlocal)) - (native-inputs - (list python-mock - python-pytest - python-pytest-asyncio - python-pytest-cov - python-pytest-tornado5 - python-setuptools - python-setuptools-scm)) - (home-page "https://github.com/agronholm/apscheduler") - (synopsis "In-process task scheduler with Cron-like capabilities") - (description "In-process task scheduler with Cron-like capabilities") - (license license:expat))) - -(define-public python-telegram-bot - (package - (name "python-telegram-bot") - (version "13.12") - (source - (origin - (method url-fetch) - (uri - (pypi-uri "python-telegram-bot" version)) - (sha256 - (base32 "1rbdyr1f9mndlh83in47k8if65yp9n1dy4px2wipbf0qyjv5zxfs")))) - (build-system python-build-system) - (arguments - (list - #:tests? #f - #:phases - #~(modify-phases %standard-phases - (delete 'sanity-check)))) - (native-inputs - (list python-apscheduler)) - (propagated-inputs - (list python-apscheduler - python-cachetools - python-certifi - python-pytz - python-tornado-6)) - (home-page "https://python-telegram-bot.org/") - (synopsis "Python library to interface with the Telegram Bot API") - (description "We have made you a wrapper you can't refuse") - (license #f))) - -(define-public gm2 - (package - (inherit gcc-14) - (name "gm2") - (arguments - (substitute-keyword-arguments (package-arguments gcc-14) - ((#:modules modules %default-gnu-modules) - (append '((ice-9 regex)) modules)) - ((#:configure-flags flags) - #~(append - (list - "--enable-languages=m2") - (filter (lambda (s) - (not (string-match "--enable-languages.*" s))) - #$flags))))) - (native-inputs - (modify-inputs (package-native-inputs gcc-14) - (append flex))))) - -(define-public ffmpegx - (package - (inherit ffmpeg) - (name "ffmpegx") - (arguments - (substitute-keyword-arguments (package-arguments ffmpeg) - ((#:configure-flags flags) - #~(append - #$flags - '("--enable-libxml2"))))) - (inputs - (modify-inputs (package-inputs ffmpeg) - (append libxml2))))) - -(define-public mpvx - (package - (inherit mpv) - (name "mpvx") - (propagated-inputs - (modify-inputs (package-propagated-inputs mpv) - (replace "ffmpeg" ffmpegx))))) - -(define-public dovecotx - (package - (inherit dovecot) - (name "dovecotx") - (arguments - (substitute-keyword-arguments (package-arguments dovecot) - ((#:tests? _ #f) #f) - ((#:configure-flags flags) - #~(filter (lambda (flag) - (not (string=? flag "--with-moduledir=/usr/lib/dovecot"))) - #$flags)))))) - - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;; finished services ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - - -(define-record-type* - shadow-group-configuration - make-shadow-group-configuration - shadow-group-configuration? - (group shadow-group-configuration-group (default "etc-shadow"))) - -(define (shadow-group-activation config) - (match-record config - (group) - #~(begin - (use-modules (guix build utils)) - (format (current-error-port) - "Setting ownership and permission for \"/etc/shadow\".~%") - (chown "/etc/shadow" - (passwd:uid (getpwnam "root")) - (group:gid (getgrnam #$group))) - (chmod "/etc/shadow" #o640)))) - -(define (shadow-group-accounts config) - (match-record config - (group) - (list - (user-group - (name group) - (system? #t))))) - -(define shadow-group-service-type - (service-type - (name 'shadow-group) - (extensions - (list - (service-extension activation-service-type - shadow-group-activation) - (service-extension account-service-type - shadow-group-accounts))) - (default-value (shadow-group-configuration)) - (description "Provide the infrastructure to allow access to the -@file{/etc/shadow} file without requiring superuser privileges, by: - -@itemize -@item adding a dedicated group to the system (default: @code{etc-shadow}); -@item granting said group @emph{read-only access} to the @file{/etc/shadow} -file. -@end itemize - -The goal is to allow unprivileged processes to perform password authentication -against the @file{/etc/passwd} database, by adding the @code{etc-shadow} group -to the list of supplementary groups of the user of such running process."))) - - -(define-record-type* - cyrus-service-configuration - make-cyrus-service-configuration - cyrus-service-configuration? - (name cyrus-service-configuration-name) - (authmech cyrus-service-configuration-authmech (default "saslauthd")) - (log-level cyrus-service-configuration-log-level (default 7)) - (raw-file cyrus-service-configuration-raw-file (default #f))) - -(define-record-type* - cyrus-sasl-configuration - make-cyrus-sasl-configuration - cyrus-sasl-configuration? - (package cyrus-sasl-configuration-package (default cyrus-sasl)) - (user cyrus-sasl-configuration-user (default "cyrus-sasl")) - (group cyrus-sasl-configuration-group (default "cyrus-sasl")) - (supplementary-groups cyrus-sasl-configuration-supplementary-groups (default '("etc-shadow"))) - (authmech cyrus-sasl-configuration-authmech (default "shadow")) - (services cyrus-sasl-configuration-services (default '())) - (config-dirname cyrus-sasl-configuration-config-dirname (default "sasl2")) - (run-directory cyrus-sasl-configuration-run-directory (default "/var/run/saslauthd")) - (run-in-container? cyrus-sasl-configuration-run-in-container? (default #t)) - (container-name cyrus-sasl-configuration-container-name (default "saslauthd")) - (container-namespaces cyrus-sasl-configuration-container-namespaces (default container:%namespaces))) - -(define (cyrus-sasl-etc-files config) - (match-record config - (services config-dirname run-directory) - `((,config-dirname - ,(file-union - config-dirname - (map (lambda (service-config) - (match-record service-config - (name authmech log-level raw-file) - `(,name ,(plain-file - name - (or raw-file - (format #f - "pwcheck_method: ~a~%saslauthd_path: ~a/mux~%log_level: ~a~%" - authmech - run-directory - log-level)))))) - services)))))) - -(define (cyrus-sasl-activation config) - (match-record config - (user run-directory) - #~(begin - (use-modules (guix build utils)) - (format (current-error-port) - "Creating Cyrus SASL socket directory: \"~a\".~%" #$run-directory) - (mkdir-p/perms #$run-directory (getpwnam #$user) #o755)))) - -(define (cyrus-sasl-accounts config) - (match-record config - (user group supplementary-groups) - (list - (user-account - (name user) - (group group) - (supplementary-groups supplementary-groups) - (comment "Cyrus SASL system user") - (home-directory "/var/empty") - (create-home-directory? #f) - (shell - (file-append shadow "/sbin/nologin")) - (system? #t)) - (user-group - (name group) - (system? #t))))) - -(define (cyrus-sasl-shepherd-service config) - (match-record config - (package user group supplementary-groups authmech config-dirname run-directory - services run-in-container? container-name container-namespaces) - (let* ((bin (file-append package "/sbin/saslauthd")) - (cmd (if (not run-in-container?) - bin - (least-authority-wrapper - bin - #:name container-name - #:namespaces container-namespaces - #:mappings (list - (file-system-mapping - (source run-directory) - (target source) - (writable? #t)) - (file-system-mapping - (source "/etc/passwd") - (target source)) - (file-system-mapping - (source "/etc/shadow") - (target source))))))) - (list - (shepherd-service - (provision '(cyrus-sasl)) - (documentation "Run the saslauthd daemon of Cyrus SASL.") - (start #~(make-forkexec-constructor - (list #$cmd "-a" #$authmech "-d" "-m" #$run-directory) - #:user #$user - #:group #$group - #:supplementary-groups '(#$@supplementary-groups))) - (stop #~(make-kill-destructor)) - (actions - (list - (shepherd-action - (name 'configuration) - (documentation "Display the name of all registered configuration files.") - (procedure - (let ((names (map cyrus-service-configuration-name services))) - #~(lambda _ - (for-each (lambda (name) - (format #t "/etc/~a/~a~%" #$config-dirname name)) - '#$names)))))))))))) - -(define cyrus-sasl-service-type - (service-type - (name 'cyrus-sasl) - (extensions - (list - (service-extension etc-service-type - cyrus-sasl-etc-files) - (service-extension activation-service-type - cyrus-sasl-activation) - (service-extension profile-service-type - (compose list cyrus-sasl-configuration-package)) - (service-extension account-service-type - cyrus-sasl-accounts) - (service-extension shepherd-root-service-type - cyrus-sasl-shepherd-service))) - (compose s1:concatenate) - (extend (lambda (config services) - (cyrus-sasl-configuration - (inherit config) - (services - (append - (cyrus-sasl-configuration-services config) - services))))) - (default-value (cyrus-sasl-configuration)) - (description "Run the @code{saslauthd} daemon from the Cyrus SASL package. - -Services can extend @code{cyrus-sasl-service-type}, and provide their own list -of @code{cyrus-service-configuration} entries to be registered in this service. - -For the @code{saslauthd} daemon to be able to authenticate using the \"shadow\" -@code{authmech}, it needs read access to the @file{/etc/shadow} file. This is -accomplished by default by adding the @code{etc-shadow} group to the list of -supplementary groups of the running daemon, and by enabling the -@code{shadow-group-service-type} service. - -By default, the daemon runs in a container."))) - - -(define-record-type* - dkimproxyout-configuration - make-dkimproxyout-configuration - dkimproxyout-configuration? - (package dkimproxyout-configuration-package (default dkimproxy)) - (user dkimproxyout-configuration-user (default "dkimproxyout")) - (group dkimproxyout-configuration-group (default "dkimproxyout")) - (supplementary-groups dkimproxyout-configuration-supplementary-groups (default '())) - (config-name dkimproxyout-configuration-config-name (default "dkimproxyout.conf")) - (config-extra dkimproxyout-configuration-config-extra (default "")) - (raw-file dkimproxyout-configuration-raw-file (default #f)) - (listen dkimproxyout-configuration-listen (default "127.0.0.1:10027")) - (relay dkimproxyout-configuration-relay (default "127.0.0.1:10028")) - (domains dkimproxyout-configuration-domains (default (list (gethostname)))) - (selector dkimproxyout-configuration-selector (default "dkimproxyout")) - (key-size dkimproxyout-configuration-key-size (default 2048)) - (data-directory dkimproxyout-configuration-data-directory (default "/var/lib/dkimproxyout")) - (run-in-container? dkimproxyout-configuration-run-in-container? (default #t)) - (container-name dkimproxyout-configuration-container-name (default "dkimproxyout")) - (container-namespaces dkimproxyout-configuration-container-namespaces (default (s1:fold delq container:%namespaces '(net))))) - -(define (generate-out.cf config) - (match-record config - (config-extra listen relay domains selector data-directory) - (format #f - "listen ~a -relay ~a - -domain ~a -selector ~a - -signature dkim(c=relaxed/relaxed,a=rsa-sha256) - -keyfile ~a/private.key -~a" - listen - relay - (string-join domains ",") - selector - data-directory - config-extra))) - -(define (dkimproxyout-etc-files config) - (match-record config - (config-name raw-file) - `((,config-name ,(plain-file config-name - (or raw-file - (generate-out.cf config))))))) - -(define (dkimproxyout-accounts config) - (match-record config - (user group supplementary-groups) - (list - (user-account - (name user) - (group group) - (supplementary-groups supplementary-groups) - (comment "DKIMproxy.out signing system user") - (home-directory "/var/empty") - (create-home-directory? #f) - (shell - (file-append shadow "/sbin/nologin")) - (system? #t)) - (user-group - (name group) - (system? #t))))) - -(define (dkimproxyout-activation config) - (match-record config - (user data-directory key-size) - #~(begin - (use-modules (guix build utils)) - (let* ((user (getpwnam #$user)) - (uid (passwd:uid user)) - (gid (passwd:gid user)) - (private-key (string-append #$data-directory "/private.key")) - (public-key (string-append #$data-directory "/public.key"))) - (format (current-error-port) - "Creating DKIMproxy.out data directory: \"~a\".~%" #$data-directory) - (mkdir-p/perms #$data-directory user #o755) - (unless (file-exists? private-key) - (format (current-error-port) - "The public/private keypair doesn't exist yet. Generating one...~%") - (cond - ((zero? (system* #$(file-append openssl "/bin/openssl") - "genrsa" - "-out" - private-key - (number->string #$key-size))) - (format (current-error-port) - "DKIMproxy.out private key file created: \"~a\".~%" private-key) - (invoke #$(file-append openssl "/bin/openssl") - "rsa" - "-in" - private-key - "-pubout" - "-out" - public-key) - (format (current-error-port) - "Setting permissions for the public/private DKIMproxy.out keypair: \"~a/{public,private}.key\".~%" #$data-directory) - (chown private-key uid gid) - (chown public-key uid gid) - (chmod private-key #o400) - (chmod public-key #o644)) - (else - (format (current-error-port) - "ERROR: failed to create DKIMproxy.out private key file: \"~a\".~%" private-key)))))))) - -(define (dkimproxyout-shepherd-service config) - (match-record config - (package user group supplementary-groups config-name data-directory - run-in-container? container-name container-namespaces) - (let* ((config-file (string-append "/etc/" config-name)) - (bin (file-append package "/bin/dkimproxy.out")) - (cmd (if (not run-in-container?) - bin - (least-authority-wrapper - bin - #:name container-name - #:namespaces container-namespaces - #:mappings (list - (file-system-mapping - (source "/etc/protocols") - (target source)) - (file-system-mapping - (source config-file) - (target source)) - (file-system-mapping - (source - (string-append data-directory "/private.key")) - (target source))))))) - (list - (shepherd-service - (provision '(dkimproxyout)) - (documentation "Run the outbound DKIMProxy.out daemon.") - (start #~(make-forkexec-constructor - (list #$cmd "--conf_file" #$config-file) - #:user #$user - #:group #$group - #:supplementary-groups '(#$@supplementary-groups))) - (stop #~(make-kill-destructor)) - (actions - (list - (shepherd-action - (name 'configuration) - (documentation "Display the name of the configuration file being used.") - (procedure - #~(lambda _ - (format #t "~a~%" #$config-file))))))))))) - -(define dkimproxyout-service-type - (service-type - (name 'dkimproxyout) - (extensions - (list - (service-extension etc-service-type - dkimproxyout-etc-files) - (service-extension account-service-type - dkimproxyout-accounts) - (service-extension activation-service-type - dkimproxyout-activation) - (service-extension profile-service-type - (compose list dkimproxyout-configuration-package)) - (service-extension shepherd-root-service-type - dkimproxyout-shepherd-service))) - (default-value (dkimproxyout-configuration)) - (description "Run the @code{dkimproxy.out} SMTP outbound proxy for adding -DKIM signature headers to emails. This daemon is meant to be used in companiong -with an SMTP server, such as Postfix. - -On startup, it creates the keypair to be used for signing if the keypair doesn't -exist yet. The corresponding public.key is kept in the same directory as the -private key. The default location for the private key is -@file{/var/lib/dkimproxyout/private.key}, so the public key is kept at -@file{/var/lib/dkimproxyout/public.key}, so that it can be added as a TXT DNS -entry. - -By default, the daemon runs in a container."))) - - -(define-record-type* - postfix-configuration - make-postfix-configuration - postfix-configuration? - (package postfix-configuration-package (default postfix)) - (enable-submission? postfix-configuration-enable-submission? (default #f)) - (set-sendmail? postfix-configuration-set-sendmail? (default #t)) - (master.cf-file postfix-configuration-master.cf-file (default #f)) - (main.cf-file postfix-configuration-main.cf-file (default #f)) - (master.cf-extra postfix-configuration-master.cf-extra (default "")) - (main.cf-extra postfix-configuration-main.cf-extra (default "")) - (config-dirname postfix-configuration-config-dirname (default "postfix")) - (mail-directory postfix-configuration-mail-directory (default "/var/mail/")) - (data-directory postfix-configuration-data-directory (default "/var/lib/postfix")) - (queue-directory postfix-configuration-queue-directory (default "/var/spool/postfix")) - (user postfix-configuration-user (default "postfix")) - (group postfix-configuration-group (default "postfix")) - (supplementary-groups postfix-configuration-supplementary-groups (default '())) - (setgid-group postfix-configuration-setgid-group (default "postdrop")) - (root-aliases postfix-configuration-root-aliases (default '("abuse" "admin" "hostmaster" "postmaster"))) - (cert-file postfix-configuration-cert-file (default #f)) - (key-file postfix-configuration-key-file (default #f)) - (hostname postfix-configuration-hostname (default (gethostname))) - (dkim-filter-listen postfix-configuration-dkim-filter-listen (default "[127.0.0.1]:10027")) - (dkim-filter-relay postfix-configuration-dkim-filter-relay (default "127.0.0.1:10028")) - (sasl-dirname postfix-configuration-sasl-dirname (default "/etc/sasl2")) - (run-in-container? postfix-configuration-run-in-container? (default #f)) - (container-name postfix-configuration-container-name (default "postfix")) - (container-namespaces postfix-configuration-container-namespaces (default (s1:fold delq container:%namespaces '(net))))) - -(define (dksign-filter dkim-filter-listen) - (format #f - " - -o content_filter=dksign:~a" - dkim-filter-listen)) - -(define (submission-config dkim-filter-listen) - (format #f - " -submission inet n - n - - smtpd -o syslog_name=postfix/submission - -o smtpd_tls_security_level=encrypt - -o content_filter=dksign:~a" - dkim-filter-listen)) - -(define (dksign-config dkim-filter-relay) - (format #f - " - -dksign unix - - n - - smtp - -o syslog_name=postfix/dkimproxyout-listen - -o smtp_send_xforward_command=yes - -o smtp_discard_ehlo_keywords=8bitmime,starttls - -~a inet n - n - - smtpd - -o syslog_name=postfix/dkimproxyout-relay - -o content_filter= - -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks - -o smtpd_helo_restrictions= - -o smtpd_client_restrictions= - -o smtpd_sender_restrictions= - -o smtpd_recipient_restrictions=permit_mynetworks,reject - -o mynetworks=127.0.0.0/8 - -o smtpd_authorized_xforward_hosts=127.0.0.0/8 -" - dkim-filter-relay)) - -(define (generate-master.cf config) - (match-record config - (enable-submission? master.cf-extra dkim-filter-listen dkim-filter-relay) - (format #f - "# ============================================================================================================ -# service type private unpriv chroot wakeup maxproc command + args -# (yes) (yes) (no) (never) (100) -# ============================================================================================================= - -anvil unix - - n - 1 anvil -bounce unix - - n - 0 bounce -cleanup unix n - n - 0 cleanup -defer unix - - n - 0 bounce -discard unix - - n - - discard -error unix - - n - - error -flush unix n - n 1000? 0 flush -lmtp unix - - n - - lmtp -local unix - n n - - local -pickup unix n - n 60 1 pickup~a -proxymap unix - - n - - proxymap -proxywrite unix - - n - 1 proxymap -qmgr unix n - n 300 1 qmgr -relay unix - - n - - smtp -retry unix - - n - - error -rewrite unix - - n - - trivial-rewrite -scache unix - - n - 1 scache -showq unix n - n - - showq -smtp inet n - n - - smtpd -o syslog_name=postfix/smtp -smtp unix - - n - - smtp -tlsmgr unix - - n 1000? 1 tlsmgr -trace unix - - n - 0 bounce -verify unix - - n - 1 verify -virtual unix - n n - - virtual -postlog unix-dgram n - n - 1 postlogd -~a~a~a" - (if enable-submission? (dksign-filter dkim-filter-listen) "") - (if enable-submission? (submission-config dkim-filter-listen) "") - (if enable-submission? (dksign-config dkim-filter-relay) "") - master.cf-extra))) - -(define (cert-for prefix config) - (match-record config - (cert-file hostname) - (or cert-file (format #f "/etc/letsencrypt/live/~a~a/fullchain.pem" prefix hostname)))) - -(define (key-for prefix config) - (match-record config - (key-file hostname) - (or key-file (format #f "/etc/letsencrypt/live/~a~a/privkey.pem" prefix hostname)))) - -(define (main.cf-internet-extra hostname cert key sasl-dirname) - (format #f - " -myhostname = ~a - -smtpd_use_tls = yes -smtpd_tls_cert_file = ~a -smtpd_tls_key_file = ~a -smtp_use_tls = $smtpd_use_tls -smtp_tls_cert_file = $smtpd_tls_cert_file -smtp_tls_key_file = $smtpd_tls_key_file - -smtp_tls_security_level = may - -recipient_delimiter = + - -smtpd_sasl_tls_security_options = noanonymous -smtpd_tls_security_level = may -smtpd_tls_auth_only = yes - -smtpd_relay_restrictions = $smtpd_recipient_restrictions -smtpd_recipient_restrictions = permit_mynetworks, - permit_sasl_authenticated, reject_unauth_destination -smtpd_sasl_auth_enable = yes -cyrus_sasl_config_path = ~a -debug_peer_list = 127.0.0.1 - -milter_default_action = accept -" - hostname - cert - key - sasl-dirname)) -(define main.cf-local-extra - " -mynetworks = 127.0.0.0/8 -") - -(define (generate-main.cf config) - (match-record config - (enable-submission? mail-directory queue-directory data-directory - user setgid-group hostname main.cf-extra sasl-dirname) - (format #f - "compatibility_level = 3.6 - -queue_directory = ~a -data_directory = ~a -mail_owner = ~a -setgid_group = ~a - -header_checks = regexp:{ { /^Received:.*/ IGNORE }, { /^X-Originating-IP:.*/ IGNORE } } - -mail_spool_directory = ~a - -message_size_limit = 102400000 -mailbox_size_limit = 5120000000 - -~a~a" - - queue-directory - data-directory - user - setgid-group - mail-directory - main.cf-extra - (if enable-submission? - (main.cf-internet-extra - hostname - (cert-for "" config) - (key-for "" config) - sasl-dirname) - main.cf-local-extra)))) - -(define (postfix-etc-files config) - (match-record config - (master.cf-file main.cf-file config-dirname) - `((,config-dirname - ,(file-union - config-dirname - `(("master.cf" ,(plain-file "master.cf" (or master.cf-file (generate-master.cf config)))) - ("main.cf" ,(plain-file "main.cf" (or main.cf-file (generate-main.cf config)))))))))) - -(define (postfix-accounts config) - (match-record config - (user group supplementary-groups setgid-group) - (list - (user-account - (name user) - (group group) - (supplementary-groups supplementary-groups) - (comment "Postfix system user") - (home-directory "/var/empty") - (create-home-directory? #f) - (shell - (file-append shadow "/sbin/nologin")) - (system? #t)) - (user-group - (name group) - (system? #t)) - (user-group - (name setgid-group) - (system? #t))))) - -(define (postfix-privileged-programs config) - (match-record config - (package setgid-group set-sendmail?) - (append (list - (privileged-program - (program (file-append package "/sbin/postdrop")) - (setuid? #f) - (setgid? #t) - (group setgid-group)) - (privileged-program - (program (file-append package "/sbin/postqueue")) - (setuid? #f) - (setgid? #t) - (group setgid-group))) - (if set-sendmail? - (list - (privileged-program - (program (file-append package "/sbin/sendmail")) - (setuid? #f) - (setgid? #t) - (group setgid-group))) - '())))) - -(define (postfix-activation config) - (match-record config - (package mail-directory queue-directory) - #~(begin - (use-modules (guix build utils)) - (let ((user (getpwnam "root"))) - (unless (directory-exists? #$mail-directory) - (format (current-error-port) - "Creating email spool director: \"~a\".~%" #$mail-directory) - (mkdir-p/perms #$mail-directory user #o755)) - (format (current-error-port) - "Creating Postfix queue directory: \"~a\".~%" #$queue-directory) - (mkdir-p/perms #$queue-directory user #o755) - (format (current-error-port) - "Updating /etc/aliases.~%") -;; FIXME -#; - (invoke #$(file-append package "/bin/newaliases")))))) - -(define (postfix-shepherd-service config) - (match-record config - (package config-dirname data-directory queue-directory - run-in-container? container-name container-namespaces) - (let* ((config-dir (string-append "/etc/" config-dirname)) - (bin (file-append package "/sbin/postfix")) - (cmd (if (not run-in-container?) - bin - (least-authority-wrapper - bin - #:name container-name - #:namespaces container-namespaces - #:mappings (list - (file-system-mapping - (source data-directory) - (target source) - (writable? #t)) - (file-system-mapping - (source queue-directory) - (target source) - (writable? #t))))))) - (list - (shepherd-service - (provision '(postfix)) - (documentation - "Run the Postfix MTA. - -This is the entrypoint for starting the \"master\" process. Then the \"master\" -process itself takes responsability of starting all the required daemons and -commands.") - (start #~(make-forkexec-constructor - (list #$cmd "-c" #$config-dir "start-fg") - #:pid-file "/var/lib/postfix/master.lock")) - (actions - (list - (shepherd-action - (name 'configuration) - (documentation "Display the name of the \"master.cf\" and \"main.cf\" file being used.") - (procedure - #~(lambda _ - (format #t "~a/master.cf~%" #$config-dir) - (format #t "~a/main.cf~%" #$config-dir)))) - (shepherd-action - (name 'reload) - (documentation - "Re-read the \"master.cf\" and \"main.cf\" configuration files. - -Daemon processes terminate when possible, and when restarted use the values of -the new configuration files. - -This live-reload option is usually preferable over a stop/start cycle, as it -incurs in no interruption of the running service.") - (procedure - #~(lambda _ - (invoke #$cmd "-c" #$config-dir "reload"))))))))))) - -(define (postfix-aliases config) - (match-record config - (root-aliases) - (map (lambda (alias) - `(,alias "root")) - root-aliases))) - -(define (postfix-nginx-locations config) - (match-record config - (hostname) - (list - (nginx-server-configuration - (server-name (list (string-append "mta-sts." hostname))) - (listen '("[::]:443 ssl" "443 ssl")) - (ssl-certificate (cert-for "mta-sts." config)) - (ssl-certificate-key (key-for "mta-sts." config)) - (locations - (list - (nginx-location-configuration - (uri "= /.well-known/mta-sts.txt") - (body - (list - (list "alias " - (plain-file - "mta-sts.txt" - (format #f - "version: STSv1 -mode: enforce -mx: ~a -max_age: 604800 -" - hostname)) - ";")))))))))) - -(define (postfix-certificates config) - (match-record config - (hostname) - (list - (certificate-configuration - (domains (list (string-append "mta-sts." hostname))))))) - -(define (postfix-sasl-services _config) - (list - (cyrus-service-configuration - (name "smtpd.conf")))) - -(define local-postfix-service-extensions - (list - (service-extension etc-service-type - postfix-etc-files) - (service-extension account-service-type - postfix-accounts) - (service-extension privileged-program-service-type - postfix-privileged-programs) - (service-extension activation-service-type - postfix-activation) - (service-extension profile-service-type - (compose list postfix-configuration-package)) - (service-extension shepherd-root-service-type - postfix-shepherd-service))) - -(define local-postfix-service-type - (service-type - (name 'postfix) - (extensions local-postfix-service-extensions) - (default-value (postfix-configuration)) - (description - "Run the Postfix MTA. - -This is the top-level system service for Postfix, targeted at \"local\" -installations, that is, not internet-facing, usually for delivery of cronjob -emails, or for offline email sending in a laptop via a relay. - -It includes: -@itemize -@item populating @file{/etc/postfix/} with read-only configuration files; -@item the user and groups used by Postfix when handling email delivery; -@item the special setgid binaries for daily usage, such as \"sendmail\"; -@item the Shepherd service for starting, stopping and @emph{reloading} the - service without restarting it; -@item the activation script for creating the required directories and - configuring them with the correct permissions; -@item the binaries in the system profile so that one doesn't need to explicilty - include the package when the service is already enabled. -@end itemize - -An extension to the log-rotation service isn't included: the default rottlog -configuration already includes @file{/var/log/maillog} in its routine, so it is -kept out. - -The defaults of @code{} provides sane default values for -most things, such as group names, data and queue directories, etc. When used -as-is, it creates a Postfix server that sends email locally-only, and one can -add relaying configuration via the @code{main.cf-extra} parameter."))) - -(define internet-postfix-service-type - (service-type - (name 'postfix) - (extensions - (append - local-postfix-service-extensions - (list - (service-extension mail-aliases-service-type - postfix-aliases) - (service-extension nginx-service-type - postfix-nginx-locations) - (service-extension certbot-service-type - postfix-certificates) - (service-extension cyrus-sasl-service-type - postfix-sasl-services)))) - (default-value (postfix-configuration - (enable-submission? #t))) - (description - "Run the Postfix MTA. - -This is the top-level system service for Postfix, targeted at \"internet\" -installations, that is, internet-facing SMTP servers, for sending and receiving -emails to other servers, as well as local delivery of emails between users or by -system users such as cronjobs. - -It includes everything from @code{local-postfix-service-type}, plus: -@itemize -@item nginx configuration for answering the @code{mta-sts.$domain} HTTP - subdomain, specifically the @code{.well-known/mta-sts.txt} URL; -@item certbot extension for acquiring the certificate for @code{mta-sts.$domain} - so that the item above happens via HTTPS; -@item best-practices email aliases for administering a SMTP server; -@item cyrus-sasl extension for authenticating SMTP users via the Cyrus SASL - @code{saslauthd} daemon. -@end itemize - -The defaults of @code{} provides sane default values for -most things, hostname, certificates, permissions, etc. When used as-is, it -creates a Postfix server that can send and receive emails from the internet -correctly."))) - - - -(define-record-type* - dovecot-configuration - make-dovecot-configuration - dovecot-configuration? - (package dovecot-configuration-package (default dovecotx)) - (mail-location dovecot-configuration-mail-location (default "/var/mail/")) - (raw-file dovecot-configuration-raw-file (default #f)) - (extra-content dovecot-configuration-extra-content (default "")) - (config-dirname dovecot-configuration-config-dirname (default "dovecot")) - (config-filename dovecot-configuration-config-filename (default "dovecot.conf")) - (user dovecot-configuration-user (default "dovecot")) - (group dovecot-configuration-group (default "dovecot")) - (supplementary-groups dovecot-configuration-supplementary-groups (default '())) - (auth-worker-group dovecot-configuration-auth-worker-group (default "etc-shadow")) - (untrusted-user dovecot-configuration-untrusted-user (default "dovenull")) - (untrusted-group dovecot-configuration-untrusted-group (default "dovenull")) - (untrusted-supplementary-groups dovecot-configuration-untrusted-supplementary-groups (default '())) - (base-dir dovecot-configuration-base-dir (default "/var/run/dovecot")) - (state-dir dovecot-configuration-state-dir (default "/var/lib/dovecot")) - (hostname dovecot-configuration-hostname (default (gethostname))) - (run-in-container? dovecot-configuration-run-in-container? (default #f)) - (container-name dovecot-configuration-container-name (default "dovecot")) - (container-namespaces dovecot-configuration-container-namespaces (default (s1:fold delq container:%namespaces '(net))))) - -(define (generate-dovecot-config config) - (match-record config - (mail-location user group auth-worker-group untrusted-user - hostname base-dir state-dir extra-content) - (format #f - "protocols = imap - -default_internal_user = ~a -default_internal_group = ~a -default_login_user = ~a -auth_mechanisms = plain login -auth_username_format = %n - -passdb { - driver = shadow -} -userdb { - driver = passwd -} -service auth-worker { - group = ~a -} - -ssl = required -ssl_cert = - (raw-file config-dirname config-filename) - `((,config-dirname - ,(file-union - config-dirname - `((,config-filename ,(plain-file config-filename - (or raw-file - (generate-dovecot-config config)))))))))) - -(define (dovecot-accounts config) - (match-record config - ( user group supplementary-groups - untrusted-user untrusted-group untrusted-supplementary-groups) - (list - (user-account - (name user) - (group group) - (supplementary-groups supplementary-groups) - (comment "Dovecot system user") - (home-directory "/var/empty") - (create-home-directory? #f) - (shell - (file-append shadow "/sbin/nologin")) - (system? #t)) - (user-account - (name untrusted-user) - (group untrusted-group) - (supplementary-groups untrusted-supplementary-groups) - (comment "Dovecot user for untrusted logins") - (home-directory "/var/empty") - (create-home-directory? #f) - (shell - (file-append shadow "/sbin/nologin")) - (system? #t)) - (user-group - (name group) - (system? #t)) - (user-group - (name untrusted-group) - (system? #t))))) - -(define (dovecot-activation config) - (match-record config - (base-dir state-dir) - #~(begin - (use-modules (guix build utils)) - (let ((user (getpwnam "root")) - (dhparam.pem (string-append #$state-dir "/dhparam.pem"))) - (format (current-error-port) - "Creating Dovecot base_dir directory: \"~a\".~%" #$base-dir) - (mkdir-p/perms #$base-dir user #o755) - (mkdir-p/perms #$state-dir user #o755) - (unless (file-exists? dhparam.pem) - (format (current-error-port) - "dhparam.pem file doesn't exist yet. Generating one...~%") - (cond - ((zero? (system* (string-append #$openssl "/bin/openssl") - "dhparam" "-out" dhparam.pem "2048")) - (format (current-error-port) - "Dovecot2 dhparam.pem file created: \"~a\".~%" dhparam.pem)) - (else - (format (current-error-port) - "Failed to create dhparam.pem file: \"~a\".~%" dhparam.pem)))))))) - -(define (dovecot-shepherd-service config) - (match-record config - (package config-dirname config-filename - run-in-container? container-name container-namespaces) - (let* ((config-file (string-append "/etc/" config-dirname "/" config-filename)) - (bin (file-append package "/sbin/dovecot")) - (cmd (if (not run-in-container?) - bin - (least-authority-wrapper - bin - #:name container-name - #:namespaces container-namespaces - #:mappings (list - (file-system-mapping - (source "/etc/shadow") - (target source))))))) - (list - (shepherd-service - (provision '(dovecot)) - (documentation "Run the Dovecot daemon.") - (start #~(make-forkexec-constructor - (list #$cmd "-F" "-c" #$config-file))) - (stop #~(make-kill-destructor)) - (actions - (list - (shepherd-action - (name 'configuration) - (documentation "Display the name of the configuration file being used.") - (procedure - #~(lambda _ - (format #t "~a~%" #$config-file)))) - (shepherd-action - (name 'reload) - (documentation "Re-read the configuration file without restarting the running dovecot daemon.") - (procedure - #~(lambda _ - (invoke #$(file-append package "/bin/doveadm") - "-c" - #$config-file - "reload"))))))))))) - -(define dovecot-service-type - (service-type - (name 'dovecot) - (extensions - (list - (service-extension etc-service-type - dovecot-etc-files) - (service-extension account-service-type - dovecot-accounts) - (service-extension activation-service-type - dovecot-activation) - (service-extension profile-service-type - (compose list dovecot-configuration-package)) - (service-extension shepherd-root-service-type - dovecot-shepherd-service))) - (default-value (dovecot-configuration)) - (description "Run the Dovecot IMAP @code{dovecot} daemon. - -This is the top-level system service for Dovecot, using the UNIX password stored -at @file{/etc/shadow} for authenticating IMAP connections. - -It includes: -@itemize -@item creating the configuration file at @file{/etc/dovecot/dovecot.conf} by - default; -@item the user and groups used by Dovecot both system and untrusted users; -@item the activation script for creating the required directories and the - @file{dhparam.pem} file if it is missing; -@item the Shepherd service for starting, stopping and @emph{reloading} the - service without restarting it; -@item the binaries in the system profile so that one doesn't need to explicilty - include the package when the service is already enabled. -@end itemize - -An extension to the log-rotation service isn't included: the default rottlog -configuration already includes @file{/var/log/maillog} in its routine, so it is -kept out. - -The defaults of @code{} provides sane default values for -most things, such as group names, data and mail directories, etc. When used -as-is, it creates a Dovecot server that and serve and authenticate IMAP -connections correctly."))) - - - -(define setenvfmt "Environment variable `~a' set to `~a'.~%") -(define-public gol - (let ((pkg go-1.23)) - (package - (inherit pkg) - (name "gol") - (arguments - (substitute-keyword-arguments (package-arguments pkg) - ((#:tests? _) #f) - ((#:phases phases) - #~(modify-phases #$phases - (add-before 'build 'recover-binary-stdlib - (lambda _ - (let ((name "GODEBUG") - (value "installgoroot=all")) - (setenv name value) - (format #t #$setenvfmt name value)))) - ;; Not all of us work with fancy modern computers that have have - ;; too much memory and computing power for programmers to waste. - ;; Therefore, Go's default timeout of 10 minutes (!!) to run all - ;; tests isn't enough, so we disable it with an huge value and - ;; instead inherit the effective timeout from Guix itself. How not - ;; to like software that adheres so well to the Unix philosophy? - (add-before 'build 'tolerate-slow-tests - (lambda _ - (let ((name "GO_TEST_TIMEOUT_SCALE") - (value "10")) - (setenv name value) - (format #t #$setenvfmt name value)))) - (add-after 'install 'install-binaries - (lambda _ - (copy-recursively "pkg" - (string-append #$output "/lib/go/pkg")))) - (delete 'strip)))))))) - -(define-public cgit-pre-configuration - (cgit-configuration - (nginx '()) - (source-filter (file-append cgit "/lib/cgit/filters/syntax-highlighting.py")) - (about-filter (file-append cgit "/lib/cgit/filters/about-formatting.sh")) - (virtual-root "/git/") - (remove-suffix? #t) - (nocache? #t) - (enable-commit-graph? #t) - (enable-follow-links? #t) - (enable-index-links? #t) - (enable-index-owner? #f) - (enable-log-filecount? #t) - (enable-log-linecount? #t) - (enable-remote-branches? #t) - (enable-subject-links? #t) - (max-repo-count 0) - (snapshots '("tar.gz" "tar.xz")) - (root-desc "Patches welcome!") - (root-title (string-append (gethostname) " repositories")) - (logo "/git/static/cgit.png") - (favicon "/git/static/favicon.ico") - (css "/git/static/cgit.css") - (extra-options - '("enable-blame=1" - "nocache=1" - "mimetype.mjs=text/javascript" - "readme=:README.md" - "readme=:README")))) - -(define-public (tld-certbot-configuration tld) - (certbot-configuration - (email (string-append "root@" tld)) - (certificates - (list - (certificate-configuration - (domains (list tld))))))) ;; FIXME: SIGHUP nginx/untls - -(define-public (openssh-default-configuration authorized-keys) - (openssh-configuration - (openssh openssh-sans-x) - (password-authentication? #f) - (authorized-keys authorized-keys) - (extra-content "MaxSessions 20 -ClientAliveInterval 30 -ClientAliveCountMax 23 -SetEnv GIT_CONFIG_GLOBAL=/etc/gitconfig"))) - - - -(define-public (dkim-public-key-from path) - (if (file-exists? path) - (string-join (reverse - (cddr - (reverse - (cdr - (string-split (call-with-input-file - path - textual-ports:get-string-all) - #\newline))))) - "") - "stub-public-key-for-building")) - -(define-public (build-ipv4-reverse-domain ipv4) - (string-append - (string-join (reverse - (string-split ipv4 - #\.)) - ".") - ".in-addr.arpa")) - -(define-public (build-ipv6-reverse-domain ipv6) - (string-append - (string-join (reverse - (map (lambda (s) (format #f "~a" s)) - (string->list - (string-delete #\: ipv6)))) - ".") - ".ip6.arpa")) - -(define-public (knot-zones-for tld ipv4 ipv6) - (define dkim-selector "dkimproxyout") - (define dkim-public-key-path "/var/lib/dkimproxyout/public.key") - (define dkim-name (string-append dkim-selector "._domainkey")) - (let ((tld. (string-append tld ".")) - (ns1 (format #f "ns1.~a." tld)) - (ns2 (format #f "ns2.~a." tld)) - (mail (format #f "hostmaster.~a." tld)) - (dkim-public-key (dkim-public-key-from dkim-public-key-path)) - (ipv4-reverse-domain (build-ipv4-reverse-domain ipv4)) - (ipv6-reverse-domain (build-ipv6-reverse-domain ipv6))) - (define-zone-entries tld-zone - ("@" "" "IN" "NS" ns1) - ("@" "" "IN" "NS" ns2) - ("ns1" "" "IN" "A" ipv4) - ("ns1" "" "IN" "AAAA" ipv6) - ("ns2" "" "IN" "A" ipv4) - ("ns2" "" "IN" "AAAA" ipv6) - ("@" "" "IN" "A" ipv4) - ("@" "" "IN" "AAAA" ipv6) - ("@" "" "IN" "CAA" "0 issue \"letsencrypt.org\"") - ("@" "" "IN" "CAA" "0 issuewild \";\"") - ("@" "" "IN" "CAA" "0 iodef \"mailto:eu@euandre.org\"") - ("mta-sts" "" "IN" "A" ipv4) - ("mta-sts" "" "IN" "AAAA" ipv6) - ("_mta-sts" "" "IN" "TXT" "\"v=STSv1; id=20230314\"") - ("@" "" "IN" "MX" (format #f "10 ~a." tld)) - ("_dmarc" "" "IN" "TXT" "\"v=DMARC1; p=quarantine\"") - ("@" "" "IN" "TXT" (format #f "\"v=spf1 a:~a -all\"" tld)) - (dkim-name "" "IN" "TXT" (format #f "\"v=DKIM1; k=rsa; t=s; p=~a\"" dkim-public-key))) - (define-zone-entries ipv4-reverse-domain-zone - ("@" "" "IN" "PTR" tld.) - ("@" "" "IN" "NS" ns1) - ("@" "" "IN" "NS" ns2)) - (define-zone-entries ipv6-reverse-domain-zone - ("@" "" "IN" "PTR" tld.) - ("@" "" "IN" "NS" ns1) - ("@" "" "IN" "NS" ns2)) - (list - (knot-zone-configuration - (domain tld) - (semantic-checks? #t) - (zone - (zone-file - (origin tld) - (ns ns1) - (mail mail) - (entries tld-zone)))) - (knot-zone-configuration - (domain ipv4-reverse-domain) - (semantic-checks? #t) - (zone - (zone-file - (origin ipv4-reverse-domain) - (ns ns1) - (mail mail) - (entries ipv4-reverse-domain-zone)))) - (knot-zone-configuration - (domain ipv6-reverse-domain) - (semantic-checks? #t) - (zone - (zone-file - (origin ipv6-reverse-domain) - (ns ns1) - (mail mail) - (entries ipv6-reverse-domain-zone))))))) - -(define-public (knot-zones-configuration tld ipv4 ipv6) - (knot-configuration - (zones - (knot-zones-for tld ipv4 ipv6)))) - -(define-public sqlitex - (package - (inherit sqlite-next) - (name "sqlitex") - (arguments - (list - #:tests? #f - #:configure-flags - #~(list - "--disable-option-checking" - "--disable-shared" - "--enable-static" - "--disable-editline" - "--disable-readline" - "--enable-threadsafe" - "--disable-dynamic-extensions" - "--disable-math" - "--disable-fts3" - "--disable-fts4" - "--enable-fts5" - "--disable-rtree" - "--disable-debug" - "--disable-session" - (string-join - '("CFLAGS=" - "-D_POSIX_C_SOURCE=200809L" - "-D_XOPEN_SOURCE=700" - "-DSQLITE_DEFAULT_FOREIGN_KEYS=1" - "-DSQLITE_ENABLE_COLUMN_METADATA" - "-DSQLITE_DQS=0" - "-DSQLITE_THREADSAFE=1" - "-DSQLITE_DEFAULT_MEMSTATUS=0" - "-DSQLITE_DEFAULT_SYNCHRONOUS=3" - "-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=3" - "-DSQLITE_LIKE_DOESNT_MATCH_BLOBS" - "-DSQLITE_MAX_EXPR_DEPTH=0" - "-DSQLITE_OMIT_DEPRECATED" - "-DSQLITE_OMIT_PROGESS_CALLBACK" - "-DSQLITE_USE_ALLOCA" - "-DSQLITE_STRICT_SUBTYPE=1" - "-DSQLITE_OMIT_AUTOMATIC_INDEX" - "-DSQLITE_CASE_SENSITIVE_LIKE" - "-DSQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA" - "-DSQLITE_DIRECT_OVERFLOW_READ" - "-DSQLITE_USE_URI" - "-DSQLITE_ENABLE_API_ARMOR" - "-DSQLITE_ENABLE_QPSG" - "-DSQLITE_ENABLE_SNAPSHOT" - "-DSQLITE_OMIT_SEH" - "-DSQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS" - "-DSQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA" - "-DSQLITE_OMIT_GET_TABLE" - "-DSQLITE_OMIT_TCL_VARIABLE" - "-DSQLITE_OMIT_TRACE" - "-DSQLITE_OMIT_UTF16" - "-g" - "-O3" - "-march=native" - "-std=c99" - "-Wvla" - "-fPIE")) - "LDFLAGS=--static -flto"))) - (inputs - (list)) - (native-inputs - (list - editline)) - (outputs - '("out")))) - -(define-public scryptkdf - (package - (inherit scrypt) - (name "scryptkdf") - (inputs - `(("openssl:out" ,openssl "out") - ("openssl:static" ,openssl "static"))) - (arguments - (substitute-keyword-arguments (package-arguments scrypt) - ((#:configure-flags flags ''()) - #~(append - #$flags - (list - "--enable-libscrypt-kdf" - "--disable-shared" - "--enable-static" - (string-join - '("CFLAGS=" - "-D_POSIX_C_SOURCE=200809L" - "-D_XOPEN_SOURCE=700" - "-g" - "-O2" - "-march=native" - "-std=c99" - "-Wvla" - "-fPIE")) - "LDFLAGS=--static"))))))) - - - -(list - postfix - mailutils-sendmail - rottlog-mailutils-sendmail - pax-utils - hunspell-dict-en-utf8 - hunspell-dict-pt-utf8 - hunspell-dict-fr-utf8 - hunspell-dict-eo-utf8 - hunspell-dict-es-utf8 - python-telegram-bot - gm2 - ffmpegx - mpvx - dovecotx - sqlitex - scryptkdf - gol) diff --git a/src/secrets/eu@euandre.org.rsa.gpg b/src/secrets/eu@euandre.org.rsa.gpg deleted file mode 100644 index f70c6dc..0000000 --- a/src/secrets/eu@euandre.org.rsa.gpg +++ /dev/null @@ -1,69 +0,0 @@ ------BEGIN PGP MESSAGE----- - -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 -=ro7B ------END PGP MESSAGE----- diff --git a/src/secrets/eu@euandre.org.rsa.pub b/src/secrets/eu@euandre.org.rsa.pub deleted file mode 100644 index 7105487..0000000 --- a/src/secrets/eu@euandre.org.rsa.pub +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqumEtMv28uJ2Ke+HOINb -QmYzuWsRYWfp6TgoNHJNRcTJpIJcgn7tjZtFpya084sfT2CQdbnmXMNIaW8IpNi/ -xZoB2k5G55HGZQ31MvqKJGbWf6pVA25kNoeYe7GWOFJSJugGEcYMc2aMfEsEzZGF -WdlgFx8UoFj/6LYr7OdTnrfkcko2qYd+0adkO8WLs8rRAEhqwG+r51Bo/I3FP6yb -9ZVv53YN0fRTRXSCLBq35uipMRJ441mC1uGckaC0BPA6oB6qCmb1A3Tc/tnmW80A -NAxm996FrqdK1rsnp9HzZmYJ0Jkl1nM6cznwdELsHBmAO3YoFMbWCyP+0B7SoHrF -O/Iau4JjntYlLb2jsUgOZCLXzsatpBsLFtYC+NJxh9kdVCMp829nJfsO02do8rzR -xDq65c8lueTyjF0J4ntZB1O0ILSp3LdSfMC3hTQSE4PTEu1LuExQlvEN63YAb9vh -f0l1sgxvCIEnN0pArJbcTgiglq54x47DMwGKpI9c1DDUlJkYUYpr30WO5B8zpSvo -69rKlMbAh0RyaStHiDbk1G4xR7TmME9JnRUEQN/+pfVKhcf47hABe3BVNWKTJwnY -cSRzMS324vbatA9QC9Csz+cf6vmNtmlu0B1y/DzEtKWtpsu0v4TczdN4+lckZrdk -5x1xz70MvZWzlHE2RQdDio0CAwEAAQ== ------END PUBLIC KEY----- diff --git a/tests/checks/apk.sh b/tests/checks/apk.sh deleted file mode 100755 index 5acb479..0000000 --- a/tests/checks/apk.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -set -eu - - -while getopts 'k:' flag; do - case "$flag" in - k) - KEY="$OPTARG" - ;; - *) - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -if [ -z "${KEY:-}" ]; then - echo 'Missing "-k KEY" argument.' >&2 - exit 2 -fi - -set -x - -REPO="$1/alpine" - -if command -v remembering; then - echo 'remembering(1) is already installed.' >&2 - exit 1 -fi - -if apk info remembering; then - echo 'remembering(1) is already in apk(8) list.' >&2 - exit 1 -fi - -wget -qO- "$REPO"/"$KEY".rsa.pub | doas tee /etc/apk/keys/"$KEY".rsa.pub -printf '%s\n' "$REPO" | doas tee -a /etc/apk/repositories -doas apk add remembering - -remembering --help -remembering -V diff --git a/tests/checks/deb.sh b/tests/checks/deb.sh deleted file mode 100755 index 9a0ba7d..0000000 --- a/tests/checks/deb.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -set -eu -set -x - - -REPO="$1/debian" -KEY="$(printf '%s' "${REPO#https://}" | sed 's|/|-|g').asc" - -if command -v remembering; then - echo 'remembering(1) is already installed.' >&2 - exit 1 -fi - -if apt info remembering; then - echo 'remembering(1) is already in apt(8) list.' >&2 - exit 1 -fi - -wget -qO- "$REPO"/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/"$KEY" -echo "deb $REPO ./" | sudo tee -a /etc/apt/sources.list -sudo apt update -sudo apt install remembering - -remembering --help -remembering -V diff --git a/tests/checks/homebrew.sh b/tests/checks/homebrew.sh deleted file mode 100755 index ba33be8..0000000 --- a/tests/checks/homebrew.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# Load brew(1) -# shellcheck source=/dev/null -. ~/.profile -set -eu -set -x - - -REPO="$1" - -if command -v remembering; then - echo 'remembering(1) is already installed.' >&2 - exit 1 -fi - -if brew info remembering; then - echo 'remembering(1) is already in the list of taps.' >&2 - exit 1 -fi - -brew tap org/euandre "$REPO" -brew install remembering-0-1-2 - -remembering --help -remembering -V diff --git a/tests/internet/etc/dkimproxyout.conf.in b/tests/internet/etc/dkimproxyout.conf.in deleted file mode 100644 index 3ee2466..0000000 --- a/tests/internet/etc/dkimproxyout.conf.in +++ /dev/null @@ -1,9 +0,0 @@ -listen 127.0.0.1:10027 -relay 127.0.0.1:10028 - -domain @HOSTNAME@ -selector dkimproxyout - -signature dkim(c=relaxed/relaxed,a=rsa-sha256) - -keyfile /var/lib/dkimproxyout/private.key diff --git a/tests/internet/etc/dovecot/dovecot.conf.in b/tests/internet/etc/dovecot/dovecot.conf.in deleted file mode 100644 index 6ac013d..0000000 --- a/tests/internet/etc/dovecot/dovecot.conf.in +++ /dev/null @@ -1,54 +0,0 @@ -protocols = imap - -default_internal_user = dovecot -default_internal_group = dovecot -default_login_user = dovenull -auth_mechanisms = plain login -auth_username_format = %n - -passdb { - driver = shadow -} -userdb { - driver = passwd -} -service auth-worker { - group = etc-shadow -} - -ssl = required -ssl_cert = - (pkg:papod-configuration) - '())) +(use-service-modules) (operating-system (host-name "a-internet-test-host") - (skeletons pkg:skeletons) - (users (append (pkg:user-accounts +users+) %base-user-accounts)) (services (append - (list - (service ntp-service-type) - (service dhcpcd-service-type) - ;; (service fail2ban-service-type) - (service pkg:binder-service-type) - (service pkg:glaze-service-type) - (service pkg:hsts-service-type) - (service pkg:untls-service-type) - (service pkg:wscat-service-type) - (service papod-service-type) - (service knot-service-type - (q:knot-zones-configuration "euandre.org" "1.2.3.4" "1:2:3:4:5:6:7:8")) - (service openssh-service-type - (q:openssh-default-configuration (pkg:users->keys +users+))) - (service certbot-service-type (q:tld-certbot-configuration "tld.local")) - (service cgit-service-type q:cgit-pre-configuration) - (service pkg:syskeep-service-type) - (service pkg:cicd-service-type) - (service q:shadow-group-service-type) - (service q:dkimproxyout-service-type) - (service q:cyrus-sasl-service-type) - (service q:dovecot-service-type) - (service q:internet-postfix-service-type) - (service mail-aliases-service-type '())) - pkg:base-services)) + (list) + %base-services)) (bootloader (bootloader-configuration (bootloader grub-bootloader))) diff --git a/tests/internet/tests.scm b/tests/internet/tests.scm deleted file mode 100644 index c4ffe85..0000000 --- a/tests/internet/tests.scm +++ /dev/null @@ -1,72 +0,0 @@ -(use-modules - ((org euandre packages) #:prefix pkg:) - (gnu) - (gnu tests) - (gnu system vm) - (guix profiles)) -(use-service-modules - networking) - - - -(define test-git-os - (simple-operating-system - (service dhcpcd-service-type) - (service pkg:git-service-type - (pkg:git-configuration - (run-server? #t))) - (simple-service 'mkdir-srv-dir activation-service-type - #~(mkdir-p "/srv/git")))) - -(define (test-git-fn) - (let* ((os (marionette-operating-system - test-git-os - #:imported-modules - '((gnu services herd)))) - (vm (virtual-machine - (operating-system os) - (port-forwardings - '())))) - (define test - (with-imported-modules '((gnu build marionette)) - #~(begin - (use-modules - ((srfi srfi-64) #:prefix t:) - ((gnu build marionette) #:prefix mrntt:)) - (define manette - (mrntt:make-marionette (list #$vm))) - (t:test-runner-current (mrntt:system-test-runner #$output)) - (t:test-begin "git-daemon-server") - (t:test-assert "Git daemon service running" - (mrntt:marionette-eval - '(begin - (use-modules - ((gnu services herd) #:prefix herd:)) - (herd:start-service 'git)) - manette)) - (t:test-assert "Git daemon TCP port ready" - (mrntt:wait-for-tcp-port 9418 manette)) - (t:test-end)))) - (gexp->derivation "git-service-type-test" test))) - -(define test-git - (system-test - (name "git") - (description "Test custom Git service") - (value (test-git-fn)))) - -(define tests - (list - test-git)) - -(define (system-test->manifest-entry test) - (manifest-entry - (name - (pkg:str "test." - (system-test-name test))) - (version "0") - (item test))) - -(manifest - (map system-test->manifest-entry - tests)) diff --git a/tests/local/etc/postfix/main.cf b/tests/local/etc/postfix/main.cf deleted file mode 100644 index 143ba5a..0000000 --- a/tests/local/etc/postfix/main.cf +++ /dev/null @@ -1,25 +0,0 @@ -compatibility_level = 3.6 - -queue_directory = /var/spool/postfix -data_directory = /var/lib/postfix -mail_owner = postfix -setgid_group = postdrop - -header_checks = regexp:{ { /^Received:.*/ IGNORE }, { /^X-Originating-IP:.*/ IGNORE } } - -mail_spool_directory = /var/mail/ - -message_size_limit = 102400000 -mailbox_size_limit = 5120000000 - -smtp_sender_dependent_authentication = yes -sender_dependent_relayhost_maps = hash:/var/lib/private/postfix/relayhosts-maps -smtp_sasl_password_maps = hash:/var/lib/private/postfix/sasl-password -smtp_sasl_auth_enable = yes -smtp_sasl_security_options = noanonymous -smtp_sasl_mechanism_filter = login, plain -smtp_use_tls = yes -smtp_tls_security_level = encrypt -smtp_tls_note_starttls_offer = yes - -mynetworks = 127.0.0.0/8 diff --git a/tests/local/etc/postfix/master.cf b/tests/local/etc/postfix/master.cf deleted file mode 100644 index 2cc4b02..0000000 --- a/tests/local/etc/postfix/master.cf +++ /dev/null @@ -1,30 +0,0 @@ -# ============================================================================================================ -# service type private unpriv chroot wakeup maxproc command + args -# (yes) (yes) (no) (never) (100) -# ============================================================================================================= - -anvil unix - - n - 1 anvil -bounce unix - - n - 0 bounce -cleanup unix n - n - 0 cleanup -defer unix - - n - 0 bounce -discard unix - - n - - discard -error unix - - n - - error -flush unix n - n 1000? 0 flush -lmtp unix - - n - - lmtp -local unix - n n - - local -pickup unix n - n 60 1 pickup -proxymap unix - - n - - proxymap -proxywrite unix - - n - 1 proxymap -qmgr unix n - n 300 1 qmgr -relay unix - - n - - smtp -retry unix - - n - - error -rewrite unix - - n - - trivial-rewrite -scache unix - - n - 1 scache -showq unix n - n - - showq -smtp inet n - n - - smtpd -o syslog_name=postfix/smtp -smtp unix - - n - - smtp -tlsmgr unix - - n 1000? 1 tlsmgr -trace unix - - n - 0 bounce -verify unix - - n - 1 verify -virtual unix - n n - - virtual -postlog unix-dgram n - n - 1 postlogd diff --git a/tests/local/system.scm b/tests/local/system.scm index 67c9292..4cb7550 100644 --- a/tests/local/system.scm +++ b/tests/local/system.scm @@ -1,33 +1,16 @@ (use-modules - ((org euandre packages) #:prefix pkg:) - ((org euandre queue) #:prefix q:) - ((xyz euandreh heredoc) #:prefix heredoc:) + ((org euandre packages) #:prefix packages:) (gnu)) (use-package-modules) -(use-service-modules - networking) -(heredoc:enable-syntax) +(use-service-modules) + + (operating-system (host-name "a-local-test-host") (services (append - (list - (service dhcpcd-service-type) - (service pkg:git-service-type) - (service q:local-postfix-service-type - (q:postfix-configuration - (main.cf-extra #"- - smtp_sender_dependent_authentication = yes - sender_dependent_relayhost_maps = hash:/var/lib/private/postfix/relayhosts-maps - smtp_sasl_password_maps = hash:/var/lib/private/postfix/sasl-password - smtp_sasl_auth_enable = yes - smtp_sasl_security_options = noanonymous - smtp_sasl_mechanism_filter = login, plain - smtp_use_tls = yes - smtp_tls_security_level = encrypt - smtp_tls_note_starttls_offer = yes - "#)))) + (list) %base-services)) (bootloader (bootloader-configuration diff --git a/tests/tests.scm b/tests/tests.scm new file mode 100644 index 0000000..852a186 --- /dev/null +++ b/tests/tests.scm @@ -0,0 +1,71 @@ +(use-modules + ((im papo packages) #:prefix pkgs:) + ((org euandre packages) #:prefix packages:) + (gnu) + (gnu tests) + (gnu system vm) + (guix gexp) + (guix profiles)) +(use-package-modules + tls) +(use-service-modules + certbot + mail + mcron + networking) + + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Helpers functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (test-for name description test-name os test-fn) + (system-test + (name name) + (description description) + (value + (gexp->derivation + (string-append test-name ".test") + (with-imported-modules '((gnu build marionette)) + #~(begin + (use-modules + ((gnu build marionette) #:prefix mrntt:) + ((srfi srfi-64) #:prefix t:)) + (let ((manette (mrntt:make-marionette + (list + #$(virtual-machine + (operating-system + (marionette-operating-system + os + #:imported-modules + '((gnu services herd))))))))) + (t:test-runner-current (mrntt:system-test-runner #$output)) + (t:test-begin #$name) + (#$test-fn manette) + (t:test-end)))))))) + + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Service tests ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + + +(define tests + (list)) + +(define (system-test->manifest-entry test) + (manifest-entry + (name + (pkgs:str "test." + (system-test-name test))) + (version "0") + (item test))) + +(manifest + (map system-test->manifest-entry + tests)) diff --git a/tests/unit.scm b/tests/unit.scm new file mode 100644 index 0000000..b363d36 --- /dev/null +++ b/tests/unit.scm @@ -0,0 +1,18 @@ +(use-modules + ((org euandre packages) #:prefix packages:) + ((srfi srfi-64) #:prefix t:)) + + + +(define test-fns + (list)) + +(define (main) + (t:test-begin "unit") + (for-each (lambda (fn) (fn)) test-fns) + (let ((n-fail (t:test-runner-fail-count (t:test-runner-get)))) + (t:test-end) + (when (not (= 0 n-fail)) + (exit 1)))) + +(main) diff --git a/tests/vm-check.sh b/tests/vm-check.sh deleted file mode 100755 index 695e4d7..0000000 --- a/tests/vm-check.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - Usage: - vm-check.sh [-x] -t TYPE -H HOST -r REMOTE [-- ARGS] - vm-check.sh -h - EOF -} - -help() { - cat <<-'EOF' - - - Options: - -x shutdown the VM before running checks - -t TYPE the type of VM being tested - -H HOST the name of the host to SSH into - -r REMOTE the base address of the remote package-repository - -h, --help show this message - - - - Run end-to-end tests of the package repository. - EOF -} - - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -SHUTDOWN=false -while getopts 'xt:H:r:h' flag; do - case "$flag" in - x) - SHUTDOWN=true - ;; - t) - TYPE="$OPTARG" - ;; - H) - HOST="$OPTARG" - ;; - r) - REMOTE="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -eval "$(assert-arg -- "${TYPE:-}" '-t TYPE')" -eval "$(assert-arg -- "${HOST:-}" '-H HOST')" -eval "$(assert-arg -- "${REMOTE:-}" '-r REMOTE')" - - -SEP="$(color -c blacki ':')" - -pre() { - # Same as: - # sed -u "s|^|[$CMD]: |" - # but the "-u" option is not POSIX - IFS='' - while read -r line; do - printf '%s%s\n' "$1" "$line" - done -} - -pre_guest() { - pre "$(color -c green "$HOST")$SEP$(color -c yellow "$TYPE")$SEP " -} - -pre_host() { - pre "$(color -c blueb "$0")$SEP " -} - -STATUS_F="$(mkstemp)" -shutdown() { - STATUS="$(cat "$STATUS_F" || echo 1)" - rm -f "$STATUS_F" - if [ "$SHUTDOWN" = true ]; then - vm down "$HOST" 2>&1 | pre_host - fi - exit "$STATUS" -} -trap shutdown EXIT - -{ - - { - if [ "$SHUTDOWN" = true ]; then - vm down "$HOST" - fi - vm up "$HOST" - untill -m5 -n5 ssh "$HOST" uptime - scp tests/checks/"$TYPE".sh "$HOST":check.sh - } 2>&1 | pre_host - - { - STATUS=0 - # shellcheck disable=2029 - ssh "$HOST" sh check.sh "$@" "$REMOTE" || STATUS=$? - printf '%s' "$STATUS" > "$STATUS_F" - } 2>&1 | pre_guest - -} | ts -s '%.s' diff --git a/tld.txt b/tld.txt new file mode 100644 index 0000000..fd7ea0f --- /dev/null +++ b/tld.txt @@ -0,0 +1 @@ +euandre.org -- cgit v1.3