diff --git a/.envrc b/.envrc index 77900409..61da12f8 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,7 @@ direnv_version 2.30.3 # IEx Persistent History, see https://tylerpachal.medium.com/iex-persistent-history-5d7d64e905d3 export ERL_AFLAGS="-kernel shell_history enabled" +if has nix && nix show-config 2> /dev/null | grep "experimental-features" | grep -q "flakes" +then + use flake +fi diff --git a/.gitignore b/.gitignore index afb01b22..56186eb4 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,6 @@ k8s-*.tar # Ignore local k8s config/integration test files integration.yaml + +# direnv & nix +.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..2b28cd68 --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1645493675, + "narHash": "sha256-9xundbZQbhFodsQRh6QMN1GeSXfo3y/5NL0CZcJULz0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "74b10859829153d5c5d50f7c77b86763759e8654", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..16e335c6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,19 @@ +{ + description = "Kubernetes API Client for Elixir"; + + 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 = nixpkgs.legacyPackages.${system}; + in { + devShell = pkgs.mkShell { + packages = [ + pkgs.elixir + ]; + }; + }); +}