infrastructure/scripts/default.nix

48 lines
995 B
Nix
Raw Normal View History

# SPDX-FileCopyrightText: 2024 Maurice Debray <maurice.debray@dgnum.eu>
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
{ sources, pkgs }:
let
# TODO: move this into a proper overlay of `pkgs` so that we don't need to track this for every and any package.
colmena = pkgs.callPackage ../lib/colmena {
colmena = pkgs.callPackage "${sources.colmena}/package.nix" { };
};
inherit (pkgs.lib) mapAttrs;
inherit (pkgs)
writeShellApplication
jq
nvd
;
scripts = {
2024-12-21 14:01:10 +01:00
cache-node = [
colmena
self.push-to-cache
];
push-to-cache = [ ];
nix-build-and-cache = [ self.push-to-cache ];
check-deployment = [
colmena
jq
nvd
];
launch-vm = [ colmena ];
list-nodes = [ jq ];
};
2024-12-21 14:01:10 +01:00
self = mapAttrs (
name: runtimeInputs:
writeShellApplication {
inherit name runtimeInputs;
2024-12-21 14:01:10 +01:00
text = builtins.readFile ./${name}.sh;
}
) scripts;
in
self