commit 69a872fe2d00a7ec67323ba373b8ae2565db4116 Author: ctsk <9384305+ctsk@users.noreply.github.com> Date: Wed Aug 31 21:21:03 2022 +0200 Add Nix env for Java and C diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a991863 --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1661864979, + "narHash": "sha256-ajXYYTE1uoY3ei/P1v+Knklf2QNCBxMtw1gByaPTGU4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a28adc36c20fd2fbaeb06ec9bbd79b6bf7443979", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-22.05", + "type": "indirect" + } + }, + "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 0000000..5d5bee4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +{ + description = "Crafting Interpreters"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-22.05"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + + let + pkgs = import nixpkgs { inherit system; }; + + gcc = pkgs.gcc; + openjdk = pkgs.openjdk; + in + { + devShell = pkgs.mkShell { + buildInputs = [ + gcc + openjdk + ]; + }; + } + ); +}