Skip to content

Instantly share code, notes, and snippets.

@NobbZ
Created November 20, 2022 16:37
Show Gist options
  • Save NobbZ/1603ba65e135bf293a50c4b98eb41f71 to your computer and use it in GitHub Desktop.
Save NobbZ/1603ba65e135bf293a50c4b98eb41f71 to your computer and use it in GitHub Desktop.
Minimal elixir dockerTools image
pkgs: let
beamPkgs = with pkgs.beam_minimal; packagesWith interpreters.erlangR25;
erlang = beamPkgs.erlang;
elixir = beamPkgs.elixir_1_14;
fetchMixDeps = beamPkgs.fetchMixDeps.override {inherit elixir;};
buildMix' = beamPkgs.buildMix'.override {inherit fetchMixDeps;};
mixRelease = beamPkgs.mixRelease.override {inherit elixir erlang fetchMixDeps;};
in {inherit erlang elixir buildMix' mixRelease fetchMixDeps;}
{
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
inputs.nobbz.url = "github:nobbz/nixos-config?ref=main";
outputs = {
self,
nixpkgs,
nobbz,
}: let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
npkgs = nobbz.packages.x86_64-linux;
spkgs = self.packages.x86_64-linux;
bpkgs = import ./.nix/beams.nix pkgs;
callPackage = pkgs.lib.callPackageWith (pkgs
// npkgs
// spkgs
// {
inherit callPackage;
inherit (bpkgs) mixRelease fetchMixDeps;
});
in {
inherit (nobbz) formatter;
devShells.x86_64-linux.default = callPackage ./.nix/shell.nix {};
packages.x86_64-linux = {
inherit (bpkgs) erlang elixir;
yamlfmt = callPackage ./.nix/yamlfmt.nix {};
crosslink = callPackage ./.nix/cross_link.nix {};
image = callPackage ./.nix/image.nix {};
};
};
}
{
dockerTools,
crosslink,
}:
dockerTools.buildLayeredImage {
name = "${crosslink.pname}";
tag = "${crosslink.version}";
contents = crosslink;
}
@NobbZ
Copy link
Author

NobbZ commented Aug 3, 2023

As I have trouble following discussions on a gist, I'd suggest to move any further questions to the official discourse, which I can more actively watch, and where your problem is also more visible to other users.

https://discourse.nixos.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment