flake.nix: fix memory leak by reorganizing hydraJobs

This commit is contained in:
Astro 2022-05-31 22:07:32 +02:00
parent a050b4b653
commit 7e11e77515
2 changed files with 7 additions and 10 deletions

View File

@ -620,18 +620,15 @@
rpi-netboot = ./modules/rpi-netboot.nix; rpi-netboot = ./modules/rpi-netboot.nix;
}; };
hydraJobs = forAllSystems (system: hydraJobs =
builtins.mapAttrs (_: nixpkgs.lib.hydraJob) ( builtins.mapAttrs (_: nixpkgs.lib.hydraJob) (
nixpkgs.lib.filterAttrs (_: toplevel: builtins.mapAttrs (_: nixosSystem:
system == toplevel.system
) (builtins.mapAttrs (_: nixosSystem:
nixosSystem.config.system.build.toplevel nixosSystem.config.system.build.toplevel
) self.nixosConfigurations) ) self.nixosConfigurations
// //
nixpkgs.lib.filterAttrs (name: _: nixpkgs.lib.filterAttrs (name: _:
builtins.match ".+-tftproot" name != null builtins.match ".+-tftproot" name != null
) self.packages.${system} ) self.packages.aarch64-linux
) );
);
}; };
} }

View File

@ -27,7 +27,7 @@
}; };
script = '' script = ''
OLD=$(readlink /run/current-system) OLD=$(readlink /run/current-system)
NEW=$(curl -sLH "Accept: application/json" https://hydra.hq.c3d2.de/job/c3d2/nix-config/${pkgs.system}.$(hostname)/latest | jq -r .buildoutputs.out.path) NEW=$(curl -sLH "Accept: application/json" https://hydra.hq.c3d2.de/job/c3d2/nix-config/$(hostname)/latest | jq -r .buildoutputs.out.path)
if [ -z "$NEW" ] || [ "$NEW" = "null" ]; then if [ -z "$NEW" ] || [ "$NEW" = "null" ]; then
echo "Unable to obtain updated system" echo "Unable to obtain updated system"
exit 1 exit 1
@ -76,7 +76,7 @@
OLD=$(readlink /run/current-system) OLD=$(readlink /run/current-system)
echo Current system: $(basename $OLD) echo Current system: $(basename $OLD)
NEW=$(curl -sLH "Accept: application/json" https://hydra.hq.c3d2.de/job/c3d2/nix-config/${pkgs.system}.$(hostname)/latest | ${pkgs.jq}/bin/jq -r .buildoutputs.out.path) NEW=$(curl -sLH "Accept: application/json" https://hydra.hq.c3d2.de/job/c3d2/nix-config/$(hostname)/latest | ${pkgs.jq}/bin/jq -r .buildoutputs.out.path)
if [ -z "$NEW" ] || [ "$NEW" = "null" ]; then if [ -z "$NEW" ] || [ "$NEW" = "null" ]; then
echo "Unable to obtain updated system" echo "Unable to obtain updated system"
exit 1 exit 1