-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
44 lines (35 loc) · 1.4 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ system ? builtins.currentSystem
, pkgs ? import ./nix/pinned-nixpkgs.nix { inherit system; }
, isRelease ? false }:
let
inherit (import ./nix/dependencies.nix { inherit pkgs isRelease; }) bundler bundix ruby postgresql opensearch psql ociTools;
inherit (pkgs) lib callPackage writeShellScript makeWrapper runCommand buildEnv writeShellScriptBin;
services = callPackage ./nix/services.nix { inherit postgresql opensearch; };
main = callPackage ./nix/demoapp.nix { inherit ruby bundler postgresql; };
in
rec {
inherit (main) bundleEnv bundleProdEnv demoapp uuidTools runtimeDependencies;
# To run services
# ./nix/start-services
# To build a procfile:
# nix-build -A services.procfile -o services.procfile
# Or to run services directly:
# PORT=10000 nix shell -f . services.environment -c start-redis
inherit services;
developmentDependencies = with pkgs; runtimeDependencies ++ [
postgresql jq coreutils nodejs yarn
];
# To update Gemfile.lock/gemset.nix
# nix shell -f . bundleLock -c bundleLock
bundleLock = writeShellScriptBin "bundleLock" ''
set -e
${bundler}/bin/bundle lock "$@"
${bundix}/bin/bundix
'';
# To update nix/pinned-nixpkgs.json
# nix shell -f . updatePin -c updatePin
updatePin = writeShellScriptBin "updatePin" ''
${ruby}/bin/ruby ${./nix/generate-pin.rb} > nix/pinned-nixpkgs.json
'';
inherit ruby postgresql psql bundix ociTools;
}