From 11fcb4183e4caf0274d5a0b963085e7c691161a9 Mon Sep 17 00:00:00 2001 From: Max Veytsman Date: Tue, 30 Aug 2022 12:08:54 -0400 Subject: [PATCH] Gitignore ni --- .gitignore | 4 ++++ flake.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index a0c2a29..5bda43e 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,7 @@ heroicons-*.tar # Temporary files for e.g. tests /tmp + +# Elixir deps +.nix-mix/ +.nix-hex/ \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5afc2b6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1661720780, + "narHash": "sha256-AJNGyaB2eKZAYaPNjBZOzap87yL+F9ZLaFzzMkvega0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a63021a330d8d33d862a8e29924b42d73037dd37", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c28235f --- /dev/null +++ b/flake.nix @@ -0,0 +1,32 @@ +{ + description = "Heroicons"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { inherit system; }; + in with pkgs; { + + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ elixir erlang ]; + shellHook = '' + mkdir -p .nix-mix + mkdir -p .nix-hex + export MIX_HOME=$PWD/.nix-mix + export HEX_HOME=$PWD/.nix-hex + export PATH=$MIX_HOME/bin:$PATH + export PATH=$HEX_HOME/bin:$PATH + export PATH=$MIX_HOME/escripts:$PATH + + export ERL_AFLAGS="-kernel shell_history enabled" + export ERL_LIBS="" # see https://elixirforum.com/t/compilation-warnings-clause-cannot-match-in-mix-and-otp-tutorial/25114/4 + + export PS1="\[\e[1;33m\][dev]\[\e[1;34m\] \w $ \[\e[0m\]" + ''; + }; + }); +}