This commit is contained in:
60
flake.nix
60
flake.nix
@@ -1,25 +1,55 @@
|
||||
{
|
||||
description = "test";
|
||||
description = "Customer Service - Phoenix/Commanded CQRS/ES service";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
in {
|
||||
devShell =
|
||||
pkgs.mkShell {
|
||||
buildInputs = with pkgs;
|
||||
[
|
||||
elixir
|
||||
elixir-ls
|
||||
git
|
||||
];
|
||||
beamPackages = pkgs.beamPackages;
|
||||
pname = "customer_service";
|
||||
version = "1.0.0";
|
||||
mixFodDeps = beamPackages.fetchMixDeps {
|
||||
inherit pname version;
|
||||
src = pkgs.lib.cleanSource ./.;
|
||||
sha256 = "sha256-SspB/uMURF/QIjs+h11rr+X/pJ4dy7zuX8HV52CK998=";
|
||||
};
|
||||
});
|
||||
package = beamPackages.mixRelease {
|
||||
inherit pname version mixFodDeps;
|
||||
src = pkgs.lib.cleanSource ./.;
|
||||
meta = {
|
||||
mainProgram = "customer_service";
|
||||
};
|
||||
removeCookie = false;
|
||||
};
|
||||
dockerImage = pkgs.dockerTools.buildLayeredImage {
|
||||
name = "customer_service";
|
||||
contents = [ package pkgs.bashInteractive pkgs.busybox pkgs.shadow ];
|
||||
config = {
|
||||
Cmd = [ "${package}/bin/customer_service" "start" ];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
packages.default = package;
|
||||
packages.dockerImage = dockerImage;
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
elixir
|
||||
elixir-ls
|
||||
kubernetes-helm
|
||||
git
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user