Add basic nix development shell (#9162)

* Add basic nix development shell

* Use google-chrome instead of chromium

* Move nix stuff to subdirectory

* Update gemset, improve readme, fix shell

* Update nix README, remove .envrc
This commit is contained in:
Benjamin Bädorf
2021-05-10 10:44:08 +00:00
committed by GitHub
parent d4a0b55c9d
commit 8ccbc46277
4 changed files with 3837 additions and 0 deletions
+3
View File
@@ -114,3 +114,6 @@ structure.sql
# Local development docker
/.env
# Local development direnv file
/.envrc
+24
View File
@@ -0,0 +1,24 @@
# Nix development
This directory contains files that ease development on nix-enabled systems. Just run `nix-shell ./nix` in the root project directory.
The setup was tested on docker-enabled systems, however nothing should stop you from using this without docker.
This is still a work in progress, feel free to improve as needed.
## Updating gemset.nix
Run `bundix --gemset=./nix/gemset.nix` to update the gemset file from the Gemlock file.
## Autoloading
If you have `lorri` and `direnv` installed, you can autoload the shell by adding a `.envrc` to the root directory with
the following contents:
```
eval "$(lorri direnv --shell-file ./nix/shell.nix)"
```
## Questions?
Contact @b12f
+3777
View File
File diff suppressed because it is too large Load Diff
+33
View File
@@ -0,0 +1,33 @@
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
op-get-test-failures = writeShellScriptBin "op-get-test-failures" ''
exec ${curl}/bin/curl "$$1" | grep 'rspec \.\/' | cut -f3 -d' ' | paste -s -d ' '
'';
gems = bundlerEnv {
name = "openproject-dev";
inherit ruby;
gemdir = ./.;
};
in
mkShell {
nativeBuildInputs = [
buildPackages.ruby_2_7
postgresql
nodejs
tightvnc
bundix
docker-compose
google-chrome
gems
op-get-test-failures
];
CHROME_BINARY = "${google-chrome}/bin/google-chrome";
OPENPROJECT_TESTING_NO_HEADLESS = "1";
OPENPROJECT_TESTING_AUTO_DEVTOOLS = "1";
}