guichet/default.nix
Quentin a84ac778ad
All checks were successful
continuous-integration/drone/push Build is passing
Ease packaging by making resource path configurable
2022-07-19 15:39:49 +02:00

49 lines
1.2 KiB
Nix

let
pkgsSrc = fetchTarball {
# As of 2022-07-19
url = "https://github.com/NixOS/nixpkgs/archive/d2db10786f27619d5519b12b03fb10dc8ca95e59.tar.gz";
sha256 = "0s9gigs3ylnq5b94rfcmxvrmmr3kzhs497gksajf638d5bv7zcl5";
};
pkgs = import pkgsSrc {
overlays = [
(self: super: {
gomod = super.callPackage ./nix/builder { };
})
];
};
bin = pkgs.gomod.buildGoApplication {
pname = "guichet-bin";
version = "0.1.0";
src = ./.;
modules = ./gomod2nix.toml;
CGO_ENABLED=0;
meta = with pkgs.lib; {
description = "Interface web pour gérer le LDAP: changer son mot de passe, ses infos de profil, inviter des gens, administration";
homepage = "https://git.deuxfleurs.fr/Deuxfleurs/guichet";
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
};
in
pkgs.stdenv.mkDerivation {
pname = "guichet";
version = "0.1.0";
src = ./.;
installPhase = ''
mkdir -p $out/
cat > guichet <<EOF
#!${pkgs.bash}/bin/bash
cd $out
${bin}/bin/guichet \$@
EOF
chmod +x guichet
cp guichet $out/guichet
cp -r templates static $out/
'';
}