From de3a027ab0c298d64253e4df8e4d457ba01b404e Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Mon, 3 Jun 2024 20:59:02 -0400 Subject: [PATCH] remove image generation from Hydra Signed-off-by: ahuston-0 --- flake.nix | 8 +++++++- hydra/jobs.nix | 7 ------- lib/systems.nix | 11 +++++++++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 4556079..6e9b9c3 100644 --- a/flake.nix +++ b/flake.nix @@ -144,7 +144,7 @@ lib = self; } ); - inherit (lib.rad-dev.systems) genSystems; + inherit (lib.rad-dev.systems) genSystems getImages; inherit (self) outputs; # for hydra in rec { @@ -154,6 +154,12 @@ formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); nixosConfigurations = genSystems inputs src (src + "/systems"); + images = { + install-iso = getImages nixosConfigurations "install-iso"; + iso = getImages nixosConfigurations "iso"; + qcow = getImages nixosConfigurations "qcow"; + }; + checks = import ./checks.nix { inherit inputs forEachSystem formatter; }; devShells = import ./shell.nix { inherit inputs forEachSystem checks; }; }; diff --git a/hydra/jobs.nix b/hydra/jobs.nix index 7033994..cb70d1b 100644 --- a/hydra/jobs.nix +++ b/hydra/jobs.nix @@ -3,15 +3,8 @@ let inherit (inputs.nixpkgs.lib) mapAttrs; getCfg = _: cfg: cfg.config.system.build.toplevel; - # getFormat = - # _: cfg: format: - # cfg.config.formats.${format}; - imageWrapper = format: mapAttrs (_: cfg: cfg.config.formats.${format}) outputs.nixosConfigurations; in { inherit (outputs) formatter devShells; hosts = mapAttrs getCfg outputs.nixosConfigurations; - install-isos = imageWrapper "install-iso"; - isos = imageWrapper "iso"; - qcow = imageWrapper "qcow"; } diff --git a/lib/systems.nix b/lib/systems.nix index f9d4876..11620df 100644 --- a/lib/systems.nix +++ b/lib/systems.nix @@ -213,4 +213,15 @@ rec { } ) (lib.rad-dev.lsdir path) ); + + # gets all the images of a specified format + # + # args: + # systems: a set of systems to generate (usually outputs.nixosConfigurations) + # format: a format to generate images for (must be a format compatible with + # nixos-generators or custom) + # + # type: + # AttrSet -> String -> AttrSet + getImages = systems: format: lib.mapAttrs (_: cfg: cfg.config.formats.${format}) systems; }