added comments to explain need help with one section marked TODO
This commit is contained in:
parent
f098443518
commit
dab2edce05
2 changed files with 11 additions and 7 deletions
|
|
@ -10,9 +10,6 @@
|
||||||
# System types to support.
|
# System types to support.
|
||||||
supportedSystems = [
|
supportedSystems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"x86_64-darwin"
|
|
||||||
"aarch64-linux"
|
|
||||||
"aarch64-darwin"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
||||||
|
|
@ -24,18 +21,20 @@
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
# Provide some binary packages for selected system types.
|
# Provide some binary packages for selected system types by mapping over each system architecture.
|
||||||
packages = forAllSystems (
|
packages = forAllSystems (
|
||||||
system:
|
system:
|
||||||
let
|
let
|
||||||
|
# Set pkgs = the correct version for a given architecture.
|
||||||
pkgs = nixpkgsFor.${system};
|
pkgs = nixpkgsFor.${system};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
#TODO: NEED TO GO OVER THIS SYNTAX AGAIN.
|
||||||
go-hello = pkgs.callPackage ./package.nix { };
|
go-hello = pkgs.callPackage ./package.nix { };
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
# Add dependencies that are only needed for development
|
# Add dependencies that are only needed for development, this also allows for nix develop command to launch a devshell
|
||||||
devShells = forAllSystems (
|
devShells = forAllSystems (
|
||||||
system:
|
system:
|
||||||
let
|
let
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
{ buildGoModule, gitMinimal }:
|
{ buildGoModule, gitMinimal }:
|
||||||
|
# This is the wrapping around mkderivation that abstracts away the standard boilerplate logic for building go packages.
|
||||||
buildGoModule {
|
buildGoModule {
|
||||||
|
# The final built binary name.
|
||||||
pname = "go-hello";
|
pname = "go-hello";
|
||||||
|
# The binary version | NEEDS TO BE IN STEP WITH GO MOD.
|
||||||
version = "v1.0.0";
|
version = "v1.0.0";
|
||||||
# In 'nix develop', we don't need a copy of the source tree
|
# In 'nix develop', we don't need a copy of the source tree
|
||||||
# in the Nix store.
|
# in the Nix store.
|
||||||
|
|
@ -8,8 +11,10 @@ buildGoModule {
|
||||||
name = "source";
|
name = "source";
|
||||||
path = ./.;
|
path = ./.;
|
||||||
};
|
};
|
||||||
vendorHash = null;
|
|
||||||
|
# required deps for build time nativeBuildInputs are runtime deps
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
|
# Just an example input
|
||||||
gitMinimal
|
gitMinimal
|
||||||
];
|
];
|
||||||
# This hash locks the dependencies of this package. It is
|
# This hash locks the dependencies of this package. It is
|
||||||
|
|
@ -21,5 +26,5 @@ buildGoModule {
|
||||||
# To begin with it is recommended to set this, but one must
|
# To begin with it is recommended to set this, but one must
|
||||||
# remember to bump this hash when your dependencies change.
|
# remember to bump this hash when your dependencies change.
|
||||||
# vendorHash = pkgs.lib.fakeHash;
|
# vendorHash = pkgs.lib.fakeHash;
|
||||||
|
vendorHash = null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue