aboutsummaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-07-19 16:53:55 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-07-19 16:53:55 +0200
commitaac8ee19d7ef80f437714f882ec8e32b06d00f41 (patch)
treeb6b022091aa6d20d06c7d343a28756af7faad3c9 /default.nix
parent9ce0d22c99472534838c1afe7c6dffdd0aa659a8 (diff)
downloadbottin-aac8ee19d7ef80f437714f882ec8e32b06d00f41.tar.gz
bottin-aac8ee19d7ef80f437714f882ec8e32b06d00f41.zip
Add Nix packaging
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..cc73d86
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,48 @@
+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 { };
+ })
+ ];
+ };
+in rec {
+ bin = pkgs.gomod.buildGoApplication {
+ pname = "bottin-bin";
+ version = "0.1.0";
+ src = builtins.filterSource
+ (path: type: (builtins.match ".*/test/.*\\.(go|sum|mod)" path) == null)
+ ./.;
+ 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;
+ };
+ };
+ pkg = pkgs.stdenv.mkDerivation {
+ pname = "bottin";
+ version = "0.1.0";
+ unpackPhase = "true";
+
+ installPhase = ''
+ mkdir -p $out/
+ cp ${bin}/bin/bottin $out/bottin
+ '';
+ };
+ docker = pkgs.dockerTools.buildImage {
+ name = "dxflrs/bottin";
+ config = {
+ Cmd = [ "${pkg}/bottin" ];
+ };
+ };
+}