Instead of polluting the repository namespace with the list of CI
projects, move that to a separate file.
Currently the list of projects to be built by CI is still hardcoded,
but this will be fixed soon.
If a folder contains a `default.nix`, Nix expressions contained in
adjacent files should not be imported (they might be things like a
`shell.nix` or a `deps.nix` which do not evaluate to derivations).
The tree traversal still continues for all children folders of a
folder with a `default.nix`.
Instead of exposing the entire package tree from nixpkgs, whitelist
individual packages explicitly so that they show up in
`pkgs.third_party`.
This makes it much easier to control external dependencies used by my
projects.
Bonus: It even includes a working `third_party.callPackage` with only
the whitelisted packages!
This is not the final layout yet, but makes it so that my top-level
attribute set is no longer overlaid into nixpkgs itself.
This is useful for other people who are importing my monorepo.
This makes it possible to override arguments to the Go builders
downstream in the style of `overrideAttrs` from standard nixpkgs
derivations.
For example, given a Nix value `foo` that builds a binary called `foo`
the name of this binary could be changed and a new dependency on
`somelib` added like so:
foo.overrideGo(old: {
name = "bar";
deps = old.deps ++ [ somelib ];
})
This makes it possible for people to drop a default.nix into folders
along the way that add additional things into the attribute set at
that level.
These default.nix files are imported and merged with the rest of the
traversal from that point on. In theory nothing stops a user from
putting a derivation into one of them, but the effects of merging that
derivation's underlying attribute set with random other things from
the traversal are undefined.
This feature is being introduced for a slight revamp of the thirdParty
layout.
Moves the Protobuf & gRPC dependencies to a separate file which uses
buildGo.external to build the dependencies.
The versions are pinned at master of 2019-11-26.
Adds two new parameters to buildGo.external:
* `srcOnly` toggles whether the created derivation should contain only
the source code, or the built package.
This is useful in situations where some sub-packages of a larger
package are needed and the build should be deferred to the package
depending on them.
It defaults to false, meaning that external packages are built by
default.
* `targets` controls which "sub-packages" of the target package are
built. It defaults to building all sub-packages.
Adds a buildGo.external function that can build packages following the
default go-tool package layout. Dependencies work the same way as they
do for other buildGo-packages, but instead of being passed straight to
the compiler a fake GOPATH is assembled using a symlink forest.
External currently supports very few direct configuration options and
was primarily created to build the protobuf packages, but it is also
useful for including external dependencies in buildGo-native projects.
The previous complex build logic for the protobuf package has been
replaced with a call to `external`.
Passes the location from the root at which packages are imported on to
all packages.
The path is passed in as a parameter called 'locatedAt' which contains
a list of strings with each individual path component.
For example, the blog source in `services/tazblog` will have a list
with `[ "services" "tazblog" ]` passed in as the `locatedAt`
attribute.
This can be used for enabling features such as path-specific imports
when using things like buildGo.
Adds a 'buildGo.proto' function which takes a single .proto file as
its source and generates a corresponding Go library which can then be
imported.
'proto' takes these arguments (Yants-style type definition):
struct "protoArgs" {
# required:
name = string;
proto = path;
# optional:
extraDeps = list goLib; # defaults to [ ]
protocFlags = option string;
}
Note that proto libraries will automatically have dependencies for the
required protobuf Go libraries added to them.
gRPC is not (yet) supported.
This is a tiny program that does nothing but exists to demonstrate
pkgs.buildGo by building a program that depends on a local library as
well as a protobuf definition.
Broadly speaking, the following things are included:
* there is now a uniform `args` struct that is passed to all
derivations, package headers have been changed appropriately
* overrides are now loaded from a separate `override` folder just
using read-tree.nix
* third-party packages have moved into the `third_party` attribute set