mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
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:
@@ -114,3 +114,6 @@ structure.sql
|
||||
|
||||
# Local development docker
|
||||
/.env
|
||||
|
||||
# Local development direnv file
|
||||
/.envrc
|
||||
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user