2024-06-16 21:25:23 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
2024-07-14 13:26:34 +00:00
|
|
|
hostSystem,
|
2024-06-16 21:25:23 +00:00
|
|
|
releaseName,
|
2024-12-19 19:57:09 +00:00
|
|
|
appDir,
|
2024-06-16 21:25:23 +00:00
|
|
|
}: let
|
|
|
|
|
2024-07-14 13:26:34 +00:00
|
|
|
cpuArch = (pkgs.lib.systems.parse.mkSystemFromString hostSystem).cpu.name;
|
2024-06-16 21:25:23 +00:00
|
|
|
|
|
|
|
pkgbuild = pkgs.writeText "isle-arch-PKGBUILD-${releaseName}-${cpuArch}" ''
|
|
|
|
pkgname=isle
|
2024-07-14 11:56:43 +00:00
|
|
|
pkgver=${builtins.replaceStrings ["-"] ["_"] releaseName}
|
2024-06-16 21:25:23 +00:00
|
|
|
pkgrel=0
|
|
|
|
pkgdesc="The foundation for an autonomous community cloud infrastructure."
|
|
|
|
arch=('${cpuArch}')
|
|
|
|
url="https://code.betamike.com/micropelago/isle"
|
|
|
|
license=('AGPL-3.0-or-later')
|
|
|
|
|
2024-12-19 19:57:09 +00:00
|
|
|
source=('src.tar.zst')
|
|
|
|
md5sums=('SKIP')
|
2024-06-16 21:25:23 +00:00
|
|
|
|
|
|
|
package() {
|
|
|
|
cp -r etc "$pkgdir"/etc
|
|
|
|
cp -r usr "$pkgdir"/usr
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
|
|
|
in
|
|
|
|
pkgs.stdenv.mkDerivation {
|
|
|
|
name = "isle-arch-pkg-${releaseName}-${cpuArch}";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgs.zstd
|
|
|
|
pkgs.pacman
|
|
|
|
pkgs.fakeroot
|
|
|
|
pkgs.libarchive
|
|
|
|
];
|
|
|
|
|
|
|
|
inherit pkgbuild;
|
2024-12-19 19:57:09 +00:00
|
|
|
src = appDir;
|
2024-09-24 09:22:00 +00:00
|
|
|
defaultDaemonYml = ../../../go/daemon/daecommon/daemon.yml;
|
2024-06-16 21:25:23 +00:00
|
|
|
systemdService = ../isle.service;
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
buildPhase = ''
|
2024-12-19 19:57:09 +00:00
|
|
|
cp -rL "$src" root
|
|
|
|
chmod -R +w root
|
|
|
|
|
2024-06-16 21:25:23 +00:00
|
|
|
mkdir -p root/etc/isle/
|
2024-09-24 09:22:00 +00:00
|
|
|
cp "$defaultDaemonYml" root/etc/isle/daemon.yml
|
2024-06-16 21:25:23 +00:00
|
|
|
|
|
|
|
mkdir -p root/usr/lib/sysusers.d/
|
|
|
|
cat >root/usr/lib/sysusers.d/isle.conf <<EOF
|
|
|
|
u isle - "isle Daemon"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
mkdir -p root/usr/lib/systemd/system
|
|
|
|
cp "$systemdService" root/usr/lib/systemd/system/isle.service
|
|
|
|
|
|
|
|
cp $pkgbuild PKGBUILD
|
|
|
|
|
|
|
|
tar -cf src.tar.zst --zstd --mode=a+rX,u+w -C root .
|
|
|
|
|
2024-07-14 13:26:34 +00:00
|
|
|
PKGEXT=".pkg.tar.zst" CARCH="${cpuArch}" makepkg \
|
2024-06-16 21:25:23 +00:00
|
|
|
--nodeps \
|
|
|
|
--config ${pkgs.pacman}/etc/makepkg.conf
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp *.pkg.tar.zst $out/
|
|
|
|
'';
|
|
|
|
|
|
|
|
# NOTE if https://github.com/NixOS/nixpkgs/issues/241911 is ever addressed
|
|
|
|
# it'd be nice to add an automatic check using namcap here.
|
|
|
|
}
|