From 9d2f77b79ff910c14951b76051b8448825acd390 Mon Sep 17 00:00:00 2001 From: Ryan Pandya Date: Mon, 27 May 2024 22:15:26 -0700 Subject: [PATCH] Initial commit~ --- .direnv/flake-profile | 1 + .direnv/flake-profile-1-link | 1 + .envrc | 1 + flake.lock | 61 ++++++++++++++++++++++++++++++++++++ flake.nix | 33 +++++++++++++++++++ 5 files changed, 97 insertions(+) create mode 120000 .direnv/flake-profile create mode 120000 .direnv/flake-profile-1-link create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.direnv/flake-profile b/.direnv/flake-profile new file mode 120000 index 0000000..0c05709 --- /dev/null +++ b/.direnv/flake-profile @@ -0,0 +1 @@ +flake-profile-1-link \ No newline at end of file diff --git a/.direnv/flake-profile-1-link b/.direnv/flake-profile-1-link new file mode 120000 index 0000000..2889480 --- /dev/null +++ b/.direnv/flake-profile-1-link @@ -0,0 +1 @@ +/nix/store/skpf963qlgp0hslckrhp2rix2p6c7m08-nix-shell-env \ No newline at end of file diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..8392d15 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..444ac09 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1716715802, + "narHash": "sha256-usk0vE7VlxPX8jOavrtpOqphdfqEQpf9lgedlY/r66c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7c05db8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "Nix-flake Elixir development environment (adds nodejs and fly.io)"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + inherit (pkgs.lib) optional optionals; + pkgs = import nixpkgs { inherit system; }; + + elixir = pkgs.beam.packages.erlang.elixir; + in + with pkgs; + { + devShell = pkgs.mkShell { + buildInputs = [ + bashInteractive + elixir + elixir_ls + nodejs + glibcLocales + flyctl + ] ++ optional stdenv.isLinux inotify-tools + ++ optional stdenv.isDarwin terminal-notifier + ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ + CoreFoundation + CoreServices + ]); + }; + }); +}