Skip to content

Commit

Permalink
nix: Apply some nixfmt suggestions and fix macOS status-go buildInputs
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
  • Loading branch information
Pedro Pombeiro committed Jul 29, 2019
1 parent 4ab64d6 commit 9594552
Show file tree
Hide file tree
Showing 22 changed files with 7,210 additions and 3,624 deletions.
5 changes: 3 additions & 2 deletions nix/bootstrapped-shell.nix
Expand Up @@ -8,7 +8,7 @@
let
shell' = shellAttr:
shellAttr // {
nativeBuildInputs = (shellAttr.nativeBuildInputs or []) ++ [ git ];
nativeBuildInputs = (shellAttr.nativeBuildInputs or [ ]) ++ [ git ];
TARGET_OS = target-os;
shellHook = ''
set -e
Expand All @@ -27,6 +27,7 @@ let
};
# Declare a specialized mkShell function which adds some bootstrapping
# so that e.g. STATUS_REACT_HOME is automatically available in the shell
mkShell' = shellAttr: (mkShell.override { inherit stdenv; }) (shell' shellAttr);
mkShell' = shellAttr:
(mkShell.override { inherit stdenv; }) (shell' shellAttr);

in mkShell'
19 changes: 12 additions & 7 deletions nix/derivation.nix
Expand Up @@ -10,7 +10,10 @@ let
platform = pkgs.callPackage ./platform.nix { inherit target-os; };
# Declare a specialized mkShell function which adds some bootstrapping
# so that e.g. STATUS_REACT_HOME is automatically available in the shell
mkShell = (import ./bootstrapped-shell.nix { inherit stdenv target-os; inherit (pkgs) mkShell git; });
mkShell = (import ./bootstrapped-shell.nix {
inherit stdenv target-os;
inherit (pkgs) mkShell git;
});
# TODO: Try to use stdenv for iOS. The problem is with building iOS as the build is trying to pass parameters to Apple's ld that are meant for GNU's ld (e.g. -dynamiclib)
stdenv = pkgs.stdenvNoCC;
maven = pkgs.maven;
Expand All @@ -22,7 +25,10 @@ let
status-go = pkgs.callPackage ./status-go { inherit target-os go buildGoPackage; inherit (mobile.ios) xcodeWrapper; androidPkgs = mobile.android.androidComposition; };
# mkFilter is a function that allows filtering a directory structure (used for filtering source files being captured in a closure)
mkFilter = import ./tools/mkFilter.nix { inherit (stdenv) lib; };
localMavenRepoBuilder = pkgs.callPackage ./tools/maven/maven-repo-builder.nix { inherit (pkgs) stdenv; };
localMavenRepoBuilder =
pkgs.callPackage ./tools/maven/maven-repo-builder.nix {
inherit (pkgs) stdenv;
};
nodejs = pkgs.nodejs-10_x;
yarn = pkgs.yarn.override { inherit nodejs; };
selectedSources =
Expand Down Expand Up @@ -54,11 +60,10 @@ in {

shell = {
buildInputs = unique ([
nodejs
pkgs.python27 # for e.g. gyp
yarn
]
++ optional isDarwin pkgs.cocoapods
nodejs
pkgs.python27 # for e.g. gyp
yarn
] ++ optional isDarwin pkgs.cocoapods
++ optional (isDarwin && !platform.targetIOS) pkgs.clang
++ optional (!isDarwin) pkgs.gcc8
++ catAttrs "buildInputs" selectedSources);
Expand Down
10 changes: 7 additions & 3 deletions nix/desktop/macos/default.nix
Expand Up @@ -11,10 +11,14 @@ let

in {
buildInputs = [
baseImage status-go.buildInputs
baseImage
qt5.full
AppKit Cocoa darwin.cf-private Foundation OpenGL
];
AppKit
Cocoa
darwin.cf-private
Foundation
OpenGL
] ++ status-go.buildInputs;

shellHook =
concatStrings (catAttrs "shellHook" [ baseImage status-go ] ) + ''
Expand Down

0 comments on commit 9594552

Please sign in to comment.