diff --git a/templates/deno/flake.nix b/templates/deno/flake.nix index d2d66da..b89370f 100644 --- a/templates/deno/flake.nix +++ b/templates/deno/flake.nix @@ -1,5 +1,5 @@ { - inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=bd645e8668ec6612439a9ee7e71f7eac4099d4f6"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; outputs = { self, diff --git a/templates/elixir/.envrc b/templates/elixir/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/templates/elixir/.envrc @@ -0,0 +1 @@ +use flake diff --git a/templates/elixir/.gitignore b/templates/elixir/.gitignore new file mode 100644 index 0000000..8cf7b60 --- /dev/null +++ b/templates/elixir/.gitignore @@ -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 diff --git a/templates/elixir/flake.nix b/templates/elixir/flake.nix new file mode 100644 index 0000000..196d407 --- /dev/null +++ b/templates/elixir/flake.nix @@ -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]; + }; + }); + }; +} diff --git a/templates/rust/flake.nix b/templates/rust/flake.nix index cae00dc..e98d5c6 100644 --- a/templates/rust/flake.nix +++ b/templates/rust/flake.nix @@ -1,5 +1,5 @@ { - inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=bd645e8668ec6612439a9ee7e71f7eac4099d4f6"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; outputs = { self, nixpkgs,