Break up flake
All checks were successful
/ check (push) Successful in 5m16s

This commit is contained in:
Daniel Flanagan 2024-12-18 09:30:00 -06:00
parent 5481cdb362
commit d5d4a1d96c
6 changed files with 103 additions and 73 deletions

View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1734435836,
"narHash": "sha256-kMBQ5PRiFLagltK0sH+08aiNt3zGERC2297iB6vrvlU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4989a246d7a390a859852baddb1013f825435cee",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -3,79 +3,11 @@
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = {
self,
nixpkgs,
...
}: let
inherit (self) outputs;
supportedSystems = [
"aarch64-linux"
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
overlay = final: prev: {
erlangPackages = prev.beam.packagesWith prev.erlang_26;
erlang = final.erlangPackages.erlang;
elixir = final.erlangPackages.elixir_1_16;
mixRelease = final.erlangPackages.mixRelease.override {
elixir = final.elixir;
};
fetchMixDeps = final.erlangPackages.fetchMixDeps.override {
elixir = final.elixir;
};
elixir-ls = prev.elixir-ls.override {elixir = final.elixir;};
};
nixpkgsFor = system: ((import nixpkgs {inherit system;}).extend overlay);
outputs = inputs: let
inherit (import nix/boilerplate.nix inputs) call;
in {
packages = forAllSystems (system: let
pkgs = nixpkgsFor system;
inherit (pkgs) beamPackages;
inherit (beamPackages) mixRelease fetchMixDeps;
version = "0.1.0";
src = ./.;
pname = "api.lyte.dev";
in {
/*
this-package = mixRelease {
inherit pname version src;
mixFodDeps = fetchMixDeps {
inherit version src;
pname = "mix-deps-${pname}";
hash = pkgs.lib.fakeSha256;
};
buildInputs = with pkgs; [sqlite];
HOME = "$(pwd)";
MIX_XDG = "$HOME";
};
default = outputs.packages.${system}.this-package;
*/
});
devShells = forAllSystems (system: let
pkgs = nixpkgsFor system;
in {
default = pkgs.mkShell {
shellHook = "export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive";
buildInputs = with pkgs; [
elixir
elixir-ls
inotify-tools
];
};
});
overlays = import nix/overlays.nix;
packages = call (import nix/packages.nix);
devShells = call (import nix/shells.nix);
};
}

View file

@ -0,0 +1,16 @@
inputs @ {
nixpkgs,
self,
...
}: let
forSelfOverlay =
if builtins.hasAttr "forSelf" self.overlays
then self.overlays.forSelf
else (_: p: p);
in rec {
systems = ["aarch64-linux" "x86_64-linux" "x86_64-darwin" "aarch64-darwin"];
forSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: ((import nixpkgs {inherit system;}).extend forSelfOverlay);
genPkgs = func: (forSystems (system: func (pkgsFor system)));
call = imported: genPkgs (pkgs: imported (inputs // {inherit pkgs;}));
}

View file

@ -0,0 +1,16 @@
{
forrSelf = final: prev: {
erlangPackages = prev.beam.packagesWith prev.erlang_28;
erlang = final.erlangPackages.erlang;
elixir = final.erlangPackages.elixir_1_17;
mixRelease = final.erlangPackages.mixRelease.override {
elixir = final.elixir;
};
fetchMixDeps = final.erlangPackages.fetchMixDeps.override {
elixir = final.elixir;
};
elixir-ls = prev.elixir-ls.override {elixir = final.elixir;};
};
}

View file

@ -0,0 +1,24 @@
{
pkgs,
self,
...
}: {
my-package = let
version = "1.0.0";
src = ./.;
pname = "my-package";
in
pkgs.beamPackages.mixRelease {
inherit pname version src;
mixFodDeps = pkgs.beamPackages.fetchMixDeps {
inherit version src;
pname = "mix-deps-${pname}";
hash = pkgs.lib.fakeSha256;
};
# buildInputs = with pkgs; [];
# HOME = "$(pwd)";
# MIX_XDG = "$HOME";
};
default = self.packages.${pkgs.system}.my-package;
}

View file

@ -0,0 +1,15 @@
{
pkgs,
# self,
...
}: {
elixir-dev = pkgs.mkShell {
shellHook = "export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive";
# inputsFrom = [self.packages.${pkgs.system}.my-package];
buildInputs = with pkgs; [
elixir
elixir-ls
inotify-tools
];
};
}