From dab2edce05761de9bf1863f91eb3b064ef0c240e Mon Sep 17 00:00:00 2001 From: specCon18 Date: Sat, 21 Jun 2025 03:55:37 -0400 Subject: [PATCH] added comments to explain need help with one section marked TODO --- flake.nix | 9 ++++----- package.nix | 9 +++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index c30a445..57fd6e4 100644 --- a/flake.nix +++ b/flake.nix @@ -10,9 +10,6 @@ # System types to support. supportedSystems = [ "x86_64-linux" - "x86_64-darwin" - "aarch64-linux" - "aarch64-darwin" ]; # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'. @@ -24,18 +21,20 @@ 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 ( system: let + # Set pkgs = the correct version for a given architecture. pkgs = nixpkgsFor.${system}; in { + #TODO: NEED TO GO OVER THIS SYNTAX AGAIN. 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 ( system: let diff --git a/package.nix b/package.nix index fc9d08c..a792b35 100644 --- a/package.nix +++ b/package.nix @@ -1,6 +1,9 @@ { buildGoModule, gitMinimal }: +# This is the wrapping around mkderivation that abstracts away the standard boilerplate logic for building go packages. buildGoModule { + # The final built binary name. pname = "go-hello"; + # The binary version | NEEDS TO BE IN STEP WITH GO MOD. version = "v1.0.0"; # In 'nix develop', we don't need a copy of the source tree # in the Nix store. @@ -8,8 +11,10 @@ buildGoModule { name = "source"; path = ./.; }; - vendorHash = null; + + # required deps for build time nativeBuildInputs are runtime deps buildInputs = [ + # Just an example input gitMinimal ]; # 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 # remember to bump this hash when your dependencies change. # vendorHash = pkgs.lib.fakeHash; - + vendorHash = null; }