diff --git a/.envrc b/.envrc new file mode 100644 index 00000000000..3550a30f2de --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index c2192dfc5e2..38bf29180d1 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ packages/ nbproject/ nbactions.xml nb-configuration.xml +.direnv/ .settings diff --git a/README.md b/README.md index 58322ec10ba..91d0c5a4f2d 100644 --- a/README.md +++ b/README.md @@ -263,6 +263,20 @@ If you don't have maven installed, you may directly use the included [maven wrap ./mvnw clean install ``` +#### Nix users + +If you're a nix user, you can enter OpenAPI Generator shell, by typing: +```sh +nix develop +``` +It will enter a shell with Java 8 and Maven installed. + +Direnv supports automatically loading of the nix developer shell, so if you're using direnv too, type: +```sh +direnv allow +``` +and have `java` and `mvn` set up with correct versions each time you enter project directory. + The default build contains minimal static analysis (via CheckStyle). To run your build with PMD and Spotbugs, use the `static-analysis` profile: ```sh diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000000..da1901930c2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1678083093, + "narHash": "sha256-eTkS9GcdSAYA3cE9zCAAs9wY3+oM2zT45ydIkAcEFFQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "684306b246d05168e42425a3610df7e2c4d51fcd", + "type": "github" + }, + "original": { + "owner": "nixos", + "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 00000000000..ccc7357dbb6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + description = "OpenAPI generator nix flake"; + + inputs.nixpkgs.url = "github:nixos/nixpkgs"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + devShells.default = pkgs.mkShell + { + buildInputs = with pkgs;[ + jdk8 + maven + ]; + }; + } + ); +} +