Skip to content

Commit

Permalink
chore: move to flake
Browse files Browse the repository at this point in the history
  • Loading branch information
rakshans1 committed Nov 24, 2023
1 parent ba9697a commit ec2a631
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 272 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use_nix
use flake .
Empty file added .livehook/.gitkeep
Empty file.
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
description = "Livebook Starter";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};

inherit (pkgs) inotify-tools terminal-notifier;
inherit (pkgs.lib) optionals;
inherit (pkgs.stdenv) isDarwin isLinux;

linuxDeps = optionals isLinux [ inotify-tools ];
darwinDeps = optionals isDarwin [ terminal-notifier ]
++ (with pkgs.darwin.apple_sdk.frameworks; optionals isDarwin [
CoreFoundation
CoreServices
]);

in
{
devShells = {
default = pkgs.mkShell {
packages = with pkgs; [
beam.packages.erlangR26.elixir_1_15
] ++ linuxDeps ++ darwinDeps;
shellHook = ''
# this allows mix to work on the local directory
mkdir -p .nix-mix .nix-hex
export MIX_HOME=$PWD/.nix-mix
export HEX_HOME=$PWD/.nix-hex
# make hex from Nixpkgs available
# `mix local.hex` will install hex into MIX_HOME and should take precedence
export MIX_PATH="${pkgs.beam.packages.erlangR26.hex}/lib/erlang/lib/hex/ebin"
export PATH=${pkgs.erlangR26}/bin:$MIX_HOME/escripts:$MIX_HOME/bin:$HEX_HOME/bin:bin:$PATH
export LANG=C.UTF-8
# keep your shell history in iex
export ERL_AFLAGS="-kernel shell_history enabled"
export MIX_ENV=dev
'';
};
};
});
}
12 changes: 0 additions & 12 deletions nix/default.nix

This file was deleted.

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

This file was deleted.

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

This file was deleted.

39 changes: 0 additions & 39 deletions shell.nix

This file was deleted.

0 comments on commit ec2a631

Please sign in to comment.