Skip to content

Commit

Permalink
nix for m1 mac (#101)
Browse files Browse the repository at this point in the history
* Fix compile error on OTP 24
* nix for m1 mac
  • Loading branch information
jechol authored Jan 21, 2022
1 parent fc7b202 commit f072f03
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 356 deletions.
5 changes: 4 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
eval "$(lorri direnv)"
use nix

export MIX_HOME=$(pwd)/.mix
export PATH=$PATH:$(pwd)/.mix/escripts
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ erl_crash.dump
/docs/all.json
/bench/snapshots
/bench/graphs
.mix
1 change: 1 addition & 0 deletions lib/witchcraft/foldable.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ defclass Witchcraft.Foldable do
alias __MODULE__
alias Witchcraft.{Apply, Ord, Monad, Monoid, Semigroup, Unit}

import Kernel, except: [length: 1, max: 2, min: 2, then: 2]
import Exceptional.Safe, only: [safe: 1]

require Foldable.EmptyError
Expand Down
87 changes: 0 additions & 87 deletions nix/commands.nix

This file was deleted.

50 changes: 0 additions & 50 deletions nix/sources.json

This file was deleted.

174 changes: 0 additions & 174 deletions nix/sources.nix

This file was deleted.

63 changes: 19 additions & 44 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,45 +1,20 @@
let
sources = import ./nix/sources.nix;
commands = import ./nix/commands.nix;

nixos = import sources.nixpkgs {};
darwin = import sources.darwin {};
unstable = import sources.unstable {};

pkgs = if darwin.stdenv.isDarwin then darwin else nixos;
tasks = commands {
inherit pkgs;
inherit unstable;
};

deps = {
common =
[ pkgs.niv
];

elixir =
[ unstable.elixir
];

platform =
if pkgs.stdenv.isDarwin then
[ unstable.darwin.apple_sdk.frameworks.CoreServices
unstable.darwin.apple_sdk.frameworks.Foundation
]
else if pkgs.stdenv.isLinux then
[ pkgs.inotify-tools
]
else
[];
};
in

pkgs.mkShell {
name = "Witchcraft";
nativeBuildInputs = builtins.concatLists [
deps.common
deps.elixir
deps.platform
tasks
];
let
nixpkgs = import (fetchTarball {
url = "https://github.com/jechol/nixpkgs/archive/21.11-otp24-no-jit.tar.gz";
sha256 = "sha256:1lka707hrnkp70vny99m9fmp4a8136vl7addmpfsdvkwb81d1jk9";
}) { };
platform = if nixpkgs.stdenv.isDarwin then [
nixpkgs.darwin.apple_sdk.frameworks.CoreServices
nixpkgs.darwin.apple_sdk.frameworks.Foundation
] else if nixpkgs.stdenv.isLinux then
[ nixpkgs.inotify-tools ]
else
[ ];
in nixpkgs.mkShell {
buildInputs = with nixpkgs;
[
# OTP
erlang
elixir
] ++ platform;
}

0 comments on commit f072f03

Please sign in to comment.