clan-core/pkgs/distro-packages/gui-installer/flake-module.nix

39 lines
1.1 KiB
Nix
Raw Normal View History

{ self, ... }:
{
perSystem =
{ pkgs, ... }:
let
nfpmConfig = pkgs.writeText "clan-nfpm-config.yaml" (
builtins.toJSON {
name = "clan-gui-installer";
version = "0.0.${self.lastModifiedDate}";
2024-06-09 12:28:54 +00:00
maintainer = "clan core team";
homepage = "https://clan.lol";
description = "Peer-to-Peer self-hosting made easy for developers";
license = "MIT";
contents = [
{
src = "${./gui-installer.sh}";
2024-06-05 09:23:12 +00:00
dst = "/usr/bin/clan-app";
}
];
}
);
installerFor =
packager:
pkgs.runCommand "gui-installer" { } ''
mkdir build
cd build
${pkgs.nfpm}/bin/nfpm package --config ${nfpmConfig} --packager ${packager}
mkdir $out
mv * $out/
'';
in
{
packages.gui-installer-apk = installerFor "apk";
packages.gui-installer-archlinux = installerFor "archlinux";
packages.gui-installer-deb = installerFor "deb";
packages.gui-installer-rpm = installerFor "rpm";
};
}