Skip to content

Commit

Permalink
adding the ablity to build hyoketsu into a docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
cbleslie committed Jun 19, 2024
1 parent a6554eb commit 8342af5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,32 @@
}: let
forAllSystems = nixpkgs.lib.genAttrs (import systems);
in {
packages = forAllSystems (system: let
pkgs = import nixpkgs {inherit system;};
in {
default = pkgs.stdenv.mkDerivation {
pname = "hyoketsu";
version = "1.0.0";
src = ./.;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
cp * -r $out/bin
echo '#!${pkgs.bash}/bin/bash
${pkgs.deno}/bin/deno run -A ${placeholder "out"}/bin/main.ts
' > $out/bin/hyoketsu
chmod +x $out/bin/hyoketsu
'';
};
docker = pkgs.dockerTools.buildImage {
name = "hyoketsu";
config = {
Env = ["PATH=${self.packages.${system}.default}/bin"];
ExposedPorts = {"8000" = {};};
Cmd = ["${self.packages.${system}.default}/bin/hyoketsu"];
};
};
});
formatter = forAllSystems (system: let
pkgs = import nixpkgs {inherit system;};
in
Expand Down

0 comments on commit 8342af5

Please sign in to comment.