aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-07-19 15:08:51 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-07-19 15:08:51 +0200
commitb41630e941b44a8fffe09f42d9a7efb728fcbfa1 (patch)
treed22177bb563476216a6a52ef80cb030c66666713
parentc3958801656c7ce0362eeb8cb57f279d5466a2fc (diff)
downloadguichet-b41630e941b44a8fffe09f42d9a7efb728fcbfa1.tar.gz
guichet-b41630e941b44a8fffe09f42d9a7efb728fcbfa1.zip
Embed static/ and templates/
-rw-r--r--default.nix26
1 files changed, 22 insertions, 4 deletions
diff --git a/default.nix b/default.nix
index 6c88213..336e58d 100644
--- a/default.nix
+++ b/default.nix
@@ -11,9 +11,8 @@ let
})
];
};
-in
- pkgs.gomod.buildGoApplication {
- pname = "bottin";
+ bin = pkgs.gomod.buildGoApplication {
+ pname = "bottin-bin";
version = "0.1.0";
src = ./.;
modules = ./gomod2nix.toml;
@@ -26,5 +25,24 @@ in
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
- }
+ };
+in
+ pkgs.stdenv.mkDerivation {
+ pname = "bottin";
+ 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/
+ '';
+ }