forked from witchcrafters/algae
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Synchronize Nix configuration with other Witchcraft projects
These changes had already been applied to the other projects within the Witchcraft suite, and add support for working with the project on apple silicon.
- Loading branch information
Showing
6 changed files
with
25 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ erl_crash.dump | |
*.beam | ||
.DS_Store | ||
mix.lock | ||
.mix |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,21 @@ | ||
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 = "Algae"; | ||
nativeBuildInputs = builtins.concatLists [ | ||
deps.common | ||
deps.elixir | ||
deps.platform | ||
tasks | ||
]; | ||
let | ||
nixpkgs = import (fetchTarball { | ||
# Run `cachix use jechol` to use compiled binary cache. | ||
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; | ||
} |