From a9b09341f7dfee811e4ae684d361ad75af255df6 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Mon, 28 Jun 2021 09:45:09 +0200 Subject: hydra: try hydra jobs with build products --- flake.lock | 23 ++++++++++++++++++++--- flake.nix | 41 +++++++++++++++++++++++++---------------- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/flake.lock b/flake.lock index 3c89ab9..ad885c3 100644 --- a/flake.lock +++ b/flake.lock @@ -3,7 +3,7 @@ "androidPkgs": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1623960850, @@ -36,6 +36,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1624656607, + "narHash": "sha256-jWVM6RP8WdRV1l0Z36hA/y6kl9BmasYVa9TpKkjRMLI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b72bde7c4a1f9c9bf1a161f0c267186ce3c6483c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-21.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1614989413, "narHash": "sha256-g503bGSdVhLu2cKR5sHG8XetLFrVUzAL3+mrnQJpmdY=", @@ -51,7 +67,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { "lastModified": 1623617138, "narHash": "sha256-zd03k0aZWdE+JjZjVbsQGCKmc1C4HIwIbW7MbI9ym6s=", @@ -70,7 +86,7 @@ "robotnix": { "inputs": { "androidPkgs": "androidPkgs", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1624762178, @@ -88,6 +104,7 @@ }, "root": { "inputs": { + "nixpkgs": "nixpkgs", "robotnix": "robotnix" } } diff --git a/flake.nix b/flake.nix index 6b588ef..e11b29d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,10 @@ { description = "A basic example robotnix configuration"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05"; inputs.robotnix.url = "github:danielfullmer/robotnix"; - outputs = { self, robotnix }: + outputs = { self, nixpkgs, robotnix }: let common = { apps = { @@ -47,21 +48,29 @@ # Build other outputs with (for example): "nix build .#robotnixConfigurations.dailydriver.ota" defaultPackage.x86_64-linux = self.robotnixConfigurations.fp3.img; - hydraJobs.robotnixConfigurations = { - fp3 = { - inherit (self.robotnixConfigurations.fp3) - bootImg - factoryImg - img - ota; - }; - fp2 = { - inherit (self.robotnixConfigurations.fp2) - bootImg - factoryImg - img - ota; - }; + hydraJobs.robotnixConfigurations = with nixpkgs.legacyPackages.x86_64-linux; { + fp3 = with self.robotnixConfigurations.fp3; + runCommandLocal + "hydra-fp3-products-${config.buildNumber}" + { } + '' + mkdir -p $out/nix-support + echo "file bootImg ${bootImg}" >> $out/nix-support/hydra-build-products + echo "file factoryImg ${factoryImg}" >> $out/nix-support/hydra-build-products + echo "file img ${img}" >> $out/nix-support/hydra-build-products + echo "file ota ${ota}" >> $out/nix-support/hydra-build-products + ''; + fp2 = with self.robotnixConfigurations.fp2; + runCommandLocal + "hydra-fp2-products-${config.buildNumber}" + { } + '' + mkdir -p $out/nix-support + echo "file bootImg ${bootImg}" >> $out/nix-support/hydra-build-products + echo "file factoryImg ${factoryImg}" >> $out/nix-support/hydra-build-products + echo "file img ${img}" >> $out/nix-support/hydra-build-products + echo "file ota ${ota}" >> $out/nix-support/hydra-build-products + ''; }; }; } -- cgit v1.2.3