From d10a73c6661153d4775deed3ed6f41518e2f9b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 15 Sep 2023 09:10:02 +0200 Subject: [PATCH] also test buildbot on aarch64-linux --- examples/default.nix | 6 +++--- flake.nix | 50 +++++++++++++++++++++++++------------------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/examples/default.nix b/examples/default.nix index 30638b7..2ee51bf 100644 --- a/examples/default.nix +++ b/examples/default.nix @@ -1,4 +1,4 @@ -{ nixpkgs, system, srvos, buildbot-nix, disko, ... }: +{ nixpkgs, system, buildbot-nix, ... }: let # some example configuration to make it eval dummy = { config, modulesPath, ... }: { @@ -15,7 +15,7 @@ let inherit (lib) nixosSystem; in { - example-master = nixosSystem { + "example-master-${system}" = nixosSystem { inherit system; modules = [ dummy @@ -44,7 +44,7 @@ in buildbot-nix.nixosModules.buildbot-master ]; }; - example-worker = nixosSystem { + "example-worker-${system}" = nixosSystem { inherit system; modules = [ dummy diff --git a/flake.nix b/flake.nix index 7e80f5a..311c696 100644 --- a/flake.nix +++ b/flake.nix @@ -9,28 +9,36 @@ }; outputs = inputs@{ self, flake-parts, ... }: - flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: { - systems = [ "x86_64-linux" ]; - flake = { - nixosModules.buildbot-master = ./nix/master.nix; - nixosModules.buildbot-worker = ./nix/worker.nix; + flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: + { + systems = [ "x86_64-linux" "aarch64-linux" ]; + flake = { + nixosModules.buildbot-master = ./nix/master.nix; + nixosModules.buildbot-worker = ./nix/worker.nix; - nixosConfigurations = import ./examples { - inherit (inputs) nixpkgs srvos disko; - buildbot-nix = self; - system = "x86_64-linux"; + nixosConfigurations = + let + examplesFor = system: import ./examples { + inherit system; + inherit (inputs) nixpkgs; + buildbot-nix = self; + }; + in + examplesFor "x86_64-linux" // examplesFor "aarch64-linux"; }; - checks.x86_64-linux = { - nixos-master = self.nixosConfigurations.example-master.config.system.build.toplevel; - nixos-worker = self.nixosConfigurations.example-worker.config.system.build.toplevel; + perSystem = { self', pkgs, system, ... }: { + packages.default = pkgs.mkShell { + packages = [ + pkgs.bashInteractive + ]; + }; + checks = + let + nixosMachines = lib.mapAttrs' (name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations); + packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages; + devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells; + in + nixosMachines // packages // devShells; }; - }; - perSystem = { pkgs, system, ... }: { - packages.default = pkgs.mkShell { - packages = [ - pkgs.bashInteractive - ]; - }; - }; - }); + }); }