Add elixir flake template, update templates to use nixos-unstable nixpkgs
This commit is contained in:
parent
b77283f7ba
commit
aa520ec9b1
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=bd645e8668ec6612439a9ee7e71f7eac4099d4f6";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
|
|
1
templates/elixir/.envrc
Normal file
1
templates/elixir/.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use flake
|
22
templates/elixir/.gitignore
vendored
Normal file
22
templates/elixir/.gitignore
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
# secret files
|
||||
*.secret.*
|
||||
|
||||
# build output
|
||||
/_build
|
||||
|
||||
# elixir dependencies
|
||||
/deps
|
||||
|
||||
# crash dumps
|
||||
erl_crash.dump
|
||||
|
||||
# sqlite databases
|
||||
*.db
|
||||
*.db-shm
|
||||
*.db-wal
|
||||
|
||||
# nix build output
|
||||
/result
|
||||
|
||||
# direnv cache
|
||||
/.direnv
|
60
templates/elixir/flake.nix
Normal file
60
templates/elixir/flake.nix
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (self) outputs;
|
||||
|
||||
systems = [
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
"x86_64-linux"
|
||||
];
|
||||
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
|
||||
nixpkgsFor = system: import nixpkgs {inherit system;};
|
||||
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;
|
||||
erlang = pkgs.beam.packages.erlang_26;
|
||||
elixir = erlang.elixir_1_15;
|
||||
in {
|
||||
default = pkgs.mkShell {
|
||||
shellHook = "export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive";
|
||||
buildInputs = [erlang elixir pkgs.elixir-ls];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=bd645e8668ec6612439a9ee7e71f7eac4099d4f6";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
|
|
Loading…
Reference in a new issue