!zghijEASpYQWYFzriI:nixos.org

Hydra

381 Members
109 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
18 Feb 2024
@hacker1024:matrix.orghacker1024
In reply to @bri:catgirl.cloud
Is there a way to download the built outputs from a job on a self-hosted hydra server?
It acts as a binary cache, so you should just be able to do something like nix-store --extra-substituters https://hydra.example.org -r path-to-derivation-or-output
06:59:11
@bri:catgirl.cloudbri Hm, that’s helpful, but considering I’m building NixOS images for VMs and my laptop I’m hoping maybe there’s a way to get a direct link or even upload it somewhere without reinventing the wheel… 07:01:54
@bri:catgirl.cloudbri After spending way too much time hacking together a bash script to build and upload a few outputs from a flake I was really hoping hydra would solve my problems, lol 07:04:28
@hacker1024:matrix.orghacker1024 You can make a file in nix-support/hydra-build-products to add links to artifacts in the Web UI.
To automatically upload things instead, you can use RunCommand.
Search GitHub for examples of these things.
07:21:11
@bri:catgirl.cloudbrithank you, those both sound like they'll solve this for me! i'll check out github07:33:47
@bri:catgirl.cloudbrithanks so much!07:33:58
@hacker1024:matrix.orghacker1024No problem, feel free to ask if you have any more questions - the documentation isn't great07:34:24
@bri:catgirl.cloudbri

the documentation isn't great

seems to be a running theme in nix and nixos… something something "now simply draw the rest of the owl…"

07:50:18
@bri:catgirl.cloudbribut i should try not to stare at it too long and maybe get some sleep.07:51:08
@bri:catgirl.cloudbri could i please ask someone to help me figure out how to use runCommand (or probably better for my case dynamicRunCommand) and nix-support/hydra-build-products to rsync built products and also give me a URL to them? (hacker1024 in case you're around) 20:46:18
@bri:catgirl.cloudbri

in particular i just don't have any idea where i'd begin to edit my flake.nix to add a script, and i saw here

mkdir -p $out/nix-support
echo "file binary-dist \"$(echo $out/*.apk)\"" \
    > $out/nix-support/hydra-build-products

which i see is a bash script, so does that sort of thing need to be run by the runCommand? i assume $out is set by hydra/nix?

20:50:45
@tomberek:matrix.orgtomberek

bri: Hydra will detect outputs in those locations and provide helpful links to them. This is purely for Hydra integration. You would have a hydraJob that would reference the specific artifacts you want so that it would generate nice links. So something like:

hydraJobs = {
my-other-job = runCommand ....;
...
}
20:56:11
@bri:catgirl.cloudbri

right now my hydraJobs is ```nix
hydraJobs = {
serverProxmox = self.nixosConfigurations."server@x86_64-linux".config.formats.proxmox;
serverProxmoxLxc = self.nixosConfigurations."server@x86_64-linux".config.formats.proxmox-lxc;
briRawEfi = self.nixosConfigurations."bri@x86_64-linux".config.formats.raw-efi;
};

(snipping out the ones that i commented out), so would i add that as another job and it would get added as another job? or do i put runCommand into the existing job? and where do i stick the actual script for runCommand?
20:59:59
@bri:catgirl.cloudbri *

right now my hydraJobs is

hydraJobs = {
serverProxmox = self.nixosConfigurations."server@x86\_64-linux".config.formats.proxmox;
serverProxmoxLxc = self.nixosConfigurations."server@x86\_64-linux".config.formats.proxmox-lxc;
briRawEfi = self.nixosConfigurations."bri@x86\_64-linux".config.formats.raw-efi;
};

(snipping out the ones that i commented out), so would i add that as another job and it would get added as another job? or do i put runCommand into the existing job? and where do i stick the actual script for runCommand?

21:00:14

Show newer messages


Back to Room ListRoom Version: 6