Files
archived-hipudding-teslamate/nix/flake-modules/package.nix
dependabot[bot] 1b89ae7fd3 build(deps): bump elixir from 1.16.2-otp-26 to 1.17.2-otp-27 (#4296)
* build(deps): bump elixir from 1.16.2-otp-26 to 1.17.2-otp-27

Bumps elixir from 1.16.2-otp-26 to 1.17.2-otp-27.

---
updated-dependencies:
- dependency-name: elixir
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump elixir from 1.16.2-otp-26 to 1.17.2-otp-27 in workflow, flake and docs

* docs: update changelog

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
2024-10-23 11:27:20 +02:00

105 lines
2.7 KiB
Nix

{ ... }:
{
perSystem = { lib, pkgs, system, ... }:
let
elixir = pkgs.beam.packages.erlang_27.elixir_1_17;
beamPackages = pkgs.beam.packagesWith pkgs.beam.interpreters.erlang_27;
src = ../..;
version = builtins.readFile "${src}/VERSION";
pname = "teslamate";
mixFodDeps = beamPackages.fetchMixDeps {
TOP_SRC = src;
pname = "${pname}-mix-deps";
inherit src version;
hash = "sha256-Y+CGgvnSCiiuyhtsQ+j0vayq1IHO5IEPVl+V/wwTd6w=";
# hash = pkgs.lib.fakeHash;
};
nodejs = pkgs.nodejs;
nodePackages = pkgs.buildNpmPackage {
name = "${pname}-assets";
src = "${src}/assets";
npmDepsHash = "sha256-05AKPyms4WP8MHBqWMup8VXR3a1tv/f/7jT8c6EpWBw=";
# npmDepsHash = pkgs.lib.fakeHash;
dontNpmBuild = true;
inherit nodejs;
installPhase = ''
mkdir $out
cp -r node_modules $out
ln -s $out/node_modules/.bin $out/bin
rm $out/node_modules/phoenix
ln -s ${mixFodDeps}/phoenix $out/node_modules
rm $out/node_modules/phoenix_html
ln -s ${mixFodDeps}/phoenix_html $out/node_modules
rm $out/node_modules/phoenix_live_view
ln -s ${mixFodDeps}/phoenix_live_view $out/node_modules
'';
};
cldr = pkgs.fetchFromGitHub {
owner = "elixir-cldr";
repo = "cldr";
rev = "v2.37.5";
sha256 = "sha256-T5Qvuo+xPwpgBsqHNZYnTCA4loToeBn1LKTMsDcCdYs=";
# sha256 = pkgs.lib.fakeHash;
};
teslamate = beamPackages.mixRelease {
TOP_SRC = src;
inherit
pname
version
elixir
src
mixFodDeps
;
LOCALES = "${cldr}/priv/cldr";
postBuild = ''
ln -sf ${mixFodDeps}/deps deps
ln -sf ${nodePackages}/node_modules assets/node_modules
export PATH="${pkgs.nodejs}/bin:${nodePackages}/bin:$PATH"
${nodejs}/bin/npm run deploy --prefix ./assets
# for external task you need a workaround for the no deps check flag
# https://github.com/phoenixframework/phoenix/issues/2690
mix do deps.loadpaths --no-deps-check, phx.digest
mix phx.digest --no-deps-check
'';
meta = {
mainProgram = "teslamate";
};
};
in
{
options = {
teslamate.cldr = lib.mkOption {
type = lib.types.package;
readOnly = true;
};
teslamate.elixir = lib.mkOption {
type = lib.types.package;
readOnly = true;
};
};
config = {
teslamate = {
inherit cldr elixir;
};
packages = {
default = teslamate;
};
};
};
}