Skip to content

Commit

Permalink
add docker output to flake
Browse files Browse the repository at this point in the history
  • Loading branch information
kloenk committed Apr 2, 2023
1 parent afd96d3 commit c992be0
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
overlays = [ self.overlays.default self.overlays.docker ];
});
in {
overlays.fleet = final: prev: {
Expand Down Expand Up @@ -77,10 +77,33 @@
nativeBuildInputs = [ rebar3 ];
}) { };
};
overlays.docker = final: prev: {
ex_fleet_yards_docker = final.callPackage
({ lib, ex_fleet_yards, dockerTools, buildEnv }:
dockerTools.buildImage {
name = "ExFleetYards";
tag = "latest";

copyToRoot = buildEnv {
name = "ex_fleet_yards-root";
paths = [ ex_fleet_yards ];
pathsToLink = [ "/bin" ];
};

config = {
Entrypoint = [ "/bin/ex_fleet_yards_web" ];
Cmd = [ "start" ];
ExposedPorts."4000/tcp" = { };
Env = [ "FLEETYARDS_CONFIG_PATH=/config/config.exs" ];
Volumes."/config/" = { };
};
}) { };
};
overlays.default = self.overlays.fleet;

packages = forAllSystems (system: {
inherit (nixpkgsFor.${system}) ex_fleet_yards appsignal_nif;
inherit (nixpkgsFor.${system})
ex_fleet_yards appsignal_nif ex_fleet_yards_docker;
default = self.packages.${system}.ex_fleet_yards;
});

Expand Down

0 comments on commit c992be0

Please sign in to comment.