You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm reaching out for help with a default.nix file. I'm trying to nix-build -A three-layer.components.exes.three-layer-exehttps://github.com/trodrigu/three-layer on master and I'm running into the following error
==========
Error: couldn't find the executable "protoc" in your $PATH.
Follow the installation instructions at https://google.github.io/proto-lens/installing-protoc.html .
==========
Missing executable "protoc"
CallStack (from HasCallStack):
error, called at src/Data/ProtoLens/Setup.hs:416:13 in proto-lens-setup-0.4.0.2-Cbx7Qu7aR8y55lkeRKSlEN:Data.ProtoLens.Setup
builder for '/nix/store/l4mljbqzqv44wqy2hllnk8f8y3zsm2yy-three-layer-lib-three-layer-0.0.0.0.drv' failed with exit code 1
cannot build derivation '/nix/store/ly8rsadqyfavhmz8zq84nmw5hp31sral-three-layer-exe-three-layer-exe-0.0.0.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/ly8rsadqyfavhmz8zq84nmw5hp31sral-three-layer-exe-three-layer-exe-0.0.0.0.drv' failed
I'm not sure how to add this executable to my default.nix.
# default.nix
let
# Read in the Niv sources
sources = import ./nix/sources.nix {};
# If ./nix/sources.nix file is not found run:
# niv init
# niv add input-output-hk/haskell.nix -n haskellNix
# Fetch the haskell.nix commit we have pinned with Niv
haskellNix = import sources.haskellNix {};
# If haskellNix is not found run:
# niv add input-output-hk/haskell.nix -n haskellNix
# Import nixpkgs and pass the haskell.nix provided nixpkgsArgs
pkgs = import
# haskell.nix provides access to the nixpkgs pins which are used by our CI,
# hence you will be more likely to get cache hits when using these.
# But you can also just use your own, e.g. '<nixpkgs>'.
haskellNix.sources.nixpkgs-2009
# These arguments passed to nixpkgs, include some patches and also
# the haskell.nix functionality itself as an overlay.
haskellNix.nixpkgsArgs;
in pkgs.haskell-nix.project {
# 'cleanGit' cleans a source directory based on the files known by git
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "three-layer";
src = ./.;
};
# Specify the GHC version to use.
# compiler-nix-name = "ghc8102"; # Not required for `stack.yaml` based projects.
}
Fixed after updating my default.nix to the following
let
# Read in the Niv sources
sources = import ./nix/sources.nix {};
# If ./nix/sources.nix file is not found run:
# niv init
# niv add input-output-hk/haskell.nix -n haskellNix
# Fetch the haskell.nix commit we have pinned with Niv
haskellNix = import sources.haskellNix {};
# If haskellNix is not found run:
# niv add input-output-hk/haskell.nix -n haskellNix
# Import nixpkgs and pass the haskell.nix provided nixpkgsArgs
pkgs = import
# haskell.nix provides access to the nixpkgs pins which are used by our CI,
# hence you will be more likely to get cache hits when using these.
# But you can also just use your own, e.g. '<nixpkgs>'.
haskellNix.sources.nixpkgs-2009
# These arguments passed to nixpkgs, include some patches and also
# the haskell.nix functionality itself as an overlay.
haskellNix.nixpkgsArgs;
in
pkgs.haskell-nix.project {
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "three-layer";
src = ./.;
};
# protobuf build tools are added here for the protoc executable
modules = [
{
packages = {
three-layer.components.library.build-tools = [ pkgs.protobuf ];
three-layer.components.exes.three-layer-exe.build-tools = [ pkgs.protobuf ];
three-layer.components.exes.three-layer-test.build-tools = [ pkgs.protobuf ];
};
}
];
}
Hello, I'm reaching out for help with a default.nix file. I'm trying to
nix-build -A three-layer.components.exes.three-layer-exe
https://github.com/trodrigu/three-layer on master and I'm running into the following errorI'm not sure how to add this executable to my
default.nix
.I think it would be cool to
niv add
it and import it somehow but it wasn't obvious for me. Any suggestions would be appreciated, thanks!The text was updated successfully, but these errors were encountered: