| 28 Nov 2024 |
elikoga | I'm assuming the go repos are git repos? | 13:17:33 |
elikoga | You can add them to the flake inputs too, and set isFlake =false Or something like that | 13:18:01 |
Magnus | I know builtins.fetchGet can do it, but go build isn't using it for obvious reasons. | 13:18:25 |
Magnus | It sounds like you are proposing something very custom made, rather than using buildGoModule though, elikoga . | 13:19:24 |
elikoga | Can you make go build fetch from local paths? | 13:19:27 |
Magnus | You mean if I can go build in an interactive shell, yes. | 13:20:06 |
Magnus | * You mean if I can go build in an interactive shell, yes I can. | 13:20:15 |
elikoga | buildGoModule is very custom made though? | 13:20:33 |
Magnus | If you by "custom made" mean, made for general consumption and therefore available in nixpkgs, yes then it's custom made. | 13:21:45 |
flyx | In reply to @elikoga:matrix.org Can you make go build fetch from local paths? you can have replace directives in your go.mod which can iirc point to local paths | 13:22:24 |
elikoga | And then template the local Paths using the nix fetched git repos? | 13:23:11 |
Magnus | flyx: ah, so then I'd have to rewrite go.mod on during the build? | 13:23:15 |
Magnus | * flyx: ah, so then I'd have to modify go.mod on during the build? | 13:23:44 |
flyx | In reply to @magthe:tchncs.de flyx: ah, so then I'd have to modify go.mod on during the build? yes. I have done this some years ago and it did work alright. I don't think I have that code lying around anymore | 13:24:17 |
Magnus | Ah, but it can be done using go mod edit so that'd be all right, I guess. | 13:26:35 |
Magnus | flyx: did you write your own derivation, or base it on buildGoModule? (If you can recall that is.) | 13:27:11 |
flyx | yeah. you also only need it during vendoring so this should go into the vendoring step of buildGoModule | 13:27:14 |
flyx | I have not worked with Nix when I did this, it had a cross-compiling context which needed patches for some targets | 13:28:25 |
flyx | however you should be able to do this by expanding on buildGoModule, specifically you should add to some phase of the vendoring derivation | 13:29:41 |
Magnus | Well, I'm guessing somewhere around configure, pre or post ought to do it. | 13:31:35 |
Magnus | Not sure how to make the derivation actually run the preConfigure though... | 13:35:25 |
flyx | `overrideModAttrs = _: { preConfigure = ''...''};`` should do it. | 13:35:27 |
flyx | * overrideModAttrs = \_: { preConfigure = ''...''}; should do it. | 13:35:41 |
flyx | * overrideModAttrs = _: { preConfigure = ''...''}; should do it. | 13:35:49 |
Magnus | I'm trying to set the preConfigure | 14:09:11 |
Magnus | * I'm trying to set the preConfigure to exit 1, but the nix build . happily jumps past the configure phase and continues... until it fails on the build phase. | 14:09:57 |
| karotte128 joined the room. | 14:59:52 |
| 29 Nov 2024 |
| bl1nk changed their profile picture. | 01:11:38 |
| bl1nk changed their profile picture. | 01:11:56 |
| @tanvir:mozilla.org joined the room. | 16:37:39 |