Skip to content

Commit

Permalink
nix for m1 mac
Browse files Browse the repository at this point in the history
  • Loading branch information
jechol committed Nov 18, 2021
1 parent b05a8a0 commit 2af30e2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 45 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
@@ -1,3 +1,4 @@
/.mix
/_build
/cover
/deps
Expand Down
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 = "Quark";
nativeBuildInputs = builtins.concatLists [
deps.common
deps.elixir
deps.platform
tasks
];
let
nixpkgs = import (fetchTarball {
url = "https://github.com/jechol/nixpkgs/archive/otp24-no-jit.tar.gz";
sha256 = "sha256:01n9hn9v7w9kgcd4zipf08bg9kskmpm7sp7f8z3yawk2c0w7q2kl";
}) { };
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 2af30e2

Please sign in to comment.