From fe6df7942ac40985e6a1a1fa073ea0eafeaa0308 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Sun, 8 Dec 2024 22:32:35 +0100 Subject: [PATCH] Add hydraJobs to flake outputs --- flake.nix | 115 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 50 deletions(-) diff --git a/flake.nix b/flake.nix index 9640393..c32b30e 100644 --- a/flake.nix +++ b/flake.nix @@ -74,60 +74,63 @@ outputs = inputs: - inputs.snowfall-lib.mkFlake { - inherit inputs; - # Must always be ./. - src = ./.; + let + snowfallOutputs = inputs.snowfall-lib.mkFlake { + inherit inputs; + # Must always be ./. + src = ./.; - # Add overlays for the `nixpkgs` channel. - overlays = with inputs; [ - nix-matlab.overlay - nix-topology.overlays.default - ]; + # Add overlays for the `nixpkgs` channel. + overlays = with inputs; [ + nix-matlab.overlay + nix-topology.overlays.default + ]; - snowfall = { - # The root of the snowfall config - root = ./.; - # lib, package and overlay namespace - namespace = "frajul"; # defaults to "internal" + snowfall = { + # The root of the snowfall config + root = ./.; + # lib, package and overlay namespace + namespace = "frajul"; # defaults to "internal" - meta = { - name = "Julian's dotfiles"; - title = "Julian's dotfiles"; + meta = { + name = "Julian's dotfiles"; + title = "Julian's dotfiles"; + }; }; + + # The attribute set specified here will be passed directly to NixPkgs when + # instantiating the package set. + channels-config = { + # Allow unfree packages. + allowUnfree = true; + nvidia.acceptLicense = true; + + # Allow certain insecure packages + permittedInsecurePackages = [ "olm-3.2.16" ]; + }; + + systems.modules.nixos = with inputs; [ + nix-topology.nixosModules.default + sops-nix.nixosModules.sops + disko.nixosModules.disko + ]; + systems.hosts.pianonix.modules = with inputs; [ nixos-hardware.nixosModules.raspberry-pi-4 ]; + + # topology = + # with inputs; + # let + # host = self.nixosConfigurations.${builtins.head (builtins.attrNames self.nixosConfigurations)}; + # in + # import nix-topology { + # inherit (host) pkgs; # Only this package set must include nix-topology.overlays.default + # modules = [ + # (import ./topology { inherit (host) config; }) + # { inherit (self) nixosConfigurations; } + # ]; + # }; }; - - # The attribute set specified here will be passed directly to NixPkgs when - # instantiating the package set. - channels-config = { - # Allow unfree packages. - allowUnfree = true; - nvidia.acceptLicense = true; - - # Allow certain insecure packages - permittedInsecurePackages = [ "olm-3.2.16" ]; - }; - - systems.modules.nixos = with inputs; [ - nix-topology.nixosModules.default - sops-nix.nixosModules.sops - disko.nixosModules.disko - ]; - systems.hosts.pianonix.modules = with inputs; [ nixos-hardware.nixosModules.raspberry-pi-4 ]; - - # topology = - # with inputs; - # let - # host = self.nixosConfigurations.${builtins.head (builtins.attrNames self.nixosConfigurations)}; - # in - # import nix-topology { - # inherit (host) pkgs; # Only this package set must include nix-topology.overlays.default - # modules = [ - # (import ./topology { inherit (host) config; }) - # { inherit (self) nixosConfigurations; } - # ]; - # }; - + in + { # deploy-rs node configuration deploy.nodes.pianonix = { hostname = "pianonix.local"; @@ -148,5 +151,17 @@ remoteBuild = true; }; }; - }; + + hydraJobs = { + x86_64-linux = { + aspi = snowfallOutputs.nixosConfigurations.aspi.config.system.build.toplevel; + builder = snowfallOutputs.nixosConfigurations.builder.config.system.build.toplevel; + kardorf = snowfallOutputs.nixosConfigurations.kardorf.config.system.build.toplevel; + }; + aarch64-linux = { + pianonix = snowfallOutputs.nixosConfigurations.pianonix.config.system.build.toplevel; + }; + }; + } + // snowfallOutputs; }