!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

865 Members
177 Servers

Load older messages


SenderMessageTime
25 Nov 2024
@jfquesada:matrix.org@jfquesada:matrix.org left the room.19:06:10
27 Nov 2024
@sky1e:mildlyfunctional.gay@sky1e:mildlyfunctional.gay left the room.03:14:45
@susscrofa:matrix.orgsoiledit left the room.17:58:30
@jopejoe1:matrix.orgjopejoe1 (4094@39c3) changed their display name from jopejoe1 to jopejoe1 [4094].18:18:57
28 Nov 2024
@magthe:tchncs.deMagnusIs it impossible to write a flake to build a go project that has dependencies in private repos, or am I failing to find information on how to do it?13:12:42
@elikoga:matrix.orgelikogaYou could pull the private repos in as a git Repo using ssh and a private key available to the user13:13:27
@magthe:tchncs.deMagnus How? I'm failing to push any kind of git setup into the build environment of nix build .. 13:17:01
@elikoga:matrix.orgelikogaThis is a normal nix feature though someone should write that it does that in builtins.fetchGit13:17:12
@elikoga:matrix.orgelikoga I'm assuming the go repos are git repos? 13:17:33
@elikoga:matrix.orgelikoga You can add them to the flake inputs too, and set isFlake =false
Or something like that
13:18:01
@magthe:tchncs.deMagnus I know builtins.fetchGet can do it, but go build isn't using it for obvious reasons. 13:18:25
@magthe:tchncs.deMagnus It sounds like you are proposing something very custom made, rather than using buildGoModule though, elikoga . 13:19:24
@elikoga:matrix.orgelikoga Can you make go build fetch from local paths? 13:19:27
@magthe:tchncs.deMagnus You mean if I can go build in an interactive shell, yes. 13:20:06
@magthe:tchncs.deMagnus * You mean if I can go build in an interactive shell, yes I can. 13:20:15
@elikoga:matrix.orgelikoga buildGoModule is very custom made though? 13:20:33
@magthe:tchncs.deMagnus 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:klacker.euflyx
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:matrix.orgelikoga And then template the local Paths using the nix fetched git repos? 13:23:11
@magthe:tchncs.deMagnus flyx: ah, so then I'd have to rewrite go.mod on during the build? 13:23:15
@magthe:tchncs.deMagnus * flyx: ah, so then I'd have to modify go.mod on during the build? 13:23:44
@flyx:klacker.euflyx
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
@magthe:tchncs.deMagnus Ah, but it can be done using go mod edit so that'd be all right, I guess. 13:26:35
@magthe:tchncs.deMagnus flyx: did you write your own derivation, or base it on buildGoModule? (If you can recall that is.) 13:27:11
@flyx:klacker.euflyxyeah. you also only need it during vendoring so this should go into the vendoring step of buildGoModule13:27:14
@flyx:klacker.euflyxI have not worked with Nix when I did this, it had a cross-compiling context which needed patches for some targets13:28:25
@flyx:klacker.euflyxhowever you should be able to do this by expanding on buildGoModule, specifically you should add to some phase of the vendoring derivation13:29:41
@magthe:tchncs.deMagnusWell, I'm guessing somewhere around configure, pre or post ought to do it.13:31:35
@magthe:tchncs.deMagnus Not sure how to make the derivation actually run the preConfigure though... 13:35:25
@flyx:klacker.euflyx`overrideModAttrs = _: { preConfigure = ''...''};`` should do it.13:35:27

Show newer messages


Back to Room ListRoom Version: 6