Skip to content

Commit

Permalink
Allow customVendorSrc for go sources
Browse files Browse the repository at this point in the history
use rsync bin

rsync directly into out

Testing solution

testing more

testing more

testing more

testing more

testing more

remove rsync

format
  • Loading branch information
JonathanLorimer committed Feb 17, 2022
1 parent c3f885a commit 0da5333
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 10 additions & 3 deletions builder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
, go
}:
let

parseGoMod = import ./parser.nix;

removeExpr = refs: ''remove-references-to ${lib.concatMapStrings (ref: " -t ${ref}") refs}'';
Expand All @@ -21,6 +20,7 @@ let
, allowGoReference ? false
, meta ? { }
, passthru ? { }
, customVendorSrc ? null
, ...
}@attrs:
let
Expand Down Expand Up @@ -70,10 +70,17 @@ let
go run ${./symlink.go}
${lib.concatStringsSep "\n" localReplaceCommands}
'' +
(if customVendorSrc == null
then ""
else ''
cp -R ${customVendorSrc}/* vendor/
''
) +
''
find vendor
mv vendor $out
cp -R vendor $out
''
);

Expand Down
1 change: 0 additions & 1 deletion builder/parser.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Parse go.mod in Nix
# Returns a Nix structure with the contents of the go.mod passed in
# in normalised form.

let
inherit (builtins) elemAt mapAttrs split foldl' match filter typeOf;

Expand Down

0 comments on commit 0da5333

Please sign in to comment.