feat: make production ready
This commit is contained in:
parent
0c721e9296
commit
3b196006c0
9 changed files with 87 additions and 70 deletions
104
flake.nix
104
flake.nix
|
|
@ -6,39 +6,87 @@
|
|||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
erl = pkgs.beam.interpreters.erlang_27;
|
||||
erlangPackages = pkgs.beam.packagesWith erl;
|
||||
elixir = erlangPackages.elixir;
|
||||
in {
|
||||
packages = let
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
mixFodDeps = erlangPackages.fetchMixDeps {
|
||||
inherit version src;
|
||||
pname = "putzplan";
|
||||
sha256 = "sha256-H8FFuNayJcFvESWlGYr6H6L5zSzAjqBixBmob5Gnoc4=";
|
||||
};
|
||||
translatedPlatform =
|
||||
pkgs.lib.getAttr
|
||||
system
|
||||
{
|
||||
aarch64-darwin = "macos-arm64";
|
||||
aarch64-linux = "linux-arm64";
|
||||
armv7l-linux = "linux-armv7";
|
||||
x86_64-darwin = "macos-x64";
|
||||
x86_64-linux = "linux-x64";
|
||||
};
|
||||
in rec {
|
||||
default = erlangPackages.mixRelease {
|
||||
inherit version src mixFodDeps;
|
||||
pname = "putzplan";
|
||||
|
||||
preInstall = ''
|
||||
ln -s ${pkgs.tailwindcss}/bin/tailwindcss _build/tailwind-${translatedPlatform}
|
||||
ln -s ${pkgs.esbuild}/bin/esbuild _build/esbuild-${translatedPlatform}
|
||||
|
||||
${elixir}/bin/mix assets.deploy
|
||||
${elixir}/bin/mix phx.gen.release
|
||||
'';
|
||||
};
|
||||
dockerImage = pkgs.dockerTools.buildImage {
|
||||
name = "putzplan";
|
||||
config = {
|
||||
Entrypoint = "${default}/bin/putzplan";
|
||||
Cmd = "start";
|
||||
};
|
||||
};
|
||||
};
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
erlang_25
|
||||
beam.packages.erlang_25.elixir_1_18
|
||||
lexical
|
||||
beam.packages.erlang_25.elixir-ls
|
||||
next-ls
|
||||
buildInputs = with pkgs;
|
||||
[
|
||||
erl
|
||||
elixir
|
||||
lexical
|
||||
erlangPackages.elixir-ls
|
||||
next-ls
|
||||
|
||||
sqlite
|
||||
gnumake
|
||||
authelia
|
||||
]
|
||||
++ lib.optionals stdenv.isLinux [
|
||||
# For ExUnit Notifier on Linux.
|
||||
libnotify
|
||||
gnumake
|
||||
authelia
|
||||
lazysql
|
||||
|
||||
# For file_system on Linux.
|
||||
inotify-tools
|
||||
]
|
||||
++ lib.optionals stdenv.isDarwin ([
|
||||
# For ExUnit Notifier on macOS.
|
||||
terminal-notifier
|
||||
nix-output-monitor
|
||||
]
|
||||
++ lib.optionals stdenv.isLinux [
|
||||
# For ExUnit Notifier on Linux.
|
||||
libnotify
|
||||
|
||||
# For file_system on macOS.
|
||||
darwin.apple_sdk.frameworks.CoreFoundation
|
||||
darwin.apple_sdk.frameworks.CoreServices
|
||||
]);
|
||||
# For file_system on Linux.
|
||||
inotify-tools
|
||||
]
|
||||
++ lib.optionals stdenv.isDarwin [
|
||||
# For ExUnit Notifier on macOS.
|
||||
terminal-notifier
|
||||
|
||||
# For file_system on macOS.
|
||||
darwin.apple_sdk.frameworks.CoreFoundation
|
||||
darwin.apple_sdk.frameworks.CoreServices
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export OIDC_CLIENT_ID="putzplan"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue